1 | Massive pullreq but almost all of that is RTH's SVE | 1 | The following changes since commit 3db29dcac23da85486704ef9e7a8e7217f7829cd: |
---|---|---|---|
2 | refactoring patchset. The other interesting thing here is | ||
3 | the fix for compiling on aarch64 macos. | ||
4 | 2 | ||
5 | thanks | 3 | Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging (2023-01-12 13:51:36 +0000) |
6 | -- PMM | ||
7 | |||
8 | The following changes since commit f7a1ea403e0282a7f57edd4298c4f65f24165da5: | ||
9 | |||
10 | Merge tag 'misc-pull-request' of gitlab.com:marcandre.lureau/qemu into staging (2022-05-29 16:34:56 -0700) | ||
11 | 4 | ||
12 | are available in the Git repository at: | 5 | are available in the Git repository at: |
13 | 6 | ||
14 | https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20220530 | 7 | https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20230113 |
15 | 8 | ||
16 | for you to fetch changes up to b1071174d2a2ab371082b7d4b5f19e98edc61ac6: | 9 | for you to fetch changes up to 08899b5c68a55a3780d707e2464073c8f2670d31: |
17 | 10 | ||
18 | target/arm: Remove aa64_sve check from before disas_sve (2022-05-30 17:05:12 +0100) | 11 | target/arm: allow writes to SCR_EL3.HXEn bit when FEAT_HCX is enabled (2023-01-13 13:19:36 +0000) |
19 | 12 | ||
20 | ---------------------------------------------------------------- | 13 | ---------------------------------------------------------------- |
21 | target-arm queue: | 14 | target-arm queue: |
22 | * docs/system/arm: Add FEAT_HCX to list of emulated features | 15 | hw/arm/stm32f405: correctly describe the memory layout |
23 | * target/arm/hvf: Include missing "cpregs.h" | 16 | hw/arm: Add Olimex H405 board |
24 | * hw/sd/allwinner-sdhost: report FIFO water level as 1 when data ready | 17 | cubieboard: Support booting from an SD card image with u-boot on it |
25 | * SVE: refactor to use TRANS/TRANS_FEAT macros and push | 18 | target/arm: Fix sve_probe_page |
26 | SVE feature check down to individual insn level | 19 | target/arm: allow writes to SCR_EL3.HXEn bit when FEAT_HCX is enabled |
20 | various code cleanups | ||
27 | 21 | ||
28 | ---------------------------------------------------------------- | 22 | ---------------------------------------------------------------- |
29 | Icenowy Zheng (1): | 23 | Evgeny Iakovlev (1): |
30 | hw/sd/allwinner-sdhost: report FIFO water level as 1 when data ready | 24 | target/arm: allow writes to SCR_EL3.HXEn bit when FEAT_HCX is enabled |
31 | 25 | ||
32 | Peter Maydell (1): | 26 | Felipe Balbi (2): |
33 | docs/system/arm: Add FEAT_HCX to list of emulated features | 27 | hw/arm/stm32f405: correctly describe the memory layout |
28 | hw/arm: Add Olimex H405 | ||
34 | 29 | ||
35 | Philippe Mathieu-Daudé (1): | 30 | Philippe Mathieu-Daudé (27): |
36 | target/arm/hvf: Include missing "cpregs.h" | 31 | hw/arm/pxa2xx: Simplify pxa255_init() |
32 | hw/arm/pxa2xx: Simplify pxa270_init() | ||
33 | hw/arm/collie: Use the IEC binary prefix definitions | ||
34 | hw/arm/collie: Simplify flash creation using for() loop | ||
35 | hw/arm/gumstix: Improve documentation | ||
36 | hw/arm/gumstix: Use the IEC binary prefix definitions | ||
37 | hw/arm/mainstone: Use the IEC binary prefix definitions | ||
38 | hw/arm/musicpal: Use the IEC binary prefix definitions | ||
39 | hw/arm/omap_sx1: Remove unused 'total_ram' definitions | ||
40 | hw/arm/omap_sx1: Use the IEC binary prefix definitions | ||
41 | hw/arm/z2: Use the IEC binary prefix definitions | ||
42 | hw/arm/vexpress: Remove dead code in vexpress_common_init() | ||
43 | hw/arm: Remove unreachable code calling pflash_cfi01_register() | ||
44 | hw/arm/pxa: Avoid forward-declaring PXA2xxI2CState | ||
45 | hw/gpio/omap_gpio: Add local variable to avoid embedded cast | ||
46 | hw/arm/omap: Drop useless casts from void * to pointer | ||
47 | hw/gpio/omap_gpio: Use CamelCase for TYPE_OMAP1_GPIO type name | ||
48 | hw/gpio/omap_gpio: Use CamelCase for TYPE_OMAP2_GPIO type name | ||
49 | hw/intc/omap_intc: Use CamelCase for TYPE_OMAP_INTC type name | ||
50 | hw/arm/stellaris: Drop useless casts from void * to pointer | ||
51 | hw/arm/stellaris: Use CamelCase for STELLARIS_ADC type name | ||
52 | hw/arm/bcm2836: Remove definitions generated by OBJECT_DECLARE_TYPE() | ||
53 | hw/arm/npcm7xx: Declare QOM macros using OBJECT_DECLARE_SIMPLE_TYPE() | ||
54 | hw/misc/sbsa_ec: Rename TYPE_SBSA_EC -> TYPE_SBSA_SECURE_EC | ||
55 | hw/misc/sbsa_ec: Declare QOM macros using OBJECT_DECLARE_SIMPLE_TYPE() | ||
56 | hw/intc/xilinx_intc: Use 'XpsIntc' typedef instead of 'struct xlx_pic' | ||
57 | hw/timer/xilinx_timer: Use XpsTimerState instead of 'struct timerblock' | ||
37 | 58 | ||
38 | Richard Henderson (114): | 59 | Richard Henderson (1): |
39 | target/arm: Introduce TRANS, TRANS_FEAT | 60 | target/arm: Fix sve_probe_page |
40 | target/arm: Move null function and sve check into gen_gvec_ool_zz | ||
41 | target/arm: Use TRANS_FEAT for gen_gvec_ool_zz | ||
42 | target/arm: Move null function and sve check into gen_gvec_ool_zzz | ||
43 | target/arm: Introduce gen_gvec_ool_arg_zzz | ||
44 | target/arm: Use TRANS_FEAT for gen_gvec_ool_arg_zzz | ||
45 | target/arm: Use TRANS_FEAT for do_sve2_zzz_ool | ||
46 | target/arm: Move null function and sve check into gen_gvec_ool_zzzz | ||
47 | target/arm: Use TRANS_FEAT for gen_gvec_ool_zzzz | ||
48 | target/arm: Introduce gen_gvec_ool_arg_zzzz | ||
49 | target/arm: Use TRANS_FEAT for do_sve2_zzzz_ool | ||
50 | target/arm: Use TRANS_FEAT for gen_gvec_ool_arg_zzzz | ||
51 | target/arm: Rename do_zzxz_ool to gen_gvec_ool_arg_zzxz | ||
52 | target/arm: Use TRANS_FEAT for gen_gvec_ool_arg_zzxz | ||
53 | target/arm: Use TRANS_FEAT for do_sve2_zzz_data | ||
54 | target/arm: Use TRANS_FEAT for do_sve2_zzzz_data | ||
55 | target/arm: Use TRANS_FEAT for do_sve2_zzw_data | ||
56 | target/arm: Use TRANS_FEAT for USDOT_zzzz | ||
57 | target/arm: Move null function and sve check into gen_gvec_ool_zzp | ||
58 | target/arm: Introduce gen_gvec_ool_arg_zpz | ||
59 | target/arm: Use TRANS_FEAT for gen_gvec_ool_arg_zpz | ||
60 | target/arm: Use TRANS_FEAT for do_sve2_zpz_data | ||
61 | target/arm: Rename do_zpzi_ool to gen_gvec_ool_arg_zpzi | ||
62 | target/arm: Use TRANS_FEAT for gen_gvec_ool_arg_zpzi | ||
63 | target/arm: Move null function and sve check into gen_gvec_ool_zzzp | ||
64 | target/arm: Introduce gen_gvec_ool_arg_zpzz | ||
65 | target/arm: Use TRANS_FEAT for gen_gvec_ool_arg_zpzz | ||
66 | target/arm: Use TRANS_FEAT for do_sve2_zpzz_ool | ||
67 | target/arm: Merge gen_gvec_fn_zz into do_mov_z | ||
68 | target/arm: Move null function and sve check into gen_gvec_fn_zzz | ||
69 | target/arm: Rename do_zzz_fn to gen_gvec_fn_arg_zzz | ||
70 | target/arm: More use of gen_gvec_fn_arg_zzz | ||
71 | target/arm: Use TRANS_FEAT for gen_gvec_fn_arg_zzz | ||
72 | target/arm: Use TRANS_FEAT for do_sve2_fn_zzz | ||
73 | target/arm: Use TRANS_FEAT for RAX1 | ||
74 | target/arm: Introduce gen_gvec_fn_arg_zzzz | ||
75 | target/arm: Use TRANS_FEAT for do_sve2_zzzz_fn | ||
76 | target/arm: Introduce gen_gvec_fn_zzi | ||
77 | target/arm: Use TRANS_FEAT for do_zz_dbm | ||
78 | target/arm: Hoist sve access check through do_sel_z | ||
79 | target/arm: Introduce gen_gvec_fn_arg_zzi | ||
80 | target/arm: Use TRANS_FEAT for do_sve2_fn2i | ||
81 | target/arm: Use TRANS_FEAT for do_vpz_ool | ||
82 | target/arm: Use TRANS_FEAT for do_shift_imm | ||
83 | target/arm: Introduce do_shift_zpzi | ||
84 | target/arm: Use TRANS_FEAT for do_shift_zpzi | ||
85 | target/arm: Use TRANS_FEAT for do_zpzzz_ool | ||
86 | target/arm: Move sve check into do_index | ||
87 | target/arm: Use TRANS_FEAT for do_index | ||
88 | target/arm: Use TRANS_FEAT for do_adr | ||
89 | target/arm: Use TRANS_FEAT for do_predset | ||
90 | target/arm: Use TRANS_FEAT for RDFFR, WRFFR | ||
91 | target/arm: Use TRANS_FEAT for do_pfirst_pnext | ||
92 | target/arm: Use TRANS_FEAT for do_EXT | ||
93 | target/arm: Use TRANS_FEAT for do_perm_pred3 | ||
94 | target/arm: Use TRANS_FEAT for do_perm_pred2 | ||
95 | target/arm: Move sve zip high_ofs into simd_data | ||
96 | target/arm: Use gen_gvec_ool_arg_zzz for do_zip, do_zip_q | ||
97 | target/arm: Use TRANS_FEAT for do_zip, do_zip_q | ||
98 | target/arm: Use TRANS_FEAT for do_clast_vector | ||
99 | target/arm: Use TRANS_FEAT for do_clast_fp | ||
100 | target/arm: Use TRANS_FEAT for do_clast_general | ||
101 | target/arm: Use TRANS_FEAT for do_last_fp | ||
102 | target/arm: Use TRANS_FEAT for do_last_general | ||
103 | target/arm: Use TRANS_FEAT for SPLICE | ||
104 | target/arm: Use TRANS_FEAT for do_ppzz_flags | ||
105 | target/arm: Use TRANS_FEAT for do_sve2_ppzz_flags | ||
106 | target/arm: Use TRANS_FEAT for do_ppzi_flags | ||
107 | target/arm: Use TRANS_FEAT for do_brk2, do_brk3 | ||
108 | target/arm: Use TRANS_FEAT for MUL_zzi | ||
109 | target/arm: Reject dup_i w/ shifted byte early | ||
110 | target/arm: Reject add/sub w/ shifted byte early | ||
111 | target/arm: Reject copy w/ shifted byte early | ||
112 | target/arm: Use TRANS_FEAT for ADD_zzi | ||
113 | target/arm: Use TRANS_FEAT for do_zzi_sat | ||
114 | target/arm: Use TRANS_FEAT for do_zzi_ool | ||
115 | target/arm: Introduce gen_gvec_{ptr,fpst}_zzzz | ||
116 | target/arm: Use TRANS_FEAT for FMMLA | ||
117 | target/arm: Move sve check into gen_gvec_fn_ppp | ||
118 | target/arm: Implement NOT (prediates) alias | ||
119 | target/arm: Use TRANS_FEAT for SEL_zpzz | ||
120 | target/arm: Use TRANS_FEAT for MOVPRFX | ||
121 | target/arm: Use TRANS_FEAT for FMLA | ||
122 | target/arm: Use TRANS_FEAT for BFMLA | ||
123 | target/arm: Rename do_zzz_fp to gen_gvec_ool_fpst_arg_zzz | ||
124 | target/arm: Use TRANS_FEAT for DO_FP3 | ||
125 | target/arm: Use TRANS_FEAT for FMUL_zzx | ||
126 | target/arm: Use TRANS_FEAT for FTMAD | ||
127 | target/arm: Move null function and sve check into do_reduce | ||
128 | target/arm: Use TRANS_FEAT for do_reduce | ||
129 | target/arm: Use TRANS_FEAT for FRECPE, FRSQRTE | ||
130 | target/arm: Expand frint_fns for MO_8 | ||
131 | target/arm: Rename do_zpz_ptr to gen_gvec_ool_fpst_arg_zpz | ||
132 | target/arm: Move null function and sve check into do_frint_mode | ||
133 | target/arm: Use TRANS_FEAT for do_frint_mode | ||
134 | target/arm: Use TRANS_FEAT for FLOGB | ||
135 | target/arm: Use TRANS_FEAT for do_ppz_fp | ||
136 | target/arm: Rename do_zpzz_ptr to gen_gvec_fpst_arg_zpzz | ||
137 | target/arm: Use TRANS_FEAT for gen_gvec_fpst_arg_zpzz | ||
138 | target/arm: Use TRANS_FEAT for FCADD | ||
139 | target/arm: Introduce gen_gvec_fpst_zzzzp | ||
140 | target/arm: Use TRANS_FEAT for gen_gvec_fpst_zzzzp | ||
141 | target/arm: Move null function and sve check into do_fp_imm | ||
142 | target/arm: Use TRANS_FEAT for DO_FP_IMM | ||
143 | target/arm: Use TRANS_FEAT for DO_FPCMP | ||
144 | target/arm: Remove assert in trans_FCMLA_zzxz | ||
145 | target/arm: Use TRANS_FEAT for FCMLA_zzxz | ||
146 | target/arm: Use TRANS_FEAT for do_narrow_extract | ||
147 | target/arm: Use TRANS_FEAT for do_shll_tb | ||
148 | target/arm: Use TRANS_FEAT for do_shr_narrow | ||
149 | target/arm: Use TRANS_FEAT for do_FMLAL_zzzw | ||
150 | target/arm: Use TRANS_FEAT for do_FMLAL_zzxw | ||
151 | target/arm: Add sve feature check for remaining trans_* functions | ||
152 | target/arm: Remove aa64_sve check from before disas_sve | ||
153 | 61 | ||
154 | docs/system/arm/emulation.rst | 1 + | 62 | Strahinja Jankovic (7): |
155 | target/arm/translate.h | 11 + | 63 | hw/misc: Allwinner-A10 Clock Controller Module Emulation |
156 | target/arm/sve.decode | 57 +- | 64 | hw/misc: Allwinner A10 DRAM Controller Emulation |
157 | hw/sd/allwinner-sdhost.c | 7 + | 65 | {hw/i2c,docs/system/arm}: Allwinner TWI/I2C Emulation |
158 | target/arm/hvf/hvf.c | 1 + | 66 | hw/misc: AXP209 PMU Emulation |
159 | target/arm/sve_helper.c | 6 +- | 67 | hw/arm: Add AXP209 to Cubieboard |
160 | target/arm/translate-a64.c | 2 +- | 68 | hw/arm: Allwinner A10 enable SPL load from MMC |
161 | target/arm/translate-sve.c | 5367 +++++++++++++++-------------------------- | 69 | tests/avocado: Add SD boot test to Cubieboard |
162 | 8 files changed, 2067 insertions(+), 3385 deletions(-) | ||
163 | 70 | ||
71 | docs/system/arm/cubieboard.rst | 1 + | ||
72 | docs/system/arm/orangepi.rst | 1 + | ||
73 | docs/system/arm/stm32.rst | 1 + | ||
74 | configs/devices/arm-softmmu/default.mak | 1 + | ||
75 | include/hw/adc/npcm7xx_adc.h | 7 +- | ||
76 | include/hw/arm/allwinner-a10.h | 27 ++ | ||
77 | include/hw/arm/allwinner-h3.h | 3 + | ||
78 | include/hw/arm/npcm7xx.h | 18 +- | ||
79 | include/hw/arm/omap.h | 24 +- | ||
80 | include/hw/arm/pxa.h | 11 +- | ||
81 | include/hw/arm/stm32f405_soc.h | 5 +- | ||
82 | include/hw/i2c/allwinner-i2c.h | 55 ++++ | ||
83 | include/hw/i2c/npcm7xx_smbus.h | 7 +- | ||
84 | include/hw/misc/allwinner-a10-ccm.h | 67 +++++ | ||
85 | include/hw/misc/allwinner-a10-dramc.h | 68 +++++ | ||
86 | include/hw/misc/npcm7xx_clk.h | 2 +- | ||
87 | include/hw/misc/npcm7xx_gcr.h | 6 +- | ||
88 | include/hw/misc/npcm7xx_mft.h | 7 +- | ||
89 | include/hw/misc/npcm7xx_pwm.h | 3 +- | ||
90 | include/hw/misc/npcm7xx_rng.h | 6 +- | ||
91 | include/hw/net/npcm7xx_emc.h | 5 +- | ||
92 | include/hw/sd/npcm7xx_sdhci.h | 4 +- | ||
93 | hw/arm/allwinner-a10.c | 40 +++ | ||
94 | hw/arm/allwinner-h3.c | 11 +- | ||
95 | hw/arm/bcm2836.c | 9 +- | ||
96 | hw/arm/collie.c | 25 +- | ||
97 | hw/arm/cubieboard.c | 11 + | ||
98 | hw/arm/gumstix.c | 45 ++-- | ||
99 | hw/arm/mainstone.c | 37 ++- | ||
100 | hw/arm/musicpal.c | 9 +- | ||
101 | hw/arm/olimex-stm32-h405.c | 69 +++++ | ||
102 | hw/arm/omap1.c | 115 ++++---- | ||
103 | hw/arm/omap2.c | 40 ++- | ||
104 | hw/arm/omap_sx1.c | 53 ++-- | ||
105 | hw/arm/palm.c | 2 +- | ||
106 | hw/arm/pxa2xx.c | 8 +- | ||
107 | hw/arm/spitz.c | 6 +- | ||
108 | hw/arm/stellaris.c | 73 +++-- | ||
109 | hw/arm/stm32f405_soc.c | 8 + | ||
110 | hw/arm/tosa.c | 2 +- | ||
111 | hw/arm/versatilepb.c | 6 +- | ||
112 | hw/arm/vexpress.c | 10 +- | ||
113 | hw/arm/z2.c | 16 +- | ||
114 | hw/char/omap_uart.c | 7 +- | ||
115 | hw/display/omap_dss.c | 15 +- | ||
116 | hw/display/omap_lcdc.c | 9 +- | ||
117 | hw/dma/omap_dma.c | 15 +- | ||
118 | hw/gpio/omap_gpio.c | 48 ++-- | ||
119 | hw/i2c/allwinner-i2c.c | 459 ++++++++++++++++++++++++++++++++ | ||
120 | hw/intc/omap_intc.c | 38 +-- | ||
121 | hw/intc/xilinx_intc.c | 28 +- | ||
122 | hw/misc/allwinner-a10-ccm.c | 224 ++++++++++++++++ | ||
123 | hw/misc/allwinner-a10-dramc.c | 179 +++++++++++++ | ||
124 | hw/misc/axp209.c | 238 +++++++++++++++++ | ||
125 | hw/misc/omap_gpmc.c | 12 +- | ||
126 | hw/misc/omap_l4.c | 7 +- | ||
127 | hw/misc/omap_sdrc.c | 7 +- | ||
128 | hw/misc/omap_tap.c | 5 +- | ||
129 | hw/misc/sbsa_ec.c | 12 +- | ||
130 | hw/sd/omap_mmc.c | 9 +- | ||
131 | hw/ssi/omap_spi.c | 7 +- | ||
132 | hw/timer/omap_gptimer.c | 22 +- | ||
133 | hw/timer/omap_synctimer.c | 4 +- | ||
134 | hw/timer/xilinx_timer.c | 27 +- | ||
135 | target/arm/helper.c | 3 + | ||
136 | target/arm/sve_helper.c | 14 +- | ||
137 | MAINTAINERS | 8 + | ||
138 | hw/arm/Kconfig | 9 + | ||
139 | hw/arm/meson.build | 1 + | ||
140 | hw/i2c/Kconfig | 4 + | ||
141 | hw/i2c/meson.build | 1 + | ||
142 | hw/i2c/trace-events | 5 + | ||
143 | hw/misc/Kconfig | 10 + | ||
144 | hw/misc/meson.build | 3 + | ||
145 | hw/misc/trace-events | 5 + | ||
146 | tests/avocado/boot_linux_console.py | 47 ++++ | ||
147 | 76 files changed, 1951 insertions(+), 455 deletions(-) | ||
148 | create mode 100644 include/hw/i2c/allwinner-i2c.h | ||
149 | create mode 100644 include/hw/misc/allwinner-a10-ccm.h | ||
150 | create mode 100644 include/hw/misc/allwinner-a10-dramc.h | ||
151 | create mode 100644 hw/arm/olimex-stm32-h405.c | ||
152 | create mode 100644 hw/i2c/allwinner-i2c.c | ||
153 | create mode 100644 hw/misc/allwinner-a10-ccm.c | ||
154 | create mode 100644 hw/misc/allwinner-a10-dramc.c | ||
155 | create mode 100644 hw/misc/axp209.c | ||
156 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | In commit 5814d587fe861fe9 we added support for emulating | ||
2 | FEAT_HCX (Support for the HCRX_EL2 register). However we | ||
3 | forgot to add it to the list in emulated.rst. Correct the | ||
4 | omission. | ||
5 | 1 | ||
6 | Fixes: 5814d587fe861fe9 ("target/arm: Enable FEAT_HCX for -cpu max") | ||
7 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
8 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
9 | Message-id: 20220520084320.424166-1-peter.maydell@linaro.org | ||
10 | --- | ||
11 | docs/system/arm/emulation.rst | 1 + | ||
12 | 1 file changed, 1 insertion(+) | ||
13 | |||
14 | diff --git a/docs/system/arm/emulation.rst b/docs/system/arm/emulation.rst | ||
15 | index XXXXXXX..XXXXXXX 100644 | ||
16 | --- a/docs/system/arm/emulation.rst | ||
17 | +++ b/docs/system/arm/emulation.rst | ||
18 | @@ -XXX,XX +XXX,XX @@ the following architecture extensions: | ||
19 | - FEAT_FRINTTS (Floating-point to integer instructions) | ||
20 | - FEAT_FlagM (Flag manipulation instructions v2) | ||
21 | - FEAT_FlagM2 (Enhancements to flag manipulation instructions) | ||
22 | +- FEAT_HCX (Support for the HCRX_EL2 register) | ||
23 | - FEAT_HPDS (Hierarchical permission disables) | ||
24 | - FEAT_I8MM (AArch64 Int8 matrix multiplication instructions) | ||
25 | - FEAT_IDST (ID space trap handling) | ||
26 | -- | ||
27 | 2.25.1 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Felipe Balbi <balbi@kernel.org> |
---|---|---|---|
2 | 2 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 3 | STM32F405 has 128K of SRAM and another 64K of CCM (Core-coupled |
4 | Message-id: 20220527181907.189259-97-richard.henderson@linaro.org | 4 | Memory) at a different base address. Correctly describe the memory |
5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 5 | layout to give existing FW images a chance to run unmodified. |
6 | |||
7 | Reviewed-by: Alistair Francis <alistair@alistair23.me> | ||
8 | Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> | ||
9 | Signed-off-by: Felipe Balbi <balbi@kernel.org> | ||
10 | Message-id: 20221230145733.200496-2-balbi@kernel.org | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 11 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
7 | --- | 12 | --- |
8 | target/arm/translate-sve.c | 29 ++++++----------------------- | 13 | include/hw/arm/stm32f405_soc.h | 5 ++++- |
9 | 1 file changed, 6 insertions(+), 23 deletions(-) | 14 | hw/arm/stm32f405_soc.c | 8 ++++++++ |
15 | 2 files changed, 12 insertions(+), 1 deletion(-) | ||
10 | 16 | ||
11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | 17 | diff --git a/include/hw/arm/stm32f405_soc.h b/include/hw/arm/stm32f405_soc.h |
12 | index XXXXXXX..XXXXXXX 100644 | 18 | index XXXXXXX..XXXXXXX 100644 |
13 | --- a/target/arm/translate-sve.c | 19 | --- a/include/hw/arm/stm32f405_soc.h |
14 | +++ b/target/arm/translate-sve.c | 20 | +++ b/include/hw/arm/stm32f405_soc.h |
15 | @@ -XXX,XX +XXX,XX @@ TRANS_FEAT(FCVTX_ds, aa64_sve2, do_frint_mode, a, | 21 | @@ -XXX,XX +XXX,XX @@ OBJECT_DECLARE_SIMPLE_TYPE(STM32F405State, STM32F405_SOC) |
16 | TRANS_FEAT(FCVTXNT_ds, aa64_sve2, do_frint_mode, a, | 22 | #define FLASH_BASE_ADDRESS 0x08000000 |
17 | float_round_to_odd, gen_helper_sve2_fcvtnt_ds) | 23 | #define FLASH_SIZE (1024 * 1024) |
18 | 24 | #define SRAM_BASE_ADDRESS 0x20000000 | |
19 | -static bool trans_FLOGB(DisasContext *s, arg_rpr_esz *a) | 25 | -#define SRAM_SIZE (192 * 1024) |
20 | -{ | 26 | +#define SRAM_SIZE (128 * 1024) |
21 | - static gen_helper_gvec_3_ptr * const fns[] = { | 27 | +#define CCM_BASE_ADDRESS 0x10000000 |
22 | - NULL, gen_helper_flogb_h, | 28 | +#define CCM_SIZE (64 * 1024) |
23 | - gen_helper_flogb_s, gen_helper_flogb_d | 29 | |
24 | - }; | 30 | struct STM32F405State { |
25 | - | 31 | /*< private >*/ |
26 | - if (!dc_isar_feature(aa64_sve2, s) || fns[a->esz] == NULL) { | 32 | @@ -XXX,XX +XXX,XX @@ struct STM32F405State { |
27 | - return false; | 33 | STM32F2XXADCState adc[STM_NUM_ADCS]; |
28 | - } | 34 | STM32F2XXSPIState spi[STM_NUM_SPIS]; |
29 | - if (sve_access_check(s)) { | 35 | |
30 | - TCGv_ptr status = | 36 | + MemoryRegion ccm; |
31 | - fpstatus_ptr(a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); | 37 | MemoryRegion sram; |
32 | - unsigned vsz = vec_full_reg_size(s); | 38 | MemoryRegion flash; |
33 | - | 39 | MemoryRegion flash_alias; |
34 | - tcg_gen_gvec_3_ptr(vec_full_reg_offset(s, a->rd), | 40 | diff --git a/hw/arm/stm32f405_soc.c b/hw/arm/stm32f405_soc.c |
35 | - vec_full_reg_offset(s, a->rn), | 41 | index XXXXXXX..XXXXXXX 100644 |
36 | - pred_full_reg_offset(s, a->pg), | 42 | --- a/hw/arm/stm32f405_soc.c |
37 | - status, vsz, vsz, 0, fns[a->esz]); | 43 | +++ b/hw/arm/stm32f405_soc.c |
38 | - tcg_temp_free_ptr(status); | 44 | @@ -XXX,XX +XXX,XX @@ static void stm32f405_soc_realize(DeviceState *dev_soc, Error **errp) |
39 | - } | 45 | } |
40 | - return true; | 46 | memory_region_add_subregion(system_memory, SRAM_BASE_ADDRESS, &s->sram); |
41 | -} | 47 | |
42 | +static gen_helper_gvec_3_ptr * const flogb_fns[] = { | 48 | + memory_region_init_ram(&s->ccm, NULL, "STM32F405.ccm", CCM_SIZE, |
43 | + NULL, gen_helper_flogb_h, | 49 | + &err); |
44 | + gen_helper_flogb_s, gen_helper_flogb_d | 50 | + if (err != NULL) { |
45 | +}; | 51 | + error_propagate(errp, err); |
46 | +TRANS_FEAT(FLOGB, aa64_sve2, gen_gvec_fpst_arg_zpz, flogb_fns[a->esz], | 52 | + return; |
47 | + a, 0, a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR) | 53 | + } |
48 | 54 | + memory_region_add_subregion(system_memory, CCM_BASE_ADDRESS, &s->ccm); | |
49 | static bool do_FMLAL_zzzw(DisasContext *s, arg_rrrr_esz *a, bool sub, bool sel) | 55 | + |
50 | { | 56 | armv7m = DEVICE(&s->armv7m); |
57 | qdev_prop_set_uint32(armv7m, "num-irq", 96); | ||
58 | qdev_prop_set_string(armv7m, "cpu-type", s->cpu_type); | ||
51 | -- | 59 | -- |
52 | 2.25.1 | 60 | 2.34.1 |
61 | |||
62 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Felipe Balbi <balbi@kernel.org> |
---|---|---|---|
2 | 2 | ||
3 | Rename the function to match other expansion function and | 3 | Olimex makes a series of low-cost STM32 boards. This commit introduces |
4 | move to be adjacent. Split out gen_gvec_fpst_zzp as a | 4 | the minimum setup to support SMT32-H405. See [1] for details |
5 | helper while we're at it. | ||
6 | 5 | ||
7 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 6 | [1] https://www.olimex.com/Products/ARM/ST/STM32-H405/ |
8 | Message-id: 20220527181907.189259-94-richard.henderson@linaro.org | 7 | |
9 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 8 | Signed-off-by: Felipe Balbi <balbi@kernel.org> |
9 | Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> | ||
10 | Reviewed-by: Alistair Francis <alistair.francis@wdc.com> | ||
11 | Message-id: 20221230145733.200496-3-balbi@kernel.org | ||
10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 12 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
11 | --- | 13 | --- |
12 | target/arm/translate-sve.c | 392 ++++++++++++------------------------- | 14 | docs/system/arm/stm32.rst | 1 + |
13 | 1 file changed, 129 insertions(+), 263 deletions(-) | 15 | configs/devices/arm-softmmu/default.mak | 1 + |
16 | hw/arm/olimex-stm32-h405.c | 69 +++++++++++++++++++++++++ | ||
17 | MAINTAINERS | 6 +++ | ||
18 | hw/arm/Kconfig | 4 ++ | ||
19 | hw/arm/meson.build | 1 + | ||
20 | 6 files changed, 82 insertions(+) | ||
21 | create mode 100644 hw/arm/olimex-stm32-h405.c | ||
14 | 22 | ||
15 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | 23 | diff --git a/docs/system/arm/stm32.rst b/docs/system/arm/stm32.rst |
16 | index XXXXXXX..XXXXXXX 100644 | 24 | index XXXXXXX..XXXXXXX 100644 |
17 | --- a/target/arm/translate-sve.c | 25 | --- a/docs/system/arm/stm32.rst |
18 | +++ b/target/arm/translate-sve.c | 26 | +++ b/docs/system/arm/stm32.rst |
19 | @@ -XXX,XX +XXX,XX @@ static bool gen_gvec_ool_arg_zpzi(DisasContext *s, gen_helper_gvec_3 *fn, | 27 | @@ -XXX,XX +XXX,XX @@ The STM32F4 series is based on ARM Cortex-M4F core. This series is pin-to-pin |
20 | return gen_gvec_ool_zzp(s, fn, a->rd, a->rn, a->pg, a->imm); | 28 | compatible with STM32F2 series. The following machines are based on this chip : |
21 | } | 29 | |
22 | 30 | - ``netduinoplus2`` Netduino Plus 2 board with STM32F405RGT6 microcontroller | |
23 | +static bool gen_gvec_fpst_zzp(DisasContext *s, gen_helper_gvec_3_ptr *fn, | 31 | +- ``olimex-stm32-h405`` Olimex STM32 H405 board with STM32F405RGT6 microcontroller |
24 | + int rd, int rn, int pg, int data, | 32 | |
25 | + ARMFPStatusFlavour flavour) | 33 | There are many other STM32 series that are currently not supported by QEMU. |
34 | |||
35 | diff --git a/configs/devices/arm-softmmu/default.mak b/configs/devices/arm-softmmu/default.mak | ||
36 | index XXXXXXX..XXXXXXX 100644 | ||
37 | --- a/configs/devices/arm-softmmu/default.mak | ||
38 | +++ b/configs/devices/arm-softmmu/default.mak | ||
39 | @@ -XXX,XX +XXX,XX @@ CONFIG_COLLIE=y | ||
40 | CONFIG_ASPEED_SOC=y | ||
41 | CONFIG_NETDUINO2=y | ||
42 | CONFIG_NETDUINOPLUS2=y | ||
43 | +CONFIG_OLIMEX_STM32_H405=y | ||
44 | CONFIG_MPS2=y | ||
45 | CONFIG_RASPI=y | ||
46 | CONFIG_DIGIC=y | ||
47 | diff --git a/hw/arm/olimex-stm32-h405.c b/hw/arm/olimex-stm32-h405.c | ||
48 | new file mode 100644 | ||
49 | index XXXXXXX..XXXXXXX | ||
50 | --- /dev/null | ||
51 | +++ b/hw/arm/olimex-stm32-h405.c | ||
52 | @@ -XXX,XX +XXX,XX @@ | ||
53 | +/* | ||
54 | + * ST STM32VLDISCOVERY machine | ||
55 | + * Olimex STM32-H405 machine | ||
56 | + * | ||
57 | + * Copyright (c) 2022 Felipe Balbi <balbi@kernel.org> | ||
58 | + * | ||
59 | + * Permission is hereby granted, free of charge, to any person obtaining a copy | ||
60 | + * of this software and associated documentation files (the "Software"), to deal | ||
61 | + * in the Software without restriction, including without limitation the rights | ||
62 | + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
63 | + * copies of the Software, and to permit persons to whom the Software is | ||
64 | + * furnished to do so, subject to the following conditions: | ||
65 | + * | ||
66 | + * The above copyright notice and this permission notice shall be included in | ||
67 | + * all copies or substantial portions of the Software. | ||
68 | + * | ||
69 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
70 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
71 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
72 | + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
73 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
74 | + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
75 | + * THE SOFTWARE. | ||
76 | + */ | ||
77 | + | ||
78 | +#include "qemu/osdep.h" | ||
79 | +#include "qapi/error.h" | ||
80 | +#include "hw/boards.h" | ||
81 | +#include "hw/qdev-properties.h" | ||
82 | +#include "hw/qdev-clock.h" | ||
83 | +#include "qemu/error-report.h" | ||
84 | +#include "hw/arm/stm32f405_soc.h" | ||
85 | +#include "hw/arm/boot.h" | ||
86 | + | ||
87 | +/* olimex-stm32-h405 implementation is derived from netduinoplus2 */ | ||
88 | + | ||
89 | +/* Main SYSCLK frequency in Hz (168MHz) */ | ||
90 | +#define SYSCLK_FRQ 168000000ULL | ||
91 | + | ||
92 | +static void olimex_stm32_h405_init(MachineState *machine) | ||
26 | +{ | 93 | +{ |
27 | + if (fn == NULL) { | 94 | + DeviceState *dev; |
28 | + return false; | 95 | + Clock *sysclk; |
29 | + } | ||
30 | + if (sve_access_check(s)) { | ||
31 | + unsigned vsz = vec_full_reg_size(s); | ||
32 | + TCGv_ptr status = fpstatus_ptr(flavour); | ||
33 | + | 96 | + |
34 | + tcg_gen_gvec_3_ptr(vec_full_reg_offset(s, rd), | 97 | + /* This clock doesn't need migration because it is fixed-frequency */ |
35 | + vec_full_reg_offset(s, rn), | 98 | + sysclk = clock_new(OBJECT(machine), "SYSCLK"); |
36 | + pred_full_reg_offset(s, pg), | 99 | + clock_set_hz(sysclk, SYSCLK_FRQ); |
37 | + status, vsz, vsz, data, fn); | 100 | + |
38 | + tcg_temp_free_ptr(status); | 101 | + dev = qdev_new(TYPE_STM32F405_SOC); |
39 | + } | 102 | + qdev_prop_set_string(dev, "cpu-type", ARM_CPU_TYPE_NAME("cortex-m4")); |
40 | + return true; | 103 | + qdev_connect_clock_in(dev, "sysclk", sysclk); |
104 | + sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); | ||
105 | + | ||
106 | + armv7m_load_kernel(ARM_CPU(first_cpu), | ||
107 | + machine->kernel_filename, | ||
108 | + 0, FLASH_SIZE); | ||
41 | +} | 109 | +} |
42 | + | 110 | + |
43 | +static bool gen_gvec_fpst_arg_zpz(DisasContext *s, gen_helper_gvec_3_ptr *fn, | 111 | +static void olimex_stm32_h405_machine_init(MachineClass *mc) |
44 | + arg_rpr_esz *a, int data, | ||
45 | + ARMFPStatusFlavour flavour) | ||
46 | +{ | 112 | +{ |
47 | + return gen_gvec_fpst_zzp(s, fn, a->rd, a->rn, a->pg, data, flavour); | 113 | + mc->desc = "Olimex STM32-H405 (Cortex-M4)"; |
114 | + mc->init = olimex_stm32_h405_init; | ||
115 | + mc->default_cpu_type = ARM_CPU_TYPE_NAME("cortex-m4"); | ||
116 | + | ||
117 | + /* SRAM pre-allocated as part of the SoC instantiation */ | ||
118 | + mc->default_ram_size = 0; | ||
48 | +} | 119 | +} |
49 | + | 120 | + |
50 | /* Invoke an out-of-line helper on 3 Zregs and a predicate. */ | 121 | +DEFINE_MACHINE("olimex-stm32-h405", olimex_stm32_h405_machine_init) |
51 | static bool gen_gvec_ool_zzzp(DisasContext *s, gen_helper_gvec_4 *fn, | 122 | diff --git a/MAINTAINERS b/MAINTAINERS |
52 | int rd, int rn, int rm, int pg, int data) | 123 | index XXXXXXX..XXXXXXX 100644 |
53 | @@ -XXX,XX +XXX,XX @@ static bool trans_FCMLA_zzxz(DisasContext *s, arg_FCMLA_zzxz *a) | 124 | --- a/MAINTAINERS |
54 | *** SVE Floating Point Unary Operations Predicated Group | 125 | +++ b/MAINTAINERS |
55 | */ | 126 | @@ -XXX,XX +XXX,XX @@ L: qemu-arm@nongnu.org |
56 | 127 | S: Maintained | |
57 | -static bool do_zpz_ptr(DisasContext *s, int rd, int rn, int pg, | 128 | F: hw/arm/netduinoplus2.c |
58 | - bool is_fp16, gen_helper_gvec_3_ptr *fn) | 129 | |
59 | -{ | 130 | +Olimex STM32 H405 |
60 | - if (sve_access_check(s)) { | 131 | +M: Felipe Balbi <balbi@kernel.org> |
61 | - unsigned vsz = vec_full_reg_size(s); | 132 | +L: qemu-arm@nongnu.org |
62 | - TCGv_ptr status = fpstatus_ptr(is_fp16 ? FPST_FPCR_F16 : FPST_FPCR); | 133 | +S: Maintained |
63 | - tcg_gen_gvec_3_ptr(vec_full_reg_offset(s, rd), | 134 | +F: hw/arm/olimex-stm32-h405.c |
64 | - vec_full_reg_offset(s, rn), | 135 | + |
65 | - pred_full_reg_offset(s, pg), | 136 | SmartFusion2 |
66 | - status, vsz, vsz, 0, fn); | 137 | M: Subbaraya Sundeep <sundeep.lkml@gmail.com> |
67 | - tcg_temp_free_ptr(status); | 138 | M: Peter Maydell <peter.maydell@linaro.org> |
68 | - } | 139 | diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig |
69 | - return true; | 140 | index XXXXXXX..XXXXXXX 100644 |
70 | -} | 141 | --- a/hw/arm/Kconfig |
71 | +TRANS_FEAT(FCVT_sh, aa64_sve, gen_gvec_fpst_arg_zpz, | 142 | +++ b/hw/arm/Kconfig |
72 | + gen_helper_sve_fcvt_sh, a, 0, FPST_FPCR) | 143 | @@ -XXX,XX +XXX,XX @@ config NETDUINOPLUS2 |
73 | +TRANS_FEAT(FCVT_hs, aa64_sve, gen_gvec_fpst_arg_zpz, | 144 | bool |
74 | + gen_helper_sve_fcvt_hs, a, 0, FPST_FPCR) | 145 | select STM32F405_SOC |
75 | 146 | ||
76 | -static bool trans_FCVT_sh(DisasContext *s, arg_rpr_esz *a) | 147 | +config OLIMEX_STM32_H405 |
77 | -{ | 148 | + bool |
78 | - return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve_fcvt_sh); | 149 | + select STM32F405_SOC |
79 | -} | 150 | + |
80 | +TRANS_FEAT(BFCVT, aa64_sve_bf16, gen_gvec_fpst_arg_zpz, | 151 | config NSERIES |
81 | + gen_helper_sve_bfcvt, a, 0, FPST_FPCR) | 152 | bool |
82 | 153 | select OMAP | |
83 | -static bool trans_FCVT_hs(DisasContext *s, arg_rpr_esz *a) | 154 | diff --git a/hw/arm/meson.build b/hw/arm/meson.build |
84 | -{ | 155 | index XXXXXXX..XXXXXXX 100644 |
85 | - return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve_fcvt_hs); | 156 | --- a/hw/arm/meson.build |
86 | -} | 157 | +++ b/hw/arm/meson.build |
87 | +TRANS_FEAT(FCVT_dh, aa64_sve, gen_gvec_fpst_arg_zpz, | 158 | @@ -XXX,XX +XXX,XX @@ arm_ss.add(when: 'CONFIG_MICROBIT', if_true: files('microbit.c')) |
88 | + gen_helper_sve_fcvt_dh, a, 0, FPST_FPCR) | 159 | arm_ss.add(when: 'CONFIG_MUSICPAL', if_true: files('musicpal.c')) |
89 | +TRANS_FEAT(FCVT_hd, aa64_sve, gen_gvec_fpst_arg_zpz, | 160 | arm_ss.add(when: 'CONFIG_NETDUINO2', if_true: files('netduino2.c')) |
90 | + gen_helper_sve_fcvt_hd, a, 0, FPST_FPCR) | 161 | arm_ss.add(when: 'CONFIG_NETDUINOPLUS2', if_true: files('netduinoplus2.c')) |
91 | +TRANS_FEAT(FCVT_ds, aa64_sve, gen_gvec_fpst_arg_zpz, | 162 | +arm_ss.add(when: 'CONFIG_OLIMEX_STM32_H405', if_true: files('olimex-stm32-h405.c')) |
92 | + gen_helper_sve_fcvt_ds, a, 0, FPST_FPCR) | 163 | arm_ss.add(when: 'CONFIG_NPCM7XX', if_true: files('npcm7xx.c', 'npcm7xx_boards.c')) |
93 | +TRANS_FEAT(FCVT_sd, aa64_sve, gen_gvec_fpst_arg_zpz, | 164 | arm_ss.add(when: 'CONFIG_NSERIES', if_true: files('nseries.c')) |
94 | + gen_helper_sve_fcvt_sd, a, 0, FPST_FPCR) | 165 | arm_ss.add(when: 'CONFIG_SX1', if_true: files('omap_sx1.c')) |
95 | |||
96 | -static bool trans_BFCVT(DisasContext *s, arg_rpr_esz *a) | ||
97 | -{ | ||
98 | - if (!dc_isar_feature(aa64_sve_bf16, s)) { | ||
99 | - return false; | ||
100 | - } | ||
101 | - return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve_bfcvt); | ||
102 | -} | ||
103 | +TRANS_FEAT(FCVTZS_hh, aa64_sve, gen_gvec_fpst_arg_zpz, | ||
104 | + gen_helper_sve_fcvtzs_hh, a, 0, FPST_FPCR_F16) | ||
105 | +TRANS_FEAT(FCVTZU_hh, aa64_sve, gen_gvec_fpst_arg_zpz, | ||
106 | + gen_helper_sve_fcvtzu_hh, a, 0, FPST_FPCR_F16) | ||
107 | +TRANS_FEAT(FCVTZS_hs, aa64_sve, gen_gvec_fpst_arg_zpz, | ||
108 | + gen_helper_sve_fcvtzs_hs, a, 0, FPST_FPCR_F16) | ||
109 | +TRANS_FEAT(FCVTZU_hs, aa64_sve, gen_gvec_fpst_arg_zpz, | ||
110 | + gen_helper_sve_fcvtzu_hs, a, 0, FPST_FPCR_F16) | ||
111 | +TRANS_FEAT(FCVTZS_hd, aa64_sve, gen_gvec_fpst_arg_zpz, | ||
112 | + gen_helper_sve_fcvtzs_hd, a, 0, FPST_FPCR_F16) | ||
113 | +TRANS_FEAT(FCVTZU_hd, aa64_sve, gen_gvec_fpst_arg_zpz, | ||
114 | + gen_helper_sve_fcvtzu_hd, a, 0, FPST_FPCR_F16) | ||
115 | |||
116 | -static bool trans_FCVT_dh(DisasContext *s, arg_rpr_esz *a) | ||
117 | -{ | ||
118 | - return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve_fcvt_dh); | ||
119 | -} | ||
120 | +TRANS_FEAT(FCVTZS_ss, aa64_sve, gen_gvec_fpst_arg_zpz, | ||
121 | + gen_helper_sve_fcvtzs_ss, a, 0, FPST_FPCR) | ||
122 | +TRANS_FEAT(FCVTZU_ss, aa64_sve, gen_gvec_fpst_arg_zpz, | ||
123 | + gen_helper_sve_fcvtzu_ss, a, 0, FPST_FPCR) | ||
124 | +TRANS_FEAT(FCVTZS_sd, aa64_sve, gen_gvec_fpst_arg_zpz, | ||
125 | + gen_helper_sve_fcvtzs_sd, a, 0, FPST_FPCR) | ||
126 | +TRANS_FEAT(FCVTZU_sd, aa64_sve, gen_gvec_fpst_arg_zpz, | ||
127 | + gen_helper_sve_fcvtzu_sd, a, 0, FPST_FPCR) | ||
128 | +TRANS_FEAT(FCVTZS_ds, aa64_sve, gen_gvec_fpst_arg_zpz, | ||
129 | + gen_helper_sve_fcvtzs_ds, a, 0, FPST_FPCR) | ||
130 | +TRANS_FEAT(FCVTZU_ds, aa64_sve, gen_gvec_fpst_arg_zpz, | ||
131 | + gen_helper_sve_fcvtzu_ds, a, 0, FPST_FPCR) | ||
132 | |||
133 | -static bool trans_FCVT_hd(DisasContext *s, arg_rpr_esz *a) | ||
134 | -{ | ||
135 | - return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve_fcvt_hd); | ||
136 | -} | ||
137 | - | ||
138 | -static bool trans_FCVT_ds(DisasContext *s, arg_rpr_esz *a) | ||
139 | -{ | ||
140 | - return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve_fcvt_ds); | ||
141 | -} | ||
142 | - | ||
143 | -static bool trans_FCVT_sd(DisasContext *s, arg_rpr_esz *a) | ||
144 | -{ | ||
145 | - return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve_fcvt_sd); | ||
146 | -} | ||
147 | - | ||
148 | -static bool trans_FCVTZS_hh(DisasContext *s, arg_rpr_esz *a) | ||
149 | -{ | ||
150 | - return do_zpz_ptr(s, a->rd, a->rn, a->pg, true, gen_helper_sve_fcvtzs_hh); | ||
151 | -} | ||
152 | - | ||
153 | -static bool trans_FCVTZU_hh(DisasContext *s, arg_rpr_esz *a) | ||
154 | -{ | ||
155 | - return do_zpz_ptr(s, a->rd, a->rn, a->pg, true, gen_helper_sve_fcvtzu_hh); | ||
156 | -} | ||
157 | - | ||
158 | -static bool trans_FCVTZS_hs(DisasContext *s, arg_rpr_esz *a) | ||
159 | -{ | ||
160 | - return do_zpz_ptr(s, a->rd, a->rn, a->pg, true, gen_helper_sve_fcvtzs_hs); | ||
161 | -} | ||
162 | - | ||
163 | -static bool trans_FCVTZU_hs(DisasContext *s, arg_rpr_esz *a) | ||
164 | -{ | ||
165 | - return do_zpz_ptr(s, a->rd, a->rn, a->pg, true, gen_helper_sve_fcvtzu_hs); | ||
166 | -} | ||
167 | - | ||
168 | -static bool trans_FCVTZS_hd(DisasContext *s, arg_rpr_esz *a) | ||
169 | -{ | ||
170 | - return do_zpz_ptr(s, a->rd, a->rn, a->pg, true, gen_helper_sve_fcvtzs_hd); | ||
171 | -} | ||
172 | - | ||
173 | -static bool trans_FCVTZU_hd(DisasContext *s, arg_rpr_esz *a) | ||
174 | -{ | ||
175 | - return do_zpz_ptr(s, a->rd, a->rn, a->pg, true, gen_helper_sve_fcvtzu_hd); | ||
176 | -} | ||
177 | - | ||
178 | -static bool trans_FCVTZS_ss(DisasContext *s, arg_rpr_esz *a) | ||
179 | -{ | ||
180 | - return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve_fcvtzs_ss); | ||
181 | -} | ||
182 | - | ||
183 | -static bool trans_FCVTZU_ss(DisasContext *s, arg_rpr_esz *a) | ||
184 | -{ | ||
185 | - return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve_fcvtzu_ss); | ||
186 | -} | ||
187 | - | ||
188 | -static bool trans_FCVTZS_sd(DisasContext *s, arg_rpr_esz *a) | ||
189 | -{ | ||
190 | - return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve_fcvtzs_sd); | ||
191 | -} | ||
192 | - | ||
193 | -static bool trans_FCVTZU_sd(DisasContext *s, arg_rpr_esz *a) | ||
194 | -{ | ||
195 | - return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve_fcvtzu_sd); | ||
196 | -} | ||
197 | - | ||
198 | -static bool trans_FCVTZS_ds(DisasContext *s, arg_rpr_esz *a) | ||
199 | -{ | ||
200 | - return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve_fcvtzs_ds); | ||
201 | -} | ||
202 | - | ||
203 | -static bool trans_FCVTZU_ds(DisasContext *s, arg_rpr_esz *a) | ||
204 | -{ | ||
205 | - return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve_fcvtzu_ds); | ||
206 | -} | ||
207 | - | ||
208 | -static bool trans_FCVTZS_dd(DisasContext *s, arg_rpr_esz *a) | ||
209 | -{ | ||
210 | - return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve_fcvtzs_dd); | ||
211 | -} | ||
212 | - | ||
213 | -static bool trans_FCVTZU_dd(DisasContext *s, arg_rpr_esz *a) | ||
214 | -{ | ||
215 | - return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve_fcvtzu_dd); | ||
216 | -} | ||
217 | +TRANS_FEAT(FCVTZS_dd, aa64_sve, gen_gvec_fpst_arg_zpz, | ||
218 | + gen_helper_sve_fcvtzs_dd, a, 0, FPST_FPCR) | ||
219 | +TRANS_FEAT(FCVTZU_dd, aa64_sve, gen_gvec_fpst_arg_zpz, | ||
220 | + gen_helper_sve_fcvtzu_dd, a, 0, FPST_FPCR) | ||
221 | |||
222 | static gen_helper_gvec_3_ptr * const frint_fns[] = { | ||
223 | NULL, | ||
224 | @@ -XXX,XX +XXX,XX @@ static gen_helper_gvec_3_ptr * const frint_fns[] = { | ||
225 | gen_helper_sve_frint_s, | ||
226 | gen_helper_sve_frint_d | ||
227 | }; | ||
228 | +TRANS_FEAT(FRINTI, aa64_sve, gen_gvec_fpst_arg_zpz, frint_fns[a->esz], | ||
229 | + a, 0, a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR) | ||
230 | |||
231 | -static bool trans_FRINTI(DisasContext *s, arg_rpr_esz *a) | ||
232 | -{ | ||
233 | - if (a->esz == 0) { | ||
234 | - return false; | ||
235 | - } | ||
236 | - return do_zpz_ptr(s, a->rd, a->rn, a->pg, a->esz == MO_16, | ||
237 | - frint_fns[a->esz]); | ||
238 | -} | ||
239 | - | ||
240 | -static bool trans_FRINTX(DisasContext *s, arg_rpr_esz *a) | ||
241 | -{ | ||
242 | - static gen_helper_gvec_3_ptr * const fns[3] = { | ||
243 | - gen_helper_sve_frintx_h, | ||
244 | - gen_helper_sve_frintx_s, | ||
245 | - gen_helper_sve_frintx_d | ||
246 | - }; | ||
247 | - if (a->esz == 0) { | ||
248 | - return false; | ||
249 | - } | ||
250 | - return do_zpz_ptr(s, a->rd, a->rn, a->pg, a->esz == MO_16, fns[a->esz - 1]); | ||
251 | -} | ||
252 | +static gen_helper_gvec_3_ptr * const frintx_fns[] = { | ||
253 | + NULL, | ||
254 | + gen_helper_sve_frintx_h, | ||
255 | + gen_helper_sve_frintx_s, | ||
256 | + gen_helper_sve_frintx_d | ||
257 | +}; | ||
258 | +TRANS_FEAT(FRINTX, aa64_sve, gen_gvec_fpst_arg_zpz, frintx_fns[a->esz], | ||
259 | + a, 0, a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); | ||
260 | |||
261 | static bool do_frint_mode(DisasContext *s, arg_rpr_esz *a, | ||
262 | int mode, gen_helper_gvec_3_ptr *fn) | ||
263 | @@ -XXX,XX +XXX,XX @@ static bool trans_FRINTA(DisasContext *s, arg_rpr_esz *a) | ||
264 | return do_frint_mode(s, a, float_round_ties_away, frint_fns[a->esz]); | ||
265 | } | ||
266 | |||
267 | -static bool trans_FRECPX(DisasContext *s, arg_rpr_esz *a) | ||
268 | -{ | ||
269 | - static gen_helper_gvec_3_ptr * const fns[3] = { | ||
270 | - gen_helper_sve_frecpx_h, | ||
271 | - gen_helper_sve_frecpx_s, | ||
272 | - gen_helper_sve_frecpx_d | ||
273 | - }; | ||
274 | - if (a->esz == 0) { | ||
275 | - return false; | ||
276 | - } | ||
277 | - return do_zpz_ptr(s, a->rd, a->rn, a->pg, a->esz == MO_16, fns[a->esz - 1]); | ||
278 | -} | ||
279 | +static gen_helper_gvec_3_ptr * const frecpx_fns[] = { | ||
280 | + NULL, gen_helper_sve_frecpx_h, | ||
281 | + gen_helper_sve_frecpx_s, gen_helper_sve_frecpx_d, | ||
282 | +}; | ||
283 | +TRANS_FEAT(FRECPX, aa64_sve, gen_gvec_fpst_arg_zpz, frecpx_fns[a->esz], | ||
284 | + a, 0, a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR) | ||
285 | |||
286 | -static bool trans_FSQRT(DisasContext *s, arg_rpr_esz *a) | ||
287 | -{ | ||
288 | - static gen_helper_gvec_3_ptr * const fns[3] = { | ||
289 | - gen_helper_sve_fsqrt_h, | ||
290 | - gen_helper_sve_fsqrt_s, | ||
291 | - gen_helper_sve_fsqrt_d | ||
292 | - }; | ||
293 | - if (a->esz == 0) { | ||
294 | - return false; | ||
295 | - } | ||
296 | - return do_zpz_ptr(s, a->rd, a->rn, a->pg, a->esz == MO_16, fns[a->esz - 1]); | ||
297 | -} | ||
298 | +static gen_helper_gvec_3_ptr * const fsqrt_fns[] = { | ||
299 | + NULL, gen_helper_sve_fsqrt_h, | ||
300 | + gen_helper_sve_fsqrt_s, gen_helper_sve_fsqrt_d, | ||
301 | +}; | ||
302 | +TRANS_FEAT(FSQRT, aa64_sve, gen_gvec_fpst_arg_zpz, fsqrt_fns[a->esz], | ||
303 | + a, 0, a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR) | ||
304 | |||
305 | -static bool trans_SCVTF_hh(DisasContext *s, arg_rpr_esz *a) | ||
306 | -{ | ||
307 | - return do_zpz_ptr(s, a->rd, a->rn, a->pg, true, gen_helper_sve_scvt_hh); | ||
308 | -} | ||
309 | +TRANS_FEAT(SCVTF_hh, aa64_sve, gen_gvec_fpst_arg_zpz, | ||
310 | + gen_helper_sve_scvt_hh, a, 0, FPST_FPCR_F16) | ||
311 | +TRANS_FEAT(SCVTF_sh, aa64_sve, gen_gvec_fpst_arg_zpz, | ||
312 | + gen_helper_sve_scvt_sh, a, 0, FPST_FPCR_F16) | ||
313 | +TRANS_FEAT(SCVTF_dh, aa64_sve, gen_gvec_fpst_arg_zpz, | ||
314 | + gen_helper_sve_scvt_dh, a, 0, FPST_FPCR_F16) | ||
315 | |||
316 | -static bool trans_SCVTF_sh(DisasContext *s, arg_rpr_esz *a) | ||
317 | -{ | ||
318 | - return do_zpz_ptr(s, a->rd, a->rn, a->pg, true, gen_helper_sve_scvt_sh); | ||
319 | -} | ||
320 | +TRANS_FEAT(SCVTF_ss, aa64_sve, gen_gvec_fpst_arg_zpz, | ||
321 | + gen_helper_sve_scvt_ss, a, 0, FPST_FPCR) | ||
322 | +TRANS_FEAT(SCVTF_ds, aa64_sve, gen_gvec_fpst_arg_zpz, | ||
323 | + gen_helper_sve_scvt_ds, a, 0, FPST_FPCR) | ||
324 | |||
325 | -static bool trans_SCVTF_dh(DisasContext *s, arg_rpr_esz *a) | ||
326 | -{ | ||
327 | - return do_zpz_ptr(s, a->rd, a->rn, a->pg, true, gen_helper_sve_scvt_dh); | ||
328 | -} | ||
329 | +TRANS_FEAT(SCVTF_sd, aa64_sve, gen_gvec_fpst_arg_zpz, | ||
330 | + gen_helper_sve_scvt_sd, a, 0, FPST_FPCR) | ||
331 | +TRANS_FEAT(SCVTF_dd, aa64_sve, gen_gvec_fpst_arg_zpz, | ||
332 | + gen_helper_sve_scvt_dd, a, 0, FPST_FPCR) | ||
333 | |||
334 | -static bool trans_SCVTF_ss(DisasContext *s, arg_rpr_esz *a) | ||
335 | -{ | ||
336 | - return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve_scvt_ss); | ||
337 | -} | ||
338 | +TRANS_FEAT(UCVTF_hh, aa64_sve, gen_gvec_fpst_arg_zpz, | ||
339 | + gen_helper_sve_ucvt_hh, a, 0, FPST_FPCR_F16) | ||
340 | +TRANS_FEAT(UCVTF_sh, aa64_sve, gen_gvec_fpst_arg_zpz, | ||
341 | + gen_helper_sve_ucvt_sh, a, 0, FPST_FPCR_F16) | ||
342 | +TRANS_FEAT(UCVTF_dh, aa64_sve, gen_gvec_fpst_arg_zpz, | ||
343 | + gen_helper_sve_ucvt_dh, a, 0, FPST_FPCR_F16) | ||
344 | |||
345 | -static bool trans_SCVTF_ds(DisasContext *s, arg_rpr_esz *a) | ||
346 | -{ | ||
347 | - return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve_scvt_ds); | ||
348 | -} | ||
349 | +TRANS_FEAT(UCVTF_ss, aa64_sve, gen_gvec_fpst_arg_zpz, | ||
350 | + gen_helper_sve_ucvt_ss, a, 0, FPST_FPCR) | ||
351 | +TRANS_FEAT(UCVTF_ds, aa64_sve, gen_gvec_fpst_arg_zpz, | ||
352 | + gen_helper_sve_ucvt_ds, a, 0, FPST_FPCR) | ||
353 | +TRANS_FEAT(UCVTF_sd, aa64_sve, gen_gvec_fpst_arg_zpz, | ||
354 | + gen_helper_sve_ucvt_sd, a, 0, FPST_FPCR) | ||
355 | |||
356 | -static bool trans_SCVTF_sd(DisasContext *s, arg_rpr_esz *a) | ||
357 | -{ | ||
358 | - return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve_scvt_sd); | ||
359 | -} | ||
360 | - | ||
361 | -static bool trans_SCVTF_dd(DisasContext *s, arg_rpr_esz *a) | ||
362 | -{ | ||
363 | - return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve_scvt_dd); | ||
364 | -} | ||
365 | - | ||
366 | -static bool trans_UCVTF_hh(DisasContext *s, arg_rpr_esz *a) | ||
367 | -{ | ||
368 | - return do_zpz_ptr(s, a->rd, a->rn, a->pg, true, gen_helper_sve_ucvt_hh); | ||
369 | -} | ||
370 | - | ||
371 | -static bool trans_UCVTF_sh(DisasContext *s, arg_rpr_esz *a) | ||
372 | -{ | ||
373 | - return do_zpz_ptr(s, a->rd, a->rn, a->pg, true, gen_helper_sve_ucvt_sh); | ||
374 | -} | ||
375 | - | ||
376 | -static bool trans_UCVTF_dh(DisasContext *s, arg_rpr_esz *a) | ||
377 | -{ | ||
378 | - return do_zpz_ptr(s, a->rd, a->rn, a->pg, true, gen_helper_sve_ucvt_dh); | ||
379 | -} | ||
380 | - | ||
381 | -static bool trans_UCVTF_ss(DisasContext *s, arg_rpr_esz *a) | ||
382 | -{ | ||
383 | - return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve_ucvt_ss); | ||
384 | -} | ||
385 | - | ||
386 | -static bool trans_UCVTF_ds(DisasContext *s, arg_rpr_esz *a) | ||
387 | -{ | ||
388 | - return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve_ucvt_ds); | ||
389 | -} | ||
390 | - | ||
391 | -static bool trans_UCVTF_sd(DisasContext *s, arg_rpr_esz *a) | ||
392 | -{ | ||
393 | - return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve_ucvt_sd); | ||
394 | -} | ||
395 | - | ||
396 | -static bool trans_UCVTF_dd(DisasContext *s, arg_rpr_esz *a) | ||
397 | -{ | ||
398 | - return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve_ucvt_dd); | ||
399 | -} | ||
400 | +TRANS_FEAT(UCVTF_dd, aa64_sve, gen_gvec_fpst_arg_zpz, | ||
401 | + gen_helper_sve_ucvt_dd, a, 0, FPST_FPCR) | ||
402 | |||
403 | /* | ||
404 | *** SVE Memory - 32-bit Gather and Unsized Contiguous Group | ||
405 | @@ -XXX,XX +XXX,XX @@ TRANS_FEAT(SM4EKEY, aa64_sve2_sm4, gen_gvec_ool_arg_zzz, | ||
406 | |||
407 | TRANS_FEAT(RAX1, aa64_sve2_sha3, gen_gvec_fn_arg_zzz, gen_gvec_rax1, a) | ||
408 | |||
409 | -static bool trans_FCVTNT_sh(DisasContext *s, arg_rpr_esz *a) | ||
410 | -{ | ||
411 | - if (!dc_isar_feature(aa64_sve2, s)) { | ||
412 | - return false; | ||
413 | - } | ||
414 | - return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve2_fcvtnt_sh); | ||
415 | -} | ||
416 | +TRANS_FEAT(FCVTNT_sh, aa64_sve2, gen_gvec_fpst_arg_zpz, | ||
417 | + gen_helper_sve2_fcvtnt_sh, a, 0, FPST_FPCR) | ||
418 | +TRANS_FEAT(FCVTNT_ds, aa64_sve2, gen_gvec_fpst_arg_zpz, | ||
419 | + gen_helper_sve2_fcvtnt_ds, a, 0, FPST_FPCR) | ||
420 | |||
421 | -static bool trans_BFCVTNT(DisasContext *s, arg_rpr_esz *a) | ||
422 | -{ | ||
423 | - if (!dc_isar_feature(aa64_sve_bf16, s)) { | ||
424 | - return false; | ||
425 | - } | ||
426 | - return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve_bfcvtnt); | ||
427 | -} | ||
428 | +TRANS_FEAT(BFCVTNT, aa64_sve_bf16, gen_gvec_fpst_arg_zpz, | ||
429 | + gen_helper_sve_bfcvtnt, a, 0, FPST_FPCR) | ||
430 | |||
431 | -static bool trans_FCVTNT_ds(DisasContext *s, arg_rpr_esz *a) | ||
432 | -{ | ||
433 | - if (!dc_isar_feature(aa64_sve2, s)) { | ||
434 | - return false; | ||
435 | - } | ||
436 | - return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve2_fcvtnt_ds); | ||
437 | -} | ||
438 | - | ||
439 | -static bool trans_FCVTLT_hs(DisasContext *s, arg_rpr_esz *a) | ||
440 | -{ | ||
441 | - if (!dc_isar_feature(aa64_sve2, s)) { | ||
442 | - return false; | ||
443 | - } | ||
444 | - return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve2_fcvtlt_hs); | ||
445 | -} | ||
446 | - | ||
447 | -static bool trans_FCVTLT_sd(DisasContext *s, arg_rpr_esz *a) | ||
448 | -{ | ||
449 | - if (!dc_isar_feature(aa64_sve2, s)) { | ||
450 | - return false; | ||
451 | - } | ||
452 | - return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve2_fcvtlt_sd); | ||
453 | -} | ||
454 | +TRANS_FEAT(FCVTLT_hs, aa64_sve2, gen_gvec_fpst_arg_zpz, | ||
455 | + gen_helper_sve2_fcvtlt_hs, a, 0, FPST_FPCR) | ||
456 | +TRANS_FEAT(FCVTLT_sd, aa64_sve2, gen_gvec_fpst_arg_zpz, | ||
457 | + gen_helper_sve2_fcvtlt_sd, a, 0, FPST_FPCR) | ||
458 | |||
459 | static bool trans_FCVTX_ds(DisasContext *s, arg_rpr_esz *a) | ||
460 | { | ||
461 | -- | 166 | -- |
462 | 2.25.1 | 167 | 2.34.1 |
168 | |||
169 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Strahinja Jankovic <strahinjapjankovic@gmail.com> |
---|---|---|---|
2 | 2 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 3 | During SPL boot several Clock Controller Module (CCM) registers are |
4 | Message-id: 20220527181907.189259-90-richard.henderson@linaro.org | 4 | read, most important are PLL and Tuning, as well as divisor registers. |
5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 5 | |
6 | This patch adds these registers and initializes reset values from user's | ||
7 | guide. | ||
8 | |||
9 | Signed-off-by: Strahinja Jankovic <strahinja.p.jankovic@gmail.com> | ||
10 | |||
11 | Reviewed-by: Niek Linnenbank <nieklinnenbank@gmail.com> | ||
12 | Message-id: 20221226220303.14420-2-strahinja.p.jankovic@gmail.com | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 13 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
7 | --- | 14 | --- |
8 | target/arm/translate-sve.c | 30 +++++++++++++++++------------- | 15 | include/hw/arm/allwinner-a10.h | 2 + |
9 | 1 file changed, 17 insertions(+), 13 deletions(-) | 16 | include/hw/misc/allwinner-a10-ccm.h | 67 +++++++++ |
17 | hw/arm/allwinner-a10.c | 7 + | ||
18 | hw/misc/allwinner-a10-ccm.c | 224 ++++++++++++++++++++++++++++ | ||
19 | hw/arm/Kconfig | 1 + | ||
20 | hw/misc/Kconfig | 3 + | ||
21 | hw/misc/meson.build | 1 + | ||
22 | 7 files changed, 305 insertions(+) | ||
23 | create mode 100644 include/hw/misc/allwinner-a10-ccm.h | ||
24 | create mode 100644 hw/misc/allwinner-a10-ccm.c | ||
10 | 25 | ||
11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | 26 | diff --git a/include/hw/arm/allwinner-a10.h b/include/hw/arm/allwinner-a10.h |
12 | index XXXXXXX..XXXXXXX 100644 | 27 | index XXXXXXX..XXXXXXX 100644 |
13 | --- a/target/arm/translate-sve.c | 28 | --- a/include/hw/arm/allwinner-a10.h |
14 | +++ b/target/arm/translate-sve.c | 29 | +++ b/include/hw/arm/allwinner-a10.h |
15 | @@ -XXX,XX +XXX,XX @@ TRANS_FEAT(FMUL_zzx, aa64_sve, gen_gvec_fpst_zzz, | 30 | @@ -XXX,XX +XXX,XX @@ |
16 | typedef void gen_helper_fp_reduce(TCGv_i64, TCGv_ptr, TCGv_ptr, | 31 | #include "hw/usb/hcd-ohci.h" |
17 | TCGv_ptr, TCGv_i32); | 32 | #include "hw/usb/hcd-ehci.h" |
18 | 33 | #include "hw/rtc/allwinner-rtc.h" | |
19 | -static void do_reduce(DisasContext *s, arg_rpr_esz *a, | 34 | +#include "hw/misc/allwinner-a10-ccm.h" |
20 | +static bool do_reduce(DisasContext *s, arg_rpr_esz *a, | 35 | |
21 | gen_helper_fp_reduce *fn) | 36 | #include "target/arm/cpu.h" |
22 | { | 37 | #include "qom/object.h" |
23 | - unsigned vsz = vec_full_reg_size(s); | 38 | @@ -XXX,XX +XXX,XX @@ struct AwA10State { |
24 | - unsigned p2vsz = pow2ceil(vsz); | 39 | /*< public >*/ |
25 | - TCGv_i32 t_desc = tcg_constant_i32(simd_desc(vsz, vsz, p2vsz)); | 40 | |
26 | + unsigned vsz, p2vsz; | 41 | ARMCPU cpu; |
27 | + TCGv_i32 t_desc; | 42 | + AwA10ClockCtlState ccm; |
28 | TCGv_ptr t_zn, t_pg, status; | 43 | AwA10PITState timer; |
29 | TCGv_i64 temp; | 44 | AwA10PICState intc; |
30 | 45 | AwEmacState emac; | |
31 | + if (fn == NULL) { | 46 | diff --git a/include/hw/misc/allwinner-a10-ccm.h b/include/hw/misc/allwinner-a10-ccm.h |
32 | + return false; | 47 | new file mode 100644 |
48 | index XXXXXXX..XXXXXXX | ||
49 | --- /dev/null | ||
50 | +++ b/include/hw/misc/allwinner-a10-ccm.h | ||
51 | @@ -XXX,XX +XXX,XX @@ | ||
52 | +/* | ||
53 | + * Allwinner A10 Clock Control Module emulation | ||
54 | + * | ||
55 | + * Copyright (C) 2022 Strahinja Jankovic <strahinja.p.jankovic@gmail.com> | ||
56 | + * | ||
57 | + * This file is derived from Allwinner H3 CCU, | ||
58 | + * by Niek Linnenbank. | ||
59 | + * | ||
60 | + * This program is free software: you can redistribute it and/or modify | ||
61 | + * it under the terms of the GNU General Public License as published by | ||
62 | + * the Free Software Foundation, either version 2 of the License, or | ||
63 | + * (at your option) any later version. | ||
64 | + * | ||
65 | + * This program is distributed in the hope that it will be useful, | ||
66 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
67 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
68 | + * GNU General Public License for more details. | ||
69 | + * | ||
70 | + * You should have received a copy of the GNU General Public License | ||
71 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
72 | + */ | ||
73 | + | ||
74 | +#ifndef HW_MISC_ALLWINNER_A10_CCM_H | ||
75 | +#define HW_MISC_ALLWINNER_A10_CCM_H | ||
76 | + | ||
77 | +#include "qom/object.h" | ||
78 | +#include "hw/sysbus.h" | ||
79 | + | ||
80 | +/** | ||
81 | + * @name Constants | ||
82 | + * @{ | ||
83 | + */ | ||
84 | + | ||
85 | +/** Size of register I/O address space used by CCM device */ | ||
86 | +#define AW_A10_CCM_IOSIZE (0x400) | ||
87 | + | ||
88 | +/** Total number of known registers */ | ||
89 | +#define AW_A10_CCM_REGS_NUM (AW_A10_CCM_IOSIZE / sizeof(uint32_t)) | ||
90 | + | ||
91 | +/** @} */ | ||
92 | + | ||
93 | +/** | ||
94 | + * @name Object model | ||
95 | + * @{ | ||
96 | + */ | ||
97 | + | ||
98 | +#define TYPE_AW_A10_CCM "allwinner-a10-ccm" | ||
99 | +OBJECT_DECLARE_SIMPLE_TYPE(AwA10ClockCtlState, AW_A10_CCM) | ||
100 | + | ||
101 | +/** @} */ | ||
102 | + | ||
103 | +/** | ||
104 | + * Allwinner A10 CCM object instance state. | ||
105 | + */ | ||
106 | +struct AwA10ClockCtlState { | ||
107 | + /*< private >*/ | ||
108 | + SysBusDevice parent_obj; | ||
109 | + /*< public >*/ | ||
110 | + | ||
111 | + /** Maps I/O registers in physical memory */ | ||
112 | + MemoryRegion iomem; | ||
113 | + | ||
114 | + /** Array of hardware registers */ | ||
115 | + uint32_t regs[AW_A10_CCM_REGS_NUM]; | ||
116 | +}; | ||
117 | + | ||
118 | +#endif /* HW_MISC_ALLWINNER_H3_CCU_H */ | ||
119 | diff --git a/hw/arm/allwinner-a10.c b/hw/arm/allwinner-a10.c | ||
120 | index XXXXXXX..XXXXXXX 100644 | ||
121 | --- a/hw/arm/allwinner-a10.c | ||
122 | +++ b/hw/arm/allwinner-a10.c | ||
123 | @@ -XXX,XX +XXX,XX @@ | ||
124 | #include "hw/usb/hcd-ohci.h" | ||
125 | |||
126 | #define AW_A10_MMC0_BASE 0x01c0f000 | ||
127 | +#define AW_A10_CCM_BASE 0x01c20000 | ||
128 | #define AW_A10_PIC_REG_BASE 0x01c20400 | ||
129 | #define AW_A10_PIT_REG_BASE 0x01c20c00 | ||
130 | #define AW_A10_UART0_REG_BASE 0x01c28000 | ||
131 | @@ -XXX,XX +XXX,XX @@ static void aw_a10_init(Object *obj) | ||
132 | |||
133 | object_initialize_child(obj, "timer", &s->timer, TYPE_AW_A10_PIT); | ||
134 | |||
135 | + object_initialize_child(obj, "ccm", &s->ccm, TYPE_AW_A10_CCM); | ||
136 | + | ||
137 | object_initialize_child(obj, "emac", &s->emac, TYPE_AW_EMAC); | ||
138 | |||
139 | object_initialize_child(obj, "sata", &s->sata, TYPE_ALLWINNER_AHCI); | ||
140 | @@ -XXX,XX +XXX,XX @@ static void aw_a10_realize(DeviceState *dev, Error **errp) | ||
141 | memory_region_add_subregion(get_system_memory(), 0x00000000, &s->sram_a); | ||
142 | create_unimplemented_device("a10-sram-ctrl", 0x01c00000, 4 * KiB); | ||
143 | |||
144 | + /* Clock Control Module */ | ||
145 | + sysbus_realize(SYS_BUS_DEVICE(&s->ccm), &error_fatal); | ||
146 | + sysbus_mmio_map(SYS_BUS_DEVICE(&s->ccm), 0, AW_A10_CCM_BASE); | ||
147 | + | ||
148 | /* FIXME use qdev NIC properties instead of nd_table[] */ | ||
149 | if (nd_table[0].used) { | ||
150 | qemu_check_nic_model(&nd_table[0], TYPE_AW_EMAC); | ||
151 | diff --git a/hw/misc/allwinner-a10-ccm.c b/hw/misc/allwinner-a10-ccm.c | ||
152 | new file mode 100644 | ||
153 | index XXXXXXX..XXXXXXX | ||
154 | --- /dev/null | ||
155 | +++ b/hw/misc/allwinner-a10-ccm.c | ||
156 | @@ -XXX,XX +XXX,XX @@ | ||
157 | +/* | ||
158 | + * Allwinner A10 Clock Control Module emulation | ||
159 | + * | ||
160 | + * Copyright (C) 2022 Strahinja Jankovic <strahinja.p.jankovic@gmail.com> | ||
161 | + * | ||
162 | + * This file is derived from Allwinner H3 CCU, | ||
163 | + * by Niek Linnenbank. | ||
164 | + * | ||
165 | + * This program is free software: you can redistribute it and/or modify | ||
166 | + * it under the terms of the GNU General Public License as published by | ||
167 | + * the Free Software Foundation, either version 2 of the License, or | ||
168 | + * (at your option) any later version. | ||
169 | + * | ||
170 | + * This program is distributed in the hope that it will be useful, | ||
171 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
172 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
173 | + * GNU General Public License for more details. | ||
174 | + * | ||
175 | + * You should have received a copy of the GNU General Public License | ||
176 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
177 | + */ | ||
178 | + | ||
179 | +#include "qemu/osdep.h" | ||
180 | +#include "qemu/units.h" | ||
181 | +#include "hw/sysbus.h" | ||
182 | +#include "migration/vmstate.h" | ||
183 | +#include "qemu/log.h" | ||
184 | +#include "qemu/module.h" | ||
185 | +#include "hw/misc/allwinner-a10-ccm.h" | ||
186 | + | ||
187 | +/* CCM register offsets */ | ||
188 | +enum { | ||
189 | + REG_PLL1_CFG = 0x0000, /* PLL1 Control */ | ||
190 | + REG_PLL1_TUN = 0x0004, /* PLL1 Tuning */ | ||
191 | + REG_PLL2_CFG = 0x0008, /* PLL2 Control */ | ||
192 | + REG_PLL2_TUN = 0x000C, /* PLL2 Tuning */ | ||
193 | + REG_PLL3_CFG = 0x0010, /* PLL3 Control */ | ||
194 | + REG_PLL4_CFG = 0x0018, /* PLL4 Control */ | ||
195 | + REG_PLL5_CFG = 0x0020, /* PLL5 Control */ | ||
196 | + REG_PLL5_TUN = 0x0024, /* PLL5 Tuning */ | ||
197 | + REG_PLL6_CFG = 0x0028, /* PLL6 Control */ | ||
198 | + REG_PLL6_TUN = 0x002C, /* PLL6 Tuning */ | ||
199 | + REG_PLL7_CFG = 0x0030, /* PLL7 Control */ | ||
200 | + REG_PLL1_TUN2 = 0x0038, /* PLL1 Tuning2 */ | ||
201 | + REG_PLL5_TUN2 = 0x003C, /* PLL5 Tuning2 */ | ||
202 | + REG_PLL8_CFG = 0x0040, /* PLL8 Control */ | ||
203 | + REG_OSC24M_CFG = 0x0050, /* OSC24M Control */ | ||
204 | + REG_CPU_AHB_APB0_CFG = 0x0054, /* CPU, AHB and APB0 Divide Ratio */ | ||
205 | +}; | ||
206 | + | ||
207 | +#define REG_INDEX(offset) (offset / sizeof(uint32_t)) | ||
208 | + | ||
209 | +/* CCM register reset values */ | ||
210 | +enum { | ||
211 | + REG_PLL1_CFG_RST = 0x21005000, | ||
212 | + REG_PLL1_TUN_RST = 0x0A101000, | ||
213 | + REG_PLL2_CFG_RST = 0x08100010, | ||
214 | + REG_PLL2_TUN_RST = 0x00000000, | ||
215 | + REG_PLL3_CFG_RST = 0x0010D063, | ||
216 | + REG_PLL4_CFG_RST = 0x21009911, | ||
217 | + REG_PLL5_CFG_RST = 0x11049280, | ||
218 | + REG_PLL5_TUN_RST = 0x14888000, | ||
219 | + REG_PLL6_CFG_RST = 0x21009911, | ||
220 | + REG_PLL6_TUN_RST = 0x00000000, | ||
221 | + REG_PLL7_CFG_RST = 0x0010D063, | ||
222 | + REG_PLL1_TUN2_RST = 0x00000000, | ||
223 | + REG_PLL5_TUN2_RST = 0x00000000, | ||
224 | + REG_PLL8_CFG_RST = 0x21009911, | ||
225 | + REG_OSC24M_CFG_RST = 0x00138013, | ||
226 | + REG_CPU_AHB_APB0_CFG_RST = 0x00010010, | ||
227 | +}; | ||
228 | + | ||
229 | +static uint64_t allwinner_a10_ccm_read(void *opaque, hwaddr offset, | ||
230 | + unsigned size) | ||
231 | +{ | ||
232 | + const AwA10ClockCtlState *s = AW_A10_CCM(opaque); | ||
233 | + const uint32_t idx = REG_INDEX(offset); | ||
234 | + | ||
235 | + switch (offset) { | ||
236 | + case REG_PLL1_CFG: | ||
237 | + case REG_PLL1_TUN: | ||
238 | + case REG_PLL2_CFG: | ||
239 | + case REG_PLL2_TUN: | ||
240 | + case REG_PLL3_CFG: | ||
241 | + case REG_PLL4_CFG: | ||
242 | + case REG_PLL5_CFG: | ||
243 | + case REG_PLL5_TUN: | ||
244 | + case REG_PLL6_CFG: | ||
245 | + case REG_PLL6_TUN: | ||
246 | + case REG_PLL7_CFG: | ||
247 | + case REG_PLL1_TUN2: | ||
248 | + case REG_PLL5_TUN2: | ||
249 | + case REG_PLL8_CFG: | ||
250 | + case REG_OSC24M_CFG: | ||
251 | + case REG_CPU_AHB_APB0_CFG: | ||
252 | + break; | ||
253 | + case 0x158 ... AW_A10_CCM_IOSIZE: | ||
254 | + qemu_log_mask(LOG_GUEST_ERROR, "%s: out-of-bounds offset 0x%04x\n", | ||
255 | + __func__, (uint32_t)offset); | ||
256 | + return 0; | ||
257 | + default: | ||
258 | + qemu_log_mask(LOG_UNIMP, "%s: unimplemented read offset 0x%04x\n", | ||
259 | + __func__, (uint32_t)offset); | ||
260 | + return 0; | ||
33 | + } | 261 | + } |
34 | + if (!sve_access_check(s)) { | 262 | + |
35 | + return true; | 263 | + return s->regs[idx]; |
264 | +} | ||
265 | + | ||
266 | +static void allwinner_a10_ccm_write(void *opaque, hwaddr offset, | ||
267 | + uint64_t val, unsigned size) | ||
268 | +{ | ||
269 | + AwA10ClockCtlState *s = AW_A10_CCM(opaque); | ||
270 | + const uint32_t idx = REG_INDEX(offset); | ||
271 | + | ||
272 | + switch (offset) { | ||
273 | + case REG_PLL1_CFG: | ||
274 | + case REG_PLL1_TUN: | ||
275 | + case REG_PLL2_CFG: | ||
276 | + case REG_PLL2_TUN: | ||
277 | + case REG_PLL3_CFG: | ||
278 | + case REG_PLL4_CFG: | ||
279 | + case REG_PLL5_CFG: | ||
280 | + case REG_PLL5_TUN: | ||
281 | + case REG_PLL6_CFG: | ||
282 | + case REG_PLL6_TUN: | ||
283 | + case REG_PLL7_CFG: | ||
284 | + case REG_PLL1_TUN2: | ||
285 | + case REG_PLL5_TUN2: | ||
286 | + case REG_PLL8_CFG: | ||
287 | + case REG_OSC24M_CFG: | ||
288 | + case REG_CPU_AHB_APB0_CFG: | ||
289 | + break; | ||
290 | + case 0x158 ... AW_A10_CCM_IOSIZE: | ||
291 | + qemu_log_mask(LOG_GUEST_ERROR, "%s: out-of-bounds offset 0x%04x\n", | ||
292 | + __func__, (uint32_t)offset); | ||
293 | + break; | ||
294 | + default: | ||
295 | + qemu_log_mask(LOG_UNIMP, "%s: unimplemented write offset 0x%04x\n", | ||
296 | + __func__, (uint32_t)offset); | ||
297 | + break; | ||
36 | + } | 298 | + } |
37 | + | 299 | + |
38 | + vsz = vec_full_reg_size(s); | 300 | + s->regs[idx] = (uint32_t) val; |
39 | + p2vsz = pow2ceil(vsz); | 301 | +} |
40 | + t_desc = tcg_constant_i32(simd_desc(vsz, vsz, p2vsz)); | 302 | + |
41 | temp = tcg_temp_new_i64(); | 303 | +static const MemoryRegionOps allwinner_a10_ccm_ops = { |
42 | t_zn = tcg_temp_new_ptr(); | 304 | + .read = allwinner_a10_ccm_read, |
43 | t_pg = tcg_temp_new_ptr(); | 305 | + .write = allwinner_a10_ccm_write, |
44 | @@ -XXX,XX +XXX,XX @@ static void do_reduce(DisasContext *s, arg_rpr_esz *a, | 306 | + .endianness = DEVICE_NATIVE_ENDIAN, |
45 | 307 | + .valid = { | |
46 | write_fp_dreg(s, a->rd, temp); | 308 | + .min_access_size = 4, |
47 | tcg_temp_free_i64(temp); | 309 | + .max_access_size = 4, |
48 | + return true; | 310 | + }, |
49 | } | 311 | + .impl.min_access_size = 4, |
50 | 312 | +}; | |
51 | #define DO_VPZ(NAME, name) \ | 313 | + |
52 | static bool trans_##NAME(DisasContext *s, arg_rpr_esz *a) \ | 314 | +static void allwinner_a10_ccm_reset_enter(Object *obj, ResetType type) |
53 | { \ | 315 | +{ |
54 | - static gen_helper_fp_reduce * const fns[3] = { \ | 316 | + AwA10ClockCtlState *s = AW_A10_CCM(obj); |
55 | - gen_helper_sve_##name##_h, \ | 317 | + |
56 | + static gen_helper_fp_reduce * const fns[4] = { \ | 318 | + /* Set default values for registers */ |
57 | + NULL, gen_helper_sve_##name##_h, \ | 319 | + s->regs[REG_INDEX(REG_PLL1_CFG)] = REG_PLL1_CFG_RST; |
58 | gen_helper_sve_##name##_s, \ | 320 | + s->regs[REG_INDEX(REG_PLL1_TUN)] = REG_PLL1_TUN_RST; |
59 | gen_helper_sve_##name##_d, \ | 321 | + s->regs[REG_INDEX(REG_PLL2_CFG)] = REG_PLL2_CFG_RST; |
60 | }; \ | 322 | + s->regs[REG_INDEX(REG_PLL2_TUN)] = REG_PLL2_TUN_RST; |
61 | - if (a->esz == 0) { \ | 323 | + s->regs[REG_INDEX(REG_PLL3_CFG)] = REG_PLL3_CFG_RST; |
62 | - return false; \ | 324 | + s->regs[REG_INDEX(REG_PLL4_CFG)] = REG_PLL4_CFG_RST; |
63 | - } \ | 325 | + s->regs[REG_INDEX(REG_PLL5_CFG)] = REG_PLL5_CFG_RST; |
64 | - if (sve_access_check(s)) { \ | 326 | + s->regs[REG_INDEX(REG_PLL5_TUN)] = REG_PLL5_TUN_RST; |
65 | - do_reduce(s, a, fns[a->esz - 1]); \ | 327 | + s->regs[REG_INDEX(REG_PLL6_CFG)] = REG_PLL6_CFG_RST; |
66 | - } \ | 328 | + s->regs[REG_INDEX(REG_PLL6_TUN)] = REG_PLL6_TUN_RST; |
67 | - return true; \ | 329 | + s->regs[REG_INDEX(REG_PLL7_CFG)] = REG_PLL7_CFG_RST; |
68 | + return do_reduce(s, a, fns[a->esz]); \ | 330 | + s->regs[REG_INDEX(REG_PLL1_TUN2)] = REG_PLL1_TUN2_RST; |
69 | } | 331 | + s->regs[REG_INDEX(REG_PLL5_TUN2)] = REG_PLL5_TUN2_RST; |
70 | 332 | + s->regs[REG_INDEX(REG_PLL8_CFG)] = REG_PLL8_CFG_RST; | |
71 | DO_VPZ(FADDV, faddv) | 333 | + s->regs[REG_INDEX(REG_OSC24M_CFG)] = REG_OSC24M_CFG_RST; |
334 | + s->regs[REG_INDEX(REG_CPU_AHB_APB0_CFG)] = REG_CPU_AHB_APB0_CFG_RST; | ||
335 | +} | ||
336 | + | ||
337 | +static void allwinner_a10_ccm_init(Object *obj) | ||
338 | +{ | ||
339 | + SysBusDevice *sbd = SYS_BUS_DEVICE(obj); | ||
340 | + AwA10ClockCtlState *s = AW_A10_CCM(obj); | ||
341 | + | ||
342 | + /* Memory mapping */ | ||
343 | + memory_region_init_io(&s->iomem, OBJECT(s), &allwinner_a10_ccm_ops, s, | ||
344 | + TYPE_AW_A10_CCM, AW_A10_CCM_IOSIZE); | ||
345 | + sysbus_init_mmio(sbd, &s->iomem); | ||
346 | +} | ||
347 | + | ||
348 | +static const VMStateDescription allwinner_a10_ccm_vmstate = { | ||
349 | + .name = "allwinner-a10-ccm", | ||
350 | + .version_id = 1, | ||
351 | + .minimum_version_id = 1, | ||
352 | + .fields = (VMStateField[]) { | ||
353 | + VMSTATE_UINT32_ARRAY(regs, AwA10ClockCtlState, AW_A10_CCM_REGS_NUM), | ||
354 | + VMSTATE_END_OF_LIST() | ||
355 | + } | ||
356 | +}; | ||
357 | + | ||
358 | +static void allwinner_a10_ccm_class_init(ObjectClass *klass, void *data) | ||
359 | +{ | ||
360 | + DeviceClass *dc = DEVICE_CLASS(klass); | ||
361 | + ResettableClass *rc = RESETTABLE_CLASS(klass); | ||
362 | + | ||
363 | + rc->phases.enter = allwinner_a10_ccm_reset_enter; | ||
364 | + dc->vmsd = &allwinner_a10_ccm_vmstate; | ||
365 | +} | ||
366 | + | ||
367 | +static const TypeInfo allwinner_a10_ccm_info = { | ||
368 | + .name = TYPE_AW_A10_CCM, | ||
369 | + .parent = TYPE_SYS_BUS_DEVICE, | ||
370 | + .instance_init = allwinner_a10_ccm_init, | ||
371 | + .instance_size = sizeof(AwA10ClockCtlState), | ||
372 | + .class_init = allwinner_a10_ccm_class_init, | ||
373 | +}; | ||
374 | + | ||
375 | +static void allwinner_a10_ccm_register(void) | ||
376 | +{ | ||
377 | + type_register_static(&allwinner_a10_ccm_info); | ||
378 | +} | ||
379 | + | ||
380 | +type_init(allwinner_a10_ccm_register) | ||
381 | diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig | ||
382 | index XXXXXXX..XXXXXXX 100644 | ||
383 | --- a/hw/arm/Kconfig | ||
384 | +++ b/hw/arm/Kconfig | ||
385 | @@ -XXX,XX +XXX,XX @@ config ALLWINNER_A10 | ||
386 | select AHCI | ||
387 | select ALLWINNER_A10_PIT | ||
388 | select ALLWINNER_A10_PIC | ||
389 | + select ALLWINNER_A10_CCM | ||
390 | select ALLWINNER_EMAC | ||
391 | select SERIAL | ||
392 | select UNIMP | ||
393 | diff --git a/hw/misc/Kconfig b/hw/misc/Kconfig | ||
394 | index XXXXXXX..XXXXXXX 100644 | ||
395 | --- a/hw/misc/Kconfig | ||
396 | +++ b/hw/misc/Kconfig | ||
397 | @@ -XXX,XX +XXX,XX @@ config VIRT_CTRL | ||
398 | config LASI | ||
399 | bool | ||
400 | |||
401 | +config ALLWINNER_A10_CCM | ||
402 | + bool | ||
403 | + | ||
404 | source macio/Kconfig | ||
405 | diff --git a/hw/misc/meson.build b/hw/misc/meson.build | ||
406 | index XXXXXXX..XXXXXXX 100644 | ||
407 | --- a/hw/misc/meson.build | ||
408 | +++ b/hw/misc/meson.build | ||
409 | @@ -XXX,XX +XXX,XX @@ subdir('macio') | ||
410 | |||
411 | softmmu_ss.add(when: 'CONFIG_IVSHMEM_DEVICE', if_true: files('ivshmem.c')) | ||
412 | |||
413 | +softmmu_ss.add(when: 'CONFIG_ALLWINNER_A10_CCM', if_true: files('allwinner-a10-ccm.c')) | ||
414 | softmmu_ss.add(when: 'CONFIG_ALLWINNER_H3', if_true: files('allwinner-h3-ccu.c')) | ||
415 | specific_ss.add(when: 'CONFIG_ALLWINNER_H3', if_true: files('allwinner-cpucfg.c')) | ||
416 | softmmu_ss.add(when: 'CONFIG_ALLWINNER_H3', if_true: files('allwinner-h3-dramc.c')) | ||
72 | -- | 417 | -- |
73 | 2.25.1 | 418 | 2.34.1 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Strahinja Jankovic <strahinjapjankovic@gmail.com> |
---|---|---|---|
2 | 2 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 3 | During SPL boot several DRAM Controller registers are used. Most |
4 | Message-id: 20220527181907.189259-49-richard.henderson@linaro.org | 4 | important registers are those related to DRAM initialization and |
5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 5 | calibration, where SPL initiates process and waits until certain bit is |
6 | set/cleared. | ||
7 | |||
8 | This patch adds these registers, initializes reset values from user's | ||
9 | guide and updates state of registers as SPL expects it. | ||
10 | |||
11 | Signed-off-by: Strahinja Jankovic <strahinja.p.jankovic@gmail.com> | ||
12 | |||
13 | Reviewed-by: Niek Linnenbank <nieklinnenbank@gmail.com> | ||
14 | Message-id: 20221226220303.14420-3-strahinja.p.jankovic@gmail.com | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 15 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
7 | --- | 16 | --- |
8 | target/arm/translate-sve.c | 53 ++++++++++++++++++-------------------- | 17 | include/hw/arm/allwinner-a10.h | 2 + |
9 | 1 file changed, 25 insertions(+), 28 deletions(-) | 18 | include/hw/misc/allwinner-a10-dramc.h | 68 ++++++++++ |
10 | 19 | hw/arm/allwinner-a10.c | 7 + | |
11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | 20 | hw/misc/allwinner-a10-dramc.c | 179 ++++++++++++++++++++++++++ |
12 | index XXXXXXX..XXXXXXX 100644 | 21 | hw/arm/Kconfig | 1 + |
13 | --- a/target/arm/translate-sve.c | 22 | hw/misc/Kconfig | 3 + |
14 | +++ b/target/arm/translate-sve.c | 23 | hw/misc/meson.build | 1 + |
15 | @@ -XXX,XX +XXX,XX @@ TRANS_FEAT(MLS, aa64_sve, do_zpzzz_ool, a, mls_fns[a->esz]) | 24 | 7 files changed, 261 insertions(+) |
16 | *** SVE Index Generation Group | 25 | create mode 100644 include/hw/misc/allwinner-a10-dramc.h |
17 | */ | 26 | create mode 100644 hw/misc/allwinner-a10-dramc.c |
18 | 27 | ||
19 | -static void do_index(DisasContext *s, int esz, int rd, | 28 | diff --git a/include/hw/arm/allwinner-a10.h b/include/hw/arm/allwinner-a10.h |
20 | +static bool do_index(DisasContext *s, int esz, int rd, | 29 | index XXXXXXX..XXXXXXX 100644 |
21 | TCGv_i64 start, TCGv_i64 incr) | 30 | --- a/include/hw/arm/allwinner-a10.h |
22 | { | 31 | +++ b/include/hw/arm/allwinner-a10.h |
23 | - unsigned vsz = vec_full_reg_size(s); | 32 | @@ -XXX,XX +XXX,XX @@ |
24 | - TCGv_i32 desc = tcg_constant_i32(simd_desc(vsz, vsz, 0)); | 33 | #include "hw/usb/hcd-ehci.h" |
25 | - TCGv_ptr t_zd = tcg_temp_new_ptr(); | 34 | #include "hw/rtc/allwinner-rtc.h" |
26 | + unsigned vsz; | 35 | #include "hw/misc/allwinner-a10-ccm.h" |
27 | + TCGv_i32 desc; | 36 | +#include "hw/misc/allwinner-a10-dramc.h" |
28 | + TCGv_ptr t_zd; | 37 | |
29 | + | 38 | #include "target/arm/cpu.h" |
30 | + if (!sve_access_check(s)) { | 39 | #include "qom/object.h" |
31 | + return true; | 40 | @@ -XXX,XX +XXX,XX @@ struct AwA10State { |
41 | |||
42 | ARMCPU cpu; | ||
43 | AwA10ClockCtlState ccm; | ||
44 | + AwA10DramControllerState dramc; | ||
45 | AwA10PITState timer; | ||
46 | AwA10PICState intc; | ||
47 | AwEmacState emac; | ||
48 | diff --git a/include/hw/misc/allwinner-a10-dramc.h b/include/hw/misc/allwinner-a10-dramc.h | ||
49 | new file mode 100644 | ||
50 | index XXXXXXX..XXXXXXX | ||
51 | --- /dev/null | ||
52 | +++ b/include/hw/misc/allwinner-a10-dramc.h | ||
53 | @@ -XXX,XX +XXX,XX @@ | ||
54 | +/* | ||
55 | + * Allwinner A10 DRAM Controller emulation | ||
56 | + * | ||
57 | + * Copyright (C) 2022 Strahinja Jankovic <strahinja.p.jankovic@gmail.com> | ||
58 | + * | ||
59 | + * This file is derived from Allwinner H3 DRAMC, | ||
60 | + * by Niek Linnenbank. | ||
61 | + * | ||
62 | + * This program is free software: you can redistribute it and/or modify | ||
63 | + * it under the terms of the GNU General Public License as published by | ||
64 | + * the Free Software Foundation, either version 2 of the License, or | ||
65 | + * (at your option) any later version. | ||
66 | + * | ||
67 | + * This program is distributed in the hope that it will be useful, | ||
68 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
69 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
70 | + * GNU General Public License for more details. | ||
71 | + * | ||
72 | + * You should have received a copy of the GNU General Public License | ||
73 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
74 | + */ | ||
75 | + | ||
76 | +#ifndef HW_MISC_ALLWINNER_A10_DRAMC_H | ||
77 | +#define HW_MISC_ALLWINNER_A10_DRAMC_H | ||
78 | + | ||
79 | +#include "qom/object.h" | ||
80 | +#include "hw/sysbus.h" | ||
81 | +#include "hw/register.h" | ||
82 | + | ||
83 | +/** | ||
84 | + * @name Constants | ||
85 | + * @{ | ||
86 | + */ | ||
87 | + | ||
88 | +/** Size of register I/O address space used by DRAMC device */ | ||
89 | +#define AW_A10_DRAMC_IOSIZE (0x1000) | ||
90 | + | ||
91 | +/** Total number of known registers */ | ||
92 | +#define AW_A10_DRAMC_REGS_NUM (AW_A10_DRAMC_IOSIZE / sizeof(uint32_t)) | ||
93 | + | ||
94 | +/** @} */ | ||
95 | + | ||
96 | +/** | ||
97 | + * @name Object model | ||
98 | + * @{ | ||
99 | + */ | ||
100 | + | ||
101 | +#define TYPE_AW_A10_DRAMC "allwinner-a10-dramc" | ||
102 | +OBJECT_DECLARE_SIMPLE_TYPE(AwA10DramControllerState, AW_A10_DRAMC) | ||
103 | + | ||
104 | +/** @} */ | ||
105 | + | ||
106 | +/** | ||
107 | + * Allwinner A10 DRAMC object instance state. | ||
108 | + */ | ||
109 | +struct AwA10DramControllerState { | ||
110 | + /*< private >*/ | ||
111 | + SysBusDevice parent_obj; | ||
112 | + /*< public >*/ | ||
113 | + | ||
114 | + /** Maps I/O registers in physical memory */ | ||
115 | + MemoryRegion iomem; | ||
116 | + | ||
117 | + /** Array of hardware registers */ | ||
118 | + uint32_t regs[AW_A10_DRAMC_REGS_NUM]; | ||
119 | +}; | ||
120 | + | ||
121 | +#endif /* HW_MISC_ALLWINNER_A10_DRAMC_H */ | ||
122 | diff --git a/hw/arm/allwinner-a10.c b/hw/arm/allwinner-a10.c | ||
123 | index XXXXXXX..XXXXXXX 100644 | ||
124 | --- a/hw/arm/allwinner-a10.c | ||
125 | +++ b/hw/arm/allwinner-a10.c | ||
126 | @@ -XXX,XX +XXX,XX @@ | ||
127 | #include "hw/boards.h" | ||
128 | #include "hw/usb/hcd-ohci.h" | ||
129 | |||
130 | +#define AW_A10_DRAMC_BASE 0x01c01000 | ||
131 | #define AW_A10_MMC0_BASE 0x01c0f000 | ||
132 | #define AW_A10_CCM_BASE 0x01c20000 | ||
133 | #define AW_A10_PIC_REG_BASE 0x01c20400 | ||
134 | @@ -XXX,XX +XXX,XX @@ static void aw_a10_init(Object *obj) | ||
135 | |||
136 | object_initialize_child(obj, "ccm", &s->ccm, TYPE_AW_A10_CCM); | ||
137 | |||
138 | + object_initialize_child(obj, "dramc", &s->dramc, TYPE_AW_A10_DRAMC); | ||
139 | + | ||
140 | object_initialize_child(obj, "emac", &s->emac, TYPE_AW_EMAC); | ||
141 | |||
142 | object_initialize_child(obj, "sata", &s->sata, TYPE_ALLWINNER_AHCI); | ||
143 | @@ -XXX,XX +XXX,XX @@ static void aw_a10_realize(DeviceState *dev, Error **errp) | ||
144 | sysbus_realize(SYS_BUS_DEVICE(&s->ccm), &error_fatal); | ||
145 | sysbus_mmio_map(SYS_BUS_DEVICE(&s->ccm), 0, AW_A10_CCM_BASE); | ||
146 | |||
147 | + /* DRAM Control Module */ | ||
148 | + sysbus_realize(SYS_BUS_DEVICE(&s->dramc), &error_fatal); | ||
149 | + sysbus_mmio_map(SYS_BUS_DEVICE(&s->dramc), 0, AW_A10_DRAMC_BASE); | ||
150 | + | ||
151 | /* FIXME use qdev NIC properties instead of nd_table[] */ | ||
152 | if (nd_table[0].used) { | ||
153 | qemu_check_nic_model(&nd_table[0], TYPE_AW_EMAC); | ||
154 | diff --git a/hw/misc/allwinner-a10-dramc.c b/hw/misc/allwinner-a10-dramc.c | ||
155 | new file mode 100644 | ||
156 | index XXXXXXX..XXXXXXX | ||
157 | --- /dev/null | ||
158 | +++ b/hw/misc/allwinner-a10-dramc.c | ||
159 | @@ -XXX,XX +XXX,XX @@ | ||
160 | +/* | ||
161 | + * Allwinner A10 DRAM Controller emulation | ||
162 | + * | ||
163 | + * Copyright (C) 2022 Strahinja Jankovic <strahinja.p.jankovic@gmail.com> | ||
164 | + * | ||
165 | + * This file is derived from Allwinner H3 DRAMC, | ||
166 | + * by Niek Linnenbank. | ||
167 | + * | ||
168 | + * This program is free software: you can redistribute it and/or modify | ||
169 | + * it under the terms of the GNU General Public License as published by | ||
170 | + * the Free Software Foundation, either version 2 of the License, or | ||
171 | + * (at your option) any later version. | ||
172 | + * | ||
173 | + * This program is distributed in the hope that it will be useful, | ||
174 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
175 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
176 | + * GNU General Public License for more details. | ||
177 | + * | ||
178 | + * You should have received a copy of the GNU General Public License | ||
179 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
180 | + */ | ||
181 | + | ||
182 | +#include "qemu/osdep.h" | ||
183 | +#include "qemu/units.h" | ||
184 | +#include "hw/sysbus.h" | ||
185 | +#include "migration/vmstate.h" | ||
186 | +#include "qemu/log.h" | ||
187 | +#include "qemu/module.h" | ||
188 | +#include "hw/misc/allwinner-a10-dramc.h" | ||
189 | + | ||
190 | +/* DRAMC register offsets */ | ||
191 | +enum { | ||
192 | + REG_SDR_CCR = 0x0000, | ||
193 | + REG_SDR_ZQCR0 = 0x00a8, | ||
194 | + REG_SDR_ZQSR = 0x00b0 | ||
195 | +}; | ||
196 | + | ||
197 | +#define REG_INDEX(offset) (offset / sizeof(uint32_t)) | ||
198 | + | ||
199 | +/* DRAMC register flags */ | ||
200 | +enum { | ||
201 | + REG_SDR_CCR_DATA_TRAINING = (1 << 30), | ||
202 | + REG_SDR_CCR_DRAM_INIT = (1 << 31), | ||
203 | +}; | ||
204 | +enum { | ||
205 | + REG_SDR_ZQSR_ZCAL = (1 << 31), | ||
206 | +}; | ||
207 | + | ||
208 | +/* DRAMC register reset values */ | ||
209 | +enum { | ||
210 | + REG_SDR_CCR_RESET = 0x80020000, | ||
211 | + REG_SDR_ZQCR0_RESET = 0x07b00000, | ||
212 | + REG_SDR_ZQSR_RESET = 0x80000000 | ||
213 | +}; | ||
214 | + | ||
215 | +static uint64_t allwinner_a10_dramc_read(void *opaque, hwaddr offset, | ||
216 | + unsigned size) | ||
217 | +{ | ||
218 | + const AwA10DramControllerState *s = AW_A10_DRAMC(opaque); | ||
219 | + const uint32_t idx = REG_INDEX(offset); | ||
220 | + | ||
221 | + switch (offset) { | ||
222 | + case REG_SDR_CCR: | ||
223 | + case REG_SDR_ZQCR0: | ||
224 | + case REG_SDR_ZQSR: | ||
225 | + break; | ||
226 | + case 0x2e4 ... AW_A10_DRAMC_IOSIZE: | ||
227 | + qemu_log_mask(LOG_GUEST_ERROR, "%s: out-of-bounds offset 0x%04x\n", | ||
228 | + __func__, (uint32_t)offset); | ||
229 | + return 0; | ||
230 | + default: | ||
231 | + qemu_log_mask(LOG_UNIMP, "%s: unimplemented read offset 0x%04x\n", | ||
232 | + __func__, (uint32_t)offset); | ||
233 | + return 0; | ||
32 | + } | 234 | + } |
33 | + | 235 | + |
34 | + vsz = vec_full_reg_size(s); | 236 | + return s->regs[idx]; |
35 | + desc = tcg_constant_i32(simd_desc(vsz, vsz, 0)); | 237 | +} |
36 | + t_zd = tcg_temp_new_ptr(); | 238 | + |
37 | 239 | +static void allwinner_a10_dramc_write(void *opaque, hwaddr offset, | |
38 | tcg_gen_addi_ptr(t_zd, cpu_env, vec_full_reg_offset(s, rd)); | 240 | + uint64_t val, unsigned size) |
39 | if (esz == 3) { | 241 | +{ |
40 | @@ -XXX,XX +XXX,XX @@ static void do_index(DisasContext *s, int esz, int rd, | 242 | + AwA10DramControllerState *s = AW_A10_DRAMC(opaque); |
41 | tcg_temp_free_i32(i32); | 243 | + const uint32_t idx = REG_INDEX(offset); |
42 | } | 244 | + |
43 | tcg_temp_free_ptr(t_zd); | 245 | + switch (offset) { |
44 | + return true; | 246 | + case REG_SDR_CCR: |
45 | } | 247 | + if (val & REG_SDR_CCR_DRAM_INIT) { |
46 | 248 | + /* Clear DRAM_INIT to indicate process is done. */ | |
47 | static bool trans_INDEX_ii(DisasContext *s, arg_INDEX_ii *a) | 249 | + val &= ~REG_SDR_CCR_DRAM_INIT; |
48 | { | 250 | + } |
49 | - if (sve_access_check(s)) { | 251 | + if (val & REG_SDR_CCR_DATA_TRAINING) { |
50 | - TCGv_i64 start = tcg_constant_i64(a->imm1); | 252 | + /* Clear DATA_TRAINING to indicate process is done. */ |
51 | - TCGv_i64 incr = tcg_constant_i64(a->imm2); | 253 | + val &= ~REG_SDR_CCR_DATA_TRAINING; |
52 | - do_index(s, a->esz, a->rd, start, incr); | 254 | + } |
53 | - } | 255 | + break; |
54 | - return true; | 256 | + case REG_SDR_ZQCR0: |
55 | + TCGv_i64 start = tcg_constant_i64(a->imm1); | 257 | + /* Set ZCAL in ZQSR to indicate calibration is done. */ |
56 | + TCGv_i64 incr = tcg_constant_i64(a->imm2); | 258 | + s->regs[REG_INDEX(REG_SDR_ZQSR)] |= REG_SDR_ZQSR_ZCAL; |
57 | + return do_index(s, a->esz, a->rd, start, incr); | 259 | + break; |
58 | } | 260 | + case 0x2e4 ... AW_A10_DRAMC_IOSIZE: |
59 | 261 | + qemu_log_mask(LOG_GUEST_ERROR, "%s: out-of-bounds offset 0x%04x\n", | |
60 | static bool trans_INDEX_ir(DisasContext *s, arg_INDEX_ir *a) | 262 | + __func__, (uint32_t)offset); |
61 | { | 263 | + break; |
62 | - if (sve_access_check(s)) { | 264 | + default: |
63 | - TCGv_i64 start = tcg_constant_i64(a->imm); | 265 | + qemu_log_mask(LOG_UNIMP, "%s: unimplemented write offset 0x%04x\n", |
64 | - TCGv_i64 incr = cpu_reg(s, a->rm); | 266 | + __func__, (uint32_t)offset); |
65 | - do_index(s, a->esz, a->rd, start, incr); | 267 | + break; |
66 | - } | 268 | + } |
67 | - return true; | 269 | + |
68 | + TCGv_i64 start = tcg_constant_i64(a->imm); | 270 | + s->regs[idx] = (uint32_t) val; |
69 | + TCGv_i64 incr = cpu_reg(s, a->rm); | 271 | +} |
70 | + return do_index(s, a->esz, a->rd, start, incr); | 272 | + |
71 | } | 273 | +static const MemoryRegionOps allwinner_a10_dramc_ops = { |
72 | 274 | + .read = allwinner_a10_dramc_read, | |
73 | static bool trans_INDEX_ri(DisasContext *s, arg_INDEX_ri *a) | 275 | + .write = allwinner_a10_dramc_write, |
74 | { | 276 | + .endianness = DEVICE_NATIVE_ENDIAN, |
75 | - if (sve_access_check(s)) { | 277 | + .valid = { |
76 | - TCGv_i64 start = cpu_reg(s, a->rn); | 278 | + .min_access_size = 4, |
77 | - TCGv_i64 incr = tcg_constant_i64(a->imm); | 279 | + .max_access_size = 4, |
78 | - do_index(s, a->esz, a->rd, start, incr); | 280 | + }, |
79 | - } | 281 | + .impl.min_access_size = 4, |
80 | - return true; | 282 | +}; |
81 | + TCGv_i64 start = cpu_reg(s, a->rn); | 283 | + |
82 | + TCGv_i64 incr = tcg_constant_i64(a->imm); | 284 | +static void allwinner_a10_dramc_reset_enter(Object *obj, ResetType type) |
83 | + return do_index(s, a->esz, a->rd, start, incr); | 285 | +{ |
84 | } | 286 | + AwA10DramControllerState *s = AW_A10_DRAMC(obj); |
85 | 287 | + | |
86 | static bool trans_INDEX_rr(DisasContext *s, arg_INDEX_rr *a) | 288 | + /* Set default values for registers */ |
87 | { | 289 | + s->regs[REG_INDEX(REG_SDR_CCR)] = REG_SDR_CCR_RESET; |
88 | - if (sve_access_check(s)) { | 290 | + s->regs[REG_INDEX(REG_SDR_ZQCR0)] = REG_SDR_ZQCR0_RESET; |
89 | - TCGv_i64 start = cpu_reg(s, a->rn); | 291 | + s->regs[REG_INDEX(REG_SDR_ZQSR)] = REG_SDR_ZQSR_RESET; |
90 | - TCGv_i64 incr = cpu_reg(s, a->rm); | 292 | +} |
91 | - do_index(s, a->esz, a->rd, start, incr); | 293 | + |
92 | - } | 294 | +static void allwinner_a10_dramc_init(Object *obj) |
93 | - return true; | 295 | +{ |
94 | + TCGv_i64 start = cpu_reg(s, a->rn); | 296 | + SysBusDevice *sbd = SYS_BUS_DEVICE(obj); |
95 | + TCGv_i64 incr = cpu_reg(s, a->rm); | 297 | + AwA10DramControllerState *s = AW_A10_DRAMC(obj); |
96 | + return do_index(s, a->esz, a->rd, start, incr); | 298 | + |
97 | } | 299 | + /* Memory mapping */ |
98 | 300 | + memory_region_init_io(&s->iomem, OBJECT(s), &allwinner_a10_dramc_ops, s, | |
99 | /* | 301 | + TYPE_AW_A10_DRAMC, AW_A10_DRAMC_IOSIZE); |
302 | + sysbus_init_mmio(sbd, &s->iomem); | ||
303 | +} | ||
304 | + | ||
305 | +static const VMStateDescription allwinner_a10_dramc_vmstate = { | ||
306 | + .name = "allwinner-a10-dramc", | ||
307 | + .version_id = 1, | ||
308 | + .minimum_version_id = 1, | ||
309 | + .fields = (VMStateField[]) { | ||
310 | + VMSTATE_UINT32_ARRAY(regs, AwA10DramControllerState, | ||
311 | + AW_A10_DRAMC_REGS_NUM), | ||
312 | + VMSTATE_END_OF_LIST() | ||
313 | + } | ||
314 | +}; | ||
315 | + | ||
316 | +static void allwinner_a10_dramc_class_init(ObjectClass *klass, void *data) | ||
317 | +{ | ||
318 | + DeviceClass *dc = DEVICE_CLASS(klass); | ||
319 | + ResettableClass *rc = RESETTABLE_CLASS(klass); | ||
320 | + | ||
321 | + rc->phases.enter = allwinner_a10_dramc_reset_enter; | ||
322 | + dc->vmsd = &allwinner_a10_dramc_vmstate; | ||
323 | +} | ||
324 | + | ||
325 | +static const TypeInfo allwinner_a10_dramc_info = { | ||
326 | + .name = TYPE_AW_A10_DRAMC, | ||
327 | + .parent = TYPE_SYS_BUS_DEVICE, | ||
328 | + .instance_init = allwinner_a10_dramc_init, | ||
329 | + .instance_size = sizeof(AwA10DramControllerState), | ||
330 | + .class_init = allwinner_a10_dramc_class_init, | ||
331 | +}; | ||
332 | + | ||
333 | +static void allwinner_a10_dramc_register(void) | ||
334 | +{ | ||
335 | + type_register_static(&allwinner_a10_dramc_info); | ||
336 | +} | ||
337 | + | ||
338 | +type_init(allwinner_a10_dramc_register) | ||
339 | diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig | ||
340 | index XXXXXXX..XXXXXXX 100644 | ||
341 | --- a/hw/arm/Kconfig | ||
342 | +++ b/hw/arm/Kconfig | ||
343 | @@ -XXX,XX +XXX,XX @@ config ALLWINNER_A10 | ||
344 | select ALLWINNER_A10_PIT | ||
345 | select ALLWINNER_A10_PIC | ||
346 | select ALLWINNER_A10_CCM | ||
347 | + select ALLWINNER_A10_DRAMC | ||
348 | select ALLWINNER_EMAC | ||
349 | select SERIAL | ||
350 | select UNIMP | ||
351 | diff --git a/hw/misc/Kconfig b/hw/misc/Kconfig | ||
352 | index XXXXXXX..XXXXXXX 100644 | ||
353 | --- a/hw/misc/Kconfig | ||
354 | +++ b/hw/misc/Kconfig | ||
355 | @@ -XXX,XX +XXX,XX @@ config LASI | ||
356 | config ALLWINNER_A10_CCM | ||
357 | bool | ||
358 | |||
359 | +config ALLWINNER_A10_DRAMC | ||
360 | + bool | ||
361 | + | ||
362 | source macio/Kconfig | ||
363 | diff --git a/hw/misc/meson.build b/hw/misc/meson.build | ||
364 | index XXXXXXX..XXXXXXX 100644 | ||
365 | --- a/hw/misc/meson.build | ||
366 | +++ b/hw/misc/meson.build | ||
367 | @@ -XXX,XX +XXX,XX @@ subdir('macio') | ||
368 | softmmu_ss.add(when: 'CONFIG_IVSHMEM_DEVICE', if_true: files('ivshmem.c')) | ||
369 | |||
370 | softmmu_ss.add(when: 'CONFIG_ALLWINNER_A10_CCM', if_true: files('allwinner-a10-ccm.c')) | ||
371 | +softmmu_ss.add(when: 'CONFIG_ALLWINNER_A10_DRAMC', if_true: files('allwinner-a10-dramc.c')) | ||
372 | softmmu_ss.add(when: 'CONFIG_ALLWINNER_H3', if_true: files('allwinner-h3-ccu.c')) | ||
373 | specific_ss.add(when: 'CONFIG_ALLWINNER_H3', if_true: files('allwinner-cpucfg.c')) | ||
374 | softmmu_ss.add(when: 'CONFIG_ALLWINNER_H3', if_true: files('allwinner-h3-dramc.c')) | ||
100 | -- | 375 | -- |
101 | 2.25.1 | 376 | 2.34.1 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Strahinja Jankovic <strahinjapjankovic@gmail.com> |
---|---|---|---|
2 | 2 | ||
3 | Simplify indexing of this array. This will allow folding | 3 | This patch implements Allwinner TWI/I2C controller emulation. Only |
4 | of the illegal esz == 0 into the normal fn == NULL check. | 4 | master-mode functionality is implemented. |
5 | 5 | ||
6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 6 | The SPL boot for Cubieboard expects AXP209 PMIC on TWI0/I2C0 bus, so this is |
7 | Message-id: 20220527181907.189259-93-richard.henderson@linaro.org | 7 | first part enabling the TWI/I2C bus operation. |
8 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 8 | |
9 | Since both Allwinner A10 and H3 use the same module, it is added for | ||
10 | both boards. | ||
11 | |||
12 | Docs are also updated for Cubieboard and Orangepi-PC board to indicate | ||
13 | I2C availability. | ||
14 | |||
15 | Signed-off-by: Strahinja Jankovic <strahinja.p.jankovic@gmail.com> | ||
16 | Reviewed-by: Niek Linnenbank <nieklinnenbank@gmail.com> | ||
17 | Message-id: 20221226220303.14420-4-strahinja.p.jankovic@gmail.com | ||
9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 18 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
10 | --- | 19 | --- |
11 | target/arm/translate-sve.c | 15 ++++++++------- | 20 | docs/system/arm/cubieboard.rst | 1 + |
12 | 1 file changed, 8 insertions(+), 7 deletions(-) | 21 | docs/system/arm/orangepi.rst | 1 + |
22 | include/hw/arm/allwinner-a10.h | 2 + | ||
23 | include/hw/arm/allwinner-h3.h | 3 + | ||
24 | include/hw/i2c/allwinner-i2c.h | 55 ++++ | ||
25 | hw/arm/allwinner-a10.c | 8 + | ||
26 | hw/arm/allwinner-h3.c | 11 +- | ||
27 | hw/i2c/allwinner-i2c.c | 459 +++++++++++++++++++++++++++++++++ | ||
28 | hw/arm/Kconfig | 2 + | ||
29 | hw/i2c/Kconfig | 4 + | ||
30 | hw/i2c/meson.build | 1 + | ||
31 | hw/i2c/trace-events | 5 + | ||
32 | 12 files changed, 551 insertions(+), 1 deletion(-) | ||
33 | create mode 100644 include/hw/i2c/allwinner-i2c.h | ||
34 | create mode 100644 hw/i2c/allwinner-i2c.c | ||
13 | 35 | ||
14 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | 36 | diff --git a/docs/system/arm/cubieboard.rst b/docs/system/arm/cubieboard.rst |
15 | index XXXXXXX..XXXXXXX 100644 | 37 | index XXXXXXX..XXXXXXX 100644 |
16 | --- a/target/arm/translate-sve.c | 38 | --- a/docs/system/arm/cubieboard.rst |
17 | +++ b/target/arm/translate-sve.c | 39 | +++ b/docs/system/arm/cubieboard.rst |
18 | @@ -XXX,XX +XXX,XX @@ static bool trans_FCVTZU_dd(DisasContext *s, arg_rpr_esz *a) | 40 | @@ -XXX,XX +XXX,XX @@ Emulated devices: |
19 | return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve_fcvtzu_dd); | 41 | - SDHCI |
42 | - USB controller | ||
43 | - SATA controller | ||
44 | +- TWI (I2C) controller | ||
45 | diff --git a/docs/system/arm/orangepi.rst b/docs/system/arm/orangepi.rst | ||
46 | index XXXXXXX..XXXXXXX 100644 | ||
47 | --- a/docs/system/arm/orangepi.rst | ||
48 | +++ b/docs/system/arm/orangepi.rst | ||
49 | @@ -XXX,XX +XXX,XX @@ The Orange Pi PC machine supports the following devices: | ||
50 | * Clock Control Unit | ||
51 | * System Control module | ||
52 | * Security Identifier device | ||
53 | + * TWI (I2C) | ||
54 | |||
55 | Limitations | ||
56 | """"""""""" | ||
57 | diff --git a/include/hw/arm/allwinner-a10.h b/include/hw/arm/allwinner-a10.h | ||
58 | index XXXXXXX..XXXXXXX 100644 | ||
59 | --- a/include/hw/arm/allwinner-a10.h | ||
60 | +++ b/include/hw/arm/allwinner-a10.h | ||
61 | @@ -XXX,XX +XXX,XX @@ | ||
62 | #include "hw/rtc/allwinner-rtc.h" | ||
63 | #include "hw/misc/allwinner-a10-ccm.h" | ||
64 | #include "hw/misc/allwinner-a10-dramc.h" | ||
65 | +#include "hw/i2c/allwinner-i2c.h" | ||
66 | |||
67 | #include "target/arm/cpu.h" | ||
68 | #include "qom/object.h" | ||
69 | @@ -XXX,XX +XXX,XX @@ struct AwA10State { | ||
70 | AwEmacState emac; | ||
71 | AllwinnerAHCIState sata; | ||
72 | AwSdHostState mmc0; | ||
73 | + AWI2CState i2c0; | ||
74 | AwRtcState rtc; | ||
75 | MemoryRegion sram_a; | ||
76 | EHCISysBusState ehci[AW_A10_NUM_USB]; | ||
77 | diff --git a/include/hw/arm/allwinner-h3.h b/include/hw/arm/allwinner-h3.h | ||
78 | index XXXXXXX..XXXXXXX 100644 | ||
79 | --- a/include/hw/arm/allwinner-h3.h | ||
80 | +++ b/include/hw/arm/allwinner-h3.h | ||
81 | @@ -XXX,XX +XXX,XX @@ | ||
82 | #include "hw/sd/allwinner-sdhost.h" | ||
83 | #include "hw/net/allwinner-sun8i-emac.h" | ||
84 | #include "hw/rtc/allwinner-rtc.h" | ||
85 | +#include "hw/i2c/allwinner-i2c.h" | ||
86 | #include "target/arm/cpu.h" | ||
87 | #include "sysemu/block-backend.h" | ||
88 | |||
89 | @@ -XXX,XX +XXX,XX @@ enum { | ||
90 | AW_H3_DEV_UART2, | ||
91 | AW_H3_DEV_UART3, | ||
92 | AW_H3_DEV_EMAC, | ||
93 | + AW_H3_DEV_TWI0, | ||
94 | AW_H3_DEV_DRAMCOM, | ||
95 | AW_H3_DEV_DRAMCTL, | ||
96 | AW_H3_DEV_DRAMPHY, | ||
97 | @@ -XXX,XX +XXX,XX @@ struct AwH3State { | ||
98 | AwH3SysCtrlState sysctrl; | ||
99 | AwSidState sid; | ||
100 | AwSdHostState mmc0; | ||
101 | + AWI2CState i2c0; | ||
102 | AwSun8iEmacState emac; | ||
103 | AwRtcState rtc; | ||
104 | GICState gic; | ||
105 | diff --git a/include/hw/i2c/allwinner-i2c.h b/include/hw/i2c/allwinner-i2c.h | ||
106 | new file mode 100644 | ||
107 | index XXXXXXX..XXXXXXX | ||
108 | --- /dev/null | ||
109 | +++ b/include/hw/i2c/allwinner-i2c.h | ||
110 | @@ -XXX,XX +XXX,XX @@ | ||
111 | +/* | ||
112 | + * Allwinner I2C Bus Serial Interface registers definition | ||
113 | + * | ||
114 | + * Copyright (C) 2022 Strahinja Jankovic. <strahinja.p.jankovic@gmail.com> | ||
115 | + * | ||
116 | + * This file is derived from IMX I2C controller, | ||
117 | + * by Jean-Christophe DUBOIS . | ||
118 | + * | ||
119 | + * This program is free software; you can redistribute it and/or modify it | ||
120 | + * under the terms of the GNU General Public License as published by the | ||
121 | + * Free Software Foundation; either version 2 of the License, or | ||
122 | + * (at your option) any later version. | ||
123 | + * | ||
124 | + * This program is distributed in the hope that it will be useful, but WITHOUT | ||
125 | + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
126 | + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
127 | + * for more details. | ||
128 | + * | ||
129 | + * You should have received a copy of the GNU General Public License along | ||
130 | + * with this program; if not, see <http://www.gnu.org/licenses/>. | ||
131 | + * | ||
132 | + */ | ||
133 | + | ||
134 | +#ifndef ALLWINNER_I2C_H | ||
135 | +#define ALLWINNER_I2C_H | ||
136 | + | ||
137 | +#include "hw/sysbus.h" | ||
138 | +#include "qom/object.h" | ||
139 | + | ||
140 | +#define TYPE_AW_I2C "allwinner.i2c" | ||
141 | +OBJECT_DECLARE_SIMPLE_TYPE(AWI2CState, AW_I2C) | ||
142 | + | ||
143 | +#define AW_I2C_MEM_SIZE 0x24 | ||
144 | + | ||
145 | +struct AWI2CState { | ||
146 | + /*< private >*/ | ||
147 | + SysBusDevice parent_obj; | ||
148 | + | ||
149 | + /*< public >*/ | ||
150 | + MemoryRegion iomem; | ||
151 | + I2CBus *bus; | ||
152 | + qemu_irq irq; | ||
153 | + | ||
154 | + uint8_t addr; | ||
155 | + uint8_t xaddr; | ||
156 | + uint8_t data; | ||
157 | + uint8_t cntr; | ||
158 | + uint8_t stat; | ||
159 | + uint8_t ccr; | ||
160 | + uint8_t srst; | ||
161 | + uint8_t efr; | ||
162 | + uint8_t lcr; | ||
163 | +}; | ||
164 | + | ||
165 | +#endif /* ALLWINNER_I2C_H */ | ||
166 | diff --git a/hw/arm/allwinner-a10.c b/hw/arm/allwinner-a10.c | ||
167 | index XXXXXXX..XXXXXXX 100644 | ||
168 | --- a/hw/arm/allwinner-a10.c | ||
169 | +++ b/hw/arm/allwinner-a10.c | ||
170 | @@ -XXX,XX +XXX,XX @@ | ||
171 | #define AW_A10_OHCI_BASE 0x01c14400 | ||
172 | #define AW_A10_SATA_BASE 0x01c18000 | ||
173 | #define AW_A10_RTC_BASE 0x01c20d00 | ||
174 | +#define AW_A10_I2C0_BASE 0x01c2ac00 | ||
175 | |||
176 | static void aw_a10_init(Object *obj) | ||
177 | { | ||
178 | @@ -XXX,XX +XXX,XX @@ static void aw_a10_init(Object *obj) | ||
179 | |||
180 | object_initialize_child(obj, "sata", &s->sata, TYPE_ALLWINNER_AHCI); | ||
181 | |||
182 | + object_initialize_child(obj, "i2c0", &s->i2c0, TYPE_AW_I2C); | ||
183 | + | ||
184 | if (machine_usb(current_machine)) { | ||
185 | int i; | ||
186 | |||
187 | @@ -XXX,XX +XXX,XX @@ static void aw_a10_realize(DeviceState *dev, Error **errp) | ||
188 | /* RTC */ | ||
189 | sysbus_realize(SYS_BUS_DEVICE(&s->rtc), &error_fatal); | ||
190 | sysbus_mmio_map_overlap(SYS_BUS_DEVICE(&s->rtc), 0, AW_A10_RTC_BASE, 10); | ||
191 | + | ||
192 | + /* I2C */ | ||
193 | + sysbus_realize(SYS_BUS_DEVICE(&s->i2c0), &error_fatal); | ||
194 | + sysbus_mmio_map(SYS_BUS_DEVICE(&s->i2c0), 0, AW_A10_I2C0_BASE); | ||
195 | + sysbus_connect_irq(SYS_BUS_DEVICE(&s->i2c0), 0, qdev_get_gpio_in(dev, 7)); | ||
20 | } | 196 | } |
21 | 197 | ||
22 | -static gen_helper_gvec_3_ptr * const frint_fns[3] = { | 198 | static void aw_a10_class_init(ObjectClass *oc, void *data) |
23 | +static gen_helper_gvec_3_ptr * const frint_fns[] = { | 199 | diff --git a/hw/arm/allwinner-h3.c b/hw/arm/allwinner-h3.c |
24 | + NULL, | 200 | index XXXXXXX..XXXXXXX 100644 |
25 | gen_helper_sve_frint_h, | 201 | --- a/hw/arm/allwinner-h3.c |
26 | gen_helper_sve_frint_s, | 202 | +++ b/hw/arm/allwinner-h3.c |
27 | gen_helper_sve_frint_d | 203 | @@ -XXX,XX +XXX,XX @@ const hwaddr allwinner_h3_memmap[] = { |
28 | @@ -XXX,XX +XXX,XX @@ static bool trans_FRINTI(DisasContext *s, arg_rpr_esz *a) | 204 | [AW_H3_DEV_UART1] = 0x01c28400, |
29 | return false; | 205 | [AW_H3_DEV_UART2] = 0x01c28800, |
30 | } | 206 | [AW_H3_DEV_UART3] = 0x01c28c00, |
31 | return do_zpz_ptr(s, a->rd, a->rn, a->pg, a->esz == MO_16, | 207 | + [AW_H3_DEV_TWI0] = 0x01c2ac00, |
32 | - frint_fns[a->esz - 1]); | 208 | [AW_H3_DEV_EMAC] = 0x01c30000, |
33 | + frint_fns[a->esz]); | 209 | [AW_H3_DEV_DRAMCOM] = 0x01c62000, |
210 | [AW_H3_DEV_DRAMCTL] = 0x01c63000, | ||
211 | @@ -XXX,XX +XXX,XX @@ struct AwH3Unimplemented { | ||
212 | { "uart1", 0x01c28400, 1 * KiB }, | ||
213 | { "uart2", 0x01c28800, 1 * KiB }, | ||
214 | { "uart3", 0x01c28c00, 1 * KiB }, | ||
215 | - { "twi0", 0x01c2ac00, 1 * KiB }, | ||
216 | { "twi1", 0x01c2b000, 1 * KiB }, | ||
217 | { "twi2", 0x01c2b400, 1 * KiB }, | ||
218 | { "scr", 0x01c2c400, 1 * KiB }, | ||
219 | @@ -XXX,XX +XXX,XX @@ enum { | ||
220 | AW_H3_GIC_SPI_UART1 = 1, | ||
221 | AW_H3_GIC_SPI_UART2 = 2, | ||
222 | AW_H3_GIC_SPI_UART3 = 3, | ||
223 | + AW_H3_GIC_SPI_TWI0 = 6, | ||
224 | AW_H3_GIC_SPI_TIMER0 = 18, | ||
225 | AW_H3_GIC_SPI_TIMER1 = 19, | ||
226 | AW_H3_GIC_SPI_MMC0 = 60, | ||
227 | @@ -XXX,XX +XXX,XX @@ static void allwinner_h3_init(Object *obj) | ||
228 | "ram-size"); | ||
229 | |||
230 | object_initialize_child(obj, "rtc", &s->rtc, TYPE_AW_RTC_SUN6I); | ||
231 | + | ||
232 | + object_initialize_child(obj, "twi0", &s->i2c0, TYPE_AW_I2C); | ||
34 | } | 233 | } |
35 | 234 | ||
36 | static bool trans_FRINTX(DisasContext *s, arg_rpr_esz *a) | 235 | static void allwinner_h3_realize(DeviceState *dev, Error **errp) |
37 | @@ -XXX,XX +XXX,XX @@ static bool trans_FRINTN(DisasContext *s, arg_rpr_esz *a) | 236 | @@ -XXX,XX +XXX,XX @@ static void allwinner_h3_realize(DeviceState *dev, Error **errp) |
38 | if (a->esz == 0) { | 237 | sysbus_realize(SYS_BUS_DEVICE(&s->rtc), &error_fatal); |
39 | return false; | 238 | sysbus_mmio_map(SYS_BUS_DEVICE(&s->rtc), 0, s->memmap[AW_H3_DEV_RTC]); |
40 | } | 239 | |
41 | - return do_frint_mode(s, a, float_round_nearest_even, frint_fns[a->esz - 1]); | 240 | + /* I2C */ |
42 | + return do_frint_mode(s, a, float_round_nearest_even, frint_fns[a->esz]); | 241 | + sysbus_realize(SYS_BUS_DEVICE(&s->i2c0), &error_fatal); |
43 | } | 242 | + sysbus_mmio_map(SYS_BUS_DEVICE(&s->i2c0), 0, s->memmap[AW_H3_DEV_TWI0]); |
44 | 243 | + sysbus_connect_irq(SYS_BUS_DEVICE(&s->i2c0), 0, | |
45 | static bool trans_FRINTP(DisasContext *s, arg_rpr_esz *a) | 244 | + qdev_get_gpio_in(DEVICE(&s->gic), AW_H3_GIC_SPI_TWI0)); |
46 | @@ -XXX,XX +XXX,XX @@ static bool trans_FRINTP(DisasContext *s, arg_rpr_esz *a) | 245 | + |
47 | if (a->esz == 0) { | 246 | /* Unimplemented devices */ |
48 | return false; | 247 | for (i = 0; i < ARRAY_SIZE(unimplemented); i++) { |
49 | } | 248 | create_unimplemented_device(unimplemented[i].device_name, |
50 | - return do_frint_mode(s, a, float_round_up, frint_fns[a->esz - 1]); | 249 | diff --git a/hw/i2c/allwinner-i2c.c b/hw/i2c/allwinner-i2c.c |
51 | + return do_frint_mode(s, a, float_round_up, frint_fns[a->esz]); | 250 | new file mode 100644 |
52 | } | 251 | index XXXXXXX..XXXXXXX |
53 | 252 | --- /dev/null | |
54 | static bool trans_FRINTM(DisasContext *s, arg_rpr_esz *a) | 253 | +++ b/hw/i2c/allwinner-i2c.c |
55 | @@ -XXX,XX +XXX,XX @@ static bool trans_FRINTM(DisasContext *s, arg_rpr_esz *a) | 254 | @@ -XXX,XX +XXX,XX @@ |
56 | if (a->esz == 0) { | 255 | +/* |
57 | return false; | 256 | + * Allwinner I2C Bus Serial Interface Emulation |
58 | } | 257 | + * |
59 | - return do_frint_mode(s, a, float_round_down, frint_fns[a->esz - 1]); | 258 | + * Copyright (C) 2022 Strahinja Jankovic <strahinja.p.jankovic@gmail.com> |
60 | + return do_frint_mode(s, a, float_round_down, frint_fns[a->esz]); | 259 | + * |
61 | } | 260 | + * This file is derived from IMX I2C controller, |
62 | 261 | + * by Jean-Christophe DUBOIS . | |
63 | static bool trans_FRINTZ(DisasContext *s, arg_rpr_esz *a) | 262 | + * |
64 | @@ -XXX,XX +XXX,XX @@ static bool trans_FRINTZ(DisasContext *s, arg_rpr_esz *a) | 263 | + * This program is free software; you can redistribute it and/or modify it |
65 | if (a->esz == 0) { | 264 | + * under the terms of the GNU General Public License as published by the |
66 | return false; | 265 | + * Free Software Foundation; either version 2 of the License, or |
67 | } | 266 | + * (at your option) any later version. |
68 | - return do_frint_mode(s, a, float_round_to_zero, frint_fns[a->esz - 1]); | 267 | + * |
69 | + return do_frint_mode(s, a, float_round_to_zero, frint_fns[a->esz]); | 268 | + * This program is distributed in the hope that it will be useful, but WITHOUT |
70 | } | 269 | + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
71 | 270 | + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
72 | static bool trans_FRINTA(DisasContext *s, arg_rpr_esz *a) | 271 | + * for more details. |
73 | @@ -XXX,XX +XXX,XX @@ static bool trans_FRINTA(DisasContext *s, arg_rpr_esz *a) | 272 | + * |
74 | if (a->esz == 0) { | 273 | + * You should have received a copy of the GNU General Public License along |
75 | return false; | 274 | + * with this program; if not, see <http://www.gnu.org/licenses/>. |
76 | } | 275 | + * |
77 | - return do_frint_mode(s, a, float_round_ties_away, frint_fns[a->esz - 1]); | 276 | + * SPDX-License-Identifier: MIT |
78 | + return do_frint_mode(s, a, float_round_ties_away, frint_fns[a->esz]); | 277 | + */ |
79 | } | 278 | + |
80 | 279 | +#include "qemu/osdep.h" | |
81 | static bool trans_FRECPX(DisasContext *s, arg_rpr_esz *a) | 280 | +#include "hw/i2c/allwinner-i2c.h" |
281 | +#include "hw/irq.h" | ||
282 | +#include "migration/vmstate.h" | ||
283 | +#include "hw/i2c/i2c.h" | ||
284 | +#include "qemu/log.h" | ||
285 | +#include "trace.h" | ||
286 | +#include "qemu/module.h" | ||
287 | + | ||
288 | +/* Allwinner I2C memory map */ | ||
289 | +#define TWI_ADDR_REG 0x00 /* slave address register */ | ||
290 | +#define TWI_XADDR_REG 0x04 /* extended slave address register */ | ||
291 | +#define TWI_DATA_REG 0x08 /* data register */ | ||
292 | +#define TWI_CNTR_REG 0x0c /* control register */ | ||
293 | +#define TWI_STAT_REG 0x10 /* status register */ | ||
294 | +#define TWI_CCR_REG 0x14 /* clock control register */ | ||
295 | +#define TWI_SRST_REG 0x18 /* software reset register */ | ||
296 | +#define TWI_EFR_REG 0x1c /* enhance feature register */ | ||
297 | +#define TWI_LCR_REG 0x20 /* line control register */ | ||
298 | + | ||
299 | +/* Used only in slave mode, do not set */ | ||
300 | +#define TWI_ADDR_RESET 0 | ||
301 | +#define TWI_XADDR_RESET 0 | ||
302 | + | ||
303 | +/* Data register */ | ||
304 | +#define TWI_DATA_MASK 0xFF | ||
305 | +#define TWI_DATA_RESET 0 | ||
306 | + | ||
307 | +/* Control register */ | ||
308 | +#define TWI_CNTR_INT_EN (1 << 7) | ||
309 | +#define TWI_CNTR_BUS_EN (1 << 6) | ||
310 | +#define TWI_CNTR_M_STA (1 << 5) | ||
311 | +#define TWI_CNTR_M_STP (1 << 4) | ||
312 | +#define TWI_CNTR_INT_FLAG (1 << 3) | ||
313 | +#define TWI_CNTR_A_ACK (1 << 2) | ||
314 | +#define TWI_CNTR_MASK 0xFC | ||
315 | +#define TWI_CNTR_RESET 0 | ||
316 | + | ||
317 | +/* Status register */ | ||
318 | +#define TWI_STAT_MASK 0xF8 | ||
319 | +#define TWI_STAT_RESET 0xF8 | ||
320 | + | ||
321 | +/* Clock register */ | ||
322 | +#define TWI_CCR_CLK_M_MASK 0x78 | ||
323 | +#define TWI_CCR_CLK_N_MASK 0x07 | ||
324 | +#define TWI_CCR_MASK 0x7F | ||
325 | +#define TWI_CCR_RESET 0 | ||
326 | + | ||
327 | +/* Soft reset */ | ||
328 | +#define TWI_SRST_MASK 0x01 | ||
329 | +#define TWI_SRST_RESET 0 | ||
330 | + | ||
331 | +/* Enhance feature */ | ||
332 | +#define TWI_EFR_MASK 0x03 | ||
333 | +#define TWI_EFR_RESET 0 | ||
334 | + | ||
335 | +/* Line control */ | ||
336 | +#define TWI_LCR_SCL_STATE (1 << 5) | ||
337 | +#define TWI_LCR_SDA_STATE (1 << 4) | ||
338 | +#define TWI_LCR_SCL_CTL (1 << 3) | ||
339 | +#define TWI_LCR_SCL_CTL_EN (1 << 2) | ||
340 | +#define TWI_LCR_SDA_CTL (1 << 1) | ||
341 | +#define TWI_LCR_SDA_CTL_EN (1 << 0) | ||
342 | +#define TWI_LCR_MASK 0x3F | ||
343 | +#define TWI_LCR_RESET 0x3A | ||
344 | + | ||
345 | +/* Status value in STAT register is shifted by 3 bits */ | ||
346 | +#define TWI_STAT_SHIFT 3 | ||
347 | +#define STAT_FROM_STA(x) ((x) << TWI_STAT_SHIFT) | ||
348 | +#define STAT_TO_STA(x) ((x) >> TWI_STAT_SHIFT) | ||
349 | + | ||
350 | +enum { | ||
351 | + STAT_BUS_ERROR = 0, | ||
352 | + /* Master mode */ | ||
353 | + STAT_M_STA_TX, | ||
354 | + STAT_M_RSTA_TX, | ||
355 | + STAT_M_ADDR_WR_ACK, | ||
356 | + STAT_M_ADDR_WR_NACK, | ||
357 | + STAT_M_DATA_TX_ACK, | ||
358 | + STAT_M_DATA_TX_NACK, | ||
359 | + STAT_M_ARB_LOST, | ||
360 | + STAT_M_ADDR_RD_ACK, | ||
361 | + STAT_M_ADDR_RD_NACK, | ||
362 | + STAT_M_DATA_RX_ACK, | ||
363 | + STAT_M_DATA_RX_NACK, | ||
364 | + /* Slave mode */ | ||
365 | + STAT_S_ADDR_WR_ACK, | ||
366 | + STAT_S_ARB_LOST_AW_ACK, | ||
367 | + STAT_S_GCA_ACK, | ||
368 | + STAT_S_ARB_LOST_GCA_ACK, | ||
369 | + STAT_S_DATA_RX_SA_ACK, | ||
370 | + STAT_S_DATA_RX_SA_NACK, | ||
371 | + STAT_S_DATA_RX_GCA_ACK, | ||
372 | + STAT_S_DATA_RX_GCA_NACK, | ||
373 | + STAT_S_STP_RSTA, | ||
374 | + STAT_S_ADDR_RD_ACK, | ||
375 | + STAT_S_ARB_LOST_AR_ACK, | ||
376 | + STAT_S_DATA_TX_ACK, | ||
377 | + STAT_S_DATA_TX_NACK, | ||
378 | + STAT_S_LB_TX_ACK, | ||
379 | + /* Master mode, 10-bit */ | ||
380 | + STAT_M_2ND_ADDR_WR_ACK, | ||
381 | + STAT_M_2ND_ADDR_WR_NACK, | ||
382 | + /* Idle */ | ||
383 | + STAT_IDLE = 0x1f | ||
384 | +} TWI_STAT_STA; | ||
385 | + | ||
386 | +static const char *allwinner_i2c_get_regname(unsigned offset) | ||
387 | +{ | ||
388 | + switch (offset) { | ||
389 | + case TWI_ADDR_REG: | ||
390 | + return "ADDR"; | ||
391 | + case TWI_XADDR_REG: | ||
392 | + return "XADDR"; | ||
393 | + case TWI_DATA_REG: | ||
394 | + return "DATA"; | ||
395 | + case TWI_CNTR_REG: | ||
396 | + return "CNTR"; | ||
397 | + case TWI_STAT_REG: | ||
398 | + return "STAT"; | ||
399 | + case TWI_CCR_REG: | ||
400 | + return "CCR"; | ||
401 | + case TWI_SRST_REG: | ||
402 | + return "SRST"; | ||
403 | + case TWI_EFR_REG: | ||
404 | + return "EFR"; | ||
405 | + case TWI_LCR_REG: | ||
406 | + return "LCR"; | ||
407 | + default: | ||
408 | + return "[?]"; | ||
409 | + } | ||
410 | +} | ||
411 | + | ||
412 | +static inline bool allwinner_i2c_is_reset(AWI2CState *s) | ||
413 | +{ | ||
414 | + return s->srst & TWI_SRST_MASK; | ||
415 | +} | ||
416 | + | ||
417 | +static inline bool allwinner_i2c_bus_is_enabled(AWI2CState *s) | ||
418 | +{ | ||
419 | + return s->cntr & TWI_CNTR_BUS_EN; | ||
420 | +} | ||
421 | + | ||
422 | +static inline bool allwinner_i2c_interrupt_is_enabled(AWI2CState *s) | ||
423 | +{ | ||
424 | + return s->cntr & TWI_CNTR_INT_EN; | ||
425 | +} | ||
426 | + | ||
427 | +static void allwinner_i2c_reset_hold(Object *obj) | ||
428 | +{ | ||
429 | + AWI2CState *s = AW_I2C(obj); | ||
430 | + | ||
431 | + if (STAT_TO_STA(s->stat) != STAT_IDLE) { | ||
432 | + i2c_end_transfer(s->bus); | ||
433 | + } | ||
434 | + | ||
435 | + s->addr = TWI_ADDR_RESET; | ||
436 | + s->xaddr = TWI_XADDR_RESET; | ||
437 | + s->data = TWI_DATA_RESET; | ||
438 | + s->cntr = TWI_CNTR_RESET; | ||
439 | + s->stat = TWI_STAT_RESET; | ||
440 | + s->ccr = TWI_CCR_RESET; | ||
441 | + s->srst = TWI_SRST_RESET; | ||
442 | + s->efr = TWI_EFR_RESET; | ||
443 | + s->lcr = TWI_LCR_RESET; | ||
444 | +} | ||
445 | + | ||
446 | +static inline void allwinner_i2c_raise_interrupt(AWI2CState *s) | ||
447 | +{ | ||
448 | + /* | ||
449 | + * Raise an interrupt if the device is not reset and it is configured | ||
450 | + * to generate some interrupts. | ||
451 | + */ | ||
452 | + if (!allwinner_i2c_is_reset(s) && allwinner_i2c_bus_is_enabled(s)) { | ||
453 | + if (STAT_TO_STA(s->stat) != STAT_IDLE) { | ||
454 | + s->cntr |= TWI_CNTR_INT_FLAG; | ||
455 | + if (allwinner_i2c_interrupt_is_enabled(s)) { | ||
456 | + qemu_irq_raise(s->irq); | ||
457 | + } | ||
458 | + } | ||
459 | + } | ||
460 | +} | ||
461 | + | ||
462 | +static uint64_t allwinner_i2c_read(void *opaque, hwaddr offset, | ||
463 | + unsigned size) | ||
464 | +{ | ||
465 | + uint16_t value; | ||
466 | + AWI2CState *s = AW_I2C(opaque); | ||
467 | + | ||
468 | + switch (offset) { | ||
469 | + case TWI_ADDR_REG: | ||
470 | + value = s->addr; | ||
471 | + break; | ||
472 | + case TWI_XADDR_REG: | ||
473 | + value = s->xaddr; | ||
474 | + break; | ||
475 | + case TWI_DATA_REG: | ||
476 | + if ((STAT_TO_STA(s->stat) == STAT_M_ADDR_RD_ACK) || | ||
477 | + (STAT_TO_STA(s->stat) == STAT_M_DATA_RX_ACK) || | ||
478 | + (STAT_TO_STA(s->stat) == STAT_M_DATA_RX_NACK)) { | ||
479 | + /* Get the next byte */ | ||
480 | + s->data = i2c_recv(s->bus); | ||
481 | + | ||
482 | + if (s->cntr & TWI_CNTR_A_ACK) { | ||
483 | + s->stat = STAT_FROM_STA(STAT_M_DATA_RX_ACK); | ||
484 | + } else { | ||
485 | + s->stat = STAT_FROM_STA(STAT_M_DATA_RX_NACK); | ||
486 | + } | ||
487 | + allwinner_i2c_raise_interrupt(s); | ||
488 | + } | ||
489 | + value = s->data; | ||
490 | + break; | ||
491 | + case TWI_CNTR_REG: | ||
492 | + value = s->cntr; | ||
493 | + break; | ||
494 | + case TWI_STAT_REG: | ||
495 | + value = s->stat; | ||
496 | + /* | ||
497 | + * If polling when reading then change state to indicate data | ||
498 | + * is available | ||
499 | + */ | ||
500 | + if (STAT_TO_STA(s->stat) == STAT_M_ADDR_RD_ACK) { | ||
501 | + if (s->cntr & TWI_CNTR_A_ACK) { | ||
502 | + s->stat = STAT_FROM_STA(STAT_M_DATA_RX_ACK); | ||
503 | + } else { | ||
504 | + s->stat = STAT_FROM_STA(STAT_M_DATA_RX_NACK); | ||
505 | + } | ||
506 | + allwinner_i2c_raise_interrupt(s); | ||
507 | + } | ||
508 | + break; | ||
509 | + case TWI_CCR_REG: | ||
510 | + value = s->ccr; | ||
511 | + break; | ||
512 | + case TWI_SRST_REG: | ||
513 | + value = s->srst; | ||
514 | + break; | ||
515 | + case TWI_EFR_REG: | ||
516 | + value = s->efr; | ||
517 | + break; | ||
518 | + case TWI_LCR_REG: | ||
519 | + value = s->lcr; | ||
520 | + break; | ||
521 | + default: | ||
522 | + qemu_log_mask(LOG_GUEST_ERROR, "[%s]%s: Bad address at offset 0x%" | ||
523 | + HWADDR_PRIx "\n", TYPE_AW_I2C, __func__, offset); | ||
524 | + value = 0; | ||
525 | + break; | ||
526 | + } | ||
527 | + | ||
528 | + trace_allwinner_i2c_read(allwinner_i2c_get_regname(offset), offset, value); | ||
529 | + | ||
530 | + return (uint64_t)value; | ||
531 | +} | ||
532 | + | ||
533 | +static void allwinner_i2c_write(void *opaque, hwaddr offset, | ||
534 | + uint64_t value, unsigned size) | ||
535 | +{ | ||
536 | + AWI2CState *s = AW_I2C(opaque); | ||
537 | + | ||
538 | + value &= 0xff; | ||
539 | + | ||
540 | + trace_allwinner_i2c_write(allwinner_i2c_get_regname(offset), offset, value); | ||
541 | + | ||
542 | + switch (offset) { | ||
543 | + case TWI_ADDR_REG: | ||
544 | + s->addr = (uint8_t)value; | ||
545 | + break; | ||
546 | + case TWI_XADDR_REG: | ||
547 | + s->xaddr = (uint8_t)value; | ||
548 | + break; | ||
549 | + case TWI_DATA_REG: | ||
550 | + /* If the device is in reset or not enabled, nothing to do */ | ||
551 | + if (allwinner_i2c_is_reset(s) || (!allwinner_i2c_bus_is_enabled(s))) { | ||
552 | + break; | ||
553 | + } | ||
554 | + | ||
555 | + s->data = value & TWI_DATA_MASK; | ||
556 | + | ||
557 | + switch (STAT_TO_STA(s->stat)) { | ||
558 | + case STAT_M_STA_TX: | ||
559 | + case STAT_M_RSTA_TX: | ||
560 | + /* Send address */ | ||
561 | + if (i2c_start_transfer(s->bus, extract32(s->data, 1, 7), | ||
562 | + extract32(s->data, 0, 1))) { | ||
563 | + /* If non zero is returned, the address is not valid */ | ||
564 | + s->stat = STAT_FROM_STA(STAT_M_ADDR_WR_NACK); | ||
565 | + } else { | ||
566 | + /* Determine if read of write */ | ||
567 | + if (extract32(s->data, 0, 1)) { | ||
568 | + s->stat = STAT_FROM_STA(STAT_M_ADDR_RD_ACK); | ||
569 | + } else { | ||
570 | + s->stat = STAT_FROM_STA(STAT_M_ADDR_WR_ACK); | ||
571 | + } | ||
572 | + allwinner_i2c_raise_interrupt(s); | ||
573 | + } | ||
574 | + break; | ||
575 | + case STAT_M_ADDR_WR_ACK: | ||
576 | + case STAT_M_DATA_TX_ACK: | ||
577 | + if (i2c_send(s->bus, s->data)) { | ||
578 | + /* If the target return non zero then end the transfer */ | ||
579 | + s->stat = STAT_FROM_STA(STAT_M_DATA_TX_NACK); | ||
580 | + i2c_end_transfer(s->bus); | ||
581 | + } else { | ||
582 | + s->stat = STAT_FROM_STA(STAT_M_DATA_TX_ACK); | ||
583 | + allwinner_i2c_raise_interrupt(s); | ||
584 | + } | ||
585 | + break; | ||
586 | + default: | ||
587 | + break; | ||
588 | + } | ||
589 | + break; | ||
590 | + case TWI_CNTR_REG: | ||
591 | + if (!allwinner_i2c_is_reset(s)) { | ||
592 | + /* Do something only if not in software reset */ | ||
593 | + s->cntr = value & TWI_CNTR_MASK; | ||
594 | + | ||
595 | + /* Check if start condition should be sent */ | ||
596 | + if (s->cntr & TWI_CNTR_M_STA) { | ||
597 | + /* Update status */ | ||
598 | + if (STAT_TO_STA(s->stat) == STAT_IDLE) { | ||
599 | + /* Send start condition */ | ||
600 | + s->stat = STAT_FROM_STA(STAT_M_STA_TX); | ||
601 | + } else { | ||
602 | + /* Send repeated start condition */ | ||
603 | + s->stat = STAT_FROM_STA(STAT_M_RSTA_TX); | ||
604 | + } | ||
605 | + /* Clear start condition */ | ||
606 | + s->cntr &= ~TWI_CNTR_M_STA; | ||
607 | + } | ||
608 | + if (s->cntr & TWI_CNTR_M_STP) { | ||
609 | + /* Update status */ | ||
610 | + i2c_end_transfer(s->bus); | ||
611 | + s->stat = STAT_FROM_STA(STAT_IDLE); | ||
612 | + s->cntr &= ~TWI_CNTR_M_STP; | ||
613 | + } | ||
614 | + if ((s->cntr & TWI_CNTR_INT_FLAG) == 0) { | ||
615 | + /* Interrupt flag cleared */ | ||
616 | + qemu_irq_lower(s->irq); | ||
617 | + } | ||
618 | + if ((s->cntr & TWI_CNTR_A_ACK) == 0) { | ||
619 | + if (STAT_TO_STA(s->stat) == STAT_M_DATA_RX_ACK) { | ||
620 | + s->stat = STAT_FROM_STA(STAT_M_DATA_RX_NACK); | ||
621 | + } | ||
622 | + } else { | ||
623 | + if (STAT_TO_STA(s->stat) == STAT_M_DATA_RX_NACK) { | ||
624 | + s->stat = STAT_FROM_STA(STAT_M_DATA_RX_ACK); | ||
625 | + } | ||
626 | + } | ||
627 | + allwinner_i2c_raise_interrupt(s); | ||
628 | + | ||
629 | + } | ||
630 | + break; | ||
631 | + case TWI_CCR_REG: | ||
632 | + s->ccr = value & TWI_CCR_MASK; | ||
633 | + break; | ||
634 | + case TWI_SRST_REG: | ||
635 | + if (((value & TWI_SRST_MASK) == 0) && (s->srst & TWI_SRST_MASK)) { | ||
636 | + /* Perform reset */ | ||
637 | + allwinner_i2c_reset_hold(OBJECT(s)); | ||
638 | + } | ||
639 | + s->srst = value & TWI_SRST_MASK; | ||
640 | + break; | ||
641 | + case TWI_EFR_REG: | ||
642 | + s->efr = value & TWI_EFR_MASK; | ||
643 | + break; | ||
644 | + case TWI_LCR_REG: | ||
645 | + s->lcr = value & TWI_LCR_MASK; | ||
646 | + break; | ||
647 | + default: | ||
648 | + qemu_log_mask(LOG_GUEST_ERROR, "[%s]%s: Bad address at offset 0x%" | ||
649 | + HWADDR_PRIx "\n", TYPE_AW_I2C, __func__, offset); | ||
650 | + break; | ||
651 | + } | ||
652 | +} | ||
653 | + | ||
654 | +static const MemoryRegionOps allwinner_i2c_ops = { | ||
655 | + .read = allwinner_i2c_read, | ||
656 | + .write = allwinner_i2c_write, | ||
657 | + .valid.min_access_size = 1, | ||
658 | + .valid.max_access_size = 4, | ||
659 | + .endianness = DEVICE_NATIVE_ENDIAN, | ||
660 | +}; | ||
661 | + | ||
662 | +static const VMStateDescription allwinner_i2c_vmstate = { | ||
663 | + .name = TYPE_AW_I2C, | ||
664 | + .version_id = 1, | ||
665 | + .minimum_version_id = 1, | ||
666 | + .fields = (VMStateField[]) { | ||
667 | + VMSTATE_UINT8(addr, AWI2CState), | ||
668 | + VMSTATE_UINT8(xaddr, AWI2CState), | ||
669 | + VMSTATE_UINT8(data, AWI2CState), | ||
670 | + VMSTATE_UINT8(cntr, AWI2CState), | ||
671 | + VMSTATE_UINT8(ccr, AWI2CState), | ||
672 | + VMSTATE_UINT8(srst, AWI2CState), | ||
673 | + VMSTATE_UINT8(efr, AWI2CState), | ||
674 | + VMSTATE_UINT8(lcr, AWI2CState), | ||
675 | + VMSTATE_END_OF_LIST() | ||
676 | + } | ||
677 | +}; | ||
678 | + | ||
679 | +static void allwinner_i2c_realize(DeviceState *dev, Error **errp) | ||
680 | +{ | ||
681 | + AWI2CState *s = AW_I2C(dev); | ||
682 | + | ||
683 | + memory_region_init_io(&s->iomem, OBJECT(s), &allwinner_i2c_ops, s, | ||
684 | + TYPE_AW_I2C, AW_I2C_MEM_SIZE); | ||
685 | + sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->iomem); | ||
686 | + sysbus_init_irq(SYS_BUS_DEVICE(dev), &s->irq); | ||
687 | + s->bus = i2c_init_bus(dev, "i2c"); | ||
688 | +} | ||
689 | + | ||
690 | +static void allwinner_i2c_class_init(ObjectClass *klass, void *data) | ||
691 | +{ | ||
692 | + DeviceClass *dc = DEVICE_CLASS(klass); | ||
693 | + ResettableClass *rc = RESETTABLE_CLASS(klass); | ||
694 | + | ||
695 | + rc->phases.hold = allwinner_i2c_reset_hold; | ||
696 | + dc->vmsd = &allwinner_i2c_vmstate; | ||
697 | + dc->realize = allwinner_i2c_realize; | ||
698 | + dc->desc = "Allwinner I2C Controller"; | ||
699 | +} | ||
700 | + | ||
701 | +static const TypeInfo allwinner_i2c_type_info = { | ||
702 | + .name = TYPE_AW_I2C, | ||
703 | + .parent = TYPE_SYS_BUS_DEVICE, | ||
704 | + .instance_size = sizeof(AWI2CState), | ||
705 | + .class_init = allwinner_i2c_class_init, | ||
706 | +}; | ||
707 | + | ||
708 | +static void allwinner_i2c_register_types(void) | ||
709 | +{ | ||
710 | + type_register_static(&allwinner_i2c_type_info); | ||
711 | +} | ||
712 | + | ||
713 | +type_init(allwinner_i2c_register_types) | ||
714 | diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig | ||
715 | index XXXXXXX..XXXXXXX 100644 | ||
716 | --- a/hw/arm/Kconfig | ||
717 | +++ b/hw/arm/Kconfig | ||
718 | @@ -XXX,XX +XXX,XX @@ config ALLWINNER_A10 | ||
719 | select ALLWINNER_A10_CCM | ||
720 | select ALLWINNER_A10_DRAMC | ||
721 | select ALLWINNER_EMAC | ||
722 | + select ALLWINNER_I2C | ||
723 | select SERIAL | ||
724 | select UNIMP | ||
725 | |||
726 | @@ -XXX,XX +XXX,XX @@ config ALLWINNER_H3 | ||
727 | bool | ||
728 | select ALLWINNER_A10_PIT | ||
729 | select ALLWINNER_SUN8I_EMAC | ||
730 | + select ALLWINNER_I2C | ||
731 | select SERIAL | ||
732 | select ARM_TIMER | ||
733 | select ARM_GIC | ||
734 | diff --git a/hw/i2c/Kconfig b/hw/i2c/Kconfig | ||
735 | index XXXXXXX..XXXXXXX 100644 | ||
736 | --- a/hw/i2c/Kconfig | ||
737 | +++ b/hw/i2c/Kconfig | ||
738 | @@ -XXX,XX +XXX,XX @@ config MPC_I2C | ||
739 | bool | ||
740 | select I2C | ||
741 | |||
742 | +config ALLWINNER_I2C | ||
743 | + bool | ||
744 | + select I2C | ||
745 | + | ||
746 | config PCA954X | ||
747 | bool | ||
748 | select I2C | ||
749 | diff --git a/hw/i2c/meson.build b/hw/i2c/meson.build | ||
750 | index XXXXXXX..XXXXXXX 100644 | ||
751 | --- a/hw/i2c/meson.build | ||
752 | +++ b/hw/i2c/meson.build | ||
753 | @@ -XXX,XX +XXX,XX @@ i2c_ss.add(when: 'CONFIG_BITBANG_I2C', if_true: files('bitbang_i2c.c')) | ||
754 | i2c_ss.add(when: 'CONFIG_EXYNOS4', if_true: files('exynos4210_i2c.c')) | ||
755 | i2c_ss.add(when: 'CONFIG_IMX_I2C', if_true: files('imx_i2c.c')) | ||
756 | i2c_ss.add(when: 'CONFIG_MPC_I2C', if_true: files('mpc_i2c.c')) | ||
757 | +i2c_ss.add(when: 'CONFIG_ALLWINNER_I2C', if_true: files('allwinner-i2c.c')) | ||
758 | i2c_ss.add(when: 'CONFIG_NRF51_SOC', if_true: files('microbit_i2c.c')) | ||
759 | i2c_ss.add(when: 'CONFIG_NPCM7XX', if_true: files('npcm7xx_smbus.c')) | ||
760 | i2c_ss.add(when: 'CONFIG_SMBUS_EEPROM', if_true: files('smbus_eeprom.c')) | ||
761 | diff --git a/hw/i2c/trace-events b/hw/i2c/trace-events | ||
762 | index XXXXXXX..XXXXXXX 100644 | ||
763 | --- a/hw/i2c/trace-events | ||
764 | +++ b/hw/i2c/trace-events | ||
765 | @@ -XXX,XX +XXX,XX @@ i2c_send_async(uint8_t address, uint8_t data) "send_async(addr:0x%02x) data:0x%0 | ||
766 | i2c_recv(uint8_t address, uint8_t data) "recv(addr:0x%02x) data:0x%02x" | ||
767 | i2c_ack(void) "" | ||
768 | |||
769 | +# allwinner_i2c.c | ||
770 | + | ||
771 | +allwinner_i2c_read(const char* reg_name, uint64_t offset, uint64_t value) "read %s [0x%" PRIx64 "]: -> 0x%" PRIx64 | ||
772 | +allwinner_i2c_write(const char* reg_name, uint64_t offset, uint64_t value) "write %s [0x%" PRIx64 "]: <- 0x%" PRIx64 | ||
773 | + | ||
774 | # aspeed_i2c.c | ||
775 | |||
776 | aspeed_i2c_bus_cmd(uint32_t cmd, const char *cmd_flags, uint32_t count, uint32_t intr_status) "handling cmd=0x%x %s count=%d intr=0x%x" | ||
82 | -- | 777 | -- |
83 | 2.25.1 | 778 | 2.34.1 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Strahinja Jankovic <strahinjapjankovic@gmail.com> |
---|---|---|---|
2 | 2 | ||
3 | Share code between the various shifts using arg_rpri_esz. | 3 | This patch adds minimal support for AXP-209 PMU. |
4 | Most important is chip ID since U-Boot SPL expects version 0x1. Besides | ||
5 | the chip ID register, reset values for two more registers used by A10 | ||
6 | U-Boot SPL are covered. | ||
4 | 7 | ||
5 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 8 | Signed-off-by: Strahinja Jankovic <strahinja.p.jankovic@gmail.com> |
6 | Message-id: 20220527181907.189259-46-richard.henderson@linaro.org | 9 | Message-id: 20221226220303.14420-5-strahinja.p.jankovic@gmail.com |
7 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 10 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> |
8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 11 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
9 | --- | 12 | --- |
10 | target/arm/translate-sve.c | 68 +++++++++++++++++--------------------- | 13 | hw/misc/axp209.c | 238 +++++++++++++++++++++++++++++++++++++++++++ |
11 | 1 file changed, 30 insertions(+), 38 deletions(-) | 14 | MAINTAINERS | 2 + |
15 | hw/misc/Kconfig | 4 + | ||
16 | hw/misc/meson.build | 1 + | ||
17 | hw/misc/trace-events | 5 + | ||
18 | 5 files changed, 250 insertions(+) | ||
19 | create mode 100644 hw/misc/axp209.c | ||
12 | 20 | ||
13 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | 21 | diff --git a/hw/misc/axp209.c b/hw/misc/axp209.c |
14 | index XXXXXXX..XXXXXXX 100644 | 22 | new file mode 100644 |
15 | --- a/target/arm/translate-sve.c | 23 | index XXXXXXX..XXXXXXX |
16 | +++ b/target/arm/translate-sve.c | 24 | --- /dev/null |
17 | @@ -XXX,XX +XXX,XX @@ static bool do_movz_zpz(DisasContext *s, int rd, int rn, int pg, | 25 | +++ b/hw/misc/axp209.c |
18 | return gen_gvec_ool_zzp(s, fns[esz], rd, rn, pg, invert); | 26 | @@ -XXX,XX +XXX,XX @@ |
19 | } | 27 | +/* |
20 | 28 | + * AXP-209 PMU Emulation | |
21 | +static bool do_shift_zpzi(DisasContext *s, arg_rpri_esz *a, bool asr, | 29 | + * |
22 | + gen_helper_gvec_3 * const fns[4]) | 30 | + * Copyright (C) 2022 Strahinja Jankovic <strahinja.p.jankovic@gmail.com> |
23 | +{ | 31 | + * |
24 | + int max; | 32 | + * Permission is hereby granted, free of charge, to any person obtaining a |
25 | + | 33 | + * copy of this software and associated documentation files (the "Software"), |
26 | + if (a->esz < 0) { | 34 | + * to deal in the Software without restriction, including without limitation |
27 | + /* Invalid tsz encoding -- see tszimm_esz. */ | 35 | + * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
28 | + return false; | 36 | + * and/or sell copies of the Software, and to permit persons to whom the |
37 | + * Software is furnished to do so, subject to the following conditions: | ||
38 | + * | ||
39 | + * The above copyright notice and this permission notice shall be included in | ||
40 | + * all copies or substantial portions of the Software. | ||
41 | + * | ||
42 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
43 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
44 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
45 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
46 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
47 | + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
48 | + * DEALINGS IN THE SOFTWARE. | ||
49 | + * | ||
50 | + * SPDX-License-Identifier: MIT | ||
51 | + */ | ||
52 | + | ||
53 | +#include "qemu/osdep.h" | ||
54 | +#include "qemu/log.h" | ||
55 | +#include "trace.h" | ||
56 | +#include "hw/i2c/i2c.h" | ||
57 | +#include "migration/vmstate.h" | ||
58 | + | ||
59 | +#define TYPE_AXP209_PMU "axp209_pmu" | ||
60 | + | ||
61 | +#define AXP209(obj) \ | ||
62 | + OBJECT_CHECK(AXP209I2CState, (obj), TYPE_AXP209_PMU) | ||
63 | + | ||
64 | +/* registers */ | ||
65 | +enum { | ||
66 | + REG_POWER_STATUS = 0x0u, | ||
67 | + REG_OPERATING_MODE, | ||
68 | + REG_OTG_VBUS_STATUS, | ||
69 | + REG_CHIP_VERSION, | ||
70 | + REG_DATA_CACHE_0, | ||
71 | + REG_DATA_CACHE_1, | ||
72 | + REG_DATA_CACHE_2, | ||
73 | + REG_DATA_CACHE_3, | ||
74 | + REG_DATA_CACHE_4, | ||
75 | + REG_DATA_CACHE_5, | ||
76 | + REG_DATA_CACHE_6, | ||
77 | + REG_DATA_CACHE_7, | ||
78 | + REG_DATA_CACHE_8, | ||
79 | + REG_DATA_CACHE_9, | ||
80 | + REG_DATA_CACHE_A, | ||
81 | + REG_DATA_CACHE_B, | ||
82 | + REG_POWER_OUTPUT_CTRL = 0x12u, | ||
83 | + REG_DC_DC2_OUT_V_CTRL = 0x23u, | ||
84 | + REG_DC_DC2_DVS_CTRL = 0x25u, | ||
85 | + REG_DC_DC3_OUT_V_CTRL = 0x27u, | ||
86 | + REG_LDO2_4_OUT_V_CTRL, | ||
87 | + REG_LDO3_OUT_V_CTRL, | ||
88 | + REG_VBUS_CH_MGMT = 0x30u, | ||
89 | + REG_SHUTDOWN_V_CTRL, | ||
90 | + REG_SHUTDOWN_CTRL, | ||
91 | + REG_CHARGE_CTRL_1, | ||
92 | + REG_CHARGE_CTRL_2, | ||
93 | + REG_SPARE_CHARGE_CTRL, | ||
94 | + REG_PEK_KEY_CTRL, | ||
95 | + REG_DC_DC_FREQ_SET, | ||
96 | + REG_CHR_TEMP_TH_SET, | ||
97 | + REG_CHR_HIGH_TEMP_TH_CTRL, | ||
98 | + REG_IPSOUT_WARN_L1, | ||
99 | + REG_IPSOUT_WARN_L2, | ||
100 | + REG_DISCHR_TEMP_TH_SET, | ||
101 | + REG_DISCHR_HIGH_TEMP_TH_CTRL, | ||
102 | + REG_IRQ_BANK_1_CTRL = 0x40u, | ||
103 | + REG_IRQ_BANK_2_CTRL, | ||
104 | + REG_IRQ_BANK_3_CTRL, | ||
105 | + REG_IRQ_BANK_4_CTRL, | ||
106 | + REG_IRQ_BANK_5_CTRL, | ||
107 | + REG_IRQ_BANK_1_STAT = 0x48u, | ||
108 | + REG_IRQ_BANK_2_STAT, | ||
109 | + REG_IRQ_BANK_3_STAT, | ||
110 | + REG_IRQ_BANK_4_STAT, | ||
111 | + REG_IRQ_BANK_5_STAT, | ||
112 | + REG_ADC_ACIN_V_H = 0x56u, | ||
113 | + REG_ADC_ACIN_V_L, | ||
114 | + REG_ADC_ACIN_CURR_H, | ||
115 | + REG_ADC_ACIN_CURR_L, | ||
116 | + REG_ADC_VBUS_V_H, | ||
117 | + REG_ADC_VBUS_V_L, | ||
118 | + REG_ADC_VBUS_CURR_H, | ||
119 | + REG_ADC_VBUS_CURR_L, | ||
120 | + REG_ADC_INT_TEMP_H, | ||
121 | + REG_ADC_INT_TEMP_L, | ||
122 | + REG_ADC_TEMP_SENS_V_H = 0x62u, | ||
123 | + REG_ADC_TEMP_SENS_V_L, | ||
124 | + REG_ADC_BAT_V_H = 0x78u, | ||
125 | + REG_ADC_BAT_V_L, | ||
126 | + REG_ADC_BAT_DISCHR_CURR_H, | ||
127 | + REG_ADC_BAT_DISCHR_CURR_L, | ||
128 | + REG_ADC_BAT_CHR_CURR_H, | ||
129 | + REG_ADC_BAT_CHR_CURR_L, | ||
130 | + REG_ADC_IPSOUT_V_H, | ||
131 | + REG_ADC_IPSOUT_V_L, | ||
132 | + REG_DC_DC_MOD_SEL = 0x80u, | ||
133 | + REG_ADC_EN_1, | ||
134 | + REG_ADC_EN_2, | ||
135 | + REG_ADC_SR_CTRL, | ||
136 | + REG_ADC_IN_RANGE, | ||
137 | + REG_GPIO1_ADC_IRQ_RISING_TH, | ||
138 | + REG_GPIO1_ADC_IRQ_FALLING_TH, | ||
139 | + REG_TIMER_CTRL = 0x8au, | ||
140 | + REG_VBUS_CTRL_MON_SRP, | ||
141 | + REG_OVER_TEMP_SHUTDOWN = 0x8fu, | ||
142 | + REG_GPIO0_FEAT_SET, | ||
143 | + REG_GPIO_OUT_HIGH_SET, | ||
144 | + REG_GPIO1_FEAT_SET, | ||
145 | + REG_GPIO2_FEAT_SET, | ||
146 | + REG_GPIO_SIG_STATE_SET_MON, | ||
147 | + REG_GPIO3_SET, | ||
148 | + REG_COULOMB_CNTR_CTRL = 0xb8u, | ||
149 | + REG_POWER_MEAS_RES, | ||
150 | + NR_REGS | ||
151 | +}; | ||
152 | + | ||
153 | +#define AXP209_CHIP_VERSION_ID (0x01) | ||
154 | +#define AXP209_DC_DC2_OUT_V_CTRL_RESET (0x16) | ||
155 | +#define AXP209_IRQ_BANK_1_CTRL_RESET (0xd8) | ||
156 | + | ||
157 | +/* A simple I2C slave which returns values of ID or CNT register. */ | ||
158 | +typedef struct AXP209I2CState { | ||
159 | + /*< private >*/ | ||
160 | + I2CSlave i2c; | ||
161 | + /*< public >*/ | ||
162 | + uint8_t regs[NR_REGS]; /* peripheral registers */ | ||
163 | + uint8_t ptr; /* current register index */ | ||
164 | + uint8_t count; /* counter used for tx/rx */ | ||
165 | +} AXP209I2CState; | ||
166 | + | ||
167 | +/* Reset all counters and load ID register */ | ||
168 | +static void axp209_reset_enter(Object *obj, ResetType type) | ||
169 | +{ | ||
170 | + AXP209I2CState *s = AXP209(obj); | ||
171 | + | ||
172 | + memset(s->regs, 0, NR_REGS); | ||
173 | + s->ptr = 0; | ||
174 | + s->count = 0; | ||
175 | + s->regs[REG_CHIP_VERSION] = AXP209_CHIP_VERSION_ID; | ||
176 | + s->regs[REG_DC_DC2_OUT_V_CTRL] = AXP209_DC_DC2_OUT_V_CTRL_RESET; | ||
177 | + s->regs[REG_IRQ_BANK_1_CTRL] = AXP209_IRQ_BANK_1_CTRL_RESET; | ||
178 | +} | ||
179 | + | ||
180 | +/* Handle events from master. */ | ||
181 | +static int axp209_event(I2CSlave *i2c, enum i2c_event event) | ||
182 | +{ | ||
183 | + AXP209I2CState *s = AXP209(i2c); | ||
184 | + | ||
185 | + s->count = 0; | ||
186 | + | ||
187 | + return 0; | ||
188 | +} | ||
189 | + | ||
190 | +/* Called when master requests read */ | ||
191 | +static uint8_t axp209_rx(I2CSlave *i2c) | ||
192 | +{ | ||
193 | + AXP209I2CState *s = AXP209(i2c); | ||
194 | + uint8_t ret = 0xff; | ||
195 | + | ||
196 | + if (s->ptr < NR_REGS) { | ||
197 | + ret = s->regs[s->ptr++]; | ||
29 | + } | 198 | + } |
30 | + | 199 | + |
31 | + /* | 200 | + trace_axp209_rx(s->ptr - 1, ret); |
32 | + * Shift by element size is architecturally valid. | 201 | + |
33 | + * For arithmetic right-shift, it's the same as by one less. | 202 | + return ret; |
34 | + * For logical shifts and ASRD, it is a zeroing operation. | 203 | +} |
35 | + */ | 204 | + |
36 | + max = 8 << a->esz; | 205 | +/* |
37 | + if (a->imm >= max) { | 206 | + * Called when master sends write. |
38 | + if (asr) { | 207 | + * Update ptr with byte 0, then perform write with second byte. |
39 | + a->imm = max - 1; | 208 | + */ |
40 | + } else { | 209 | +static int axp209_tx(I2CSlave *i2c, uint8_t data) |
41 | + return do_movz_zpz(s, a->rd, a->rd, a->pg, a->esz, true); | 210 | +{ |
211 | + AXP209I2CState *s = AXP209(i2c); | ||
212 | + | ||
213 | + if (s->count == 0) { | ||
214 | + /* Store register address */ | ||
215 | + s->ptr = data; | ||
216 | + s->count++; | ||
217 | + trace_axp209_select(data); | ||
218 | + } else { | ||
219 | + trace_axp209_tx(s->ptr, data); | ||
220 | + if (s->ptr == REG_DC_DC2_OUT_V_CTRL) { | ||
221 | + s->regs[s->ptr++] = data; | ||
42 | + } | 222 | + } |
43 | + } | 223 | + } |
44 | + return gen_gvec_ool_arg_zpzi(s, fns[a->esz], a); | 224 | + |
45 | +} | 225 | + return 0; |
46 | + | 226 | +} |
47 | static bool trans_ASR_zpzi(DisasContext *s, arg_rpri_esz *a) | 227 | + |
48 | { | 228 | +static const VMStateDescription vmstate_axp209 = { |
49 | static gen_helper_gvec_3 * const fns[4] = { | 229 | + .name = TYPE_AXP209_PMU, |
50 | gen_helper_sve_asr_zpzi_b, gen_helper_sve_asr_zpzi_h, | 230 | + .version_id = 1, |
51 | gen_helper_sve_asr_zpzi_s, gen_helper_sve_asr_zpzi_d, | 231 | + .fields = (VMStateField[]) { |
52 | }; | 232 | + VMSTATE_UINT8_ARRAY(regs, AXP209I2CState, NR_REGS), |
53 | - if (a->esz < 0) { | 233 | + VMSTATE_UINT8(count, AXP209I2CState), |
54 | - /* Invalid tsz encoding -- see tszimm_esz. */ | 234 | + VMSTATE_UINT8(ptr, AXP209I2CState), |
55 | - return false; | 235 | + VMSTATE_END_OF_LIST() |
56 | - } | 236 | + } |
57 | - /* Shift by element size is architecturally valid. For | 237 | +}; |
58 | - arithmetic right-shift, it's the same as by one less. */ | 238 | + |
59 | - a->imm = MIN(a->imm, (8 << a->esz) - 1); | 239 | +static void axp209_class_init(ObjectClass *oc, void *data) |
60 | - return gen_gvec_ool_arg_zpzi(s, fns[a->esz], a); | 240 | +{ |
61 | + return do_shift_zpzi(s, a, true, fns); | 241 | + DeviceClass *dc = DEVICE_CLASS(oc); |
62 | } | 242 | + I2CSlaveClass *isc = I2C_SLAVE_CLASS(oc); |
63 | 243 | + ResettableClass *rc = RESETTABLE_CLASS(oc); | |
64 | static bool trans_LSR_zpzi(DisasContext *s, arg_rpri_esz *a) | 244 | + |
65 | @@ -XXX,XX +XXX,XX @@ static bool trans_LSR_zpzi(DisasContext *s, arg_rpri_esz *a) | 245 | + rc->phases.enter = axp209_reset_enter; |
66 | gen_helper_sve_lsr_zpzi_b, gen_helper_sve_lsr_zpzi_h, | 246 | + dc->vmsd = &vmstate_axp209; |
67 | gen_helper_sve_lsr_zpzi_s, gen_helper_sve_lsr_zpzi_d, | 247 | + isc->event = axp209_event; |
68 | }; | 248 | + isc->recv = axp209_rx; |
69 | - if (a->esz < 0) { | 249 | + isc->send = axp209_tx; |
70 | - return false; | 250 | +} |
71 | - } | 251 | + |
72 | - /* Shift by element size is architecturally valid. | 252 | +static const TypeInfo axp209_info = { |
73 | - For logical shifts, it is a zeroing operation. */ | 253 | + .name = TYPE_AXP209_PMU, |
74 | - if (a->imm >= (8 << a->esz)) { | 254 | + .parent = TYPE_I2C_SLAVE, |
75 | - return do_movz_zpz(s, a->rd, a->rd, a->pg, a->esz, true); | 255 | + .instance_size = sizeof(AXP209I2CState), |
76 | - } else { | 256 | + .class_init = axp209_class_init |
77 | - return gen_gvec_ool_arg_zpzi(s, fns[a->esz], a); | 257 | +}; |
78 | - } | 258 | + |
79 | + return do_shift_zpzi(s, a, false, fns); | 259 | +static void axp209_register_devices(void) |
80 | } | 260 | +{ |
81 | 261 | + type_register_static(&axp209_info); | |
82 | static bool trans_LSL_zpzi(DisasContext *s, arg_rpri_esz *a) | 262 | +} |
83 | @@ -XXX,XX +XXX,XX @@ static bool trans_LSL_zpzi(DisasContext *s, arg_rpri_esz *a) | 263 | + |
84 | gen_helper_sve_lsl_zpzi_b, gen_helper_sve_lsl_zpzi_h, | 264 | +type_init(axp209_register_devices); |
85 | gen_helper_sve_lsl_zpzi_s, gen_helper_sve_lsl_zpzi_d, | 265 | diff --git a/MAINTAINERS b/MAINTAINERS |
86 | }; | 266 | index XXXXXXX..XXXXXXX 100644 |
87 | - if (a->esz < 0) { | 267 | --- a/MAINTAINERS |
88 | - return false; | 268 | +++ b/MAINTAINERS |
89 | - } | 269 | @@ -XXX,XX +XXX,XX @@ ARM Machines |
90 | - /* Shift by element size is architecturally valid. | 270 | Allwinner-a10 |
91 | - For logical shifts, it is a zeroing operation. */ | 271 | M: Beniamino Galvani <b.galvani@gmail.com> |
92 | - if (a->imm >= (8 << a->esz)) { | 272 | M: Peter Maydell <peter.maydell@linaro.org> |
93 | - return do_movz_zpz(s, a->rd, a->rd, a->pg, a->esz, true); | 273 | +R: Strahinja Jankovic <strahinja.p.jankovic@gmail.com> |
94 | - } else { | 274 | L: qemu-arm@nongnu.org |
95 | - return gen_gvec_ool_arg_zpzi(s, fns[a->esz], a); | 275 | S: Odd Fixes |
96 | - } | 276 | F: hw/*/allwinner* |
97 | + return do_shift_zpzi(s, a, false, fns); | 277 | F: include/hw/*/allwinner* |
98 | } | 278 | F: hw/arm/cubieboard.c |
99 | 279 | F: docs/system/arm/cubieboard.rst | |
100 | static bool trans_ASRD(DisasContext *s, arg_rpri_esz *a) | 280 | +F: hw/misc/axp209.c |
101 | @@ -XXX,XX +XXX,XX @@ static bool trans_ASRD(DisasContext *s, arg_rpri_esz *a) | 281 | |
102 | gen_helper_sve_asrd_b, gen_helper_sve_asrd_h, | 282 | Allwinner-h3 |
103 | gen_helper_sve_asrd_s, gen_helper_sve_asrd_d, | 283 | M: Niek Linnenbank <nieklinnenbank@gmail.com> |
104 | }; | 284 | diff --git a/hw/misc/Kconfig b/hw/misc/Kconfig |
105 | - if (a->esz < 0) { | 285 | index XXXXXXX..XXXXXXX 100644 |
106 | - return false; | 286 | --- a/hw/misc/Kconfig |
107 | - } | 287 | +++ b/hw/misc/Kconfig |
108 | - /* Shift by element size is architecturally valid. For arithmetic | 288 | @@ -XXX,XX +XXX,XX @@ config ALLWINNER_A10_CCM |
109 | - right shift for division, it is a zeroing operation. */ | 289 | config ALLWINNER_A10_DRAMC |
110 | - if (a->imm >= (8 << a->esz)) { | 290 | bool |
111 | - return do_movz_zpz(s, a->rd, a->rd, a->pg, a->esz, true); | 291 | |
112 | - } else { | 292 | +config AXP209_PMU |
113 | - return gen_gvec_ool_arg_zpzi(s, fns[a->esz], a); | 293 | + bool |
114 | - } | 294 | + depends on I2C |
115 | + return do_shift_zpzi(s, a, false, fns); | 295 | + |
116 | } | 296 | source macio/Kconfig |
117 | 297 | diff --git a/hw/misc/meson.build b/hw/misc/meson.build | |
118 | static gen_helper_gvec_3 * const sqshl_zpzi_fns[4] = { | 298 | index XXXXXXX..XXXXXXX 100644 |
299 | --- a/hw/misc/meson.build | ||
300 | +++ b/hw/misc/meson.build | ||
301 | @@ -XXX,XX +XXX,XX @@ specific_ss.add(when: 'CONFIG_ALLWINNER_H3', if_true: files('allwinner-cpucfg.c' | ||
302 | softmmu_ss.add(when: 'CONFIG_ALLWINNER_H3', if_true: files('allwinner-h3-dramc.c')) | ||
303 | softmmu_ss.add(when: 'CONFIG_ALLWINNER_H3', if_true: files('allwinner-h3-sysctrl.c')) | ||
304 | softmmu_ss.add(when: 'CONFIG_ALLWINNER_H3', if_true: files('allwinner-sid.c')) | ||
305 | +softmmu_ss.add(when: 'CONFIG_AXP209_PMU', if_true: files('axp209.c')) | ||
306 | softmmu_ss.add(when: 'CONFIG_REALVIEW', if_true: files('arm_sysctl.c')) | ||
307 | softmmu_ss.add(when: 'CONFIG_NSERIES', if_true: files('cbus.c')) | ||
308 | softmmu_ss.add(when: 'CONFIG_ECCMEMCTL', if_true: files('eccmemctl.c')) | ||
309 | diff --git a/hw/misc/trace-events b/hw/misc/trace-events | ||
310 | index XXXXXXX..XXXXXXX 100644 | ||
311 | --- a/hw/misc/trace-events | ||
312 | +++ b/hw/misc/trace-events | ||
313 | @@ -XXX,XX +XXX,XX @@ allwinner_sid_write(uint64_t offset, uint64_t data, unsigned size) "offset 0x%" | ||
314 | avr_power_read(uint8_t value) "power_reduc read value:%u" | ||
315 | avr_power_write(uint8_t value) "power_reduc write value:%u" | ||
316 | |||
317 | +# axp209.c | ||
318 | +axp209_rx(uint8_t reg, uint8_t data) "Read reg 0x%" PRIx8 " : 0x%" PRIx8 | ||
319 | +axp209_select(uint8_t reg) "Accessing reg 0x%" PRIx8 | ||
320 | +axp209_tx(uint8_t reg, uint8_t data) "Write reg 0x%" PRIx8 " : 0x%" PRIx8 | ||
321 | + | ||
322 | # eccmemctl.c | ||
323 | ecc_mem_writel_mer(uint32_t val) "Write memory enable 0x%08x" | ||
324 | ecc_mem_writel_mdr(uint32_t val) "Write memory delay 0x%08x" | ||
119 | -- | 325 | -- |
120 | 2.25.1 | 326 | 2.34.1 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Strahinja Jankovic <strahinjapjankovic@gmail.com> |
---|---|---|---|
2 | 2 | ||
3 | This alias is defined on EOR (prediates). While the | 3 | SPL Boot for Cubieboard expects AXP209 connected to I2C0 bus. |
4 | same operation could be performed with NAND or NOR, | ||
5 | only bother with the official alias. | ||
6 | 4 | ||
7 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 5 | Signed-off-by: Strahinja Jankovic <strahinja.p.jankovic@gmail.com> |
8 | Message-id: 20220527181907.189259-81-richard.henderson@linaro.org | 6 | |
9 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 7 | Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> |
8 | Message-id: 20221226220303.14420-6-strahinja.p.jankovic@gmail.com | ||
10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
11 | --- | 10 | --- |
12 | target/arm/translate-sve.c | 5 +++++ | 11 | hw/arm/cubieboard.c | 6 ++++++ |
13 | 1 file changed, 5 insertions(+) | 12 | hw/arm/Kconfig | 1 + |
13 | 2 files changed, 7 insertions(+) | ||
14 | 14 | ||
15 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | 15 | diff --git a/hw/arm/cubieboard.c b/hw/arm/cubieboard.c |
16 | index XXXXXXX..XXXXXXX 100644 | 16 | index XXXXXXX..XXXXXXX 100644 |
17 | --- a/target/arm/translate-sve.c | 17 | --- a/hw/arm/cubieboard.c |
18 | +++ b/target/arm/translate-sve.c | 18 | +++ b/hw/arm/cubieboard.c |
19 | @@ -XXX,XX +XXX,XX @@ static bool trans_EOR_pppp(DisasContext *s, arg_rprr_s *a) | 19 | @@ -XXX,XX +XXX,XX @@ |
20 | .fno = gen_helper_sve_eor_pppp, | 20 | #include "hw/boards.h" |
21 | .prefer_i64 = TCG_TARGET_REG_BITS == 64, | 21 | #include "hw/qdev-properties.h" |
22 | }; | 22 | #include "hw/arm/allwinner-a10.h" |
23 | +#include "hw/i2c/i2c.h" | ||
24 | |||
25 | static struct arm_boot_info cubieboard_binfo = { | ||
26 | .loader_start = AW_A10_SDRAM_BASE, | ||
27 | @@ -XXX,XX +XXX,XX @@ static void cubieboard_init(MachineState *machine) | ||
28 | BlockBackend *blk; | ||
29 | BusState *bus; | ||
30 | DeviceState *carddev; | ||
31 | + I2CBus *i2c; | ||
32 | |||
33 | /* BIOS is not supported by this board */ | ||
34 | if (machine->firmware) { | ||
35 | @@ -XXX,XX +XXX,XX @@ static void cubieboard_init(MachineState *machine) | ||
36 | exit(1); | ||
37 | } | ||
38 | |||
39 | + /* Connect AXP 209 */ | ||
40 | + i2c = I2C_BUS(qdev_get_child_bus(DEVICE(&a10->i2c0), "i2c")); | ||
41 | + i2c_slave_create_simple(i2c, "axp209_pmu", 0x34); | ||
23 | + | 42 | + |
24 | + /* Alias NOT (predicate) is EOR Pd.B, Pg/Z, Pn.B, Pg.B */ | 43 | /* Retrieve SD bus */ |
25 | + if (!a->s && a->pg == a->rm) { | 44 | di = drive_get(IF_SD, 0, 0); |
26 | + return gen_gvec_fn_ppp(s, tcg_gen_gvec_andc, a->rd, a->pg, a->rn); | 45 | blk = di ? blk_by_legacy_dinfo(di) : NULL; |
27 | + } | 46 | diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig |
28 | return do_pppp_flags(s, a, &op); | 47 | index XXXXXXX..XXXXXXX 100644 |
29 | } | 48 | --- a/hw/arm/Kconfig |
49 | +++ b/hw/arm/Kconfig | ||
50 | @@ -XXX,XX +XXX,XX @@ config ALLWINNER_A10 | ||
51 | select ALLWINNER_A10_DRAMC | ||
52 | select ALLWINNER_EMAC | ||
53 | select ALLWINNER_I2C | ||
54 | + select AXP209_PMU | ||
55 | select SERIAL | ||
56 | select UNIMP | ||
30 | 57 | ||
31 | -- | 58 | -- |
32 | 2.25.1 | 59 | 2.34.1 |
60 | |||
61 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Strahinja Jankovic <strahinjapjankovic@gmail.com> |
---|---|---|---|
2 | 2 | ||
3 | Rename do_zz_fp to gen_gvec_fpst_arg_zz, and move up. | 3 | This patch enables copying of SPL from MMC if `-kernel` parameter is not |
4 | Split out gen_gvec_fpst_zz as a helper while we're at it. | 4 | passed when starting QEMU. SPL is copied to SRAM_A. |
5 | 5 | ||
6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 6 | The approach is reused from Allwinner H3 implementation. |
7 | Message-id: 20220527181907.189259-92-richard.henderson@linaro.org | 7 | |
8 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 8 | Tested with Armbian and custom Yocto image. |
9 | |||
10 | Signed-off-by: Strahinja Jankovic <strahinja.p.jankovic@gmail.com> | ||
11 | |||
12 | Reviewed-by: Niek Linnenbank <nieklinnenbank@gmail.com> | ||
13 | Message-id: 20221226220303.14420-7-strahinja.p.jankovic@gmail.com | ||
9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 14 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
10 | --- | 15 | --- |
11 | target/arm/translate-sve.c | 77 ++++++++++++++++++-------------------- | 16 | include/hw/arm/allwinner-a10.h | 21 +++++++++++++++++++++ |
12 | 1 file changed, 36 insertions(+), 41 deletions(-) | 17 | hw/arm/allwinner-a10.c | 18 ++++++++++++++++++ |
18 | hw/arm/cubieboard.c | 5 +++++ | ||
19 | 3 files changed, 44 insertions(+) | ||
13 | 20 | ||
14 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | 21 | diff --git a/include/hw/arm/allwinner-a10.h b/include/hw/arm/allwinner-a10.h |
15 | index XXXXXXX..XXXXXXX 100644 | 22 | index XXXXXXX..XXXXXXX 100644 |
16 | --- a/target/arm/translate-sve.c | 23 | --- a/include/hw/arm/allwinner-a10.h |
17 | +++ b/target/arm/translate-sve.c | 24 | +++ b/include/hw/arm/allwinner-a10.h |
18 | @@ -XXX,XX +XXX,XX @@ static bool gen_gvec_ool_zz(DisasContext *s, gen_helper_gvec_2 *fn, | 25 | @@ -XXX,XX +XXX,XX @@ |
19 | return true; | 26 | #include "hw/misc/allwinner-a10-ccm.h" |
20 | } | 27 | #include "hw/misc/allwinner-a10-dramc.h" |
21 | 28 | #include "hw/i2c/allwinner-i2c.h" | |
22 | +static bool gen_gvec_fpst_zz(DisasContext *s, gen_helper_gvec_2_ptr *fn, | 29 | +#include "sysemu/block-backend.h" |
23 | + int rd, int rn, int data, | 30 | |
24 | + ARMFPStatusFlavour flavour) | 31 | #include "target/arm/cpu.h" |
32 | #include "qom/object.h" | ||
33 | @@ -XXX,XX +XXX,XX @@ struct AwA10State { | ||
34 | OHCISysBusState ohci[AW_A10_NUM_USB]; | ||
35 | }; | ||
36 | |||
37 | +/** | ||
38 | + * Emulate Boot ROM firmware setup functionality. | ||
39 | + * | ||
40 | + * A real Allwinner A10 SoC contains a Boot ROM | ||
41 | + * which is the first code that runs right after | ||
42 | + * the SoC is powered on. The Boot ROM is responsible | ||
43 | + * for loading user code (e.g. a bootloader) from any | ||
44 | + * of the supported external devices and writing the | ||
45 | + * downloaded code to internal SRAM. After loading the SoC | ||
46 | + * begins executing the code written to SRAM. | ||
47 | + * | ||
48 | + * This function emulates the Boot ROM by copying 32 KiB | ||
49 | + * of data at offset 8 KiB from the given block device and writes it to | ||
50 | + * the start of the first internal SRAM memory. | ||
51 | + * | ||
52 | + * @s: Allwinner A10 state object pointer | ||
53 | + * @blk: Block backend device object pointer | ||
54 | + */ | ||
55 | +void allwinner_a10_bootrom_setup(AwA10State *s, BlockBackend *blk); | ||
56 | + | ||
57 | #endif | ||
58 | diff --git a/hw/arm/allwinner-a10.c b/hw/arm/allwinner-a10.c | ||
59 | index XXXXXXX..XXXXXXX 100644 | ||
60 | --- a/hw/arm/allwinner-a10.c | ||
61 | +++ b/hw/arm/allwinner-a10.c | ||
62 | @@ -XXX,XX +XXX,XX @@ | ||
63 | #include "sysemu/sysemu.h" | ||
64 | #include "hw/boards.h" | ||
65 | #include "hw/usb/hcd-ohci.h" | ||
66 | +#include "hw/loader.h" | ||
67 | |||
68 | +#define AW_A10_SRAM_A_BASE 0x00000000 | ||
69 | #define AW_A10_DRAMC_BASE 0x01c01000 | ||
70 | #define AW_A10_MMC0_BASE 0x01c0f000 | ||
71 | #define AW_A10_CCM_BASE 0x01c20000 | ||
72 | @@ -XXX,XX +XXX,XX @@ | ||
73 | #define AW_A10_RTC_BASE 0x01c20d00 | ||
74 | #define AW_A10_I2C0_BASE 0x01c2ac00 | ||
75 | |||
76 | +void allwinner_a10_bootrom_setup(AwA10State *s, BlockBackend *blk) | ||
25 | +{ | 77 | +{ |
26 | + if (fn == NULL) { | 78 | + const int64_t rom_size = 32 * KiB; |
27 | + return false; | 79 | + g_autofree uint8_t *buffer = g_new0(uint8_t, rom_size); |
80 | + | ||
81 | + if (blk_pread(blk, 8 * KiB, rom_size, buffer, 0) < 0) { | ||
82 | + error_setg(&error_fatal, "%s: failed to read BlockBackend data", | ||
83 | + __func__); | ||
84 | + return; | ||
28 | + } | 85 | + } |
29 | + if (sve_access_check(s)) { | ||
30 | + unsigned vsz = vec_full_reg_size(s); | ||
31 | + TCGv_ptr status = fpstatus_ptr(flavour); | ||
32 | + | 86 | + |
33 | + tcg_gen_gvec_2_ptr(vec_full_reg_offset(s, rd), | 87 | + rom_add_blob("allwinner-a10.bootrom", buffer, rom_size, |
34 | + vec_full_reg_offset(s, rn), | 88 | + rom_size, AW_A10_SRAM_A_BASE, |
35 | + status, vsz, vsz, data, fn); | 89 | + NULL, NULL, NULL, NULL, false); |
36 | + tcg_temp_free_ptr(status); | ||
37 | + } | ||
38 | + return true; | ||
39 | +} | 90 | +} |
40 | + | 91 | + |
41 | +static bool gen_gvec_fpst_arg_zz(DisasContext *s, gen_helper_gvec_2_ptr *fn, | 92 | static void aw_a10_init(Object *obj) |
42 | + arg_rr_esz *a, int data) | 93 | { |
43 | +{ | 94 | AwA10State *s = AW_A10(obj); |
44 | + return gen_gvec_fpst_zz(s, fn, a->rd, a->rn, data, | 95 | diff --git a/hw/arm/cubieboard.c b/hw/arm/cubieboard.c |
45 | + a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); | 96 | index XXXXXXX..XXXXXXX 100644 |
46 | +} | 97 | --- a/hw/arm/cubieboard.c |
47 | + | 98 | +++ b/hw/arm/cubieboard.c |
48 | /* Invoke an out-of-line helper on 3 Zregs. */ | 99 | @@ -XXX,XX +XXX,XX @@ static void cubieboard_init(MachineState *machine) |
49 | static bool gen_gvec_ool_zzz(DisasContext *s, gen_helper_gvec_3 *fn, | 100 | memory_region_add_subregion(get_system_memory(), AW_A10_SDRAM_BASE, |
50 | int rd, int rn, int rm, int data) | 101 | machine->ram); |
51 | @@ -XXX,XX +XXX,XX @@ DO_VPZ(FMAXV, fmaxv) | 102 | |
52 | *** SVE Floating Point Unary Operations - Unpredicated Group | 103 | + /* Load target kernel or start using BootROM */ |
53 | */ | 104 | + if (!machine->kernel_filename && blk && blk_is_available(blk)) { |
54 | 105 | + /* Use Boot ROM to copy data from SD card to SRAM */ | |
55 | -static void do_zz_fp(DisasContext *s, arg_rr_esz *a, gen_helper_gvec_2_ptr *fn) | 106 | + allwinner_a10_bootrom_setup(a10, blk); |
56 | -{ | 107 | + } |
57 | - unsigned vsz = vec_full_reg_size(s); | 108 | /* TODO create and connect IDE devices for ide_drive_get() */ |
58 | - TCGv_ptr status = fpstatus_ptr(a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); | 109 | |
59 | +static gen_helper_gvec_2_ptr * const frecpe_fns[] = { | 110 | cubieboard_binfo.ram_size = machine->ram_size; |
60 | + NULL, gen_helper_gvec_frecpe_h, | ||
61 | + gen_helper_gvec_frecpe_s, gen_helper_gvec_frecpe_d, | ||
62 | +}; | ||
63 | +TRANS_FEAT(FRECPE, aa64_sve, gen_gvec_fpst_arg_zz, frecpe_fns[a->esz], a, 0) | ||
64 | |||
65 | - tcg_gen_gvec_2_ptr(vec_full_reg_offset(s, a->rd), | ||
66 | - vec_full_reg_offset(s, a->rn), | ||
67 | - status, vsz, vsz, 0, fn); | ||
68 | - tcg_temp_free_ptr(status); | ||
69 | -} | ||
70 | - | ||
71 | -static bool trans_FRECPE(DisasContext *s, arg_rr_esz *a) | ||
72 | -{ | ||
73 | - static gen_helper_gvec_2_ptr * const fns[3] = { | ||
74 | - gen_helper_gvec_frecpe_h, | ||
75 | - gen_helper_gvec_frecpe_s, | ||
76 | - gen_helper_gvec_frecpe_d, | ||
77 | - }; | ||
78 | - if (a->esz == 0) { | ||
79 | - return false; | ||
80 | - } | ||
81 | - if (sve_access_check(s)) { | ||
82 | - do_zz_fp(s, a, fns[a->esz - 1]); | ||
83 | - } | ||
84 | - return true; | ||
85 | -} | ||
86 | - | ||
87 | -static bool trans_FRSQRTE(DisasContext *s, arg_rr_esz *a) | ||
88 | -{ | ||
89 | - static gen_helper_gvec_2_ptr * const fns[3] = { | ||
90 | - gen_helper_gvec_frsqrte_h, | ||
91 | - gen_helper_gvec_frsqrte_s, | ||
92 | - gen_helper_gvec_frsqrte_d, | ||
93 | - }; | ||
94 | - if (a->esz == 0) { | ||
95 | - return false; | ||
96 | - } | ||
97 | - if (sve_access_check(s)) { | ||
98 | - do_zz_fp(s, a, fns[a->esz - 1]); | ||
99 | - } | ||
100 | - return true; | ||
101 | -} | ||
102 | +static gen_helper_gvec_2_ptr * const frsqrte_fns[] = { | ||
103 | + NULL, gen_helper_gvec_frsqrte_h, | ||
104 | + gen_helper_gvec_frsqrte_s, gen_helper_gvec_frsqrte_d, | ||
105 | +}; | ||
106 | +TRANS_FEAT(FRSQRTE, aa64_sve, gen_gvec_fpst_arg_zz, frsqrte_fns[a->esz], a, 0) | ||
107 | |||
108 | /* | ||
109 | *** SVE Floating Point Compare with Zero Group | ||
110 | -- | 111 | -- |
111 | 2.25.1 | 112 | 2.34.1 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Strahinja Jankovic <strahinjapjankovic@gmail.com> |
---|---|---|---|
2 | 2 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 3 | Cubieboard now can boot directly from SD card, without the need to pass |
4 | Message-id: 20220527181907.189259-96-richard.henderson@linaro.org | 4 | `-kernel` parameter. Update Avocado tests to cover this functionality. |
5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 5 | |
6 | Signed-off-by: Strahinja Jankovic <strahinja.p.jankovic@gmail.com> | ||
7 | Reviewed-by: Niek Linnenbank <nieklinnenbank@gmail.com> | ||
8 | Tested-by: Niek Linnenbank <nieklinnenbank@gmail.com> | ||
9 | Message-id: 20221226220303.14420-8-strahinja.p.jankovic@gmail.com | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
7 | --- | 11 | --- |
8 | target/arm/translate-sve.c | 53 ++++++++++---------------------------- | 12 | tests/avocado/boot_linux_console.py | 47 +++++++++++++++++++++++++++++ |
9 | 1 file changed, 14 insertions(+), 39 deletions(-) | 13 | 1 file changed, 47 insertions(+) |
10 | 14 | ||
11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | 15 | diff --git a/tests/avocado/boot_linux_console.py b/tests/avocado/boot_linux_console.py |
12 | index XXXXXXX..XXXXXXX 100644 | 16 | index XXXXXXX..XXXXXXX 100644 |
13 | --- a/target/arm/translate-sve.c | 17 | --- a/tests/avocado/boot_linux_console.py |
14 | +++ b/target/arm/translate-sve.c | 18 | +++ b/tests/avocado/boot_linux_console.py |
15 | @@ -XXX,XX +XXX,XX @@ static bool do_frint_mode(DisasContext *s, arg_rpr_esz *a, | 19 | @@ -XXX,XX +XXX,XX @@ def test_arm_cubieboard_sata(self): |
16 | return true; | 20 | 'sda') |
17 | } | 21 | # cubieboard's reboot is not functioning; omit reboot test. |
18 | 22 | ||
19 | -static bool trans_FRINTN(DisasContext *s, arg_rpr_esz *a) | 23 | + @skipUnless(os.getenv('AVOCADO_ALLOW_LARGE_STORAGE'), 'storage limited') |
20 | -{ | 24 | + def test_arm_cubieboard_openwrt_22_03_2(self): |
21 | - return do_frint_mode(s, a, float_round_nearest_even, frint_fns[a->esz]); | 25 | + """ |
22 | -} | 26 | + :avocado: tags=arch:arm |
23 | - | 27 | + :avocado: tags=machine:cubieboard |
24 | -static bool trans_FRINTP(DisasContext *s, arg_rpr_esz *a) | 28 | + :avocado: tags=device:sd |
25 | -{ | 29 | + """ |
26 | - return do_frint_mode(s, a, float_round_up, frint_fns[a->esz]); | 30 | + |
27 | -} | 31 | + # This test download a 7.5 MiB compressed image and expand it |
28 | - | 32 | + # to 126 MiB. |
29 | -static bool trans_FRINTM(DisasContext *s, arg_rpr_esz *a) | 33 | + image_url = ('https://downloads.openwrt.org/releases/22.03.2/targets/' |
30 | -{ | 34 | + 'sunxi/cortexa8/openwrt-22.03.2-sunxi-cortexa8-' |
31 | - return do_frint_mode(s, a, float_round_down, frint_fns[a->esz]); | 35 | + 'cubietech_a10-cubieboard-ext4-sdcard.img.gz') |
32 | -} | 36 | + image_hash = ('94b5ecbfbc0b3b56276e5146b899eafa' |
33 | - | 37 | + '2ac5dc2d08733d6705af9f144f39f554') |
34 | -static bool trans_FRINTZ(DisasContext *s, arg_rpr_esz *a) | 38 | + image_path_gz = self.fetch_asset(image_url, asset_hash=image_hash, |
35 | -{ | 39 | + algorithm='sha256') |
36 | - return do_frint_mode(s, a, float_round_to_zero, frint_fns[a->esz]); | 40 | + image_path = archive.extract(image_path_gz, self.workdir) |
37 | -} | 41 | + image_pow2ceil_expand(image_path) |
38 | - | 42 | + |
39 | -static bool trans_FRINTA(DisasContext *s, arg_rpr_esz *a) | 43 | + self.vm.set_console() |
40 | -{ | 44 | + self.vm.add_args('-drive', 'file=' + image_path + ',if=sd,format=raw', |
41 | - return do_frint_mode(s, a, float_round_ties_away, frint_fns[a->esz]); | 45 | + '-nic', 'user', |
42 | -} | 46 | + '-no-reboot') |
43 | +TRANS_FEAT(FRINTN, aa64_sve, do_frint_mode, a, | 47 | + self.vm.launch() |
44 | + float_round_nearest_even, frint_fns[a->esz]) | 48 | + |
45 | +TRANS_FEAT(FRINTP, aa64_sve, do_frint_mode, a, | 49 | + kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + |
46 | + float_round_up, frint_fns[a->esz]) | 50 | + 'usbcore.nousb ' |
47 | +TRANS_FEAT(FRINTM, aa64_sve, do_frint_mode, a, | 51 | + 'noreboot') |
48 | + float_round_down, frint_fns[a->esz]) | 52 | + |
49 | +TRANS_FEAT(FRINTZ, aa64_sve, do_frint_mode, a, | 53 | + self.wait_for_console_pattern('U-Boot SPL') |
50 | + float_round_to_zero, frint_fns[a->esz]) | 54 | + |
51 | +TRANS_FEAT(FRINTA, aa64_sve, do_frint_mode, a, | 55 | + interrupt_interactive_console_until_pattern( |
52 | + float_round_ties_away, frint_fns[a->esz]) | 56 | + self, 'Hit any key to stop autoboot:', '=>') |
53 | 57 | + exec_command_and_wait_for_pattern(self, "setenv extraargs '" + | |
54 | static gen_helper_gvec_3_ptr * const frecpx_fns[] = { | 58 | + kernel_command_line + "'", '=>') |
55 | NULL, gen_helper_sve_frecpx_h, | 59 | + exec_command_and_wait_for_pattern(self, 'boot', 'Starting kernel ...'); |
56 | @@ -XXX,XX +XXX,XX @@ TRANS_FEAT(FCVTLT_hs, aa64_sve2, gen_gvec_fpst_arg_zpz, | 60 | + |
57 | TRANS_FEAT(FCVTLT_sd, aa64_sve2, gen_gvec_fpst_arg_zpz, | 61 | + self.wait_for_console_pattern( |
58 | gen_helper_sve2_fcvtlt_sd, a, 0, FPST_FPCR) | 62 | + 'Please press Enter to activate this console.') |
59 | 63 | + | |
60 | -static bool trans_FCVTX_ds(DisasContext *s, arg_rpr_esz *a) | 64 | + exec_command_and_wait_for_pattern(self, ' ', 'root@') |
61 | -{ | 65 | + |
62 | - if (!dc_isar_feature(aa64_sve2, s)) { | 66 | + exec_command_and_wait_for_pattern(self, 'cat /proc/cpuinfo', |
63 | - return false; | 67 | + 'Allwinner sun4i/sun5i') |
64 | - } | 68 | + # cubieboard's reboot is not functioning; omit reboot test. |
65 | - return do_frint_mode(s, a, float_round_to_odd, gen_helper_sve_fcvt_ds); | 69 | + |
66 | -} | 70 | @skipUnless(os.getenv('AVOCADO_TIMEOUT_EXPECTED'), 'Test might timeout') |
67 | - | 71 | def test_arm_quanta_gsj(self): |
68 | -static bool trans_FCVTXNT_ds(DisasContext *s, arg_rpr_esz *a) | 72 | """ |
69 | -{ | ||
70 | - if (!dc_isar_feature(aa64_sve2, s)) { | ||
71 | - return false; | ||
72 | - } | ||
73 | - return do_frint_mode(s, a, float_round_to_odd, gen_helper_sve2_fcvtnt_ds); | ||
74 | -} | ||
75 | +TRANS_FEAT(FCVTX_ds, aa64_sve2, do_frint_mode, a, | ||
76 | + float_round_to_odd, gen_helper_sve_fcvt_ds) | ||
77 | +TRANS_FEAT(FCVTXNT_ds, aa64_sve2, do_frint_mode, a, | ||
78 | + float_round_to_odd, gen_helper_sve2_fcvtnt_ds) | ||
79 | |||
80 | static bool trans_FLOGB(DisasContext *s, arg_rpr_esz *a) | ||
81 | { | ||
82 | -- | 73 | -- |
83 | 2.25.1 | 74 | 2.34.1 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Richard Henderson <richard.henderson@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | This is in line with how we treat uzp, and will | 3 | Don't dereference CPUTLBEntryFull until we verify that |
4 | eliminate the special case code during translation. | 4 | the page is valid. Move the other user-only info field |
5 | updates after the valid check to match. | ||
5 | 6 | ||
7 | Cc: qemu-stable@nongnu.org | ||
8 | Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1412 | ||
6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 9 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
7 | Message-id: 20220527181907.189259-58-richard.henderson@linaro.org | 10 | Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> |
8 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 11 | Message-id: 20230104190056.305143-1-richard.henderson@linaro.org |
9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 12 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
10 | --- | 13 | --- |
11 | target/arm/sve_helper.c | 6 ++++-- | 14 | target/arm/sve_helper.c | 14 +++++++++----- |
12 | target/arm/translate-sve.c | 12 ++++++------ | 15 | 1 file changed, 9 insertions(+), 5 deletions(-) |
13 | 2 files changed, 10 insertions(+), 8 deletions(-) | ||
14 | 16 | ||
15 | diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c | 17 | diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c |
16 | index XXXXXXX..XXXXXXX 100644 | 18 | index XXXXXXX..XXXXXXX 100644 |
17 | --- a/target/arm/sve_helper.c | 19 | --- a/target/arm/sve_helper.c |
18 | +++ b/target/arm/sve_helper.c | 20 | +++ b/target/arm/sve_helper.c |
19 | @@ -XXX,XX +XXX,XX @@ void HELPER(sve_punpk_p)(void *vd, void *vn, uint32_t pred_desc) | 21 | @@ -XXX,XX +XXX,XX @@ bool sve_probe_page(SVEHostPage *info, bool nofault, CPUARMState *env, |
20 | void HELPER(NAME)(void *vd, void *vn, void *vm, uint32_t desc) \ | 22 | #ifdef CONFIG_USER_ONLY |
21 | { \ | 23 | flags = probe_access_flags(env, addr, access_type, mmu_idx, nofault, |
22 | intptr_t oprsz = simd_oprsz(desc); \ | 24 | &info->host, retaddr); |
23 | + intptr_t odd_ofs = simd_data(desc); \ | 25 | - memset(&info->attrs, 0, sizeof(info->attrs)); |
24 | intptr_t i, oprsz_2 = oprsz / 2; \ | 26 | - /* Require both ANON and MTE; see allocation_tag_mem(). */ |
25 | ARMVectorReg tmp_n, tmp_m; \ | 27 | - info->tagged = (flags & PAGE_ANON) && (flags & PAGE_MTE); |
26 | /* We produce output faster than we consume input. \ | 28 | #else |
27 | @@ -XXX,XX +XXX,XX @@ void HELPER(NAME)(void *vd, void *vn, void *vm, uint32_t desc) \ | 29 | CPUTLBEntryFull *full; |
28 | vm = memcpy(&tmp_m, vm, oprsz_2); \ | 30 | flags = probe_access_full(env, addr, access_type, mmu_idx, nofault, |
29 | } \ | 31 | &info->host, &full, retaddr); |
30 | for (i = 0; i < oprsz_2; i += sizeof(TYPE)) { \ | 32 | - info->attrs = full->attrs; |
31 | - *(TYPE *)(vd + H(2 * i + 0)) = *(TYPE *)(vn + H(i)); \ | 33 | - info->tagged = full->pte_attrs == 0xf0; |
32 | - *(TYPE *)(vd + H(2 * i + sizeof(TYPE))) = *(TYPE *)(vm + H(i)); \ | 34 | #endif |
33 | + *(TYPE *)(vd + H(2 * i + 0)) = *(TYPE *)(vn + odd_ofs + H(i)); \ | 35 | info->flags = flags; |
34 | + *(TYPE *)(vd + H(2 * i + sizeof(TYPE))) = \ | 36 | |
35 | + *(TYPE *)(vm + odd_ofs + H(i)); \ | 37 | @@ -XXX,XX +XXX,XX @@ bool sve_probe_page(SVEHostPage *info, bool nofault, CPUARMState *env, |
36 | } \ | 38 | return false; |
37 | if (sizeof(TYPE) == 16 && unlikely(oprsz & 16)) { \ | ||
38 | memset(vd + oprsz - 16, 0, 16); \ | ||
39 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
40 | index XXXXXXX..XXXXXXX 100644 | ||
41 | --- a/target/arm/translate-sve.c | ||
42 | +++ b/target/arm/translate-sve.c | ||
43 | @@ -XXX,XX +XXX,XX @@ static bool do_zip(DisasContext *s, arg_rrr_esz *a, bool high) | ||
44 | unsigned vsz = vec_full_reg_size(s); | ||
45 | unsigned high_ofs = high ? vsz / 2 : 0; | ||
46 | tcg_gen_gvec_3_ool(vec_full_reg_offset(s, a->rd), | ||
47 | - vec_full_reg_offset(s, a->rn) + high_ofs, | ||
48 | - vec_full_reg_offset(s, a->rm) + high_ofs, | ||
49 | - vsz, vsz, 0, fns[a->esz]); | ||
50 | + vec_full_reg_offset(s, a->rn), | ||
51 | + vec_full_reg_offset(s, a->rm), | ||
52 | + vsz, vsz, high_ofs, fns[a->esz]); | ||
53 | } | 39 | } |
40 | |||
41 | +#ifdef CONFIG_USER_ONLY | ||
42 | + memset(&info->attrs, 0, sizeof(info->attrs)); | ||
43 | + /* Require both ANON and MTE; see allocation_tag_mem(). */ | ||
44 | + info->tagged = (flags & PAGE_ANON) && (flags & PAGE_MTE); | ||
45 | +#else | ||
46 | + info->attrs = full->attrs; | ||
47 | + info->tagged = full->pte_attrs == 0xf0; | ||
48 | +#endif | ||
49 | + | ||
50 | /* Ensure that info->host[] is relative to addr, not addr + mem_off. */ | ||
51 | info->host -= mem_off; | ||
54 | return true; | 52 | return true; |
55 | } | ||
56 | @@ -XXX,XX +XXX,XX @@ static bool do_zip_q(DisasContext *s, arg_rrr_esz *a, bool high) | ||
57 | unsigned vsz = vec_full_reg_size(s); | ||
58 | unsigned high_ofs = high ? QEMU_ALIGN_DOWN(vsz, 32) / 2 : 0; | ||
59 | tcg_gen_gvec_3_ool(vec_full_reg_offset(s, a->rd), | ||
60 | - vec_full_reg_offset(s, a->rn) + high_ofs, | ||
61 | - vec_full_reg_offset(s, a->rm) + high_ofs, | ||
62 | - vsz, vsz, 0, gen_helper_sve2_zip_q); | ||
63 | + vec_full_reg_offset(s, a->rn), | ||
64 | + vec_full_reg_offset(s, a->rm), | ||
65 | + vsz, vsz, high_ofs, gen_helper_sve2_zip_q); | ||
66 | } | ||
67 | return true; | ||
68 | } | ||
69 | -- | 53 | -- |
70 | 2.25.1 | 54 | 2.34.1 |
55 | |||
56 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Philippe Mathieu-Daudé <philmd@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 3 | Since pxa255_init() must map the device in the system memory, |
4 | Message-id: 20220527181907.189259-91-richard.henderson@linaro.org | 4 | there is no point in passing get_system_memory() by argument. |
5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 5 | |
6 | Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> | ||
7 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
8 | Message-id: 20230109115316.2235-2-philmd@linaro.org | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
7 | --- | 10 | --- |
8 | target/arm/translate-sve.c | 14 ++++++-------- | 11 | include/hw/arm/pxa.h | 2 +- |
9 | 1 file changed, 6 insertions(+), 8 deletions(-) | 12 | hw/arm/gumstix.c | 3 +-- |
13 | hw/arm/pxa2xx.c | 4 +++- | ||
14 | hw/arm/tosa.c | 2 +- | ||
15 | 4 files changed, 6 insertions(+), 5 deletions(-) | ||
10 | 16 | ||
11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | 17 | diff --git a/include/hw/arm/pxa.h b/include/hw/arm/pxa.h |
12 | index XXXXXXX..XXXXXXX 100644 | 18 | index XXXXXXX..XXXXXXX 100644 |
13 | --- a/target/arm/translate-sve.c | 19 | --- a/include/hw/arm/pxa.h |
14 | +++ b/target/arm/translate-sve.c | 20 | +++ b/include/hw/arm/pxa.h |
15 | @@ -XXX,XX +XXX,XX @@ static bool do_reduce(DisasContext *s, arg_rpr_esz *a, | 21 | @@ -XXX,XX +XXX,XX @@ struct PXA2xxI2SState { |
22 | |||
23 | PXA2xxState *pxa270_init(MemoryRegion *address_space, unsigned int sdram_size, | ||
24 | const char *revision); | ||
25 | -PXA2xxState *pxa255_init(MemoryRegion *address_space, unsigned int sdram_size); | ||
26 | +PXA2xxState *pxa255_init(unsigned int sdram_size); | ||
27 | |||
28 | #endif /* PXA_H */ | ||
29 | diff --git a/hw/arm/gumstix.c b/hw/arm/gumstix.c | ||
30 | index XXXXXXX..XXXXXXX 100644 | ||
31 | --- a/hw/arm/gumstix.c | ||
32 | +++ b/hw/arm/gumstix.c | ||
33 | @@ -XXX,XX +XXX,XX @@ static void connex_init(MachineState *machine) | ||
34 | { | ||
35 | PXA2xxState *cpu; | ||
36 | DriveInfo *dinfo; | ||
37 | - MemoryRegion *address_space_mem = get_system_memory(); | ||
38 | |||
39 | uint32_t connex_rom = 0x01000000; | ||
40 | uint32_t connex_ram = 0x04000000; | ||
41 | |||
42 | - cpu = pxa255_init(address_space_mem, connex_ram); | ||
43 | + cpu = pxa255_init(connex_ram); | ||
44 | |||
45 | dinfo = drive_get(IF_PFLASH, 0, 0); | ||
46 | if (!dinfo && !qtest_enabled()) { | ||
47 | diff --git a/hw/arm/pxa2xx.c b/hw/arm/pxa2xx.c | ||
48 | index XXXXXXX..XXXXXXX 100644 | ||
49 | --- a/hw/arm/pxa2xx.c | ||
50 | +++ b/hw/arm/pxa2xx.c | ||
51 | @@ -XXX,XX +XXX,XX @@ | ||
52 | #include "qemu/error-report.h" | ||
53 | #include "qemu/module.h" | ||
54 | #include "qapi/error.h" | ||
55 | +#include "exec/address-spaces.h" | ||
56 | #include "cpu.h" | ||
57 | #include "hw/sysbus.h" | ||
58 | #include "migration/vmstate.h" | ||
59 | @@ -XXX,XX +XXX,XX @@ PXA2xxState *pxa270_init(MemoryRegion *address_space, | ||
16 | } | 60 | } |
17 | 61 | ||
18 | #define DO_VPZ(NAME, name) \ | 62 | /* Initialise a PXA255 integrated chip (ARM based core). */ |
19 | -static bool trans_##NAME(DisasContext *s, arg_rpr_esz *a) \ | 63 | -PXA2xxState *pxa255_init(MemoryRegion *address_space, unsigned int sdram_size) |
20 | -{ \ | 64 | +PXA2xxState *pxa255_init(unsigned int sdram_size) |
21 | - static gen_helper_fp_reduce * const fns[4] = { \ | 65 | { |
22 | - NULL, gen_helper_sve_##name##_h, \ | 66 | + MemoryRegion *address_space = get_system_memory(); |
23 | - gen_helper_sve_##name##_s, \ | 67 | PXA2xxState *s; |
24 | - gen_helper_sve_##name##_d, \ | 68 | int i; |
25 | + static gen_helper_fp_reduce * const name##_fns[4] = { \ | 69 | DriveInfo *dinfo; |
26 | + NULL, gen_helper_sve_##name##_h, \ | 70 | diff --git a/hw/arm/tosa.c b/hw/arm/tosa.c |
27 | + gen_helper_sve_##name##_s, gen_helper_sve_##name##_d, \ | 71 | index XXXXXXX..XXXXXXX 100644 |
28 | }; \ | 72 | --- a/hw/arm/tosa.c |
29 | - return do_reduce(s, a, fns[a->esz]); \ | 73 | +++ b/hw/arm/tosa.c |
30 | -} | 74 | @@ -XXX,XX +XXX,XX @@ static void tosa_init(MachineState *machine) |
31 | + TRANS_FEAT(NAME, aa64_sve, do_reduce, a, name##_fns[a->esz]) | 75 | TC6393xbState *tmio; |
32 | 76 | DeviceState *scp0, *scp1; | |
33 | DO_VPZ(FADDV, faddv) | 77 | |
34 | DO_VPZ(FMINNMV, fminnmv) | 78 | - mpu = pxa255_init(address_space_mem, tosa_binfo.ram_size); |
35 | @@ -XXX,XX +XXX,XX @@ DO_VPZ(FMAXNMV, fmaxnmv) | 79 | + mpu = pxa255_init(tosa_binfo.ram_size); |
36 | DO_VPZ(FMINV, fminv) | 80 | |
37 | DO_VPZ(FMAXV, fmaxv) | 81 | memory_region_init_rom(rom, NULL, "tosa.rom", TOSA_ROM, &error_fatal); |
38 | 82 | memory_region_add_subregion(address_space_mem, 0, rom); | |
39 | +#undef DO_VPZ | ||
40 | + | ||
41 | /* | ||
42 | *** SVE Floating Point Unary Operations - Unpredicated Group | ||
43 | */ | ||
44 | -- | 83 | -- |
45 | 2.25.1 | 84 | 2.34.1 |
85 | |||
86 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Philippe Mathieu-Daudé <philmd@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | Rename the function to match gen_gvec_ool_arg_zzz, | 3 | Since pxa270_init() must map the device in the system memory, |
4 | and move to be adjacent. Split out gen_gvec_fpst_zzz | 4 | there is no point in passing get_system_memory() by argument. |
5 | as a helper while we're at it. | ||
6 | 5 | ||
7 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 6 | Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> |
8 | Message-id: 20220527181907.189259-86-richard.henderson@linaro.org | 7 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> |
9 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 8 | Message-id: 20230109115316.2235-3-philmd@linaro.org |
10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
11 | --- | 10 | --- |
12 | target/arm/translate-sve.c | 50 +++++++++++++++++++++++--------------- | 11 | include/hw/arm/pxa.h | 3 +-- |
13 | 1 file changed, 30 insertions(+), 20 deletions(-) | 12 | hw/arm/gumstix.c | 3 +-- |
13 | hw/arm/mainstone.c | 10 ++++------ | ||
14 | hw/arm/pxa2xx.c | 4 ++-- | ||
15 | hw/arm/spitz.c | 6 ++---- | ||
16 | hw/arm/z2.c | 3 +-- | ||
17 | 6 files changed, 11 insertions(+), 18 deletions(-) | ||
14 | 18 | ||
15 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | 19 | diff --git a/include/hw/arm/pxa.h b/include/hw/arm/pxa.h |
16 | index XXXXXXX..XXXXXXX 100644 | 20 | index XXXXXXX..XXXXXXX 100644 |
17 | --- a/target/arm/translate-sve.c | 21 | --- a/include/hw/arm/pxa.h |
18 | +++ b/target/arm/translate-sve.c | 22 | +++ b/include/hw/arm/pxa.h |
19 | @@ -XXX,XX +XXX,XX @@ static bool gen_gvec_ool_arg_zzz(DisasContext *s, gen_helper_gvec_3 *fn, | 23 | @@ -XXX,XX +XXX,XX @@ struct PXA2xxI2SState { |
20 | return gen_gvec_ool_zzz(s, fn, a->rd, a->rn, a->rm, data); | 24 | |
25 | # define PA_FMT "0x%08lx" | ||
26 | |||
27 | -PXA2xxState *pxa270_init(MemoryRegion *address_space, unsigned int sdram_size, | ||
28 | - const char *revision); | ||
29 | +PXA2xxState *pxa270_init(unsigned int sdram_size, const char *revision); | ||
30 | PXA2xxState *pxa255_init(unsigned int sdram_size); | ||
31 | |||
32 | #endif /* PXA_H */ | ||
33 | diff --git a/hw/arm/gumstix.c b/hw/arm/gumstix.c | ||
34 | index XXXXXXX..XXXXXXX 100644 | ||
35 | --- a/hw/arm/gumstix.c | ||
36 | +++ b/hw/arm/gumstix.c | ||
37 | @@ -XXX,XX +XXX,XX @@ static void verdex_init(MachineState *machine) | ||
38 | { | ||
39 | PXA2xxState *cpu; | ||
40 | DriveInfo *dinfo; | ||
41 | - MemoryRegion *address_space_mem = get_system_memory(); | ||
42 | |||
43 | uint32_t verdex_rom = 0x02000000; | ||
44 | uint32_t verdex_ram = 0x10000000; | ||
45 | |||
46 | - cpu = pxa270_init(address_space_mem, verdex_ram, machine->cpu_type); | ||
47 | + cpu = pxa270_init(verdex_ram, machine->cpu_type); | ||
48 | |||
49 | dinfo = drive_get(IF_PFLASH, 0, 0); | ||
50 | if (!dinfo && !qtest_enabled()) { | ||
51 | diff --git a/hw/arm/mainstone.c b/hw/arm/mainstone.c | ||
52 | index XXXXXXX..XXXXXXX 100644 | ||
53 | --- a/hw/arm/mainstone.c | ||
54 | +++ b/hw/arm/mainstone.c | ||
55 | @@ -XXX,XX +XXX,XX @@ static struct arm_boot_info mainstone_binfo = { | ||
56 | .ram_size = 0x04000000, | ||
57 | }; | ||
58 | |||
59 | -static void mainstone_common_init(MemoryRegion *address_space_mem, | ||
60 | - MachineState *machine, | ||
61 | +static void mainstone_common_init(MachineState *machine, | ||
62 | enum mainstone_model_e model, int arm_id) | ||
63 | { | ||
64 | uint32_t sector_len = 256 * 1024; | ||
65 | @@ -XXX,XX +XXX,XX @@ static void mainstone_common_init(MemoryRegion *address_space_mem, | ||
66 | MemoryRegion *rom = g_new(MemoryRegion, 1); | ||
67 | |||
68 | /* Setup CPU & memory */ | ||
69 | - mpu = pxa270_init(address_space_mem, mainstone_binfo.ram_size, | ||
70 | - machine->cpu_type); | ||
71 | + mpu = pxa270_init(mainstone_binfo.ram_size, machine->cpu_type); | ||
72 | memory_region_init_rom(rom, NULL, "mainstone.rom", MAINSTONE_ROM, | ||
73 | &error_fatal); | ||
74 | - memory_region_add_subregion(address_space_mem, 0, rom); | ||
75 | + memory_region_add_subregion(get_system_memory(), 0x00000000, rom); | ||
76 | |||
77 | /* There are two 32MiB flash devices on the board */ | ||
78 | for (i = 0; i < 2; i ++) { | ||
79 | @@ -XXX,XX +XXX,XX @@ static void mainstone_common_init(MemoryRegion *address_space_mem, | ||
80 | |||
81 | static void mainstone_init(MachineState *machine) | ||
82 | { | ||
83 | - mainstone_common_init(get_system_memory(), machine, mainstone, 0x196); | ||
84 | + mainstone_common_init(machine, mainstone, 0x196); | ||
21 | } | 85 | } |
22 | 86 | ||
23 | +/* Invoke an out-of-line helper on 3 Zregs, plus float_status. */ | 87 | static void mainstone2_machine_init(MachineClass *mc) |
24 | +static bool gen_gvec_fpst_zzz(DisasContext *s, gen_helper_gvec_3_ptr *fn, | 88 | diff --git a/hw/arm/pxa2xx.c b/hw/arm/pxa2xx.c |
25 | + int rd, int rn, int rm, | 89 | index XXXXXXX..XXXXXXX 100644 |
26 | + int data, ARMFPStatusFlavour flavour) | 90 | --- a/hw/arm/pxa2xx.c |
27 | +{ | 91 | +++ b/hw/arm/pxa2xx.c |
28 | + if (fn == NULL) { | 92 | @@ -XXX,XX +XXX,XX @@ static void pxa2xx_reset(void *opaque, int line, int level) |
29 | + return false; | ||
30 | + } | ||
31 | + if (sve_access_check(s)) { | ||
32 | + unsigned vsz = vec_full_reg_size(s); | ||
33 | + TCGv_ptr status = fpstatus_ptr(flavour); | ||
34 | + | ||
35 | + tcg_gen_gvec_3_ptr(vec_full_reg_offset(s, rd), | ||
36 | + vec_full_reg_offset(s, rn), | ||
37 | + vec_full_reg_offset(s, rm), | ||
38 | + status, vsz, vsz, data, fn); | ||
39 | + | ||
40 | + tcg_temp_free_ptr(status); | ||
41 | + } | ||
42 | + return true; | ||
43 | +} | ||
44 | + | ||
45 | +static bool gen_gvec_fpst_arg_zzz(DisasContext *s, gen_helper_gvec_3_ptr *fn, | ||
46 | + arg_rrr_esz *a, int data) | ||
47 | +{ | ||
48 | + return gen_gvec_fpst_zzz(s, fn, a->rd, a->rn, a->rm, data, | ||
49 | + a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); | ||
50 | +} | ||
51 | + | ||
52 | /* Invoke an out-of-line helper on 4 Zregs. */ | ||
53 | static bool gen_gvec_ool_zzzz(DisasContext *s, gen_helper_gvec_4 *fn, | ||
54 | int rd, int rn, int rm, int ra, int data) | ||
55 | @@ -XXX,XX +XXX,XX @@ static bool trans_FADDA(DisasContext *s, arg_rprr_esz *a) | ||
56 | *** SVE Floating Point Arithmetic - Unpredicated Group | ||
57 | */ | ||
58 | |||
59 | -static bool do_zzz_fp(DisasContext *s, arg_rrr_esz *a, | ||
60 | - gen_helper_gvec_3_ptr *fn) | ||
61 | -{ | ||
62 | - if (fn == NULL) { | ||
63 | - return false; | ||
64 | - } | ||
65 | - if (sve_access_check(s)) { | ||
66 | - unsigned vsz = vec_full_reg_size(s); | ||
67 | - TCGv_ptr status = fpstatus_ptr(a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); | ||
68 | - tcg_gen_gvec_3_ptr(vec_full_reg_offset(s, a->rd), | ||
69 | - vec_full_reg_offset(s, a->rn), | ||
70 | - vec_full_reg_offset(s, a->rm), | ||
71 | - status, vsz, vsz, 0, fn); | ||
72 | - tcg_temp_free_ptr(status); | ||
73 | - } | ||
74 | - return true; | ||
75 | -} | ||
76 | - | ||
77 | - | ||
78 | #define DO_FP3(NAME, name) \ | ||
79 | static bool trans_##NAME(DisasContext *s, arg_rrr_esz *a) \ | ||
80 | { \ | ||
81 | @@ -XXX,XX +XXX,XX @@ static bool trans_##NAME(DisasContext *s, arg_rrr_esz *a) \ | ||
82 | NULL, gen_helper_gvec_##name##_h, \ | ||
83 | gen_helper_gvec_##name##_s, gen_helper_gvec_##name##_d \ | ||
84 | }; \ | ||
85 | - return do_zzz_fp(s, a, fns[a->esz]); \ | ||
86 | + return gen_gvec_fpst_arg_zzz(s, fns[a->esz], a, 0); \ | ||
87 | } | 93 | } |
88 | 94 | ||
89 | DO_FP3(FADD_zzz, fadd) | 95 | /* Initialise a PXA270 integrated chip (ARM based core). */ |
96 | -PXA2xxState *pxa270_init(MemoryRegion *address_space, | ||
97 | - unsigned int sdram_size, const char *cpu_type) | ||
98 | +PXA2xxState *pxa270_init(unsigned int sdram_size, const char *cpu_type) | ||
99 | { | ||
100 | + MemoryRegion *address_space = get_system_memory(); | ||
101 | PXA2xxState *s; | ||
102 | int i; | ||
103 | DriveInfo *dinfo; | ||
104 | diff --git a/hw/arm/spitz.c b/hw/arm/spitz.c | ||
105 | index XXXXXXX..XXXXXXX 100644 | ||
106 | --- a/hw/arm/spitz.c | ||
107 | +++ b/hw/arm/spitz.c | ||
108 | @@ -XXX,XX +XXX,XX @@ static void spitz_common_init(MachineState *machine) | ||
109 | SpitzMachineState *sms = SPITZ_MACHINE(machine); | ||
110 | enum spitz_model_e model = smc->model; | ||
111 | PXA2xxState *mpu; | ||
112 | - MemoryRegion *address_space_mem = get_system_memory(); | ||
113 | MemoryRegion *rom = g_new(MemoryRegion, 1); | ||
114 | |||
115 | /* Setup CPU & memory */ | ||
116 | - mpu = pxa270_init(address_space_mem, spitz_binfo.ram_size, | ||
117 | - machine->cpu_type); | ||
118 | + mpu = pxa270_init(spitz_binfo.ram_size, machine->cpu_type); | ||
119 | sms->mpu = mpu; | ||
120 | |||
121 | sl_flash_register(mpu, (model == spitz) ? FLASH_128M : FLASH_1024M); | ||
122 | |||
123 | memory_region_init_rom(rom, NULL, "spitz.rom", SPITZ_ROM, &error_fatal); | ||
124 | - memory_region_add_subregion(address_space_mem, 0, rom); | ||
125 | + memory_region_add_subregion(get_system_memory(), 0, rom); | ||
126 | |||
127 | /* Setup peripherals */ | ||
128 | spitz_keyboard_register(mpu); | ||
129 | diff --git a/hw/arm/z2.c b/hw/arm/z2.c | ||
130 | index XXXXXXX..XXXXXXX 100644 | ||
131 | --- a/hw/arm/z2.c | ||
132 | +++ b/hw/arm/z2.c | ||
133 | @@ -XXX,XX +XXX,XX @@ static const TypeInfo aer915_info = { | ||
134 | |||
135 | static void z2_init(MachineState *machine) | ||
136 | { | ||
137 | - MemoryRegion *address_space_mem = get_system_memory(); | ||
138 | uint32_t sector_len = 0x10000; | ||
139 | PXA2xxState *mpu; | ||
140 | DriveInfo *dinfo; | ||
141 | @@ -XXX,XX +XXX,XX @@ static void z2_init(MachineState *machine) | ||
142 | DeviceState *wm; | ||
143 | |||
144 | /* Setup CPU & memory */ | ||
145 | - mpu = pxa270_init(address_space_mem, z2_binfo.ram_size, machine->cpu_type); | ||
146 | + mpu = pxa270_init(z2_binfo.ram_size, machine->cpu_type); | ||
147 | |||
148 | dinfo = drive_get(IF_PFLASH, 0, 0); | ||
149 | if (!pflash_cfi01_register(Z2_FLASH_BASE, "z2.flash0", Z2_FLASH_SIZE, | ||
90 | -- | 150 | -- |
91 | 2.25.1 | 151 | 2.34.1 |
152 | |||
153 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Philippe Mathieu-Daudé <philmd@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | Use gen_gvec_ool_arg_zzzz instead of gen_gvec_ool_zzzz | 3 | IEC binary prefixes ease code review: the unit is explicit. |
4 | when the arguments come from arg_rrrr_esz. | ||
5 | 4 | ||
6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 5 | Add definitions for RAM / Flash / Flash blocksize. |
7 | Message-id: 20220527181907.189259-11-richard.henderson@linaro.org | 6 | |
8 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 7 | Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> |
8 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
9 | Message-id: 20230109115316.2235-4-philmd@linaro.org | ||
9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
10 | --- | 11 | --- |
11 | target/arm/translate-sve.c | 16 ++++++++++------ | 12 | hw/arm/collie.c | 16 ++++++++++------ |
12 | 1 file changed, 10 insertions(+), 6 deletions(-) | 13 | 1 file changed, 10 insertions(+), 6 deletions(-) |
13 | 14 | ||
14 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | 15 | diff --git a/hw/arm/collie.c b/hw/arm/collie.c |
15 | index XXXXXXX..XXXXXXX 100644 | 16 | index XXXXXXX..XXXXXXX 100644 |
16 | --- a/target/arm/translate-sve.c | 17 | --- a/hw/arm/collie.c |
17 | +++ b/target/arm/translate-sve.c | 18 | +++ b/hw/arm/collie.c |
18 | @@ -XXX,XX +XXX,XX @@ static bool gen_gvec_ool_zzzz(DisasContext *s, gen_helper_gvec_4 *fn, | 19 | @@ -XXX,XX +XXX,XX @@ |
19 | return true; | 20 | #include "cpu.h" |
21 | #include "qom/object.h" | ||
22 | |||
23 | +#define RAM_SIZE (512 * MiB) | ||
24 | +#define FLASH_SIZE (32 * MiB) | ||
25 | +#define FLASH_SECTOR_SIZE (64 * KiB) | ||
26 | + | ||
27 | struct CollieMachineState { | ||
28 | MachineState parent; | ||
29 | |||
30 | @@ -XXX,XX +XXX,XX @@ OBJECT_DECLARE_SIMPLE_TYPE(CollieMachineState, COLLIE_MACHINE) | ||
31 | |||
32 | static struct arm_boot_info collie_binfo = { | ||
33 | .loader_start = SA_SDCS0, | ||
34 | - .ram_size = 0x20000000, | ||
35 | + .ram_size = RAM_SIZE, | ||
36 | }; | ||
37 | |||
38 | static void collie_init(MachineState *machine) | ||
39 | @@ -XXX,XX +XXX,XX @@ static void collie_init(MachineState *machine) | ||
40 | memory_region_add_subregion(get_system_memory(), SA_SDCS0, machine->ram); | ||
41 | |||
42 | dinfo = drive_get(IF_PFLASH, 0, 0); | ||
43 | - pflash_cfi01_register(SA_CS0, "collie.fl1", 0x02000000, | ||
44 | + pflash_cfi01_register(SA_CS0, "collie.fl1", FLASH_SIZE, | ||
45 | dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, | ||
46 | - 64 * KiB, 4, 0x00, 0x00, 0x00, 0x00, 0); | ||
47 | + FLASH_SECTOR_SIZE, 4, 0x00, 0x00, 0x00, 0x00, 0); | ||
48 | |||
49 | dinfo = drive_get(IF_PFLASH, 0, 1); | ||
50 | - pflash_cfi01_register(SA_CS1, "collie.fl2", 0x02000000, | ||
51 | + pflash_cfi01_register(SA_CS1, "collie.fl2", FLASH_SIZE, | ||
52 | dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, | ||
53 | - 64 * KiB, 4, 0x00, 0x00, 0x00, 0x00, 0); | ||
54 | + FLASH_SECTOR_SIZE, 4, 0x00, 0x00, 0x00, 0x00, 0); | ||
55 | |||
56 | sysbus_create_simple("scoop", 0x40800000, NULL); | ||
57 | |||
58 | @@ -XXX,XX +XXX,XX @@ static void collie_machine_class_init(ObjectClass *oc, void *data) | ||
59 | mc->init = collie_init; | ||
60 | mc->ignore_memory_transaction_failures = true; | ||
61 | mc->default_cpu_type = ARM_CPU_TYPE_NAME("sa1110"); | ||
62 | - mc->default_ram_size = 0x20000000; | ||
63 | + mc->default_ram_size = RAM_SIZE; | ||
64 | mc->default_ram_id = "strongarm.sdram"; | ||
20 | } | 65 | } |
21 | 66 | ||
22 | +static bool gen_gvec_ool_arg_zzzz(DisasContext *s, gen_helper_gvec_4 *fn, | ||
23 | + arg_rrrr_esz *a, int data) | ||
24 | +{ | ||
25 | + return gen_gvec_ool_zzzz(s, fn, a->rd, a->rn, a->rm, a->ra, data); | ||
26 | +} | ||
27 | + | ||
28 | /* Invoke an out-of-line helper on 2 Zregs and a predicate. */ | ||
29 | static void gen_gvec_ool_zzp(DisasContext *s, gen_helper_gvec_3 *fn, | ||
30 | int rd, int rn, int pg, int data) | ||
31 | @@ -XXX,XX +XXX,XX @@ static bool do_sve2_zzzz_ool(DisasContext *s, arg_rrrr_esz *a, | ||
32 | if (!dc_isar_feature(aa64_sve2, s)) { | ||
33 | return false; | ||
34 | } | ||
35 | - return gen_gvec_ool_zzzz(s, fn, a->rd, a->rn, a->rm, a->ra, data); | ||
36 | + return gen_gvec_ool_arg_zzzz(s, fn, a, data); | ||
37 | } | ||
38 | |||
39 | static bool do_abal(DisasContext *s, arg_rrrr_esz *a, bool uns, bool sel) | ||
40 | @@ -XXX,XX +XXX,XX @@ static bool do_i8mm_zzzz_ool(DisasContext *s, arg_rrrr_esz *a, | ||
41 | if (!dc_isar_feature(aa64_sve_i8mm, s)) { | ||
42 | return false; | ||
43 | } | ||
44 | - return gen_gvec_ool_zzzz(s, fn, a->rd, a->rn, a->rm, a->ra, data); | ||
45 | + return gen_gvec_ool_arg_zzzz(s, fn, a, data); | ||
46 | } | ||
47 | |||
48 | static bool trans_SMMLA(DisasContext *s, arg_rrrr_esz *a) | ||
49 | @@ -XXX,XX +XXX,XX @@ static bool trans_BFDOT_zzzz(DisasContext *s, arg_rrrr_esz *a) | ||
50 | if (!dc_isar_feature(aa64_sve_bf16, s)) { | ||
51 | return false; | ||
52 | } | ||
53 | - return gen_gvec_ool_zzzz(s, gen_helper_gvec_bfdot, | ||
54 | - a->rd, a->rn, a->rm, a->ra, 0); | ||
55 | + return gen_gvec_ool_arg_zzzz(s, gen_helper_gvec_bfdot, a, 0); | ||
56 | } | ||
57 | |||
58 | static bool trans_BFDOT_zzxz(DisasContext *s, arg_rrxr_esz *a) | ||
59 | @@ -XXX,XX +XXX,XX @@ static bool trans_BFMMLA(DisasContext *s, arg_rrrr_esz *a) | ||
60 | if (!dc_isar_feature(aa64_sve_bf16, s)) { | ||
61 | return false; | ||
62 | } | ||
63 | - return gen_gvec_ool_zzzz(s, gen_helper_gvec_bfmmla, | ||
64 | - a->rd, a->rn, a->rm, a->ra, 0); | ||
65 | + return gen_gvec_ool_arg_zzzz(s, gen_helper_gvec_bfmmla, a, 0); | ||
66 | } | ||
67 | |||
68 | static bool do_BFMLAL_zzzw(DisasContext *s, arg_rrrr_esz *a, bool sel) | ||
69 | -- | 67 | -- |
70 | 2.25.1 | 68 | 2.34.1 |
69 | |||
70 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Philippe Mathieu-Daudé <philmd@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 3 | Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> |
4 | Message-id: 20220527181907.189259-44-richard.henderson@linaro.org | 4 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> |
5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 5 | Message-id: 20230109115316.2235-5-philmd@linaro.org |
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
7 | --- | 7 | --- |
8 | target/arm/translate-sve.c | 20 +++++++------------- | 8 | hw/arm/collie.c | 17 +++++++---------- |
9 | 1 file changed, 7 insertions(+), 13 deletions(-) | 9 | 1 file changed, 7 insertions(+), 10 deletions(-) |
10 | 10 | ||
11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | 11 | diff --git a/hw/arm/collie.c b/hw/arm/collie.c |
12 | index XXXXXXX..XXXXXXX 100644 | 12 | index XXXXXXX..XXXXXXX 100644 |
13 | --- a/target/arm/translate-sve.c | 13 | --- a/hw/arm/collie.c |
14 | +++ b/target/arm/translate-sve.c | 14 | +++ b/hw/arm/collie.c |
15 | @@ -XXX,XX +XXX,XX @@ static bool do_vpz_ool(DisasContext *s, arg_rpr_esz *a, | 15 | @@ -XXX,XX +XXX,XX @@ static struct arm_boot_info collie_binfo = { |
16 | } | 16 | |
17 | 17 | static void collie_init(MachineState *machine) | |
18 | #define DO_VPZ(NAME, name) \ | 18 | { |
19 | -static bool trans_##NAME(DisasContext *s, arg_rpr_esz *a) \ | 19 | - DriveInfo *dinfo; |
20 | -{ \ | 20 | MachineClass *mc = MACHINE_GET_CLASS(machine); |
21 | - static gen_helper_gvec_reduc * const fns[4] = { \ | 21 | CollieMachineState *cms = COLLIE_MACHINE(machine); |
22 | + static gen_helper_gvec_reduc * const name##_fns[4] = { \ | 22 | |
23 | gen_helper_sve_##name##_b, gen_helper_sve_##name##_h, \ | 23 | @@ -XXX,XX +XXX,XX @@ static void collie_init(MachineState *machine) |
24 | gen_helper_sve_##name##_s, gen_helper_sve_##name##_d, \ | 24 | |
25 | }; \ | 25 | memory_region_add_subregion(get_system_memory(), SA_SDCS0, machine->ram); |
26 | - return do_vpz_ool(s, a, fns[a->esz]); \ | 26 | |
27 | -} | 27 | - dinfo = drive_get(IF_PFLASH, 0, 0); |
28 | + TRANS_FEAT(NAME, aa64_sve, do_vpz_ool, a, name##_fns[a->esz]) | 28 | - pflash_cfi01_register(SA_CS0, "collie.fl1", FLASH_SIZE, |
29 | 29 | - dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, | |
30 | DO_VPZ(ORV, orv) | 30 | - FLASH_SECTOR_SIZE, 4, 0x00, 0x00, 0x00, 0x00, 0); |
31 | DO_VPZ(ANDV, andv) | 31 | - |
32 | @@ -XXX,XX +XXX,XX @@ DO_VPZ(UMAXV, umaxv) | 32 | - dinfo = drive_get(IF_PFLASH, 0, 1); |
33 | DO_VPZ(SMINV, sminv) | 33 | - pflash_cfi01_register(SA_CS1, "collie.fl2", FLASH_SIZE, |
34 | DO_VPZ(UMINV, uminv) | 34 | - dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, |
35 | 35 | - FLASH_SECTOR_SIZE, 4, 0x00, 0x00, 0x00, 0x00, 0); | |
36 | -static bool trans_SADDV(DisasContext *s, arg_rpr_esz *a) | 36 | + for (unsigned i = 0; i < 2; i++) { |
37 | -{ | 37 | + DriveInfo *dinfo = drive_get(IF_PFLASH, 0, i); |
38 | - static gen_helper_gvec_reduc * const fns[4] = { | 38 | + pflash_cfi01_register(i ? SA_CS1 : SA_CS0, |
39 | - gen_helper_sve_saddv_b, gen_helper_sve_saddv_h, | 39 | + i ? "collie.fl2" : "collie.fl1", FLASH_SIZE, |
40 | - gen_helper_sve_saddv_s, NULL | 40 | + dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, |
41 | - }; | 41 | + FLASH_SECTOR_SIZE, 4, 0x00, 0x00, 0x00, 0x00, 0); |
42 | - return do_vpz_ool(s, a, fns[a->esz]); | 42 | + } |
43 | -} | 43 | |
44 | +static gen_helper_gvec_reduc * const saddv_fns[4] = { | 44 | sysbus_create_simple("scoop", 0x40800000, NULL); |
45 | + gen_helper_sve_saddv_b, gen_helper_sve_saddv_h, | ||
46 | + gen_helper_sve_saddv_s, NULL | ||
47 | +}; | ||
48 | +TRANS_FEAT(SADDV, aa64_sve, do_vpz_ool, a, saddv_fns[a->esz]) | ||
49 | |||
50 | #undef DO_VPZ | ||
51 | 45 | ||
52 | -- | 46 | -- |
53 | 2.25.1 | 47 | 2.34.1 |
48 | |||
49 | diff view generated by jsdifflib |
1 | From: Philippe Mathieu-Daudé <f4bug@amsat.org> | 1 | From: Philippe Mathieu-Daudé <f4bug@amsat.org> |
---|---|---|---|
2 | 2 | ||
3 | Fix when building HVF on macOS Aarch64: | 3 | Add a comment describing the Connex uses a Numonyx RC28F128J3F75 |
4 | flash, and the Verdex uses a Micron RC28F256P30TFA. | ||
4 | 5 | ||
5 | target/arm/hvf/hvf.c:586:15: error: unknown type name 'ARMCPRegInfo'; did you mean 'ARMCPUInfo'? | 6 | Correct the Verdex machine description (we model the 'Pro' board). |
6 | const ARMCPRegInfo *ri; | ||
7 | ^~~~~~~~~~~~ | ||
8 | ARMCPUInfo | ||
9 | target/arm/cpu-qom.h:38:3: note: 'ARMCPUInfo' declared here | ||
10 | } ARMCPUInfo; | ||
11 | ^ | ||
12 | target/arm/hvf/hvf.c:589:14: error: implicit declaration of function 'get_arm_cp_reginfo' is invalid in C99 [-Werror,-Wimplicit-function-declaration] | ||
13 | ri = get_arm_cp_reginfo(arm_cpu->cp_regs, key); | ||
14 | ^ | ||
15 | target/arm/hvf/hvf.c:589:12: warning: incompatible integer to pointer conversion assigning to 'const ARMCPUInfo *' (aka 'const struct ARMCPUInfo *') from 'int' [-Wint-conversion] | ||
16 | ri = get_arm_cp_reginfo(arm_cpu->cp_regs, key); | ||
17 | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
18 | target/arm/hvf/hvf.c:591:26: error: no member named 'type' in 'struct ARMCPUInfo' | ||
19 | assert(!(ri->type & ARM_CP_NO_RAW)); | ||
20 | ~~ ^ | ||
21 | /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/assert.h:99:25: note: expanded from macro 'assert' | ||
22 | (__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __ASSERT_FILE_NAME, __LINE__, #e) : (void)0) | ||
23 | ^ | ||
24 | target/arm/hvf/hvf.c:591:33: error: use of undeclared identifier 'ARM_CP_NO_RAW' | ||
25 | assert(!(ri->type & ARM_CP_NO_RAW)); | ||
26 | ^ | ||
27 | 1 warning and 4 errors generated. | ||
28 | 7 | ||
29 | Fixes: cf7c6d1004 ("target/arm: Split out cpregs.h") | ||
30 | Reported-by: Duncan Bayne <duncan@bayne.id.au> | ||
31 | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | 8 | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> |
32 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | 9 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> |
33 | Message-id: 20220525161926.34233-1-philmd@fungible.com | 10 | Message-id: 20230109115316.2235-6-philmd@linaro.org |
34 | Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1029 | 11 | Message-Id: <20200223231044.8003-3-philmd@redhat.com> |
35 | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
36 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 12 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
37 | --- | 13 | --- |
38 | target/arm/hvf/hvf.c | 1 + | 14 | hw/arm/gumstix.c | 6 ++++-- |
39 | 1 file changed, 1 insertion(+) | 15 | 1 file changed, 4 insertions(+), 2 deletions(-) |
40 | 16 | ||
41 | diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c | 17 | diff --git a/hw/arm/gumstix.c b/hw/arm/gumstix.c |
42 | index XXXXXXX..XXXXXXX 100644 | 18 | index XXXXXXX..XXXXXXX 100644 |
43 | --- a/target/arm/hvf/hvf.c | 19 | --- a/hw/arm/gumstix.c |
44 | +++ b/target/arm/hvf/hvf.c | 20 | +++ b/hw/arm/gumstix.c |
45 | @@ -XXX,XX +XXX,XX @@ | 21 | @@ -XXX,XX +XXX,XX @@ |
46 | #include "sysemu/hvf_int.h" | 22 | * Contributions after 2012-01-13 are licensed under the terms of the |
47 | #include "sysemu/hw_accel.h" | 23 | * GNU GPL, version 2 or (at your option) any later version. |
48 | #include "hvf_arm.h" | 24 | */ |
49 | +#include "cpregs.h" | 25 | - |
50 | 26 | + | |
51 | #include <mach/mach_time.h> | 27 | /* |
52 | 28 | * Example usage: | |
29 | * | ||
30 | @@ -XXX,XX +XXX,XX @@ static void connex_init(MachineState *machine) | ||
31 | exit(1); | ||
32 | } | ||
33 | |||
34 | + /* Numonyx RC28F128J3F75 */ | ||
35 | if (!pflash_cfi01_register(0x00000000, "connext.rom", connex_rom, | ||
36 | dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, | ||
37 | sector_len, 2, 0, 0, 0, 0, 0)) { | ||
38 | @@ -XXX,XX +XXX,XX @@ static void verdex_init(MachineState *machine) | ||
39 | exit(1); | ||
40 | } | ||
41 | |||
42 | + /* Micron RC28F256P30TFA */ | ||
43 | if (!pflash_cfi01_register(0x00000000, "verdex.rom", verdex_rom, | ||
44 | dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, | ||
45 | sector_len, 2, 0, 0, 0, 0, 0)) { | ||
46 | @@ -XXX,XX +XXX,XX @@ static void verdex_class_init(ObjectClass *oc, void *data) | ||
47 | { | ||
48 | MachineClass *mc = MACHINE_CLASS(oc); | ||
49 | |||
50 | - mc->desc = "Gumstix Verdex (PXA270)"; | ||
51 | + mc->desc = "Gumstix Verdex Pro XL6P COMs (PXA270)"; | ||
52 | mc->init = verdex_init; | ||
53 | mc->ignore_memory_transaction_failures = true; | ||
54 | mc->default_cpu_type = ARM_CPU_TYPE_NAME("pxa270-c0"); | ||
53 | -- | 55 | -- |
54 | 2.25.1 | 56 | 2.34.1 |
55 | 57 | ||
56 | 58 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Philippe Mathieu-Daudé <f4bug@amsat.org> |
---|---|---|---|
2 | 2 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 3 | IEC binary prefixes ease code review: the unit is explicit. |
4 | Message-id: 20220527181907.189259-89-richard.henderson@linaro.org | 4 | |
5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 5 | Add definitions for RAM / Flash / Flash blocksize. |
6 | |||
7 | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
8 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
9 | Message-id: 20230109115316.2235-7-philmd@linaro.org | ||
10 | Message-Id: <20200223231044.8003-3-philmd@redhat.com> | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 11 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
7 | --- | 12 | --- |
8 | target/arm/translate-sve.c | 29 +++++++---------------------- | 13 | hw/arm/gumstix.c | 27 ++++++++++++++------------- |
9 | 1 file changed, 7 insertions(+), 22 deletions(-) | 14 | 1 file changed, 14 insertions(+), 13 deletions(-) |
10 | 15 | ||
11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | 16 | diff --git a/hw/arm/gumstix.c b/hw/arm/gumstix.c |
12 | index XXXXXXX..XXXXXXX 100644 | 17 | index XXXXXXX..XXXXXXX 100644 |
13 | --- a/target/arm/translate-sve.c | 18 | --- a/hw/arm/gumstix.c |
14 | +++ b/target/arm/translate-sve.c | 19 | +++ b/hw/arm/gumstix.c |
15 | @@ -XXX,XX +XXX,XX @@ DO_PPZ(FCMNE_ppz0, fcmne0) | 20 | @@ -XXX,XX +XXX,XX @@ |
16 | *** SVE floating-point trig multiply-add coefficient | ||
17 | */ | 21 | */ |
18 | 22 | ||
19 | -static bool trans_FTMAD(DisasContext *s, arg_FTMAD *a) | 23 | #include "qemu/osdep.h" |
20 | -{ | 24 | +#include "qemu/units.h" |
21 | - static gen_helper_gvec_3_ptr * const fns[3] = { | 25 | #include "qemu/error-report.h" |
22 | - gen_helper_sve_ftmad_h, | 26 | #include "hw/arm/pxa.h" |
23 | - gen_helper_sve_ftmad_s, | 27 | #include "net/net.h" |
24 | - gen_helper_sve_ftmad_d, | 28 | @@ -XXX,XX +XXX,XX @@ |
25 | - }; | 29 | #include "sysemu/qtest.h" |
30 | #include "cpu.h" | ||
31 | |||
32 | -static const int sector_len = 128 * 1024; | ||
33 | +#define CONNEX_FLASH_SIZE (16 * MiB) | ||
34 | +#define CONNEX_RAM_SIZE (64 * MiB) | ||
35 | + | ||
36 | +#define VERDEX_FLASH_SIZE (32 * MiB) | ||
37 | +#define VERDEX_RAM_SIZE (256 * MiB) | ||
38 | + | ||
39 | +#define FLASH_SECTOR_SIZE (128 * KiB) | ||
40 | |||
41 | static void connex_init(MachineState *machine) | ||
42 | { | ||
43 | PXA2xxState *cpu; | ||
44 | DriveInfo *dinfo; | ||
45 | |||
46 | - uint32_t connex_rom = 0x01000000; | ||
47 | - uint32_t connex_ram = 0x04000000; | ||
26 | - | 48 | - |
27 | - if (a->esz == 0) { | 49 | - cpu = pxa255_init(connex_ram); |
28 | - return false; | 50 | + cpu = pxa255_init(CONNEX_RAM_SIZE); |
29 | - } | 51 | |
30 | - if (sve_access_check(s)) { | 52 | dinfo = drive_get(IF_PFLASH, 0, 0); |
31 | - unsigned vsz = vec_full_reg_size(s); | 53 | if (!dinfo && !qtest_enabled()) { |
32 | - TCGv_ptr status = fpstatus_ptr(a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); | 54 | @@ -XXX,XX +XXX,XX @@ static void connex_init(MachineState *machine) |
33 | - tcg_gen_gvec_3_ptr(vec_full_reg_offset(s, a->rd), | 55 | } |
34 | - vec_full_reg_offset(s, a->rn), | 56 | |
35 | - vec_full_reg_offset(s, a->rm), | 57 | /* Numonyx RC28F128J3F75 */ |
36 | - status, vsz, vsz, a->imm, fns[a->esz - 1]); | 58 | - if (!pflash_cfi01_register(0x00000000, "connext.rom", connex_rom, |
37 | - tcg_temp_free_ptr(status); | 59 | + if (!pflash_cfi01_register(0x00000000, "connext.rom", CONNEX_FLASH_SIZE, |
38 | - } | 60 | dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, |
39 | - return true; | 61 | - sector_len, 2, 0, 0, 0, 0, 0)) { |
40 | -} | 62 | + FLASH_SECTOR_SIZE, 2, 0, 0, 0, 0, 0)) { |
41 | +static gen_helper_gvec_3_ptr * const ftmad_fns[4] = { | 63 | error_report("Error registering flash memory"); |
42 | + NULL, gen_helper_sve_ftmad_h, | 64 | exit(1); |
43 | + gen_helper_sve_ftmad_s, gen_helper_sve_ftmad_d, | 65 | } |
44 | +}; | 66 | @@ -XXX,XX +XXX,XX @@ static void verdex_init(MachineState *machine) |
45 | +TRANS_FEAT(FTMAD, aa64_sve, gen_gvec_fpst_zzz, | 67 | PXA2xxState *cpu; |
46 | + ftmad_fns[a->esz], a->rd, a->rn, a->rm, a->imm, | 68 | DriveInfo *dinfo; |
47 | + a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR) | 69 | |
48 | 70 | - uint32_t verdex_rom = 0x02000000; | |
49 | /* | 71 | - uint32_t verdex_ram = 0x10000000; |
50 | *** SVE Floating Point Accumulating Reduction Group | 72 | - |
73 | - cpu = pxa270_init(verdex_ram, machine->cpu_type); | ||
74 | + cpu = pxa270_init(VERDEX_RAM_SIZE, machine->cpu_type); | ||
75 | |||
76 | dinfo = drive_get(IF_PFLASH, 0, 0); | ||
77 | if (!dinfo && !qtest_enabled()) { | ||
78 | @@ -XXX,XX +XXX,XX @@ static void verdex_init(MachineState *machine) | ||
79 | } | ||
80 | |||
81 | /* Micron RC28F256P30TFA */ | ||
82 | - if (!pflash_cfi01_register(0x00000000, "verdex.rom", verdex_rom, | ||
83 | + if (!pflash_cfi01_register(0x00000000, "verdex.rom", VERDEX_FLASH_SIZE, | ||
84 | dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, | ||
85 | - sector_len, 2, 0, 0, 0, 0, 0)) { | ||
86 | + FLASH_SECTOR_SIZE, 2, 0, 0, 0, 0, 0)) { | ||
87 | error_report("Error registering flash memory"); | ||
88 | exit(1); | ||
89 | } | ||
51 | -- | 90 | -- |
52 | 2.25.1 | 91 | 2.34.1 |
92 | |||
93 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Philippe Mathieu-Daudé <philmd@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | Remove the unparsed extraction in trans_DUP_i, | 3 | IEC binary prefixes ease code review: the unit is explicit. |
4 | which is intended to reject an 8-bit shift of | ||
5 | an 8-bit constant for 8-bit element. | ||
6 | 4 | ||
7 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 5 | Add the FLASH_SECTOR_SIZE definition. |
8 | Message-id: 20220527181907.189259-72-richard.henderson@linaro.org | 6 | |
9 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 7 | Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> |
8 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
9 | Message-id: 20230109115316.2235-8-philmd@linaro.org | ||
10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
11 | --- | 11 | --- |
12 | target/arm/sve.decode | 5 ++++- | 12 | hw/arm/mainstone.c | 18 ++++++++++-------- |
13 | target/arm/translate-sve.c | 10 ++++++---- | 13 | 1 file changed, 10 insertions(+), 8 deletions(-) |
14 | 2 files changed, 10 insertions(+), 5 deletions(-) | ||
15 | 14 | ||
16 | diff --git a/target/arm/sve.decode b/target/arm/sve.decode | 15 | diff --git a/hw/arm/mainstone.c b/hw/arm/mainstone.c |
17 | index XXXXXXX..XXXXXXX 100644 | 16 | index XXXXXXX..XXXXXXX 100644 |
18 | --- a/target/arm/sve.decode | 17 | --- a/hw/arm/mainstone.c |
19 | +++ b/target/arm/sve.decode | 18 | +++ b/hw/arm/mainstone.c |
20 | @@ -XXX,XX +XXX,XX @@ WHILE_ptr 00100101 esz:2 1 rm:5 001 100 rn:5 rw:1 rd:4 | 19 | @@ -XXX,XX +XXX,XX @@ |
21 | FDUP 00100101 esz:2 111 00 1110 imm:8 rd:5 | 20 | * GNU GPL, version 2 or (at your option) any later version. |
22 | 21 | */ | |
23 | # SVE broadcast integer immediate (unpredicated) | 22 | #include "qemu/osdep.h" |
24 | -DUP_i 00100101 esz:2 111 00 011 . ........ rd:5 imm=%sh8_i8s | 23 | +#include "qemu/units.h" |
25 | +{ | 24 | #include "qemu/error-report.h" |
26 | + INVALID 00100101 00 111 00 011 1 -------- ----- | 25 | #include "qapi/error.h" |
27 | + DUP_i 00100101 esz:2 111 00 011 . ........ rd:5 imm=%sh8_i8s | 26 | #include "hw/arm/pxa.h" |
28 | +} | 27 | @@ -XXX,XX +XXX,XX @@ static const struct keymap map[0xE0] = { |
29 | 28 | ||
30 | # SVE integer add/subtract immediate (unpredicated) | 29 | enum mainstone_model_e { mainstone }; |
31 | ADD_zzi 00100101 .. 100 000 11 . ........ ..... @rdn_sh_i8u | 30 | |
32 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | 31 | -#define MAINSTONE_RAM 0x04000000 |
33 | index XXXXXXX..XXXXXXX 100644 | 32 | -#define MAINSTONE_ROM 0x00800000 |
34 | --- a/target/arm/translate-sve.c | 33 | -#define MAINSTONE_FLASH 0x02000000 |
35 | +++ b/target/arm/translate-sve.c | 34 | +#define MAINSTONE_RAM_SIZE (64 * MiB) |
36 | @@ -XXX,XX +XXX,XX @@ const uint64_t pred_esz_masks[4] = { | 35 | +#define MAINSTONE_ROM_SIZE (8 * MiB) |
37 | 0x1111111111111111ull, 0x0101010101010101ull | 36 | +#define MAINSTONE_FLASH_SIZE (32 * MiB) |
37 | |||
38 | static struct arm_boot_info mainstone_binfo = { | ||
39 | .loader_start = PXA2XX_SDRAM_BASE, | ||
40 | - .ram_size = 0x04000000, | ||
41 | + .ram_size = MAINSTONE_RAM_SIZE, | ||
38 | }; | 42 | }; |
39 | 43 | ||
40 | +static bool trans_INVALID(DisasContext *s, arg_INVALID *a) | 44 | +#define FLASH_SECTOR_SIZE (256 * KiB) |
41 | +{ | ||
42 | + unallocated_encoding(s); | ||
43 | + return true; | ||
44 | +} | ||
45 | + | 45 | + |
46 | /* | 46 | static void mainstone_common_init(MachineState *machine, |
47 | *** SVE Logical - Unpredicated Group | 47 | enum mainstone_model_e model, int arm_id) |
48 | */ | ||
49 | @@ -XXX,XX +XXX,XX @@ static bool trans_FDUP(DisasContext *s, arg_FDUP *a) | ||
50 | |||
51 | static bool trans_DUP_i(DisasContext *s, arg_DUP_i *a) | ||
52 | { | 48 | { |
53 | - if (a->esz == 0 && extract32(s->insn, 13, 1)) { | 49 | - uint32_t sector_len = 256 * 1024; |
54 | - return false; | 50 | hwaddr mainstone_flash_base[] = { MST_FLASH_0, MST_FLASH_1 }; |
55 | - } | 51 | PXA2xxState *mpu; |
56 | if (sve_access_check(s)) { | 52 | DeviceState *mst_irq; |
57 | unsigned vsz = vec_full_reg_size(s); | 53 | @@ -XXX,XX +XXX,XX @@ static void mainstone_common_init(MachineState *machine, |
58 | int dofs = vec_full_reg_offset(s, a->rd); | 54 | |
59 | - | 55 | /* Setup CPU & memory */ |
60 | tcg_gen_gvec_dup_imm(a->esz, dofs, vsz, vsz, a->imm); | 56 | mpu = pxa270_init(mainstone_binfo.ram_size, machine->cpu_type); |
61 | } | 57 | - memory_region_init_rom(rom, NULL, "mainstone.rom", MAINSTONE_ROM, |
62 | return true; | 58 | + memory_region_init_rom(rom, NULL, "mainstone.rom", MAINSTONE_ROM_SIZE, |
59 | &error_fatal); | ||
60 | memory_region_add_subregion(get_system_memory(), 0x00000000, rom); | ||
61 | |||
62 | @@ -XXX,XX +XXX,XX @@ static void mainstone_common_init(MachineState *machine, | ||
63 | dinfo = drive_get(IF_PFLASH, 0, i); | ||
64 | if (!pflash_cfi01_register(mainstone_flash_base[i], | ||
65 | i ? "mainstone.flash1" : "mainstone.flash0", | ||
66 | - MAINSTONE_FLASH, | ||
67 | + MAINSTONE_FLASH_SIZE, | ||
68 | dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, | ||
69 | - sector_len, 4, 0, 0, 0, 0, 0)) { | ||
70 | + FLASH_SECTOR_SIZE, 4, 0, 0, 0, 0, 0)) { | ||
71 | error_report("Error registering flash memory"); | ||
72 | exit(1); | ||
73 | } | ||
63 | -- | 74 | -- |
64 | 2.25.1 | 75 | 2.34.1 |
76 | |||
77 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Philippe Mathieu-Daudé <philmd@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 3 | IEC binary prefixes ease code review: the unit is explicit. |
4 | Message-id: 20220527181907.189259-88-richard.henderson@linaro.org | 4 | |
5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 5 | Add the FLASH_SECTOR_SIZE definition. |
6 | |||
7 | Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> | ||
8 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
9 | Message-id: 20230109115316.2235-9-philmd@linaro.org | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
7 | --- | 11 | --- |
8 | target/arm/translate-sve.c | 26 +++++++------------------- | 12 | hw/arm/musicpal.c | 9 ++++++--- |
9 | 1 file changed, 7 insertions(+), 19 deletions(-) | 13 | 1 file changed, 6 insertions(+), 3 deletions(-) |
10 | 14 | ||
11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | 15 | diff --git a/hw/arm/musicpal.c b/hw/arm/musicpal.c |
12 | index XXXXXXX..XXXXXXX 100644 | 16 | index XXXXXXX..XXXXXXX 100644 |
13 | --- a/target/arm/translate-sve.c | 17 | --- a/hw/arm/musicpal.c |
14 | +++ b/target/arm/translate-sve.c | 18 | +++ b/hw/arm/musicpal.c |
15 | @@ -XXX,XX +XXX,XX @@ TRANS_FEAT(FMLS_zzxz, aa64_sve, do_FMLA_zzxz, a, true) | 19 | @@ -XXX,XX +XXX,XX @@ |
16 | *** SVE Floating Point Multiply Indexed Group | ||
17 | */ | 20 | */ |
18 | 21 | ||
19 | -static bool trans_FMUL_zzx(DisasContext *s, arg_FMUL_zzx *a) | 22 | #include "qemu/osdep.h" |
20 | -{ | 23 | +#include "qemu/units.h" |
21 | - static gen_helper_gvec_3_ptr * const fns[3] = { | 24 | #include "qapi/error.h" |
22 | - gen_helper_gvec_fmul_idx_h, | 25 | #include "cpu.h" |
23 | - gen_helper_gvec_fmul_idx_s, | 26 | #include "hw/sysbus.h" |
24 | - gen_helper_gvec_fmul_idx_d, | 27 | @@ -XXX,XX +XXX,XX @@ static const TypeInfo musicpal_key_info = { |
25 | - }; | 28 | .class_init = musicpal_key_class_init, |
26 | - | 29 | }; |
27 | - if (sve_access_check(s)) { | 30 | |
28 | - unsigned vsz = vec_full_reg_size(s); | 31 | +#define FLASH_SECTOR_SIZE (64 * KiB) |
29 | - TCGv_ptr status = fpstatus_ptr(a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); | 32 | + |
30 | - tcg_gen_gvec_3_ptr(vec_full_reg_offset(s, a->rd), | 33 | static struct arm_boot_info musicpal_binfo = { |
31 | - vec_full_reg_offset(s, a->rn), | 34 | .loader_start = 0x0, |
32 | - vec_full_reg_offset(s, a->rm), | 35 | .board_id = 0x20e, |
33 | - status, vsz, vsz, a->index, fns[a->esz - 1]); | 36 | @@ -XXX,XX +XXX,XX @@ static void musicpal_init(MachineState *machine) |
34 | - tcg_temp_free_ptr(status); | 37 | BlockBackend *blk = blk_by_legacy_dinfo(dinfo); |
35 | - } | 38 | |
36 | - return true; | 39 | flash_size = blk_getlength(blk); |
37 | -} | 40 | - if (flash_size != 8*1024*1024 && flash_size != 16*1024*1024 && |
38 | +static gen_helper_gvec_3_ptr * const fmul_idx_fns[4] = { | 41 | - flash_size != 32*1024*1024) { |
39 | + NULL, gen_helper_gvec_fmul_idx_h, | 42 | + if (flash_size != 8 * MiB && flash_size != 16 * MiB && |
40 | + gen_helper_gvec_fmul_idx_s, gen_helper_gvec_fmul_idx_d, | 43 | + flash_size != 32 * MiB) { |
41 | +}; | 44 | error_report("Invalid flash image size"); |
42 | +TRANS_FEAT(FMUL_zzx, aa64_sve, gen_gvec_fpst_zzz, | 45 | exit(1); |
43 | + fmul_idx_fns[a->esz], a->rd, a->rn, a->rm, a->index, | 46 | } |
44 | + a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR) | 47 | @@ -XXX,XX +XXX,XX @@ static void musicpal_init(MachineState *machine) |
45 | 48 | */ | |
46 | /* | 49 | pflash_cfi02_register(0x100000000ULL - MP_FLASH_SIZE_MAX, |
47 | *** SVE Floating Point Fast Reduction Group | 50 | "musicpal.flash", flash_size, |
51 | - blk, 0x10000, | ||
52 | + blk, FLASH_SECTOR_SIZE, | ||
53 | MP_FLASH_SIZE_MAX / flash_size, | ||
54 | 2, 0x00BF, 0x236D, 0x0000, 0x0000, | ||
55 | 0x5555, 0x2AAA, 0); | ||
48 | -- | 56 | -- |
49 | 2.25.1 | 57 | 2.34.1 |
58 | |||
59 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Philippe Mathieu-Daudé <philmd@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 3 | The total_ram_v1/total_ram_v2 definitions were never used. |
4 | Message-id: 20220527181907.189259-87-richard.henderson@linaro.org | 4 | |
5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 5 | Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> |
6 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
7 | Message-id: 20230109115316.2235-10-philmd@linaro.org | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
7 | --- | 9 | --- |
8 | target/arm/translate-sve.c | 7 ++----- | 10 | hw/arm/omap_sx1.c | 2 -- |
9 | 1 file changed, 2 insertions(+), 5 deletions(-) | 11 | 1 file changed, 2 deletions(-) |
10 | 12 | ||
11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | 13 | diff --git a/hw/arm/omap_sx1.c b/hw/arm/omap_sx1.c |
12 | index XXXXXXX..XXXXXXX 100644 | 14 | index XXXXXXX..XXXXXXX 100644 |
13 | --- a/target/arm/translate-sve.c | 15 | --- a/hw/arm/omap_sx1.c |
14 | +++ b/target/arm/translate-sve.c | 16 | +++ b/hw/arm/omap_sx1.c |
15 | @@ -XXX,XX +XXX,XX @@ static bool trans_FADDA(DisasContext *s, arg_rprr_esz *a) | 17 | @@ -XXX,XX +XXX,XX @@ static const MemoryRegionOps static_ops = { |
16 | */ | 18 | #define flash0_size (16 * 1024 * 1024) |
17 | 19 | #define flash1_size ( 8 * 1024 * 1024) | |
18 | #define DO_FP3(NAME, name) \ | 20 | #define flash2_size (32 * 1024 * 1024) |
19 | -static bool trans_##NAME(DisasContext *s, arg_rrr_esz *a) \ | 21 | -#define total_ram_v1 (sdram_size + flash0_size + flash1_size + OMAP15XX_SRAM_SIZE) |
20 | -{ \ | 22 | -#define total_ram_v2 (sdram_size + flash2_size + OMAP15XX_SRAM_SIZE) |
21 | - static gen_helper_gvec_3_ptr * const fns[4] = { \ | 23 | |
22 | + static gen_helper_gvec_3_ptr * const name##_fns[4] = { \ | 24 | static struct arm_boot_info sx1_binfo = { |
23 | NULL, gen_helper_gvec_##name##_h, \ | 25 | .loader_start = OMAP_EMIFF_BASE, |
24 | gen_helper_gvec_##name##_s, gen_helper_gvec_##name##_d \ | ||
25 | }; \ | ||
26 | - return gen_gvec_fpst_arg_zzz(s, fns[a->esz], a, 0); \ | ||
27 | -} | ||
28 | + TRANS_FEAT(NAME, aa64_sve, gen_gvec_fpst_arg_zzz, name##_fns[a->esz], a, 0) | ||
29 | |||
30 | DO_FP3(FADD_zzz, fadd) | ||
31 | DO_FP3(FSUB_zzz, fsub) | ||
32 | -- | 26 | -- |
33 | 2.25.1 | 27 | 2.34.1 |
28 | |||
29 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Philippe Mathieu-Daudé <philmd@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 3 | IEC binary prefixes ease code review: the unit is explicit. |
4 | Message-id: 20220527181907.189259-85-richard.henderson@linaro.org | 4 | |
5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 5 | Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> |
6 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
7 | Message-id: 20230109115316.2235-11-philmd@linaro.org | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
7 | --- | 9 | --- |
8 | target/arm/translate-sve.c | 28 ++++------------------------ | 10 | hw/arm/omap_sx1.c | 33 +++++++++++++++++---------------- |
9 | 1 file changed, 4 insertions(+), 24 deletions(-) | 11 | 1 file changed, 17 insertions(+), 16 deletions(-) |
10 | 12 | ||
11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | 13 | diff --git a/hw/arm/omap_sx1.c b/hw/arm/omap_sx1.c |
12 | index XXXXXXX..XXXXXXX 100644 | 14 | index XXXXXXX..XXXXXXX 100644 |
13 | --- a/target/arm/translate-sve.c | 15 | --- a/hw/arm/omap_sx1.c |
14 | +++ b/target/arm/translate-sve.c | 16 | +++ b/hw/arm/omap_sx1.c |
15 | @@ -XXX,XX +XXX,XX @@ TRANS_FEAT(BFMMLA, aa64_sve_bf16, gen_gvec_ool_arg_zzzz, | 17 | @@ -XXX,XX +XXX,XX @@ |
16 | 18 | * with this program; if not, see <http://www.gnu.org/licenses/>. | |
17 | static bool do_BFMLAL_zzzw(DisasContext *s, arg_rrrr_esz *a, bool sel) | 19 | */ |
18 | { | 20 | #include "qemu/osdep.h" |
19 | - if (!dc_isar_feature(aa64_sve_bf16, s)) { | 21 | +#include "qemu/units.h" |
20 | - return false; | 22 | #include "qapi/error.h" |
21 | - } | 23 | #include "ui/console.h" |
22 | return gen_gvec_fpst_zzzz(s, gen_helper_gvec_bfmlal, | 24 | #include "hw/arm/omap.h" |
23 | a->rd, a->rn, a->rm, a->ra, sel, FPST_FPCR); | 25 | @@ -XXX,XX +XXX,XX @@ static const MemoryRegionOps static_ops = { |
26 | .endianness = DEVICE_NATIVE_ENDIAN, | ||
27 | }; | ||
28 | |||
29 | -#define sdram_size 0x02000000 | ||
30 | -#define sector_size (128 * 1024) | ||
31 | -#define flash0_size (16 * 1024 * 1024) | ||
32 | -#define flash1_size ( 8 * 1024 * 1024) | ||
33 | -#define flash2_size (32 * 1024 * 1024) | ||
34 | +#define SDRAM_SIZE (32 * MiB) | ||
35 | +#define SECTOR_SIZE (128 * KiB) | ||
36 | +#define FLASH0_SIZE (16 * MiB) | ||
37 | +#define FLASH1_SIZE (8 * MiB) | ||
38 | +#define FLASH2_SIZE (32 * MiB) | ||
39 | |||
40 | static struct arm_boot_info sx1_binfo = { | ||
41 | .loader_start = OMAP_EMIFF_BASE, | ||
42 | - .ram_size = sdram_size, | ||
43 | + .ram_size = SDRAM_SIZE, | ||
44 | .board_id = 0x265, | ||
45 | }; | ||
46 | |||
47 | @@ -XXX,XX +XXX,XX @@ static void sx1_init(MachineState *machine, const int version) | ||
48 | static uint32_t cs3val = 0x00001139; | ||
49 | DriveInfo *dinfo; | ||
50 | int fl_idx; | ||
51 | - uint32_t flash_size = flash0_size; | ||
52 | + uint32_t flash_size = FLASH0_SIZE; | ||
53 | |||
54 | if (machine->ram_size != mc->default_ram_size) { | ||
55 | char *sz = size_to_str(mc->default_ram_size); | ||
56 | @@ -XXX,XX +XXX,XX @@ static void sx1_init(MachineState *machine, const int version) | ||
57 | } | ||
58 | |||
59 | if (version == 2) { | ||
60 | - flash_size = flash2_size; | ||
61 | + flash_size = FLASH2_SIZE; | ||
62 | } | ||
63 | |||
64 | memory_region_add_subregion(address_space, OMAP_EMIFF_BASE, machine->ram); | ||
65 | @@ -XXX,XX +XXX,XX @@ static void sx1_init(MachineState *machine, const int version) | ||
66 | if (!pflash_cfi01_register(OMAP_CS0_BASE, | ||
67 | "omap_sx1.flash0-1", flash_size, | ||
68 | blk_by_legacy_dinfo(dinfo), | ||
69 | - sector_size, 4, 0, 0, 0, 0, 0)) { | ||
70 | + SECTOR_SIZE, 4, 0, 0, 0, 0, 0)) { | ||
71 | fprintf(stderr, "qemu: Error registering flash memory %d.\n", | ||
72 | fl_idx); | ||
73 | } | ||
74 | @@ -XXX,XX +XXX,XX @@ static void sx1_init(MachineState *machine, const int version) | ||
75 | (dinfo = drive_get(IF_PFLASH, 0, fl_idx)) != NULL) { | ||
76 | MemoryRegion *flash_1 = g_new(MemoryRegion, 1); | ||
77 | memory_region_init_rom(flash_1, NULL, "omap_sx1.flash1-0", | ||
78 | - flash1_size, &error_fatal); | ||
79 | + FLASH1_SIZE, &error_fatal); | ||
80 | memory_region_add_subregion(address_space, OMAP_CS1_BASE, flash_1); | ||
81 | |||
82 | memory_region_init_io(&cs[1], NULL, &static_ops, &cs1val, | ||
83 | - "sx1.cs1", OMAP_CS1_SIZE - flash1_size); | ||
84 | + "sx1.cs1", OMAP_CS1_SIZE - FLASH1_SIZE); | ||
85 | memory_region_add_subregion(address_space, | ||
86 | - OMAP_CS1_BASE + flash1_size, &cs[1]); | ||
87 | + OMAP_CS1_BASE + FLASH1_SIZE, &cs[1]); | ||
88 | |||
89 | if (!pflash_cfi01_register(OMAP_CS1_BASE, | ||
90 | - "omap_sx1.flash1-1", flash1_size, | ||
91 | + "omap_sx1.flash1-1", FLASH1_SIZE, | ||
92 | blk_by_legacy_dinfo(dinfo), | ||
93 | - sector_size, 4, 0, 0, 0, 0, 0)) { | ||
94 | + SECTOR_SIZE, 4, 0, 0, 0, 0, 0)) { | ||
95 | fprintf(stderr, "qemu: Error registering flash memory %d.\n", | ||
96 | fl_idx); | ||
97 | } | ||
98 | @@ -XXX,XX +XXX,XX @@ static void sx1_machine_v2_class_init(ObjectClass *oc, void *data) | ||
99 | mc->init = sx1_init_v2; | ||
100 | mc->ignore_memory_transaction_failures = true; | ||
101 | mc->default_cpu_type = ARM_CPU_TYPE_NAME("ti925t"); | ||
102 | - mc->default_ram_size = sdram_size; | ||
103 | + mc->default_ram_size = SDRAM_SIZE; | ||
104 | mc->default_ram_id = "omap1.dram"; | ||
24 | } | 105 | } |
25 | 106 | ||
26 | -static bool trans_BFMLALB_zzzw(DisasContext *s, arg_rrrr_esz *a) | 107 | @@ -XXX,XX +XXX,XX @@ static void sx1_machine_v1_class_init(ObjectClass *oc, void *data) |
27 | -{ | 108 | mc->init = sx1_init_v1; |
28 | - return do_BFMLAL_zzzw(s, a, false); | 109 | mc->ignore_memory_transaction_failures = true; |
29 | -} | 110 | mc->default_cpu_type = ARM_CPU_TYPE_NAME("ti925t"); |
30 | - | 111 | - mc->default_ram_size = sdram_size; |
31 | -static bool trans_BFMLALT_zzzw(DisasContext *s, arg_rrrr_esz *a) | 112 | + mc->default_ram_size = SDRAM_SIZE; |
32 | -{ | 113 | mc->default_ram_id = "omap1.dram"; |
33 | - return do_BFMLAL_zzzw(s, a, true); | ||
34 | -} | ||
35 | +TRANS_FEAT(BFMLALB_zzzw, aa64_sve_bf16, do_BFMLAL_zzzw, a, false) | ||
36 | +TRANS_FEAT(BFMLALT_zzzw, aa64_sve_bf16, do_BFMLAL_zzzw, a, true) | ||
37 | |||
38 | static bool do_BFMLAL_zzxw(DisasContext *s, arg_rrxr_esz *a, bool sel) | ||
39 | { | ||
40 | - if (!dc_isar_feature(aa64_sve_bf16, s)) { | ||
41 | - return false; | ||
42 | - } | ||
43 | return gen_gvec_fpst_zzzz(s, gen_helper_gvec_bfmlal_idx, | ||
44 | a->rd, a->rn, a->rm, a->ra, | ||
45 | (a->index << 1) | sel, FPST_FPCR); | ||
46 | } | 114 | } |
47 | 115 | ||
48 | -static bool trans_BFMLALB_zzxw(DisasContext *s, arg_rrxr_esz *a) | ||
49 | -{ | ||
50 | - return do_BFMLAL_zzxw(s, a, false); | ||
51 | -} | ||
52 | - | ||
53 | -static bool trans_BFMLALT_zzxw(DisasContext *s, arg_rrxr_esz *a) | ||
54 | -{ | ||
55 | - return do_BFMLAL_zzxw(s, a, true); | ||
56 | -} | ||
57 | +TRANS_FEAT(BFMLALB_zzxw, aa64_sve_bf16, do_BFMLAL_zzxw, a, false) | ||
58 | +TRANS_FEAT(BFMLALT_zzxw, aa64_sve_bf16, do_BFMLAL_zzxw, a, true) | ||
59 | -- | 116 | -- |
60 | 2.25.1 | 117 | 2.34.1 |
118 | |||
119 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Philippe Mathieu-Daudé <philmd@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 3 | IEC binary prefixes ease code review: the unit is explicit. |
4 | Message-id: 20220527181907.189259-83-richard.henderson@linaro.org | 4 | |
5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 5 | Add the FLASH_SECTOR_SIZE definition. |
6 | |||
7 | Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> | ||
8 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
9 | Message-id: 20230109115316.2235-12-philmd@linaro.org | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
7 | --- | 11 | --- |
8 | target/arm/translate-sve.c | 17 +++-------------- | 12 | hw/arm/z2.c | 6 ++++-- |
9 | 1 file changed, 3 insertions(+), 14 deletions(-) | 13 | 1 file changed, 4 insertions(+), 2 deletions(-) |
10 | 14 | ||
11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | 15 | diff --git a/hw/arm/z2.c b/hw/arm/z2.c |
12 | index XXXXXXX..XXXXXXX 100644 | 16 | index XXXXXXX..XXXXXXX 100644 |
13 | --- a/target/arm/translate-sve.c | 17 | --- a/hw/arm/z2.c |
14 | +++ b/target/arm/translate-sve.c | 18 | +++ b/hw/arm/z2.c |
15 | @@ -XXX,XX +XXX,XX @@ static bool trans_PRF_rr(DisasContext *s, arg_PRF_rr *a) | 19 | @@ -XXX,XX +XXX,XX @@ |
16 | * In the meantime, just emit the moves. | ||
17 | */ | 20 | */ |
18 | 21 | ||
19 | -static bool trans_MOVPRFX(DisasContext *s, arg_MOVPRFX *a) | 22 | #include "qemu/osdep.h" |
20 | -{ | 23 | +#include "qemu/units.h" |
21 | - return do_mov_z(s, a->rd, a->rn); | 24 | #include "hw/arm/pxa.h" |
22 | -} | 25 | #include "hw/arm/boot.h" |
23 | - | 26 | #include "hw/i2c/i2c.h" |
24 | -static bool trans_MOVPRFX_m(DisasContext *s, arg_rpr_esz *a) | 27 | @@ -XXX,XX +XXX,XX @@ static const TypeInfo aer915_info = { |
25 | -{ | 28 | .class_init = aer915_class_init, |
26 | - return do_sel_z(s, a->rd, a->rn, a->rd, a->pg, a->esz); | 29 | }; |
27 | -} | 30 | |
28 | - | 31 | +#define FLASH_SECTOR_SIZE (64 * KiB) |
29 | -static bool trans_MOVPRFX_z(DisasContext *s, arg_rpr_esz *a) | 32 | + |
30 | -{ | 33 | static void z2_init(MachineState *machine) |
31 | - return do_movz_zpz(s, a->rd, a->rn, a->pg, a->esz, false); | 34 | { |
32 | -} | 35 | - uint32_t sector_len = 0x10000; |
33 | +TRANS_FEAT(MOVPRFX, aa64_sve, do_mov_z, a->rd, a->rn) | 36 | PXA2xxState *mpu; |
34 | +TRANS_FEAT(MOVPRFX_m, aa64_sve, do_sel_z, a->rd, a->rn, a->rd, a->pg, a->esz) | 37 | DriveInfo *dinfo; |
35 | +TRANS_FEAT(MOVPRFX_z, aa64_sve, do_movz_zpz, a->rd, a->rn, a->pg, a->esz, false) | 38 | void *z2_lcd; |
36 | 39 | @@ -XXX,XX +XXX,XX @@ static void z2_init(MachineState *machine) | |
37 | /* | 40 | dinfo = drive_get(IF_PFLASH, 0, 0); |
38 | * SVE2 Integer Multiply - Unpredicated | 41 | if (!pflash_cfi01_register(Z2_FLASH_BASE, "z2.flash0", Z2_FLASH_SIZE, |
42 | dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, | ||
43 | - sector_len, 4, 0, 0, 0, 0, 0)) { | ||
44 | + FLASH_SECTOR_SIZE, 4, 0, 0, 0, 0, 0)) { | ||
45 | error_report("Error registering flash memory"); | ||
46 | exit(1); | ||
47 | } | ||
39 | -- | 48 | -- |
40 | 2.25.1 | 49 | 2.34.1 |
50 | |||
51 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Philippe Mathieu-Daudé <philmd@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 3 | Upon introduction in commit b8433303fb ("Set proper device-width |
4 | Message-id: 20220527181907.189259-71-richard.henderson@linaro.org | 4 | for vexpress flash"), ve_pflash_cfi01_register() was calling |
5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 5 | qdev_init_nofail() which can not fail. This call was later |
6 | converted with a script to use &error_fatal, still unable to | ||
7 | fail. Remove the unreachable code. | ||
8 | |||
9 | Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> | ||
10 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
11 | Message-id: 20230109115316.2235-13-philmd@linaro.org | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 12 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
7 | --- | 13 | --- |
8 | target/arm/translate-sve.c | 10 +--------- | 14 | hw/arm/vexpress.c | 10 +--------- |
9 | 1 file changed, 1 insertion(+), 9 deletions(-) | 15 | 1 file changed, 1 insertion(+), 9 deletions(-) |
10 | 16 | ||
11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | 17 | diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c |
12 | index XXXXXXX..XXXXXXX 100644 | 18 | index XXXXXXX..XXXXXXX 100644 |
13 | --- a/target/arm/translate-sve.c | 19 | --- a/hw/arm/vexpress.c |
14 | +++ b/target/arm/translate-sve.c | 20 | +++ b/hw/arm/vexpress.c |
15 | @@ -XXX,XX +XXX,XX @@ static bool trans_SUBR_zzi(DisasContext *s, arg_rri_esz *a) | 21 | @@ -XXX,XX +XXX,XX @@ static void vexpress_common_init(MachineState *machine) |
16 | return true; | 22 | dinfo = drive_get(IF_PFLASH, 0, 0); |
17 | } | 23 | pflash0 = ve_pflash_cfi01_register(map[VE_NORFLASH0], "vexpress.flash0", |
18 | 24 | dinfo); | |
19 | -static bool trans_MUL_zzi(DisasContext *s, arg_rri_esz *a) | 25 | - if (!pflash0) { |
20 | -{ | 26 | - error_report("vexpress: error registering flash 0"); |
21 | - if (sve_access_check(s)) { | 27 | - exit(1); |
22 | - unsigned vsz = vec_full_reg_size(s); | ||
23 | - tcg_gen_gvec_muli(a->esz, vec_full_reg_offset(s, a->rd), | ||
24 | - vec_full_reg_offset(s, a->rn), a->imm, vsz, vsz); | ||
25 | - } | 28 | - } |
26 | - return true; | 29 | |
27 | -} | 30 | if (map[VE_NORFLASHALIAS] != -1) { |
28 | +TRANS_FEAT(MUL_zzi, aa64_sve, gen_gvec_fn_arg_zzi, tcg_gen_gvec_muli, a) | 31 | /* Map flash 0 as an alias into low memory */ |
29 | 32 | @@ -XXX,XX +XXX,XX @@ static void vexpress_common_init(MachineState *machine) | |
30 | static bool do_zzi_sat(DisasContext *s, arg_rri_esz *a, bool u, bool d) | 33 | } |
31 | { | 34 | |
35 | dinfo = drive_get(IF_PFLASH, 0, 1); | ||
36 | - if (!ve_pflash_cfi01_register(map[VE_NORFLASH1], "vexpress.flash1", | ||
37 | - dinfo)) { | ||
38 | - error_report("vexpress: error registering flash 1"); | ||
39 | - exit(1); | ||
40 | - } | ||
41 | + ve_pflash_cfi01_register(map[VE_NORFLASH1], "vexpress.flash1", dinfo); | ||
42 | |||
43 | sram_size = 0x2000000; | ||
44 | memory_region_init_ram(sram, NULL, "vexpress.sram", sram_size, | ||
32 | -- | 45 | -- |
33 | 2.25.1 | 46 | 2.34.1 |
47 | |||
48 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Philippe Mathieu-Daudé <philmd@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | Use these for the several varieties of floating-point | 3 | Since its QOM'ification in commit 368a354f02 ("pflash_cfi0x: |
4 | multiply-add instructions. | 4 | QOMified") the pflash_cfi01_register() function does not fail. |
5 | 5 | ||
6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 6 | This call was later converted with a script to use &error_fatal, |
7 | Message-id: 20220527181907.189259-78-richard.henderson@linaro.org | 7 | still unable to fail. Remove the unreachable code. |
8 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 8 | |
9 | Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> | ||
10 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
11 | Message-id: 20230109115316.2235-14-philmd@linaro.org | ||
9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 12 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
10 | --- | 13 | --- |
11 | target/arm/translate-sve.c | 140 ++++++++++++++----------------------- | 14 | hw/arm/gumstix.c | 18 ++++++------------ |
12 | 1 file changed, 53 insertions(+), 87 deletions(-) | 15 | hw/arm/mainstone.c | 13 +++++-------- |
16 | hw/arm/omap_sx1.c | 22 ++++++++-------------- | ||
17 | hw/arm/versatilepb.c | 6 ++---- | ||
18 | hw/arm/z2.c | 9 +++------ | ||
19 | 5 files changed, 24 insertions(+), 44 deletions(-) | ||
13 | 20 | ||
14 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | 21 | diff --git a/hw/arm/gumstix.c b/hw/arm/gumstix.c |
15 | index XXXXXXX..XXXXXXX 100644 | 22 | index XXXXXXX..XXXXXXX 100644 |
16 | --- a/target/arm/translate-sve.c | 23 | --- a/hw/arm/gumstix.c |
17 | +++ b/target/arm/translate-sve.c | 24 | +++ b/hw/arm/gumstix.c |
18 | @@ -XXX,XX +XXX,XX @@ static bool gen_gvec_ool_arg_zzxz(DisasContext *s, gen_helper_gvec_4 *fn, | 25 | @@ -XXX,XX +XXX,XX @@ static void connex_init(MachineState *machine) |
19 | return gen_gvec_ool_zzzz(s, fn, a->rd, a->rn, a->rm, a->ra, a->index); | 26 | } |
20 | } | 27 | |
21 | 28 | /* Numonyx RC28F128J3F75 */ | |
22 | +/* Invoke an out-of-line helper on 4 Zregs, plus a pointer. */ | 29 | - if (!pflash_cfi01_register(0x00000000, "connext.rom", CONNEX_FLASH_SIZE, |
23 | +static bool gen_gvec_ptr_zzzz(DisasContext *s, gen_helper_gvec_4_ptr *fn, | 30 | - dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, |
24 | + int rd, int rn, int rm, int ra, | 31 | - FLASH_SECTOR_SIZE, 2, 0, 0, 0, 0, 0)) { |
25 | + int data, TCGv_ptr ptr) | 32 | - error_report("Error registering flash memory"); |
26 | +{ | 33 | - exit(1); |
27 | + if (fn == NULL) { | ||
28 | + return false; | ||
29 | + } | ||
30 | + if (sve_access_check(s)) { | ||
31 | + unsigned vsz = vec_full_reg_size(s); | ||
32 | + tcg_gen_gvec_4_ptr(vec_full_reg_offset(s, rd), | ||
33 | + vec_full_reg_offset(s, rn), | ||
34 | + vec_full_reg_offset(s, rm), | ||
35 | + vec_full_reg_offset(s, ra), | ||
36 | + ptr, vsz, vsz, data, fn); | ||
37 | + } | ||
38 | + return true; | ||
39 | +} | ||
40 | + | ||
41 | +static bool gen_gvec_fpst_zzzz(DisasContext *s, gen_helper_gvec_4_ptr *fn, | ||
42 | + int rd, int rn, int rm, int ra, | ||
43 | + int data, ARMFPStatusFlavour flavour) | ||
44 | +{ | ||
45 | + TCGv_ptr status = fpstatus_ptr(flavour); | ||
46 | + bool ret = gen_gvec_ptr_zzzz(s, fn, rd, rn, rm, ra, data, status); | ||
47 | + tcg_temp_free_ptr(status); | ||
48 | + return ret; | ||
49 | +} | ||
50 | + | ||
51 | /* Invoke an out-of-line helper on 2 Zregs and a predicate. */ | ||
52 | static bool gen_gvec_ool_zzp(DisasContext *s, gen_helper_gvec_3 *fn, | ||
53 | int rd, int rn, int pg, int data) | ||
54 | @@ -XXX,XX +XXX,XX @@ DO_SVE2_RRXR_ROT(CDOT_zzxw_d, gen_helper_sve2_cdot_idx_d) | ||
55 | |||
56 | static bool do_FMLA_zzxz(DisasContext *s, arg_rrxr_esz *a, bool sub) | ||
57 | { | ||
58 | - static gen_helper_gvec_4_ptr * const fns[3] = { | ||
59 | + static gen_helper_gvec_4_ptr * const fns[4] = { | ||
60 | + NULL, | ||
61 | gen_helper_gvec_fmla_idx_h, | ||
62 | gen_helper_gvec_fmla_idx_s, | ||
63 | gen_helper_gvec_fmla_idx_d, | ||
64 | }; | ||
65 | - | ||
66 | - if (sve_access_check(s)) { | ||
67 | - unsigned vsz = vec_full_reg_size(s); | ||
68 | - TCGv_ptr status = fpstatus_ptr(a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); | ||
69 | - tcg_gen_gvec_4_ptr(vec_full_reg_offset(s, a->rd), | ||
70 | - vec_full_reg_offset(s, a->rn), | ||
71 | - vec_full_reg_offset(s, a->rm), | ||
72 | - vec_full_reg_offset(s, a->ra), | ||
73 | - status, vsz, vsz, (a->index << 1) | sub, | ||
74 | - fns[a->esz - 1]); | ||
75 | - tcg_temp_free_ptr(status); | ||
76 | - } | 34 | - } |
77 | - return true; | 35 | + pflash_cfi01_register(0x00000000, "connext.rom", CONNEX_FLASH_SIZE, |
78 | + return gen_gvec_fpst_zzzz(s, fns[a->esz], a->rd, a->rn, a->rm, a->ra, | 36 | + dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, |
79 | + (a->index << 1) | sub, | 37 | + FLASH_SECTOR_SIZE, 2, 0, 0, 0, 0, 0); |
80 | + a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); | 38 | |
81 | } | 39 | /* Interrupt line of NIC is connected to GPIO line 36 */ |
82 | 40 | smc91c111_init(&nd_table[0], 0x04000300, | |
83 | static bool trans_FMLA_zzxz(DisasContext *s, arg_FMLA_zzxz *a) | 41 | @@ -XXX,XX +XXX,XX @@ static void verdex_init(MachineState *machine) |
84 | @@ -XXX,XX +XXX,XX @@ static bool trans_FCMLA_zpzzz(DisasContext *s, arg_FCMLA_zpzzz *a) | 42 | } |
85 | 43 | ||
86 | static bool trans_FCMLA_zzxz(DisasContext *s, arg_FCMLA_zzxz *a) | 44 | /* Micron RC28F256P30TFA */ |
87 | { | 45 | - if (!pflash_cfi01_register(0x00000000, "verdex.rom", VERDEX_FLASH_SIZE, |
88 | - static gen_helper_gvec_4_ptr * const fns[2] = { | 46 | - dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, |
89 | + static gen_helper_gvec_4_ptr * const fns[4] = { | 47 | - FLASH_SECTOR_SIZE, 2, 0, 0, 0, 0, 0)) { |
90 | + NULL, | 48 | - error_report("Error registering flash memory"); |
91 | gen_helper_gvec_fcmlah_idx, | 49 | - exit(1); |
92 | gen_helper_gvec_fcmlas_idx, | ||
93 | + NULL, | ||
94 | }; | ||
95 | |||
96 | - tcg_debug_assert(a->esz == 1 || a->esz == 2); | ||
97 | tcg_debug_assert(a->rd == a->ra); | ||
98 | - if (sve_access_check(s)) { | ||
99 | - unsigned vsz = vec_full_reg_size(s); | ||
100 | - TCGv_ptr status = fpstatus_ptr(a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); | ||
101 | - tcg_gen_gvec_4_ptr(vec_full_reg_offset(s, a->rd), | ||
102 | - vec_full_reg_offset(s, a->rn), | ||
103 | - vec_full_reg_offset(s, a->rm), | ||
104 | - vec_full_reg_offset(s, a->ra), | ||
105 | - status, vsz, vsz, | ||
106 | - a->index * 4 + a->rot, | ||
107 | - fns[a->esz - 1]); | ||
108 | - tcg_temp_free_ptr(status); | ||
109 | - } | 50 | - } |
110 | - return true; | 51 | + pflash_cfi01_register(0x00000000, "verdex.rom", VERDEX_FLASH_SIZE, |
111 | + | 52 | + dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, |
112 | + return gen_gvec_fpst_zzzz(s, fns[a->esz], a->rd, a->rn, a->rm, a->ra, | 53 | + FLASH_SECTOR_SIZE, 2, 0, 0, 0, 0, 0); |
113 | + a->index * 4 + a->rot, | 54 | |
114 | + a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); | 55 | /* Interrupt line of NIC is connected to GPIO line 99 */ |
115 | } | 56 | smc91c111_init(&nd_table[0], 0x04000300, |
116 | 57 | diff --git a/hw/arm/mainstone.c b/hw/arm/mainstone.c | |
117 | /* | 58 | index XXXXXXX..XXXXXXX 100644 |
118 | @@ -XXX,XX +XXX,XX @@ static bool trans_FMMLA(DisasContext *s, arg_rrrr_esz *a) | 59 | --- a/hw/arm/mainstone.c |
119 | return false; | 60 | +++ b/hw/arm/mainstone.c |
61 | @@ -XXX,XX +XXX,XX @@ static void mainstone_common_init(MachineState *machine, | ||
62 | /* There are two 32MiB flash devices on the board */ | ||
63 | for (i = 0; i < 2; i ++) { | ||
64 | dinfo = drive_get(IF_PFLASH, 0, i); | ||
65 | - if (!pflash_cfi01_register(mainstone_flash_base[i], | ||
66 | - i ? "mainstone.flash1" : "mainstone.flash0", | ||
67 | - MAINSTONE_FLASH_SIZE, | ||
68 | - dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, | ||
69 | - FLASH_SECTOR_SIZE, 4, 0, 0, 0, 0, 0)) { | ||
70 | - error_report("Error registering flash memory"); | ||
71 | - exit(1); | ||
72 | - } | ||
73 | + pflash_cfi01_register(mainstone_flash_base[i], | ||
74 | + i ? "mainstone.flash1" : "mainstone.flash0", | ||
75 | + MAINSTONE_FLASH_SIZE, | ||
76 | + dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, | ||
77 | + FLASH_SECTOR_SIZE, 4, 0, 0, 0, 0, 0); | ||
120 | } | 78 | } |
121 | 79 | ||
122 | - if (sve_access_check(s)) { | 80 | mst_irq = sysbus_create_simple("mainstone-fpga", MST_FPGA_PHYS, |
123 | - unsigned vsz = vec_full_reg_size(s); | 81 | diff --git a/hw/arm/omap_sx1.c b/hw/arm/omap_sx1.c |
124 | - TCGv_ptr status = fpstatus_ptr(FPST_FPCR); | 82 | index XXXXXXX..XXXXXXX 100644 |
125 | - tcg_gen_gvec_4_ptr(vec_full_reg_offset(s, a->rd), | 83 | --- a/hw/arm/omap_sx1.c |
126 | - vec_full_reg_offset(s, a->rn), | 84 | +++ b/hw/arm/omap_sx1.c |
127 | - vec_full_reg_offset(s, a->rm), | 85 | @@ -XXX,XX +XXX,XX @@ static void sx1_init(MachineState *machine, const int version) |
128 | - vec_full_reg_offset(s, a->ra), | 86 | |
129 | - status, vsz, vsz, 0, fn); | 87 | fl_idx = 0; |
130 | - tcg_temp_free_ptr(status); | 88 | if ((dinfo = drive_get(IF_PFLASH, 0, fl_idx)) != NULL) { |
89 | - if (!pflash_cfi01_register(OMAP_CS0_BASE, | ||
90 | - "omap_sx1.flash0-1", flash_size, | ||
91 | - blk_by_legacy_dinfo(dinfo), | ||
92 | - SECTOR_SIZE, 4, 0, 0, 0, 0, 0)) { | ||
93 | - fprintf(stderr, "qemu: Error registering flash memory %d.\n", | ||
94 | - fl_idx); | ||
95 | - } | ||
96 | + pflash_cfi01_register(OMAP_CS0_BASE, | ||
97 | + "omap_sx1.flash0-1", flash_size, | ||
98 | + blk_by_legacy_dinfo(dinfo), | ||
99 | + SECTOR_SIZE, 4, 0, 0, 0, 0, 0); | ||
100 | fl_idx++; | ||
101 | } | ||
102 | |||
103 | @@ -XXX,XX +XXX,XX @@ static void sx1_init(MachineState *machine, const int version) | ||
104 | memory_region_add_subregion(address_space, | ||
105 | OMAP_CS1_BASE + FLASH1_SIZE, &cs[1]); | ||
106 | |||
107 | - if (!pflash_cfi01_register(OMAP_CS1_BASE, | ||
108 | - "omap_sx1.flash1-1", FLASH1_SIZE, | ||
109 | - blk_by_legacy_dinfo(dinfo), | ||
110 | - SECTOR_SIZE, 4, 0, 0, 0, 0, 0)) { | ||
111 | - fprintf(stderr, "qemu: Error registering flash memory %d.\n", | ||
112 | - fl_idx); | ||
113 | - } | ||
114 | + pflash_cfi01_register(OMAP_CS1_BASE, | ||
115 | + "omap_sx1.flash1-1", FLASH1_SIZE, | ||
116 | + blk_by_legacy_dinfo(dinfo), | ||
117 | + SECTOR_SIZE, 4, 0, 0, 0, 0, 0); | ||
118 | fl_idx++; | ||
119 | } else { | ||
120 | memory_region_init_io(&cs[1], NULL, &static_ops, &cs1val, | ||
121 | diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c | ||
122 | index XXXXXXX..XXXXXXX 100644 | ||
123 | --- a/hw/arm/versatilepb.c | ||
124 | +++ b/hw/arm/versatilepb.c | ||
125 | @@ -XXX,XX +XXX,XX @@ static void versatile_init(MachineState *machine, int board_id) | ||
126 | /* 0x34000000 NOR Flash */ | ||
127 | |||
128 | dinfo = drive_get(IF_PFLASH, 0, 0); | ||
129 | - if (!pflash_cfi01_register(VERSATILE_FLASH_ADDR, "versatile.flash", | ||
130 | + pflash_cfi01_register(VERSATILE_FLASH_ADDR, "versatile.flash", | ||
131 | VERSATILE_FLASH_SIZE, | ||
132 | dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, | ||
133 | VERSATILE_FLASH_SECT_SIZE, | ||
134 | - 4, 0x0089, 0x0018, 0x0000, 0x0, 0)) { | ||
135 | - fprintf(stderr, "qemu: Error registering flash memory.\n"); | ||
131 | - } | 136 | - } |
132 | - return true; | 137 | + 4, 0x0089, 0x0018, 0x0000, 0x0, 0); |
133 | + return gen_gvec_fpst_zzzz(s, fn, a->rd, a->rn, a->rm, a->ra, 0, FPST_FPCR); | 138 | |
134 | } | 139 | versatile_binfo.ram_size = machine->ram_size; |
135 | 140 | versatile_binfo.board_id = board_id; | |
136 | static gen_helper_gvec_4 * const sqdmlal_zzzw_fns[] = { | 141 | diff --git a/hw/arm/z2.c b/hw/arm/z2.c |
137 | @@ -XXX,XX +XXX,XX @@ static bool do_FMLAL_zzzw(DisasContext *s, arg_rrrr_esz *a, bool sub, bool sel) | 142 | index XXXXXXX..XXXXXXX 100644 |
138 | if (!dc_isar_feature(aa64_sve2, s)) { | 143 | --- a/hw/arm/z2.c |
139 | return false; | 144 | +++ b/hw/arm/z2.c |
140 | } | 145 | @@ -XXX,XX +XXX,XX @@ static void z2_init(MachineState *machine) |
141 | - if (sve_access_check(s)) { | 146 | mpu = pxa270_init(z2_binfo.ram_size, machine->cpu_type); |
142 | - unsigned vsz = vec_full_reg_size(s); | 147 | |
143 | - tcg_gen_gvec_4_ptr(vec_full_reg_offset(s, a->rd), | 148 | dinfo = drive_get(IF_PFLASH, 0, 0); |
144 | - vec_full_reg_offset(s, a->rn), | 149 | - if (!pflash_cfi01_register(Z2_FLASH_BASE, "z2.flash0", Z2_FLASH_SIZE, |
145 | - vec_full_reg_offset(s, a->rm), | 150 | - dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, |
146 | - vec_full_reg_offset(s, a->ra), | 151 | - FLASH_SECTOR_SIZE, 4, 0, 0, 0, 0, 0)) { |
147 | - cpu_env, vsz, vsz, (sel << 1) | sub, | 152 | - error_report("Error registering flash memory"); |
148 | - gen_helper_sve2_fmlal_zzzw_s); | 153 | - exit(1); |
149 | - } | 154 | - } |
150 | - return true; | 155 | + pflash_cfi01_register(Z2_FLASH_BASE, "z2.flash0", Z2_FLASH_SIZE, |
151 | + return gen_gvec_ptr_zzzz(s, gen_helper_sve2_fmlal_zzzw_s, | 156 | + dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, |
152 | + a->rd, a->rn, a->rm, a->ra, | 157 | + FLASH_SECTOR_SIZE, 4, 0, 0, 0, 0, 0); |
153 | + (sel << 1) | sub, cpu_env); | 158 | |
154 | } | 159 | /* setup keypad */ |
155 | 160 | pxa27x_register_keypad(mpu->kp, map, 0x100); | |
156 | static bool trans_FMLALB_zzzw(DisasContext *s, arg_rrrr_esz *a) | ||
157 | @@ -XXX,XX +XXX,XX @@ static bool do_FMLAL_zzxw(DisasContext *s, arg_rrxr_esz *a, bool sub, bool sel) | ||
158 | if (!dc_isar_feature(aa64_sve2, s)) { | ||
159 | return false; | ||
160 | } | ||
161 | - if (sve_access_check(s)) { | ||
162 | - unsigned vsz = vec_full_reg_size(s); | ||
163 | - tcg_gen_gvec_4_ptr(vec_full_reg_offset(s, a->rd), | ||
164 | - vec_full_reg_offset(s, a->rn), | ||
165 | - vec_full_reg_offset(s, a->rm), | ||
166 | - vec_full_reg_offset(s, a->ra), | ||
167 | - cpu_env, vsz, vsz, | ||
168 | - (a->index << 2) | (sel << 1) | sub, | ||
169 | - gen_helper_sve2_fmlal_zzxw_s); | ||
170 | - } | ||
171 | - return true; | ||
172 | + return gen_gvec_ptr_zzzz(s, gen_helper_sve2_fmlal_zzxw_s, | ||
173 | + a->rd, a->rn, a->rm, a->ra, | ||
174 | + (a->index << 2) | (sel << 1) | sub, cpu_env); | ||
175 | } | ||
176 | |||
177 | static bool trans_FMLALB_zzxw(DisasContext *s, arg_rrxr_esz *a) | ||
178 | @@ -XXX,XX +XXX,XX @@ static bool do_BFMLAL_zzzw(DisasContext *s, arg_rrrr_esz *a, bool sel) | ||
179 | if (!dc_isar_feature(aa64_sve_bf16, s)) { | ||
180 | return false; | ||
181 | } | ||
182 | - if (sve_access_check(s)) { | ||
183 | - TCGv_ptr status = fpstatus_ptr(FPST_FPCR); | ||
184 | - unsigned vsz = vec_full_reg_size(s); | ||
185 | - | ||
186 | - tcg_gen_gvec_4_ptr(vec_full_reg_offset(s, a->rd), | ||
187 | - vec_full_reg_offset(s, a->rn), | ||
188 | - vec_full_reg_offset(s, a->rm), | ||
189 | - vec_full_reg_offset(s, a->ra), | ||
190 | - status, vsz, vsz, sel, | ||
191 | - gen_helper_gvec_bfmlal); | ||
192 | - tcg_temp_free_ptr(status); | ||
193 | - } | ||
194 | - return true; | ||
195 | + return gen_gvec_fpst_zzzz(s, gen_helper_gvec_bfmlal, | ||
196 | + a->rd, a->rn, a->rm, a->ra, sel, FPST_FPCR); | ||
197 | } | ||
198 | |||
199 | static bool trans_BFMLALB_zzzw(DisasContext *s, arg_rrrr_esz *a) | ||
200 | @@ -XXX,XX +XXX,XX @@ static bool do_BFMLAL_zzxw(DisasContext *s, arg_rrxr_esz *a, bool sel) | ||
201 | if (!dc_isar_feature(aa64_sve_bf16, s)) { | ||
202 | return false; | ||
203 | } | ||
204 | - if (sve_access_check(s)) { | ||
205 | - TCGv_ptr status = fpstatus_ptr(FPST_FPCR); | ||
206 | - unsigned vsz = vec_full_reg_size(s); | ||
207 | - | ||
208 | - tcg_gen_gvec_4_ptr(vec_full_reg_offset(s, a->rd), | ||
209 | - vec_full_reg_offset(s, a->rn), | ||
210 | - vec_full_reg_offset(s, a->rm), | ||
211 | - vec_full_reg_offset(s, a->ra), | ||
212 | - status, vsz, vsz, (a->index << 1) | sel, | ||
213 | - gen_helper_gvec_bfmlal_idx); | ||
214 | - tcg_temp_free_ptr(status); | ||
215 | - } | ||
216 | - return true; | ||
217 | + return gen_gvec_fpst_zzzz(s, gen_helper_gvec_bfmlal_idx, | ||
218 | + a->rd, a->rn, a->rm, a->ra, | ||
219 | + (a->index << 1) | sel, FPST_FPCR); | ||
220 | } | ||
221 | |||
222 | static bool trans_BFMLALB_zzxw(DisasContext *s, arg_rrxr_esz *a) | ||
223 | -- | 161 | -- |
224 | 2.25.1 | 162 | 2.34.1 |
163 | |||
164 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Philippe Mathieu-Daudé <philmd@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 3 | To avoid forward-declaring PXA2xxI2CState, declare |
4 | Message-id: 20220527181907.189259-84-richard.henderson@linaro.org | 4 | PXA2XX_I2C before its use in pxa2xx_i2c_init() prototype. |
5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 5 | |
6 | Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> | ||
7 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
8 | Message-id: 20230109140306.23161-2-philmd@linaro.org | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
7 | --- | 10 | --- |
8 | target/arm/translate-sve.c | 11 ++--------- | 11 | include/hw/arm/pxa.h | 6 +++--- |
9 | 1 file changed, 2 insertions(+), 9 deletions(-) | 12 | 1 file changed, 3 insertions(+), 3 deletions(-) |
10 | 13 | ||
11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | 14 | diff --git a/include/hw/arm/pxa.h b/include/hw/arm/pxa.h |
12 | index XXXXXXX..XXXXXXX 100644 | 15 | index XXXXXXX..XXXXXXX 100644 |
13 | --- a/target/arm/translate-sve.c | 16 | --- a/include/hw/arm/pxa.h |
14 | +++ b/target/arm/translate-sve.c | 17 | +++ b/include/hw/arm/pxa.h |
15 | @@ -XXX,XX +XXX,XX @@ static bool do_FMLA_zzxz(DisasContext *s, arg_rrxr_esz *a, bool sub) | 18 | @@ -XXX,XX +XXX,XX @@ void pxa27x_register_keypad(PXA2xxKeyPadState *kp, |
16 | a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); | 19 | const struct keymap *map, int size); |
17 | } | 20 | |
18 | 21 | /* pxa2xx.c */ | |
19 | -static bool trans_FMLA_zzxz(DisasContext *s, arg_FMLA_zzxz *a) | 22 | -typedef struct PXA2xxI2CState PXA2xxI2CState; |
20 | -{ | 23 | +#define TYPE_PXA2XX_I2C "pxa2xx_i2c" |
21 | - return do_FMLA_zzxz(s, a, false); | 24 | +OBJECT_DECLARE_SIMPLE_TYPE(PXA2xxI2CState, PXA2XX_I2C) |
22 | -} | 25 | + |
23 | - | 26 | PXA2xxI2CState *pxa2xx_i2c_init(hwaddr base, |
24 | -static bool trans_FMLS_zzxz(DisasContext *s, arg_FMLA_zzxz *a) | 27 | qemu_irq irq, uint32_t page_size); |
25 | -{ | 28 | I2CBus *pxa2xx_i2c_bus(PXA2xxI2CState *s); |
26 | - return do_FMLA_zzxz(s, a, true); | 29 | |
27 | -} | 30 | -#define TYPE_PXA2XX_I2C "pxa2xx_i2c" |
28 | +TRANS_FEAT(FMLA_zzxz, aa64_sve, do_FMLA_zzxz, a, false) | 31 | typedef struct PXA2xxI2SState PXA2xxI2SState; |
29 | +TRANS_FEAT(FMLS_zzxz, aa64_sve, do_FMLA_zzxz, a, true) | 32 | -OBJECT_DECLARE_SIMPLE_TYPE(PXA2xxI2CState, PXA2XX_I2C) |
30 | 33 | ||
31 | /* | 34 | #define TYPE_PXA2XX_FIR "pxa2xx-fir" |
32 | *** SVE Floating Point Multiply Indexed Group | 35 | OBJECT_DECLARE_SIMPLE_TYPE(PXA2xxFIrState, PXA2XX_FIR) |
33 | -- | 36 | -- |
34 | 2.25.1 | 37 | 2.34.1 |
38 | |||
39 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Philippe Mathieu-Daudé <philmd@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 3 | Add a local 'struct omap_gpif_s *' variable to improve readability. |
4 | Message-id: 20220527181907.189259-82-richard.henderson@linaro.org | 4 | (This also eases next commit conversion). |
5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 5 | |
6 | Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> | ||
7 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
8 | Message-id: 20230109140306.23161-3-philmd@linaro.org | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
7 | --- | 10 | --- |
8 | target/arm/translate-sve.c | 5 +---- | 11 | hw/gpio/omap_gpio.c | 3 ++- |
9 | 1 file changed, 1 insertion(+), 4 deletions(-) | 12 | 1 file changed, 2 insertions(+), 1 deletion(-) |
10 | 13 | ||
11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | 14 | diff --git a/hw/gpio/omap_gpio.c b/hw/gpio/omap_gpio.c |
12 | index XXXXXXX..XXXXXXX 100644 | 15 | index XXXXXXX..XXXXXXX 100644 |
13 | --- a/target/arm/translate-sve.c | 16 | --- a/hw/gpio/omap_gpio.c |
14 | +++ b/target/arm/translate-sve.c | 17 | +++ b/hw/gpio/omap_gpio.c |
15 | @@ -XXX,XX +XXX,XX @@ static gen_helper_gvec_4 * const udiv_fns[4] = { | 18 | @@ -XXX,XX +XXX,XX @@ struct omap_gpif_s { |
16 | }; | 19 | /* General-Purpose I/O of OMAP1 */ |
17 | TRANS_FEAT(UDIV_zpzz, aa64_sve, gen_gvec_ool_arg_zpzz, udiv_fns[a->esz], a, 0) | 20 | static void omap_gpio_set(void *opaque, int line, int level) |
18 | 21 | { | |
19 | -static bool trans_SEL_zpzz(DisasContext *s, arg_rprr_esz *a) | 22 | - struct omap_gpio_s *s = &((struct omap_gpif_s *) opaque)->omap1; |
20 | -{ | 23 | + struct omap_gpif_s *p = opaque; |
21 | - return do_sel_z(s, a->rd, a->rn, a->rm, a->pg, a->esz); | 24 | + struct omap_gpio_s *s = &p->omap1; |
22 | -} | 25 | uint16_t prev = s->inputs; |
23 | +TRANS_FEAT(SEL_zpzz, aa64_sve, do_sel_z, a->rd, a->rn, a->rm, a->pg, a->esz) | 26 | |
24 | 27 | if (level) | |
25 | /* | ||
26 | *** SVE Integer Arithmetic - Unary Predicated Group | ||
27 | -- | 28 | -- |
28 | 2.25.1 | 29 | 2.34.1 |
30 | |||
31 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Philippe Mathieu-Daudé <philmd@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | Rename the function to match gen_gvec_ool_arg_zpz, | 3 | Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> |
4 | and move to be adjacent. | 4 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> |
5 | 5 | Message-id: 20230109140306.23161-4-philmd@linaro.org | |
6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
7 | Message-id: 20220527181907.189259-24-richard.henderson@linaro.org | ||
8 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
10 | --- | 7 | --- |
11 | target/arm/translate-sve.c | 29 ++++++++++++++--------------- | 8 | hw/arm/omap1.c | 115 ++++++++++++++++++-------------------- |
12 | 1 file changed, 14 insertions(+), 15 deletions(-) | 9 | hw/arm/omap2.c | 40 ++++++------- |
10 | hw/arm/omap_sx1.c | 2 +- | ||
11 | hw/arm/palm.c | 2 +- | ||
12 | hw/char/omap_uart.c | 7 +-- | ||
13 | hw/display/omap_dss.c | 15 +++-- | ||
14 | hw/display/omap_lcdc.c | 9 ++- | ||
15 | hw/dma/omap_dma.c | 15 +++-- | ||
16 | hw/gpio/omap_gpio.c | 15 +++-- | ||
17 | hw/intc/omap_intc.c | 12 ++-- | ||
18 | hw/misc/omap_gpmc.c | 12 ++-- | ||
19 | hw/misc/omap_l4.c | 7 +-- | ||
20 | hw/misc/omap_sdrc.c | 7 +-- | ||
21 | hw/misc/omap_tap.c | 5 +- | ||
22 | hw/sd/omap_mmc.c | 9 ++- | ||
23 | hw/ssi/omap_spi.c | 7 +-- | ||
24 | hw/timer/omap_gptimer.c | 22 ++++---- | ||
25 | hw/timer/omap_synctimer.c | 4 +- | ||
26 | 18 files changed, 142 insertions(+), 163 deletions(-) | ||
13 | 27 | ||
14 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | 28 | diff --git a/hw/arm/omap1.c b/hw/arm/omap1.c |
15 | index XXXXXXX..XXXXXXX 100644 | 29 | index XXXXXXX..XXXXXXX 100644 |
16 | --- a/target/arm/translate-sve.c | 30 | --- a/hw/arm/omap1.c |
17 | +++ b/target/arm/translate-sve.c | 31 | +++ b/hw/arm/omap1.c |
18 | @@ -XXX,XX +XXX,XX @@ static bool gen_gvec_ool_arg_zpz(DisasContext *s, gen_helper_gvec_3 *fn, | 32 | @@ -XXX,XX +XXX,XX @@ static void omap_timer_fire(void *opaque) |
19 | return gen_gvec_ool_zzp(s, fn, a->rd, a->rn, a->pg, data); | 33 | |
20 | } | 34 | static void omap_timer_tick(void *opaque) |
21 | 35 | { | |
22 | +static bool gen_gvec_ool_arg_zpzi(DisasContext *s, gen_helper_gvec_3 *fn, | 36 | - struct omap_mpu_timer_s *timer = (struct omap_mpu_timer_s *) opaque; |
23 | + arg_rpri_esz *a) | 37 | + struct omap_mpu_timer_s *timer = opaque; |
24 | +{ | 38 | |
25 | + return gen_gvec_ool_zzp(s, fn, a->rd, a->rn, a->pg, a->imm); | 39 | omap_timer_sync(timer); |
26 | +} | 40 | omap_timer_fire(timer); |
27 | 41 | @@ -XXX,XX +XXX,XX @@ static void omap_timer_tick(void *opaque) | |
28 | /* Invoke an out-of-line helper on 3 Zregs and a predicate. */ | 42 | |
29 | static void gen_gvec_ool_zzzp(DisasContext *s, gen_helper_gvec_4 *fn, | 43 | static void omap_timer_clk_update(void *opaque, int line, int on) |
30 | @@ -XXX,XX +XXX,XX @@ static bool do_movz_zpz(DisasContext *s, int rd, int rn, int pg, | 44 | { |
31 | return gen_gvec_ool_zzp(s, fns[esz], rd, rn, pg, invert); | 45 | - struct omap_mpu_timer_s *timer = (struct omap_mpu_timer_s *) opaque; |
32 | } | 46 | + struct omap_mpu_timer_s *timer = opaque; |
33 | 47 | ||
34 | -static bool do_zpzi_ool(DisasContext *s, arg_rpri_esz *a, | 48 | omap_timer_sync(timer); |
35 | - gen_helper_gvec_3 *fn) | 49 | timer->rate = on ? omap_clk_getrate(timer->clk) : 0; |
36 | -{ | 50 | @@ -XXX,XX +XXX,XX @@ static void omap_timer_clk_setup(struct omap_mpu_timer_s *timer) |
37 | - return gen_gvec_ool_zzp(s, fn, a->rd, a->rn, a->pg, a->imm); | 51 | static uint64_t omap_mpu_timer_read(void *opaque, hwaddr addr, |
38 | -} | 52 | unsigned size) |
39 | - | 53 | { |
40 | static bool trans_ASR_zpzi(DisasContext *s, arg_rpri_esz *a) | 54 | - struct omap_mpu_timer_s *s = (struct omap_mpu_timer_s *) opaque; |
41 | { | 55 | + struct omap_mpu_timer_s *s = opaque; |
42 | static gen_helper_gvec_3 * const fns[4] = { | 56 | |
43 | @@ -XXX,XX +XXX,XX @@ static bool trans_ASR_zpzi(DisasContext *s, arg_rpri_esz *a) | 57 | if (size != 4) { |
44 | /* Shift by element size is architecturally valid. For | 58 | return omap_badwidth_read32(opaque, addr); |
45 | arithmetic right-shift, it's the same as by one less. */ | 59 | @@ -XXX,XX +XXX,XX @@ static uint64_t omap_mpu_timer_read(void *opaque, hwaddr addr, |
46 | a->imm = MIN(a->imm, (8 << a->esz) - 1); | 60 | static void omap_mpu_timer_write(void *opaque, hwaddr addr, |
47 | - return do_zpzi_ool(s, a, fns[a->esz]); | 61 | uint64_t value, unsigned size) |
48 | + return gen_gvec_ool_arg_zpzi(s, fns[a->esz], a); | 62 | { |
49 | } | 63 | - struct omap_mpu_timer_s *s = (struct omap_mpu_timer_s *) opaque; |
50 | 64 | + struct omap_mpu_timer_s *s = opaque; | |
51 | static bool trans_LSR_zpzi(DisasContext *s, arg_rpri_esz *a) | 65 | |
52 | @@ -XXX,XX +XXX,XX @@ static bool trans_LSR_zpzi(DisasContext *s, arg_rpri_esz *a) | 66 | if (size != 4) { |
53 | if (a->imm >= (8 << a->esz)) { | 67 | omap_badwidth_write32(opaque, addr, value); |
54 | return do_movz_zpz(s, a->rd, a->rd, a->pg, a->esz, true); | 68 | @@ -XXX,XX +XXX,XX @@ struct omap_watchdog_timer_s { |
55 | } else { | 69 | static uint64_t omap_wd_timer_read(void *opaque, hwaddr addr, |
56 | - return do_zpzi_ool(s, a, fns[a->esz]); | 70 | unsigned size) |
57 | + return gen_gvec_ool_arg_zpzi(s, fns[a->esz], a); | 71 | { |
72 | - struct omap_watchdog_timer_s *s = (struct omap_watchdog_timer_s *) opaque; | ||
73 | + struct omap_watchdog_timer_s *s = opaque; | ||
74 | |||
75 | if (size != 2) { | ||
76 | return omap_badwidth_read16(opaque, addr); | ||
77 | @@ -XXX,XX +XXX,XX @@ static uint64_t omap_wd_timer_read(void *opaque, hwaddr addr, | ||
78 | static void omap_wd_timer_write(void *opaque, hwaddr addr, | ||
79 | uint64_t value, unsigned size) | ||
80 | { | ||
81 | - struct omap_watchdog_timer_s *s = (struct omap_watchdog_timer_s *) opaque; | ||
82 | + struct omap_watchdog_timer_s *s = opaque; | ||
83 | |||
84 | if (size != 2) { | ||
85 | omap_badwidth_write16(opaque, addr, value); | ||
86 | @@ -XXX,XX +XXX,XX @@ struct omap_32khz_timer_s { | ||
87 | static uint64_t omap_os_timer_read(void *opaque, hwaddr addr, | ||
88 | unsigned size) | ||
89 | { | ||
90 | - struct omap_32khz_timer_s *s = (struct omap_32khz_timer_s *) opaque; | ||
91 | + struct omap_32khz_timer_s *s = opaque; | ||
92 | int offset = addr & OMAP_MPUI_REG_MASK; | ||
93 | |||
94 | if (size != 4) { | ||
95 | @@ -XXX,XX +XXX,XX @@ static uint64_t omap_os_timer_read(void *opaque, hwaddr addr, | ||
96 | static void omap_os_timer_write(void *opaque, hwaddr addr, | ||
97 | uint64_t value, unsigned size) | ||
98 | { | ||
99 | - struct omap_32khz_timer_s *s = (struct omap_32khz_timer_s *) opaque; | ||
100 | + struct omap_32khz_timer_s *s = opaque; | ||
101 | int offset = addr & OMAP_MPUI_REG_MASK; | ||
102 | |||
103 | if (size != 4) { | ||
104 | @@ -XXX,XX +XXX,XX @@ static struct omap_32khz_timer_s *omap_os_timer_init(MemoryRegion *memory, | ||
105 | static uint64_t omap_ulpd_pm_read(void *opaque, hwaddr addr, | ||
106 | unsigned size) | ||
107 | { | ||
108 | - struct omap_mpu_state_s *s = (struct omap_mpu_state_s *) opaque; | ||
109 | + struct omap_mpu_state_s *s = opaque; | ||
110 | uint16_t ret; | ||
111 | |||
112 | if (size != 2) { | ||
113 | @@ -XXX,XX +XXX,XX @@ static inline void omap_ulpd_req_update(struct omap_mpu_state_s *s, | ||
114 | static void omap_ulpd_pm_write(void *opaque, hwaddr addr, | ||
115 | uint64_t value, unsigned size) | ||
116 | { | ||
117 | - struct omap_mpu_state_s *s = (struct omap_mpu_state_s *) opaque; | ||
118 | + struct omap_mpu_state_s *s = opaque; | ||
119 | int64_t now, ticks; | ||
120 | int div, mult; | ||
121 | static const int bypass_div[4] = { 1, 2, 4, 4 }; | ||
122 | @@ -XXX,XX +XXX,XX @@ static void omap_ulpd_pm_init(MemoryRegion *system_memory, | ||
123 | static uint64_t omap_pin_cfg_read(void *opaque, hwaddr addr, | ||
124 | unsigned size) | ||
125 | { | ||
126 | - struct omap_mpu_state_s *s = (struct omap_mpu_state_s *) opaque; | ||
127 | + struct omap_mpu_state_s *s = opaque; | ||
128 | |||
129 | if (size != 4) { | ||
130 | return omap_badwidth_read32(opaque, addr); | ||
131 | @@ -XXX,XX +XXX,XX @@ static inline void omap_pin_modconf1_update(struct omap_mpu_state_s *s, | ||
132 | static void omap_pin_cfg_write(void *opaque, hwaddr addr, | ||
133 | uint64_t value, unsigned size) | ||
134 | { | ||
135 | - struct omap_mpu_state_s *s = (struct omap_mpu_state_s *) opaque; | ||
136 | + struct omap_mpu_state_s *s = opaque; | ||
137 | uint32_t diff; | ||
138 | |||
139 | if (size != 4) { | ||
140 | @@ -XXX,XX +XXX,XX @@ static void omap_pin_cfg_init(MemoryRegion *system_memory, | ||
141 | static uint64_t omap_id_read(void *opaque, hwaddr addr, | ||
142 | unsigned size) | ||
143 | { | ||
144 | - struct omap_mpu_state_s *s = (struct omap_mpu_state_s *) opaque; | ||
145 | + struct omap_mpu_state_s *s = opaque; | ||
146 | |||
147 | if (size != 4) { | ||
148 | return omap_badwidth_read32(opaque, addr); | ||
149 | @@ -XXX,XX +XXX,XX @@ static void omap_id_init(MemoryRegion *memory, struct omap_mpu_state_s *mpu) | ||
150 | static uint64_t omap_mpui_read(void *opaque, hwaddr addr, | ||
151 | unsigned size) | ||
152 | { | ||
153 | - struct omap_mpu_state_s *s = (struct omap_mpu_state_s *) opaque; | ||
154 | + struct omap_mpu_state_s *s = opaque; | ||
155 | |||
156 | if (size != 4) { | ||
157 | return omap_badwidth_read32(opaque, addr); | ||
158 | @@ -XXX,XX +XXX,XX @@ static uint64_t omap_mpui_read(void *opaque, hwaddr addr, | ||
159 | static void omap_mpui_write(void *opaque, hwaddr addr, | ||
160 | uint64_t value, unsigned size) | ||
161 | { | ||
162 | - struct omap_mpu_state_s *s = (struct omap_mpu_state_s *) opaque; | ||
163 | + struct omap_mpu_state_s *s = opaque; | ||
164 | |||
165 | if (size != 4) { | ||
166 | omap_badwidth_write32(opaque, addr, value); | ||
167 | @@ -XXX,XX +XXX,XX @@ struct omap_tipb_bridge_s { | ||
168 | static uint64_t omap_tipb_bridge_read(void *opaque, hwaddr addr, | ||
169 | unsigned size) | ||
170 | { | ||
171 | - struct omap_tipb_bridge_s *s = (struct omap_tipb_bridge_s *) opaque; | ||
172 | + struct omap_tipb_bridge_s *s = opaque; | ||
173 | |||
174 | if (size < 2) { | ||
175 | return omap_badwidth_read16(opaque, addr); | ||
176 | @@ -XXX,XX +XXX,XX @@ static uint64_t omap_tipb_bridge_read(void *opaque, hwaddr addr, | ||
177 | static void omap_tipb_bridge_write(void *opaque, hwaddr addr, | ||
178 | uint64_t value, unsigned size) | ||
179 | { | ||
180 | - struct omap_tipb_bridge_s *s = (struct omap_tipb_bridge_s *) opaque; | ||
181 | + struct omap_tipb_bridge_s *s = opaque; | ||
182 | |||
183 | if (size < 2) { | ||
184 | omap_badwidth_write16(opaque, addr, value); | ||
185 | @@ -XXX,XX +XXX,XX @@ static struct omap_tipb_bridge_s *omap_tipb_bridge_init( | ||
186 | static uint64_t omap_tcmi_read(void *opaque, hwaddr addr, | ||
187 | unsigned size) | ||
188 | { | ||
189 | - struct omap_mpu_state_s *s = (struct omap_mpu_state_s *) opaque; | ||
190 | + struct omap_mpu_state_s *s = opaque; | ||
191 | uint32_t ret; | ||
192 | |||
193 | if (size != 4) { | ||
194 | @@ -XXX,XX +XXX,XX @@ static uint64_t omap_tcmi_read(void *opaque, hwaddr addr, | ||
195 | static void omap_tcmi_write(void *opaque, hwaddr addr, | ||
196 | uint64_t value, unsigned size) | ||
197 | { | ||
198 | - struct omap_mpu_state_s *s = (struct omap_mpu_state_s *) opaque; | ||
199 | + struct omap_mpu_state_s *s = opaque; | ||
200 | |||
201 | if (size != 4) { | ||
202 | omap_badwidth_write32(opaque, addr, value); | ||
203 | @@ -XXX,XX +XXX,XX @@ struct dpll_ctl_s { | ||
204 | static uint64_t omap_dpll_read(void *opaque, hwaddr addr, | ||
205 | unsigned size) | ||
206 | { | ||
207 | - struct dpll_ctl_s *s = (struct dpll_ctl_s *) opaque; | ||
208 | + struct dpll_ctl_s *s = opaque; | ||
209 | |||
210 | if (size != 2) { | ||
211 | return omap_badwidth_read16(opaque, addr); | ||
212 | @@ -XXX,XX +XXX,XX @@ static uint64_t omap_dpll_read(void *opaque, hwaddr addr, | ||
213 | static void omap_dpll_write(void *opaque, hwaddr addr, | ||
214 | uint64_t value, unsigned size) | ||
215 | { | ||
216 | - struct dpll_ctl_s *s = (struct dpll_ctl_s *) opaque; | ||
217 | + struct dpll_ctl_s *s = opaque; | ||
218 | uint16_t diff; | ||
219 | static const int bypass_div[4] = { 1, 2, 4, 4 }; | ||
220 | int div, mult; | ||
221 | @@ -XXX,XX +XXX,XX @@ static struct dpll_ctl_s *omap_dpll_init(MemoryRegion *memory, | ||
222 | static uint64_t omap_clkm_read(void *opaque, hwaddr addr, | ||
223 | unsigned size) | ||
224 | { | ||
225 | - struct omap_mpu_state_s *s = (struct omap_mpu_state_s *) opaque; | ||
226 | + struct omap_mpu_state_s *s = opaque; | ||
227 | |||
228 | if (size != 2) { | ||
229 | return omap_badwidth_read16(opaque, addr); | ||
230 | @@ -XXX,XX +XXX,XX @@ static inline void omap_clkm_ckout1_update(struct omap_mpu_state_s *s, | ||
231 | static void omap_clkm_write(void *opaque, hwaddr addr, | ||
232 | uint64_t value, unsigned size) | ||
233 | { | ||
234 | - struct omap_mpu_state_s *s = (struct omap_mpu_state_s *) opaque; | ||
235 | + struct omap_mpu_state_s *s = opaque; | ||
236 | uint16_t diff; | ||
237 | omap_clk clk; | ||
238 | static const char *clkschemename[8] = { | ||
239 | @@ -XXX,XX +XXX,XX @@ static const MemoryRegionOps omap_clkm_ops = { | ||
240 | static uint64_t omap_clkdsp_read(void *opaque, hwaddr addr, | ||
241 | unsigned size) | ||
242 | { | ||
243 | - struct omap_mpu_state_s *s = (struct omap_mpu_state_s *) opaque; | ||
244 | + struct omap_mpu_state_s *s = opaque; | ||
245 | CPUState *cpu = CPU(s->cpu); | ||
246 | |||
247 | if (size != 2) { | ||
248 | @@ -XXX,XX +XXX,XX @@ static inline void omap_clkdsp_idlect2_update(struct omap_mpu_state_s *s, | ||
249 | static void omap_clkdsp_write(void *opaque, hwaddr addr, | ||
250 | uint64_t value, unsigned size) | ||
251 | { | ||
252 | - struct omap_mpu_state_s *s = (struct omap_mpu_state_s *) opaque; | ||
253 | + struct omap_mpu_state_s *s = opaque; | ||
254 | uint16_t diff; | ||
255 | |||
256 | if (size != 2) { | ||
257 | @@ -XXX,XX +XXX,XX @@ struct omap_mpuio_s { | ||
258 | |||
259 | static void omap_mpuio_set(void *opaque, int line, int level) | ||
260 | { | ||
261 | - struct omap_mpuio_s *s = (struct omap_mpuio_s *) opaque; | ||
262 | + struct omap_mpuio_s *s = opaque; | ||
263 | uint16_t prev = s->inputs; | ||
264 | |||
265 | if (level) | ||
266 | @@ -XXX,XX +XXX,XX @@ static void omap_mpuio_kbd_update(struct omap_mpuio_s *s) | ||
267 | static uint64_t omap_mpuio_read(void *opaque, hwaddr addr, | ||
268 | unsigned size) | ||
269 | { | ||
270 | - struct omap_mpuio_s *s = (struct omap_mpuio_s *) opaque; | ||
271 | + struct omap_mpuio_s *s = opaque; | ||
272 | int offset = addr & OMAP_MPUI_REG_MASK; | ||
273 | uint16_t ret; | ||
274 | |||
275 | @@ -XXX,XX +XXX,XX @@ static uint64_t omap_mpuio_read(void *opaque, hwaddr addr, | ||
276 | static void omap_mpuio_write(void *opaque, hwaddr addr, | ||
277 | uint64_t value, unsigned size) | ||
278 | { | ||
279 | - struct omap_mpuio_s *s = (struct omap_mpuio_s *) opaque; | ||
280 | + struct omap_mpuio_s *s = opaque; | ||
281 | int offset = addr & OMAP_MPUI_REG_MASK; | ||
282 | uint16_t diff; | ||
283 | int ln; | ||
284 | @@ -XXX,XX +XXX,XX @@ static void omap_mpuio_reset(struct omap_mpuio_s *s) | ||
285 | |||
286 | static void omap_mpuio_onoff(void *opaque, int line, int on) | ||
287 | { | ||
288 | - struct omap_mpuio_s *s = (struct omap_mpuio_s *) opaque; | ||
289 | + struct omap_mpuio_s *s = opaque; | ||
290 | |||
291 | s->clk = on; | ||
292 | if (on) | ||
293 | @@ -XXX,XX +XXX,XX @@ static void omap_uwire_transfer_start(struct omap_uwire_s *s) | ||
58 | } | 294 | } |
59 | } | 295 | } |
60 | 296 | ||
61 | @@ -XXX,XX +XXX,XX @@ static bool trans_LSL_zpzi(DisasContext *s, arg_rpri_esz *a) | 297 | -static uint64_t omap_uwire_read(void *opaque, hwaddr addr, |
62 | if (a->imm >= (8 << a->esz)) { | 298 | - unsigned size) |
63 | return do_movz_zpz(s, a->rd, a->rd, a->pg, a->esz, true); | 299 | +static uint64_t omap_uwire_read(void *opaque, hwaddr addr, unsigned size) |
64 | } else { | 300 | { |
65 | - return do_zpzi_ool(s, a, fns[a->esz]); | 301 | - struct omap_uwire_s *s = (struct omap_uwire_s *) opaque; |
66 | + return gen_gvec_ool_arg_zpzi(s, fns[a->esz], a); | 302 | + struct omap_uwire_s *s = opaque; |
303 | int offset = addr & OMAP_MPUI_REG_MASK; | ||
304 | |||
305 | if (size != 2) { | ||
306 | @@ -XXX,XX +XXX,XX @@ static uint64_t omap_uwire_read(void *opaque, hwaddr addr, | ||
307 | static void omap_uwire_write(void *opaque, hwaddr addr, | ||
308 | uint64_t value, unsigned size) | ||
309 | { | ||
310 | - struct omap_uwire_s *s = (struct omap_uwire_s *) opaque; | ||
311 | + struct omap_uwire_s *s = opaque; | ||
312 | int offset = addr & OMAP_MPUI_REG_MASK; | ||
313 | |||
314 | if (size != 2) { | ||
315 | @@ -XXX,XX +XXX,XX @@ static void omap_pwl_update(struct omap_pwl_s *s) | ||
67 | } | 316 | } |
68 | } | 317 | } |
69 | 318 | ||
70 | @@ -XXX,XX +XXX,XX @@ static bool trans_ASRD(DisasContext *s, arg_rpri_esz *a) | 319 | -static uint64_t omap_pwl_read(void *opaque, hwaddr addr, |
71 | if (a->imm >= (8 << a->esz)) { | 320 | - unsigned size) |
72 | return do_movz_zpz(s, a->rd, a->rd, a->pg, a->esz, true); | 321 | +static uint64_t omap_pwl_read(void *opaque, hwaddr addr, unsigned size) |
73 | } else { | 322 | { |
74 | - return do_zpzi_ool(s, a, fns[a->esz]); | 323 | - struct omap_pwl_s *s = (struct omap_pwl_s *) opaque; |
75 | + return gen_gvec_ool_arg_zpzi(s, fns[a->esz], a); | 324 | + struct omap_pwl_s *s = opaque; |
325 | int offset = addr & OMAP_MPUI_REG_MASK; | ||
326 | |||
327 | if (size != 1) { | ||
328 | @@ -XXX,XX +XXX,XX @@ static uint64_t omap_pwl_read(void *opaque, hwaddr addr, | ||
329 | static void omap_pwl_write(void *opaque, hwaddr addr, | ||
330 | uint64_t value, unsigned size) | ||
331 | { | ||
332 | - struct omap_pwl_s *s = (struct omap_pwl_s *) opaque; | ||
333 | + struct omap_pwl_s *s = opaque; | ||
334 | int offset = addr & OMAP_MPUI_REG_MASK; | ||
335 | |||
336 | if (size != 1) { | ||
337 | @@ -XXX,XX +XXX,XX @@ static void omap_pwl_reset(struct omap_pwl_s *s) | ||
338 | |||
339 | static void omap_pwl_clk_update(void *opaque, int line, int on) | ||
340 | { | ||
341 | - struct omap_pwl_s *s = (struct omap_pwl_s *) opaque; | ||
342 | + struct omap_pwl_s *s = opaque; | ||
343 | |||
344 | s->clk = on; | ||
345 | omap_pwl_update(s); | ||
346 | @@ -XXX,XX +XXX,XX @@ struct omap_pwt_s { | ||
347 | omap_clk clk; | ||
348 | }; | ||
349 | |||
350 | -static uint64_t omap_pwt_read(void *opaque, hwaddr addr, | ||
351 | - unsigned size) | ||
352 | +static uint64_t omap_pwt_read(void *opaque, hwaddr addr, unsigned size) | ||
353 | { | ||
354 | - struct omap_pwt_s *s = (struct omap_pwt_s *) opaque; | ||
355 | + struct omap_pwt_s *s = opaque; | ||
356 | int offset = addr & OMAP_MPUI_REG_MASK; | ||
357 | |||
358 | if (size != 1) { | ||
359 | @@ -XXX,XX +XXX,XX @@ static uint64_t omap_pwt_read(void *opaque, hwaddr addr, | ||
360 | static void omap_pwt_write(void *opaque, hwaddr addr, | ||
361 | uint64_t value, unsigned size) | ||
362 | { | ||
363 | - struct omap_pwt_s *s = (struct omap_pwt_s *) opaque; | ||
364 | + struct omap_pwt_s *s = opaque; | ||
365 | int offset = addr & OMAP_MPUI_REG_MASK; | ||
366 | |||
367 | if (size != 1) { | ||
368 | @@ -XXX,XX +XXX,XX @@ static void omap_rtc_alarm_update(struct omap_rtc_s *s) | ||
369 | printf("%s: conversion failed\n", __func__); | ||
370 | } | ||
371 | |||
372 | -static uint64_t omap_rtc_read(void *opaque, hwaddr addr, | ||
373 | - unsigned size) | ||
374 | +static uint64_t omap_rtc_read(void *opaque, hwaddr addr, unsigned size) | ||
375 | { | ||
376 | - struct omap_rtc_s *s = (struct omap_rtc_s *) opaque; | ||
377 | + struct omap_rtc_s *s = opaque; | ||
378 | int offset = addr & OMAP_MPUI_REG_MASK; | ||
379 | uint8_t i; | ||
380 | |||
381 | @@ -XXX,XX +XXX,XX @@ static uint64_t omap_rtc_read(void *opaque, hwaddr addr, | ||
382 | static void omap_rtc_write(void *opaque, hwaddr addr, | ||
383 | uint64_t value, unsigned size) | ||
384 | { | ||
385 | - struct omap_rtc_s *s = (struct omap_rtc_s *) opaque; | ||
386 | + struct omap_rtc_s *s = opaque; | ||
387 | int offset = addr & OMAP_MPUI_REG_MASK; | ||
388 | struct tm new_tm; | ||
389 | time_t ti[2]; | ||
390 | @@ -XXX,XX +XXX,XX @@ static void omap_mcbsp_rx_newdata(struct omap_mcbsp_s *s) | ||
391 | |||
392 | static void omap_mcbsp_source_tick(void *opaque) | ||
393 | { | ||
394 | - struct omap_mcbsp_s *s = (struct omap_mcbsp_s *) opaque; | ||
395 | + struct omap_mcbsp_s *s = opaque; | ||
396 | static const int bps[8] = { 0, 1, 1, 2, 2, 2, -255, -255 }; | ||
397 | |||
398 | if (!s->rx_rate) | ||
399 | @@ -XXX,XX +XXX,XX @@ static void omap_mcbsp_tx_newdata(struct omap_mcbsp_s *s) | ||
400 | |||
401 | static void omap_mcbsp_sink_tick(void *opaque) | ||
402 | { | ||
403 | - struct omap_mcbsp_s *s = (struct omap_mcbsp_s *) opaque; | ||
404 | + struct omap_mcbsp_s *s = opaque; | ||
405 | static const int bps[8] = { 0, 1, 1, 2, 2, 2, -255, -255 }; | ||
406 | |||
407 | if (!s->tx_rate) | ||
408 | @@ -XXX,XX +XXX,XX @@ static void omap_mcbsp_req_update(struct omap_mcbsp_s *s) | ||
409 | static uint64_t omap_mcbsp_read(void *opaque, hwaddr addr, | ||
410 | unsigned size) | ||
411 | { | ||
412 | - struct omap_mcbsp_s *s = (struct omap_mcbsp_s *) opaque; | ||
413 | + struct omap_mcbsp_s *s = opaque; | ||
414 | int offset = addr & OMAP_MPUI_REG_MASK; | ||
415 | uint16_t ret; | ||
416 | |||
417 | @@ -XXX,XX +XXX,XX @@ static uint64_t omap_mcbsp_read(void *opaque, hwaddr addr, | ||
418 | static void omap_mcbsp_writeh(void *opaque, hwaddr addr, | ||
419 | uint32_t value) | ||
420 | { | ||
421 | - struct omap_mcbsp_s *s = (struct omap_mcbsp_s *) opaque; | ||
422 | + struct omap_mcbsp_s *s = opaque; | ||
423 | int offset = addr & OMAP_MPUI_REG_MASK; | ||
424 | |||
425 | switch (offset) { | ||
426 | @@ -XXX,XX +XXX,XX @@ static void omap_mcbsp_writeh(void *opaque, hwaddr addr, | ||
427 | static void omap_mcbsp_writew(void *opaque, hwaddr addr, | ||
428 | uint32_t value) | ||
429 | { | ||
430 | - struct omap_mcbsp_s *s = (struct omap_mcbsp_s *) opaque; | ||
431 | + struct omap_mcbsp_s *s = opaque; | ||
432 | int offset = addr & OMAP_MPUI_REG_MASK; | ||
433 | |||
434 | if (offset == 0x04) { /* DXR */ | ||
435 | @@ -XXX,XX +XXX,XX @@ static struct omap_mcbsp_s *omap_mcbsp_init(MemoryRegion *system_memory, | ||
436 | |||
437 | static void omap_mcbsp_i2s_swallow(void *opaque, int line, int level) | ||
438 | { | ||
439 | - struct omap_mcbsp_s *s = (struct omap_mcbsp_s *) opaque; | ||
440 | + struct omap_mcbsp_s *s = opaque; | ||
441 | |||
442 | if (s->rx_rate) { | ||
443 | s->rx_req = s->codec->in.len; | ||
444 | @@ -XXX,XX +XXX,XX @@ static void omap_mcbsp_i2s_swallow(void *opaque, int line, int level) | ||
445 | |||
446 | static void omap_mcbsp_i2s_start(void *opaque, int line, int level) | ||
447 | { | ||
448 | - struct omap_mcbsp_s *s = (struct omap_mcbsp_s *) opaque; | ||
449 | + struct omap_mcbsp_s *s = opaque; | ||
450 | |||
451 | if (s->tx_rate) { | ||
452 | s->tx_req = s->codec->out.size; | ||
453 | @@ -XXX,XX +XXX,XX @@ static void omap_lpg_reset(struct omap_lpg_s *s) | ||
454 | omap_lpg_update(s); | ||
455 | } | ||
456 | |||
457 | -static uint64_t omap_lpg_read(void *opaque, hwaddr addr, | ||
458 | - unsigned size) | ||
459 | +static uint64_t omap_lpg_read(void *opaque, hwaddr addr, unsigned size) | ||
460 | { | ||
461 | - struct omap_lpg_s *s = (struct omap_lpg_s *) opaque; | ||
462 | + struct omap_lpg_s *s = opaque; | ||
463 | int offset = addr & OMAP_MPUI_REG_MASK; | ||
464 | |||
465 | if (size != 1) { | ||
466 | @@ -XXX,XX +XXX,XX @@ static uint64_t omap_lpg_read(void *opaque, hwaddr addr, | ||
467 | static void omap_lpg_write(void *opaque, hwaddr addr, | ||
468 | uint64_t value, unsigned size) | ||
469 | { | ||
470 | - struct omap_lpg_s *s = (struct omap_lpg_s *) opaque; | ||
471 | + struct omap_lpg_s *s = opaque; | ||
472 | int offset = addr & OMAP_MPUI_REG_MASK; | ||
473 | |||
474 | if (size != 1) { | ||
475 | @@ -XXX,XX +XXX,XX @@ static const MemoryRegionOps omap_lpg_ops = { | ||
476 | |||
477 | static void omap_lpg_clk_update(void *opaque, int line, int on) | ||
478 | { | ||
479 | - struct omap_lpg_s *s = (struct omap_lpg_s *) opaque; | ||
480 | + struct omap_lpg_s *s = opaque; | ||
481 | |||
482 | s->clk = on; | ||
483 | omap_lpg_update(s); | ||
484 | @@ -XXX,XX +XXX,XX @@ static void omap_setup_mpui_io(MemoryRegion *system_memory, | ||
485 | /* General chip reset */ | ||
486 | static void omap1_mpu_reset(void *opaque) | ||
487 | { | ||
488 | - struct omap_mpu_state_s *mpu = (struct omap_mpu_state_s *) opaque; | ||
489 | + struct omap_mpu_state_s *mpu = opaque; | ||
490 | |||
491 | omap_dma_reset(mpu->dma); | ||
492 | omap_mpu_timer_reset(mpu->timer[0]); | ||
493 | @@ -XXX,XX +XXX,XX @@ static void omap_setup_dsp_mapping(MemoryRegion *system_memory, | ||
494 | |||
495 | void omap_mpu_wakeup(void *opaque, int irq, int req) | ||
496 | { | ||
497 | - struct omap_mpu_state_s *mpu = (struct omap_mpu_state_s *) opaque; | ||
498 | + struct omap_mpu_state_s *mpu = opaque; | ||
499 | CPUState *cpu = CPU(mpu->cpu); | ||
500 | |||
501 | if (cpu->halted) { | ||
502 | diff --git a/hw/arm/omap2.c b/hw/arm/omap2.c | ||
503 | index XXXXXXX..XXXXXXX 100644 | ||
504 | --- a/hw/arm/omap2.c | ||
505 | +++ b/hw/arm/omap2.c | ||
506 | @@ -XXX,XX +XXX,XX @@ static inline void omap_eac_out_empty(struct omap_eac_s *s) | ||
507 | |||
508 | static void omap_eac_in_cb(void *opaque, int avail_b) | ||
509 | { | ||
510 | - struct omap_eac_s *s = (struct omap_eac_s *) opaque; | ||
511 | + struct omap_eac_s *s = opaque; | ||
512 | |||
513 | s->codec.rxavail = avail_b >> 2; | ||
514 | omap_eac_in_refill(s); | ||
515 | @@ -XXX,XX +XXX,XX @@ static void omap_eac_in_cb(void *opaque, int avail_b) | ||
516 | |||
517 | static void omap_eac_out_cb(void *opaque, int free_b) | ||
518 | { | ||
519 | - struct omap_eac_s *s = (struct omap_eac_s *) opaque; | ||
520 | + struct omap_eac_s *s = opaque; | ||
521 | |||
522 | s->codec.txavail = free_b >> 2; | ||
523 | if (s->codec.txlen) | ||
524 | @@ -XXX,XX +XXX,XX @@ static void omap_eac_reset(struct omap_eac_s *s) | ||
525 | omap_eac_interrupt_update(s); | ||
526 | } | ||
527 | |||
528 | -static uint64_t omap_eac_read(void *opaque, hwaddr addr, | ||
529 | - unsigned size) | ||
530 | +static uint64_t omap_eac_read(void *opaque, hwaddr addr, unsigned size) | ||
531 | { | ||
532 | - struct omap_eac_s *s = (struct omap_eac_s *) opaque; | ||
533 | + struct omap_eac_s *s = opaque; | ||
534 | uint32_t ret; | ||
535 | |||
536 | if (size != 2) { | ||
537 | @@ -XXX,XX +XXX,XX @@ static uint64_t omap_eac_read(void *opaque, hwaddr addr, | ||
538 | static void omap_eac_write(void *opaque, hwaddr addr, | ||
539 | uint64_t value, unsigned size) | ||
540 | { | ||
541 | - struct omap_eac_s *s = (struct omap_eac_s *) opaque; | ||
542 | + struct omap_eac_s *s = opaque; | ||
543 | |||
544 | if (size != 2) { | ||
545 | omap_badwidth_write16(opaque, addr, value); | ||
546 | @@ -XXX,XX +XXX,XX @@ static void omap_sti_reset(struct omap_sti_s *s) | ||
547 | static uint64_t omap_sti_read(void *opaque, hwaddr addr, | ||
548 | unsigned size) | ||
549 | { | ||
550 | - struct omap_sti_s *s = (struct omap_sti_s *) opaque; | ||
551 | + struct omap_sti_s *s = opaque; | ||
552 | |||
553 | if (size != 4) { | ||
554 | return omap_badwidth_read32(opaque, addr); | ||
555 | @@ -XXX,XX +XXX,XX @@ static uint64_t omap_sti_read(void *opaque, hwaddr addr, | ||
556 | static void omap_sti_write(void *opaque, hwaddr addr, | ||
557 | uint64_t value, unsigned size) | ||
558 | { | ||
559 | - struct omap_sti_s *s = (struct omap_sti_s *) opaque; | ||
560 | + struct omap_sti_s *s = opaque; | ||
561 | |||
562 | if (size != 4) { | ||
563 | omap_badwidth_write32(opaque, addr, value); | ||
564 | @@ -XXX,XX +XXX,XX @@ static const MemoryRegionOps omap_sti_ops = { | ||
565 | .endianness = DEVICE_NATIVE_ENDIAN, | ||
566 | }; | ||
567 | |||
568 | -static uint64_t omap_sti_fifo_read(void *opaque, hwaddr addr, | ||
569 | - unsigned size) | ||
570 | +static uint64_t omap_sti_fifo_read(void *opaque, hwaddr addr, unsigned size) | ||
571 | { | ||
572 | OMAP_BAD_REG(addr); | ||
573 | return 0; | ||
574 | @@ -XXX,XX +XXX,XX @@ static uint64_t omap_sti_fifo_read(void *opaque, hwaddr addr, | ||
575 | static void omap_sti_fifo_write(void *opaque, hwaddr addr, | ||
576 | uint64_t value, unsigned size) | ||
577 | { | ||
578 | - struct omap_sti_s *s = (struct omap_sti_s *) opaque; | ||
579 | + struct omap_sti_s *s = opaque; | ||
580 | int ch = addr >> 6; | ||
581 | uint8_t byte = value; | ||
582 | |||
583 | @@ -XXX,XX +XXX,XX @@ static void omap_prcm_int_update(struct omap_prcm_s *s, int dom) | ||
584 | static uint64_t omap_prcm_read(void *opaque, hwaddr addr, | ||
585 | unsigned size) | ||
586 | { | ||
587 | - struct omap_prcm_s *s = (struct omap_prcm_s *) opaque; | ||
588 | + struct omap_prcm_s *s = opaque; | ||
589 | uint32_t ret; | ||
590 | |||
591 | if (size != 4) { | ||
592 | @@ -XXX,XX +XXX,XX @@ static void omap_prcm_dpll_update(struct omap_prcm_s *s) | ||
593 | static void omap_prcm_write(void *opaque, hwaddr addr, | ||
594 | uint64_t value, unsigned size) | ||
595 | { | ||
596 | - struct omap_prcm_s *s = (struct omap_prcm_s *) opaque; | ||
597 | + struct omap_prcm_s *s = opaque; | ||
598 | |||
599 | if (size != 4) { | ||
600 | omap_badwidth_write32(opaque, addr, value); | ||
601 | @@ -XXX,XX +XXX,XX @@ struct omap_sysctl_s { | ||
602 | static uint32_t omap_sysctl_read8(void *opaque, hwaddr addr) | ||
603 | { | ||
604 | |||
605 | - struct omap_sysctl_s *s = (struct omap_sysctl_s *) opaque; | ||
606 | + struct omap_sysctl_s *s = opaque; | ||
607 | int pad_offset, byte_offset; | ||
608 | int value; | ||
609 | |||
610 | @@ -XXX,XX +XXX,XX @@ static uint32_t omap_sysctl_read8(void *opaque, hwaddr addr) | ||
611 | |||
612 | static uint32_t omap_sysctl_read(void *opaque, hwaddr addr) | ||
613 | { | ||
614 | - struct omap_sysctl_s *s = (struct omap_sysctl_s *) opaque; | ||
615 | + struct omap_sysctl_s *s = opaque; | ||
616 | |||
617 | switch (addr) { | ||
618 | case 0x000: /* CONTROL_REVISION */ | ||
619 | @@ -XXX,XX +XXX,XX @@ static uint32_t omap_sysctl_read(void *opaque, hwaddr addr) | ||
620 | return 0; | ||
621 | } | ||
622 | |||
623 | -static void omap_sysctl_write8(void *opaque, hwaddr addr, | ||
624 | - uint32_t value) | ||
625 | +static void omap_sysctl_write8(void *opaque, hwaddr addr, uint32_t value) | ||
626 | { | ||
627 | - struct omap_sysctl_s *s = (struct omap_sysctl_s *) opaque; | ||
628 | + struct omap_sysctl_s *s = opaque; | ||
629 | int pad_offset, byte_offset; | ||
630 | int prev_value; | ||
631 | |||
632 | @@ -XXX,XX +XXX,XX @@ static void omap_sysctl_write8(void *opaque, hwaddr addr, | ||
76 | } | 633 | } |
77 | } | 634 | } |
78 | 635 | ||
79 | @@ -XXX,XX +XXX,XX @@ static bool trans_SQSHL_zpzi(DisasContext *s, arg_rpri_esz *a) | 636 | -static void omap_sysctl_write(void *opaque, hwaddr addr, |
80 | if (a->esz < 0 || !dc_isar_feature(aa64_sve2, s)) { | 637 | - uint32_t value) |
81 | return false; | 638 | +static void omap_sysctl_write(void *opaque, hwaddr addr, uint32_t value) |
639 | { | ||
640 | - struct omap_sysctl_s *s = (struct omap_sysctl_s *) opaque; | ||
641 | + struct omap_sysctl_s *s = opaque; | ||
642 | |||
643 | switch (addr) { | ||
644 | case 0x000: /* CONTROL_REVISION */ | ||
645 | @@ -XXX,XX +XXX,XX @@ static struct omap_sysctl_s *omap_sysctl_init(struct omap_target_agent_s *ta, | ||
646 | /* General chip reset */ | ||
647 | static void omap2_mpu_reset(void *opaque) | ||
648 | { | ||
649 | - struct omap_mpu_state_s *mpu = (struct omap_mpu_state_s *) opaque; | ||
650 | + struct omap_mpu_state_s *mpu = opaque; | ||
651 | |||
652 | omap_dma_reset(mpu->dma); | ||
653 | omap_prcm_reset(mpu->prcm); | ||
654 | diff --git a/hw/arm/omap_sx1.c b/hw/arm/omap_sx1.c | ||
655 | index XXXXXXX..XXXXXXX 100644 | ||
656 | --- a/hw/arm/omap_sx1.c | ||
657 | +++ b/hw/arm/omap_sx1.c | ||
658 | @@ -XXX,XX +XXX,XX @@ | ||
659 | static uint64_t static_read(void *opaque, hwaddr offset, | ||
660 | unsigned size) | ||
661 | { | ||
662 | - uint32_t *val = (uint32_t *) opaque; | ||
663 | + uint32_t *val = opaque; | ||
664 | uint32_t mask = (4 / size) - 1; | ||
665 | |||
666 | return *val >> ((offset & mask) << 3); | ||
667 | diff --git a/hw/arm/palm.c b/hw/arm/palm.c | ||
668 | index XXXXXXX..XXXXXXX 100644 | ||
669 | --- a/hw/arm/palm.c | ||
670 | +++ b/hw/arm/palm.c | ||
671 | @@ -XXX,XX +XXX,XX @@ static struct { | ||
672 | |||
673 | static void palmte_button_event(void *opaque, int keycode) | ||
674 | { | ||
675 | - struct omap_mpu_state_s *cpu = (struct omap_mpu_state_s *) opaque; | ||
676 | + struct omap_mpu_state_s *cpu = opaque; | ||
677 | |||
678 | if (palmte_keymap[keycode & 0x7f].row != -1) | ||
679 | omap_mpuio_key(cpu->mpuio, | ||
680 | diff --git a/hw/char/omap_uart.c b/hw/char/omap_uart.c | ||
681 | index XXXXXXX..XXXXXXX 100644 | ||
682 | --- a/hw/char/omap_uart.c | ||
683 | +++ b/hw/char/omap_uart.c | ||
684 | @@ -XXX,XX +XXX,XX @@ struct omap_uart_s *omap_uart_init(hwaddr base, | ||
685 | return s; | ||
686 | } | ||
687 | |||
688 | -static uint64_t omap_uart_read(void *opaque, hwaddr addr, | ||
689 | - unsigned size) | ||
690 | +static uint64_t omap_uart_read(void *opaque, hwaddr addr, unsigned size) | ||
691 | { | ||
692 | - struct omap_uart_s *s = (struct omap_uart_s *) opaque; | ||
693 | + struct omap_uart_s *s = opaque; | ||
694 | |||
695 | if (size == 4) { | ||
696 | return omap_badwidth_read8(opaque, addr); | ||
697 | @@ -XXX,XX +XXX,XX @@ static uint64_t omap_uart_read(void *opaque, hwaddr addr, | ||
698 | static void omap_uart_write(void *opaque, hwaddr addr, | ||
699 | uint64_t value, unsigned size) | ||
700 | { | ||
701 | - struct omap_uart_s *s = (struct omap_uart_s *) opaque; | ||
702 | + struct omap_uart_s *s = opaque; | ||
703 | |||
704 | if (size == 4) { | ||
705 | omap_badwidth_write8(opaque, addr, value); | ||
706 | diff --git a/hw/display/omap_dss.c b/hw/display/omap_dss.c | ||
707 | index XXXXXXX..XXXXXXX 100644 | ||
708 | --- a/hw/display/omap_dss.c | ||
709 | +++ b/hw/display/omap_dss.c | ||
710 | @@ -XXX,XX +XXX,XX @@ void omap_dss_reset(struct omap_dss_s *s) | ||
711 | static uint64_t omap_diss_read(void *opaque, hwaddr addr, | ||
712 | unsigned size) | ||
713 | { | ||
714 | - struct omap_dss_s *s = (struct omap_dss_s *) opaque; | ||
715 | + struct omap_dss_s *s = opaque; | ||
716 | |||
717 | if (size != 4) { | ||
718 | return omap_badwidth_read32(opaque, addr); | ||
719 | @@ -XXX,XX +XXX,XX @@ static uint64_t omap_diss_read(void *opaque, hwaddr addr, | ||
720 | static void omap_diss_write(void *opaque, hwaddr addr, | ||
721 | uint64_t value, unsigned size) | ||
722 | { | ||
723 | - struct omap_dss_s *s = (struct omap_dss_s *) opaque; | ||
724 | + struct omap_dss_s *s = opaque; | ||
725 | |||
726 | if (size != 4) { | ||
727 | omap_badwidth_write32(opaque, addr, value); | ||
728 | @@ -XXX,XX +XXX,XX @@ static const MemoryRegionOps omap_diss_ops = { | ||
729 | static uint64_t omap_disc_read(void *opaque, hwaddr addr, | ||
730 | unsigned size) | ||
731 | { | ||
732 | - struct omap_dss_s *s = (struct omap_dss_s *) opaque; | ||
733 | + struct omap_dss_s *s = opaque; | ||
734 | |||
735 | if (size != 4) { | ||
736 | return omap_badwidth_read32(opaque, addr); | ||
737 | @@ -XXX,XX +XXX,XX @@ static uint64_t omap_disc_read(void *opaque, hwaddr addr, | ||
738 | static void omap_disc_write(void *opaque, hwaddr addr, | ||
739 | uint64_t value, unsigned size) | ||
740 | { | ||
741 | - struct omap_dss_s *s = (struct omap_dss_s *) opaque; | ||
742 | + struct omap_dss_s *s = opaque; | ||
743 | |||
744 | if (size != 4) { | ||
745 | omap_badwidth_write32(opaque, addr, value); | ||
746 | @@ -XXX,XX +XXX,XX @@ static void omap_rfbi_transfer_start(struct omap_dss_s *s) | ||
747 | omap_dispc_interrupt_update(s); | ||
748 | } | ||
749 | |||
750 | -static uint64_t omap_rfbi_read(void *opaque, hwaddr addr, | ||
751 | - unsigned size) | ||
752 | +static uint64_t omap_rfbi_read(void *opaque, hwaddr addr, unsigned size) | ||
753 | { | ||
754 | - struct omap_dss_s *s = (struct omap_dss_s *) opaque; | ||
755 | + struct omap_dss_s *s = opaque; | ||
756 | |||
757 | if (size != 4) { | ||
758 | return omap_badwidth_read32(opaque, addr); | ||
759 | @@ -XXX,XX +XXX,XX @@ static uint64_t omap_rfbi_read(void *opaque, hwaddr addr, | ||
760 | static void omap_rfbi_write(void *opaque, hwaddr addr, | ||
761 | uint64_t value, unsigned size) | ||
762 | { | ||
763 | - struct omap_dss_s *s = (struct omap_dss_s *) opaque; | ||
764 | + struct omap_dss_s *s = opaque; | ||
765 | |||
766 | if (size != 4) { | ||
767 | omap_badwidth_write32(opaque, addr, value); | ||
768 | diff --git a/hw/display/omap_lcdc.c b/hw/display/omap_lcdc.c | ||
769 | index XXXXXXX..XXXXXXX 100644 | ||
770 | --- a/hw/display/omap_lcdc.c | ||
771 | +++ b/hw/display/omap_lcdc.c | ||
772 | @@ -XXX,XX +XXX,XX @@ static void draw_line16_32(void *opaque, uint8_t *d, const uint8_t *s, | ||
773 | |||
774 | static void omap_update_display(void *opaque) | ||
775 | { | ||
776 | - struct omap_lcd_panel_s *omap_lcd = (struct omap_lcd_panel_s *) opaque; | ||
777 | + struct omap_lcd_panel_s *omap_lcd = opaque; | ||
778 | DisplaySurface *surface; | ||
779 | drawfn draw_line; | ||
780 | int size, height, first, last; | ||
781 | @@ -XXX,XX +XXX,XX @@ static void omap_lcd_update(struct omap_lcd_panel_s *s) { | ||
82 | } | 782 | } |
83 | - return do_zpzi_ool(s, a, fns[a->esz]); | 783 | } |
84 | + return gen_gvec_ool_arg_zpzi(s, fns[a->esz], a); | 784 | |
85 | } | 785 | -static uint64_t omap_lcdc_read(void *opaque, hwaddr addr, |
86 | 786 | - unsigned size) | |
87 | static bool trans_UQSHL_zpzi(DisasContext *s, arg_rpri_esz *a) | 787 | +static uint64_t omap_lcdc_read(void *opaque, hwaddr addr, unsigned size) |
88 | @@ -XXX,XX +XXX,XX @@ static bool trans_UQSHL_zpzi(DisasContext *s, arg_rpri_esz *a) | 788 | { |
89 | if (a->esz < 0 || !dc_isar_feature(aa64_sve2, s)) { | 789 | - struct omap_lcd_panel_s *s = (struct omap_lcd_panel_s *) opaque; |
90 | return false; | 790 | + struct omap_lcd_panel_s *s = opaque; |
791 | |||
792 | switch (addr) { | ||
793 | case 0x00: /* LCD_CONTROL */ | ||
794 | @@ -XXX,XX +XXX,XX @@ static uint64_t omap_lcdc_read(void *opaque, hwaddr addr, | ||
795 | static void omap_lcdc_write(void *opaque, hwaddr addr, | ||
796 | uint64_t value, unsigned size) | ||
797 | { | ||
798 | - struct omap_lcd_panel_s *s = (struct omap_lcd_panel_s *) opaque; | ||
799 | + struct omap_lcd_panel_s *s = opaque; | ||
800 | |||
801 | switch (addr) { | ||
802 | case 0x00: /* LCD_CONTROL */ | ||
803 | diff --git a/hw/dma/omap_dma.c b/hw/dma/omap_dma.c | ||
804 | index XXXXXXX..XXXXXXX 100644 | ||
805 | --- a/hw/dma/omap_dma.c | ||
806 | +++ b/hw/dma/omap_dma.c | ||
807 | @@ -XXX,XX +XXX,XX @@ static int omap_dma_sys_read(struct omap_dma_s *s, int offset, | ||
808 | return 0; | ||
809 | } | ||
810 | |||
811 | -static uint64_t omap_dma_read(void *opaque, hwaddr addr, | ||
812 | - unsigned size) | ||
813 | +static uint64_t omap_dma_read(void *opaque, hwaddr addr, unsigned size) | ||
814 | { | ||
815 | - struct omap_dma_s *s = (struct omap_dma_s *) opaque; | ||
816 | + struct omap_dma_s *s = opaque; | ||
817 | int reg, ch; | ||
818 | uint16_t ret; | ||
819 | |||
820 | @@ -XXX,XX +XXX,XX @@ static uint64_t omap_dma_read(void *opaque, hwaddr addr, | ||
821 | static void omap_dma_write(void *opaque, hwaddr addr, | ||
822 | uint64_t value, unsigned size) | ||
823 | { | ||
824 | - struct omap_dma_s *s = (struct omap_dma_s *) opaque; | ||
825 | + struct omap_dma_s *s = opaque; | ||
826 | int reg, ch; | ||
827 | |||
828 | if (size != 2) { | ||
829 | @@ -XXX,XX +XXX,XX @@ static const MemoryRegionOps omap_dma_ops = { | ||
830 | |||
831 | static void omap_dma_request(void *opaque, int drq, int req) | ||
832 | { | ||
833 | - struct omap_dma_s *s = (struct omap_dma_s *) opaque; | ||
834 | + struct omap_dma_s *s = opaque; | ||
835 | /* The request pins are level triggered in QEMU. */ | ||
836 | if (req) { | ||
837 | if (~s->dma->drqbmp & (1ULL << drq)) { | ||
838 | @@ -XXX,XX +XXX,XX @@ static void omap_dma_request(void *opaque, int drq, int req) | ||
839 | /* XXX: this won't be needed once soc_dma knows about clocks. */ | ||
840 | static void omap_dma_clk_update(void *opaque, int line, int on) | ||
841 | { | ||
842 | - struct omap_dma_s *s = (struct omap_dma_s *) opaque; | ||
843 | + struct omap_dma_s *s = opaque; | ||
844 | int i; | ||
845 | |||
846 | s->dma->freq = omap_clk_getrate(s->clk); | ||
847 | @@ -XXX,XX +XXX,XX @@ static void omap_dma_interrupts_4_update(struct omap_dma_s *s) | ||
848 | static uint64_t omap_dma4_read(void *opaque, hwaddr addr, | ||
849 | unsigned size) | ||
850 | { | ||
851 | - struct omap_dma_s *s = (struct omap_dma_s *) opaque; | ||
852 | + struct omap_dma_s *s = opaque; | ||
853 | int irqn = 0, chnum; | ||
854 | struct omap_dma_channel_s *ch; | ||
855 | |||
856 | @@ -XXX,XX +XXX,XX @@ static uint64_t omap_dma4_read(void *opaque, hwaddr addr, | ||
857 | static void omap_dma4_write(void *opaque, hwaddr addr, | ||
858 | uint64_t value, unsigned size) | ||
859 | { | ||
860 | - struct omap_dma_s *s = (struct omap_dma_s *) opaque; | ||
861 | + struct omap_dma_s *s = opaque; | ||
862 | int chnum, irqn = 0; | ||
863 | struct omap_dma_channel_s *ch; | ||
864 | |||
865 | diff --git a/hw/gpio/omap_gpio.c b/hw/gpio/omap_gpio.c | ||
866 | index XXXXXXX..XXXXXXX 100644 | ||
867 | --- a/hw/gpio/omap_gpio.c | ||
868 | +++ b/hw/gpio/omap_gpio.c | ||
869 | @@ -XXX,XX +XXX,XX @@ static void omap_gpio_set(void *opaque, int line, int level) | ||
870 | static uint64_t omap_gpio_read(void *opaque, hwaddr addr, | ||
871 | unsigned size) | ||
872 | { | ||
873 | - struct omap_gpio_s *s = (struct omap_gpio_s *) opaque; | ||
874 | + struct omap_gpio_s *s = opaque; | ||
875 | int offset = addr & OMAP_MPUI_REG_MASK; | ||
876 | |||
877 | if (size != 2) { | ||
878 | @@ -XXX,XX +XXX,XX @@ static uint64_t omap_gpio_read(void *opaque, hwaddr addr, | ||
879 | static void omap_gpio_write(void *opaque, hwaddr addr, | ||
880 | uint64_t value, unsigned size) | ||
881 | { | ||
882 | - struct omap_gpio_s *s = (struct omap_gpio_s *) opaque; | ||
883 | + struct omap_gpio_s *s = opaque; | ||
884 | int offset = addr & OMAP_MPUI_REG_MASK; | ||
885 | uint16_t diff; | ||
886 | int ln; | ||
887 | @@ -XXX,XX +XXX,XX @@ static void omap2_gpio_module_reset(struct omap2_gpio_s *s) | ||
888 | |||
889 | static uint32_t omap2_gpio_module_read(void *opaque, hwaddr addr) | ||
890 | { | ||
891 | - struct omap2_gpio_s *s = (struct omap2_gpio_s *) opaque; | ||
892 | + struct omap2_gpio_s *s = opaque; | ||
893 | |||
894 | switch (addr) { | ||
895 | case 0x00: /* GPIO_REVISION */ | ||
896 | @@ -XXX,XX +XXX,XX @@ static uint32_t omap2_gpio_module_read(void *opaque, hwaddr addr) | ||
897 | static void omap2_gpio_module_write(void *opaque, hwaddr addr, | ||
898 | uint32_t value) | ||
899 | { | ||
900 | - struct omap2_gpio_s *s = (struct omap2_gpio_s *) opaque; | ||
901 | + struct omap2_gpio_s *s = opaque; | ||
902 | uint32_t diff; | ||
903 | int ln; | ||
904 | |||
905 | @@ -XXX,XX +XXX,XX @@ static void omap2_gpif_reset(DeviceState *dev) | ||
906 | s->gpo = 0; | ||
907 | } | ||
908 | |||
909 | -static uint64_t omap2_gpif_top_read(void *opaque, hwaddr addr, | ||
910 | - unsigned size) | ||
911 | +static uint64_t omap2_gpif_top_read(void *opaque, hwaddr addr, unsigned size) | ||
912 | { | ||
913 | - struct omap2_gpif_s *s = (struct omap2_gpif_s *) opaque; | ||
914 | + struct omap2_gpif_s *s = opaque; | ||
915 | |||
916 | switch (addr) { | ||
917 | case 0x00: /* IPGENERICOCPSPL_REVISION */ | ||
918 | @@ -XXX,XX +XXX,XX @@ static uint64_t omap2_gpif_top_read(void *opaque, hwaddr addr, | ||
919 | static void omap2_gpif_top_write(void *opaque, hwaddr addr, | ||
920 | uint64_t value, unsigned size) | ||
921 | { | ||
922 | - struct omap2_gpif_s *s = (struct omap2_gpif_s *) opaque; | ||
923 | + struct omap2_gpif_s *s = opaque; | ||
924 | |||
925 | switch (addr) { | ||
926 | case 0x00: /* IPGENERICOCPSPL_REVISION */ | ||
927 | diff --git a/hw/intc/omap_intc.c b/hw/intc/omap_intc.c | ||
928 | index XXXXXXX..XXXXXXX 100644 | ||
929 | --- a/hw/intc/omap_intc.c | ||
930 | +++ b/hw/intc/omap_intc.c | ||
931 | @@ -XXX,XX +XXX,XX @@ static inline void omap_inth_update(struct omap_intr_handler_s *s, int is_fiq) | ||
932 | |||
933 | static void omap_set_intr(void *opaque, int irq, int req) | ||
934 | { | ||
935 | - struct omap_intr_handler_s *ih = (struct omap_intr_handler_s *) opaque; | ||
936 | + struct omap_intr_handler_s *ih = opaque; | ||
937 | uint32_t rise; | ||
938 | |||
939 | struct omap_intr_handler_bank_s *bank = &ih->bank[irq >> 5]; | ||
940 | @@ -XXX,XX +XXX,XX @@ static void omap_set_intr(void *opaque, int irq, int req) | ||
941 | /* Simplified version with no edge detection */ | ||
942 | static void omap_set_intr_noedge(void *opaque, int irq, int req) | ||
943 | { | ||
944 | - struct omap_intr_handler_s *ih = (struct omap_intr_handler_s *) opaque; | ||
945 | + struct omap_intr_handler_s *ih = opaque; | ||
946 | uint32_t rise; | ||
947 | |||
948 | struct omap_intr_handler_bank_s *bank = &ih->bank[irq >> 5]; | ||
949 | @@ -XXX,XX +XXX,XX @@ static void omap_set_intr_noedge(void *opaque, int irq, int req) | ||
950 | static uint64_t omap_inth_read(void *opaque, hwaddr addr, | ||
951 | unsigned size) | ||
952 | { | ||
953 | - struct omap_intr_handler_s *s = (struct omap_intr_handler_s *) opaque; | ||
954 | + struct omap_intr_handler_s *s = opaque; | ||
955 | int i, offset = addr; | ||
956 | int bank_no = offset >> 8; | ||
957 | int line_no; | ||
958 | @@ -XXX,XX +XXX,XX @@ static uint64_t omap_inth_read(void *opaque, hwaddr addr, | ||
959 | static void omap_inth_write(void *opaque, hwaddr addr, | ||
960 | uint64_t value, unsigned size) | ||
961 | { | ||
962 | - struct omap_intr_handler_s *s = (struct omap_intr_handler_s *) opaque; | ||
963 | + struct omap_intr_handler_s *s = opaque; | ||
964 | int i, offset = addr; | ||
965 | int bank_no = offset >> 8; | ||
966 | struct omap_intr_handler_bank_s *bank = &s->bank[bank_no]; | ||
967 | @@ -XXX,XX +XXX,XX @@ static const TypeInfo omap_intc_info = { | ||
968 | static uint64_t omap2_inth_read(void *opaque, hwaddr addr, | ||
969 | unsigned size) | ||
970 | { | ||
971 | - struct omap_intr_handler_s *s = (struct omap_intr_handler_s *) opaque; | ||
972 | + struct omap_intr_handler_s *s = opaque; | ||
973 | int offset = addr; | ||
974 | int bank_no, line_no; | ||
975 | struct omap_intr_handler_bank_s *bank = NULL; | ||
976 | @@ -XXX,XX +XXX,XX @@ static uint64_t omap2_inth_read(void *opaque, hwaddr addr, | ||
977 | static void omap2_inth_write(void *opaque, hwaddr addr, | ||
978 | uint64_t value, unsigned size) | ||
979 | { | ||
980 | - struct omap_intr_handler_s *s = (struct omap_intr_handler_s *) opaque; | ||
981 | + struct omap_intr_handler_s *s = opaque; | ||
982 | int offset = addr; | ||
983 | int bank_no, line_no; | ||
984 | struct omap_intr_handler_bank_s *bank = NULL; | ||
985 | diff --git a/hw/misc/omap_gpmc.c b/hw/misc/omap_gpmc.c | ||
986 | index XXXXXXX..XXXXXXX 100644 | ||
987 | --- a/hw/misc/omap_gpmc.c | ||
988 | +++ b/hw/misc/omap_gpmc.c | ||
989 | @@ -XXX,XX +XXX,XX @@ static void omap_gpmc_dma_update(struct omap_gpmc_s *s, int value) | ||
990 | static uint64_t omap_nand_read(void *opaque, hwaddr addr, | ||
991 | unsigned size) | ||
992 | { | ||
993 | - struct omap_gpmc_cs_file_s *f = (struct omap_gpmc_cs_file_s *)opaque; | ||
994 | + struct omap_gpmc_cs_file_s *f = opaque; | ||
995 | uint64_t v; | ||
996 | nand_setpins(f->dev, 0, 0, 0, 1, 0); | ||
997 | switch (omap_gpmc_devsize(f)) { | ||
998 | @@ -XXX,XX +XXX,XX @@ static void omap_nand_setio(DeviceState *dev, uint64_t value, | ||
999 | static void omap_nand_write(void *opaque, hwaddr addr, | ||
1000 | uint64_t value, unsigned size) | ||
1001 | { | ||
1002 | - struct omap_gpmc_cs_file_s *f = (struct omap_gpmc_cs_file_s *)opaque; | ||
1003 | + struct omap_gpmc_cs_file_s *f = opaque; | ||
1004 | nand_setpins(f->dev, 0, 0, 0, 1, 0); | ||
1005 | omap_nand_setio(f->dev, value, omap_gpmc_devsize(f), size); | ||
1006 | } | ||
1007 | @@ -XXX,XX +XXX,XX @@ static void fill_prefetch_fifo(struct omap_gpmc_s *s) | ||
1008 | static uint64_t omap_gpmc_prefetch_read(void *opaque, hwaddr addr, | ||
1009 | unsigned size) | ||
1010 | { | ||
1011 | - struct omap_gpmc_s *s = (struct omap_gpmc_s *) opaque; | ||
1012 | + struct omap_gpmc_s *s = opaque; | ||
1013 | uint32_t data; | ||
1014 | if (s->prefetch.config1 & 1) { | ||
1015 | /* The TRM doesn't define the behaviour if you read from the | ||
1016 | @@ -XXX,XX +XXX,XX @@ static uint64_t omap_gpmc_prefetch_read(void *opaque, hwaddr addr, | ||
1017 | static void omap_gpmc_prefetch_write(void *opaque, hwaddr addr, | ||
1018 | uint64_t value, unsigned size) | ||
1019 | { | ||
1020 | - struct omap_gpmc_s *s = (struct omap_gpmc_s *) opaque; | ||
1021 | + struct omap_gpmc_s *s = opaque; | ||
1022 | int cs = prefetch_cs(s->prefetch.config1); | ||
1023 | if ((s->prefetch.config1 & 1) == 0) { | ||
1024 | /* The TRM doesn't define the behaviour of writing to the | ||
1025 | @@ -XXX,XX +XXX,XX @@ static int gpmc_wordaccess_only(hwaddr addr) | ||
1026 | static uint64_t omap_gpmc_read(void *opaque, hwaddr addr, | ||
1027 | unsigned size) | ||
1028 | { | ||
1029 | - struct omap_gpmc_s *s = (struct omap_gpmc_s *) opaque; | ||
1030 | + struct omap_gpmc_s *s = opaque; | ||
1031 | int cs; | ||
1032 | struct omap_gpmc_cs_file_s *f; | ||
1033 | |||
1034 | @@ -XXX,XX +XXX,XX @@ static uint64_t omap_gpmc_read(void *opaque, hwaddr addr, | ||
1035 | static void omap_gpmc_write(void *opaque, hwaddr addr, | ||
1036 | uint64_t value, unsigned size) | ||
1037 | { | ||
1038 | - struct omap_gpmc_s *s = (struct omap_gpmc_s *) opaque; | ||
1039 | + struct omap_gpmc_s *s = opaque; | ||
1040 | int cs; | ||
1041 | struct omap_gpmc_cs_file_s *f; | ||
1042 | |||
1043 | diff --git a/hw/misc/omap_l4.c b/hw/misc/omap_l4.c | ||
1044 | index XXXXXXX..XXXXXXX 100644 | ||
1045 | --- a/hw/misc/omap_l4.c | ||
1046 | +++ b/hw/misc/omap_l4.c | ||
1047 | @@ -XXX,XX +XXX,XX @@ hwaddr omap_l4_region_size(struct omap_target_agent_s *ta, | ||
1048 | return ta->start[region].size; | ||
1049 | } | ||
1050 | |||
1051 | -static uint64_t omap_l4ta_read(void *opaque, hwaddr addr, | ||
1052 | - unsigned size) | ||
1053 | +static uint64_t omap_l4ta_read(void *opaque, hwaddr addr, unsigned size) | ||
1054 | { | ||
1055 | - struct omap_target_agent_s *s = (struct omap_target_agent_s *) opaque; | ||
1056 | + struct omap_target_agent_s *s = opaque; | ||
1057 | |||
1058 | if (size != 2) { | ||
1059 | return omap_badwidth_read16(opaque, addr); | ||
1060 | @@ -XXX,XX +XXX,XX @@ static uint64_t omap_l4ta_read(void *opaque, hwaddr addr, | ||
1061 | static void omap_l4ta_write(void *opaque, hwaddr addr, | ||
1062 | uint64_t value, unsigned size) | ||
1063 | { | ||
1064 | - struct omap_target_agent_s *s = (struct omap_target_agent_s *) opaque; | ||
1065 | + struct omap_target_agent_s *s = opaque; | ||
1066 | |||
1067 | if (size != 4) { | ||
1068 | omap_badwidth_write32(opaque, addr, value); | ||
1069 | diff --git a/hw/misc/omap_sdrc.c b/hw/misc/omap_sdrc.c | ||
1070 | index XXXXXXX..XXXXXXX 100644 | ||
1071 | --- a/hw/misc/omap_sdrc.c | ||
1072 | +++ b/hw/misc/omap_sdrc.c | ||
1073 | @@ -XXX,XX +XXX,XX @@ void omap_sdrc_reset(struct omap_sdrc_s *s) | ||
1074 | s->config = 0x10; | ||
1075 | } | ||
1076 | |||
1077 | -static uint64_t omap_sdrc_read(void *opaque, hwaddr addr, | ||
1078 | - unsigned size) | ||
1079 | +static uint64_t omap_sdrc_read(void *opaque, hwaddr addr, unsigned size) | ||
1080 | { | ||
1081 | - struct omap_sdrc_s *s = (struct omap_sdrc_s *) opaque; | ||
1082 | + struct omap_sdrc_s *s = opaque; | ||
1083 | |||
1084 | if (size != 4) { | ||
1085 | return omap_badwidth_read32(opaque, addr); | ||
1086 | @@ -XXX,XX +XXX,XX @@ static uint64_t omap_sdrc_read(void *opaque, hwaddr addr, | ||
1087 | static void omap_sdrc_write(void *opaque, hwaddr addr, | ||
1088 | uint64_t value, unsigned size) | ||
1089 | { | ||
1090 | - struct omap_sdrc_s *s = (struct omap_sdrc_s *) opaque; | ||
1091 | + struct omap_sdrc_s *s = opaque; | ||
1092 | |||
1093 | if (size != 4) { | ||
1094 | omap_badwidth_write32(opaque, addr, value); | ||
1095 | diff --git a/hw/misc/omap_tap.c b/hw/misc/omap_tap.c | ||
1096 | index XXXXXXX..XXXXXXX 100644 | ||
1097 | --- a/hw/misc/omap_tap.c | ||
1098 | +++ b/hw/misc/omap_tap.c | ||
1099 | @@ -XXX,XX +XXX,XX @@ | ||
1100 | #include "hw/arm/omap.h" | ||
1101 | |||
1102 | /* TEST-Chip-level TAP */ | ||
1103 | -static uint64_t omap_tap_read(void *opaque, hwaddr addr, | ||
1104 | - unsigned size) | ||
1105 | +static uint64_t omap_tap_read(void *opaque, hwaddr addr, unsigned size) | ||
1106 | { | ||
1107 | - struct omap_mpu_state_s *s = (struct omap_mpu_state_s *) opaque; | ||
1108 | + struct omap_mpu_state_s *s = opaque; | ||
1109 | |||
1110 | if (size != 4) { | ||
1111 | return omap_badwidth_read32(opaque, addr); | ||
1112 | diff --git a/hw/sd/omap_mmc.c b/hw/sd/omap_mmc.c | ||
1113 | index XXXXXXX..XXXXXXX 100644 | ||
1114 | --- a/hw/sd/omap_mmc.c | ||
1115 | +++ b/hw/sd/omap_mmc.c | ||
1116 | @@ -XXX,XX +XXX,XX @@ void omap_mmc_reset(struct omap_mmc_s *host) | ||
1117 | device_cold_reset(DEVICE(host->card)); | ||
1118 | } | ||
1119 | |||
1120 | -static uint64_t omap_mmc_read(void *opaque, hwaddr offset, | ||
1121 | - unsigned size) | ||
1122 | +static uint64_t omap_mmc_read(void *opaque, hwaddr offset, unsigned size) | ||
1123 | { | ||
1124 | uint16_t i; | ||
1125 | - struct omap_mmc_s *s = (struct omap_mmc_s *) opaque; | ||
1126 | + struct omap_mmc_s *s = opaque; | ||
1127 | |||
1128 | if (size != 2) { | ||
1129 | return omap_badwidth_read16(opaque, offset); | ||
1130 | @@ -XXX,XX +XXX,XX @@ static void omap_mmc_write(void *opaque, hwaddr offset, | ||
1131 | uint64_t value, unsigned size) | ||
1132 | { | ||
1133 | int i; | ||
1134 | - struct omap_mmc_s *s = (struct omap_mmc_s *) opaque; | ||
1135 | + struct omap_mmc_s *s = opaque; | ||
1136 | |||
1137 | if (size != 2) { | ||
1138 | omap_badwidth_write16(opaque, offset, value); | ||
1139 | @@ -XXX,XX +XXX,XX @@ static const MemoryRegionOps omap_mmc_ops = { | ||
1140 | |||
1141 | static void omap_mmc_cover_cb(void *opaque, int line, int level) | ||
1142 | { | ||
1143 | - struct omap_mmc_s *host = (struct omap_mmc_s *) opaque; | ||
1144 | + struct omap_mmc_s *host = opaque; | ||
1145 | |||
1146 | if (!host->cdet_state && level) { | ||
1147 | host->status |= 0x0002; | ||
1148 | diff --git a/hw/ssi/omap_spi.c b/hw/ssi/omap_spi.c | ||
1149 | index XXXXXXX..XXXXXXX 100644 | ||
1150 | --- a/hw/ssi/omap_spi.c | ||
1151 | +++ b/hw/ssi/omap_spi.c | ||
1152 | @@ -XXX,XX +XXX,XX @@ void omap_mcspi_reset(struct omap_mcspi_s *s) | ||
1153 | omap_mcspi_interrupt_update(s); | ||
1154 | } | ||
1155 | |||
1156 | -static uint64_t omap_mcspi_read(void *opaque, hwaddr addr, | ||
1157 | - unsigned size) | ||
1158 | +static uint64_t omap_mcspi_read(void *opaque, hwaddr addr, unsigned size) | ||
1159 | { | ||
1160 | - struct omap_mcspi_s *s = (struct omap_mcspi_s *) opaque; | ||
1161 | + struct omap_mcspi_s *s = opaque; | ||
1162 | int ch = 0; | ||
1163 | uint32_t ret; | ||
1164 | |||
1165 | @@ -XXX,XX +XXX,XX @@ static uint64_t omap_mcspi_read(void *opaque, hwaddr addr, | ||
1166 | static void omap_mcspi_write(void *opaque, hwaddr addr, | ||
1167 | uint64_t value, unsigned size) | ||
1168 | { | ||
1169 | - struct omap_mcspi_s *s = (struct omap_mcspi_s *) opaque; | ||
1170 | + struct omap_mcspi_s *s = opaque; | ||
1171 | int ch = 0; | ||
1172 | |||
1173 | if (size != 4) { | ||
1174 | diff --git a/hw/timer/omap_gptimer.c b/hw/timer/omap_gptimer.c | ||
1175 | index XXXXXXX..XXXXXXX 100644 | ||
1176 | --- a/hw/timer/omap_gptimer.c | ||
1177 | +++ b/hw/timer/omap_gptimer.c | ||
1178 | @@ -XXX,XX +XXX,XX @@ static inline void omap_gp_timer_trigger(struct omap_gp_timer_s *timer) | ||
1179 | |||
1180 | static void omap_gp_timer_tick(void *opaque) | ||
1181 | { | ||
1182 | - struct omap_gp_timer_s *timer = (struct omap_gp_timer_s *) opaque; | ||
1183 | + struct omap_gp_timer_s *timer = opaque; | ||
1184 | |||
1185 | if (!timer->ar) { | ||
1186 | timer->st = 0; | ||
1187 | @@ -XXX,XX +XXX,XX @@ static void omap_gp_timer_tick(void *opaque) | ||
1188 | |||
1189 | static void omap_gp_timer_match(void *opaque) | ||
1190 | { | ||
1191 | - struct omap_gp_timer_s *timer = (struct omap_gp_timer_s *) opaque; | ||
1192 | + struct omap_gp_timer_s *timer = opaque; | ||
1193 | |||
1194 | if (timer->trigger == gpt_trigger_both) | ||
1195 | omap_gp_timer_trigger(timer); | ||
1196 | @@ -XXX,XX +XXX,XX @@ static void omap_gp_timer_match(void *opaque) | ||
1197 | |||
1198 | static void omap_gp_timer_input(void *opaque, int line, int on) | ||
1199 | { | ||
1200 | - struct omap_gp_timer_s *s = (struct omap_gp_timer_s *) opaque; | ||
1201 | + struct omap_gp_timer_s *s = opaque; | ||
1202 | int trigger; | ||
1203 | |||
1204 | switch (s->capture) { | ||
1205 | @@ -XXX,XX +XXX,XX @@ static void omap_gp_timer_input(void *opaque, int line, int on) | ||
1206 | |||
1207 | static void omap_gp_timer_clk_update(void *opaque, int line, int on) | ||
1208 | { | ||
1209 | - struct omap_gp_timer_s *timer = (struct omap_gp_timer_s *) opaque; | ||
1210 | + struct omap_gp_timer_s *timer = opaque; | ||
1211 | |||
1212 | omap_gp_timer_sync(timer); | ||
1213 | timer->rate = on ? omap_clk_getrate(timer->clk) : 0; | ||
1214 | @@ -XXX,XX +XXX,XX @@ void omap_gp_timer_reset(struct omap_gp_timer_s *s) | ||
1215 | |||
1216 | static uint32_t omap_gp_timer_readw(void *opaque, hwaddr addr) | ||
1217 | { | ||
1218 | - struct omap_gp_timer_s *s = (struct omap_gp_timer_s *) opaque; | ||
1219 | + struct omap_gp_timer_s *s = opaque; | ||
1220 | |||
1221 | switch (addr) { | ||
1222 | case 0x00: /* TIDR */ | ||
1223 | @@ -XXX,XX +XXX,XX @@ static uint32_t omap_gp_timer_readw(void *opaque, hwaddr addr) | ||
1224 | |||
1225 | static uint32_t omap_gp_timer_readh(void *opaque, hwaddr addr) | ||
1226 | { | ||
1227 | - struct omap_gp_timer_s *s = (struct omap_gp_timer_s *) opaque; | ||
1228 | + struct omap_gp_timer_s *s = opaque; | ||
1229 | uint32_t ret; | ||
1230 | |||
1231 | if (addr & 2) | ||
1232 | @@ -XXX,XX +XXX,XX @@ static uint32_t omap_gp_timer_readh(void *opaque, hwaddr addr) | ||
91 | } | 1233 | } |
92 | - return do_zpzi_ool(s, a, fns[a->esz]); | 1234 | } |
93 | + return gen_gvec_ool_arg_zpzi(s, fns[a->esz], a); | 1235 | |
94 | } | 1236 | -static void omap_gp_timer_write(void *opaque, hwaddr addr, |
95 | 1237 | - uint32_t value) | |
96 | static bool trans_SRSHR(DisasContext *s, arg_rpri_esz *a) | 1238 | +static void omap_gp_timer_write(void *opaque, hwaddr addr, uint32_t value) |
97 | @@ -XXX,XX +XXX,XX @@ static bool trans_SRSHR(DisasContext *s, arg_rpri_esz *a) | 1239 | { |
98 | if (a->esz < 0 || !dc_isar_feature(aa64_sve2, s)) { | 1240 | - struct omap_gp_timer_s *s = (struct omap_gp_timer_s *) opaque; |
99 | return false; | 1241 | + struct omap_gp_timer_s *s = opaque; |
1242 | |||
1243 | switch (addr) { | ||
1244 | case 0x00: /* TIDR */ | ||
1245 | @@ -XXX,XX +XXX,XX @@ static void omap_gp_timer_write(void *opaque, hwaddr addr, | ||
100 | } | 1246 | } |
101 | - return do_zpzi_ool(s, a, fns[a->esz]); | 1247 | } |
102 | + return gen_gvec_ool_arg_zpzi(s, fns[a->esz], a); | 1248 | |
103 | } | 1249 | -static void omap_gp_timer_writeh(void *opaque, hwaddr addr, |
104 | 1250 | - uint32_t value) | |
105 | static bool trans_URSHR(DisasContext *s, arg_rpri_esz *a) | 1251 | +static void omap_gp_timer_writeh(void *opaque, hwaddr addr, uint32_t value) |
106 | @@ -XXX,XX +XXX,XX @@ static bool trans_URSHR(DisasContext *s, arg_rpri_esz *a) | 1252 | { |
107 | if (a->esz < 0 || !dc_isar_feature(aa64_sve2, s)) { | 1253 | - struct omap_gp_timer_s *s = (struct omap_gp_timer_s *) opaque; |
108 | return false; | 1254 | + struct omap_gp_timer_s *s = opaque; |
109 | } | 1255 | |
110 | - return do_zpzi_ool(s, a, fns[a->esz]); | 1256 | if (addr & 2) |
111 | + return gen_gvec_ool_arg_zpzi(s, fns[a->esz], a); | 1257 | omap_gp_timer_write(opaque, addr, (value << 16) | s->writeh); |
112 | } | 1258 | diff --git a/hw/timer/omap_synctimer.c b/hw/timer/omap_synctimer.c |
113 | 1259 | index XXXXXXX..XXXXXXX 100644 | |
114 | static bool trans_SQSHLU(DisasContext *s, arg_rpri_esz *a) | 1260 | --- a/hw/timer/omap_synctimer.c |
115 | @@ -XXX,XX +XXX,XX @@ static bool trans_SQSHLU(DisasContext *s, arg_rpri_esz *a) | 1261 | +++ b/hw/timer/omap_synctimer.c |
116 | if (a->esz < 0 || !dc_isar_feature(aa64_sve2, s)) { | 1262 | @@ -XXX,XX +XXX,XX @@ void omap_synctimer_reset(struct omap_synctimer_s *s) |
117 | return false; | 1263 | |
118 | } | 1264 | static uint32_t omap_synctimer_readw(void *opaque, hwaddr addr) |
119 | - return do_zpzi_ool(s, a, fns[a->esz]); | 1265 | { |
120 | + return gen_gvec_ool_arg_zpzi(s, fns[a->esz], a); | 1266 | - struct omap_synctimer_s *s = (struct omap_synctimer_s *) opaque; |
121 | } | 1267 | + struct omap_synctimer_s *s = opaque; |
122 | 1268 | ||
123 | /* | 1269 | switch (addr) { |
1270 | case 0x00: /* 32KSYNCNT_REV */ | ||
1271 | @@ -XXX,XX +XXX,XX @@ static uint32_t omap_synctimer_readw(void *opaque, hwaddr addr) | ||
1272 | |||
1273 | static uint32_t omap_synctimer_readh(void *opaque, hwaddr addr) | ||
1274 | { | ||
1275 | - struct omap_synctimer_s *s = (struct omap_synctimer_s *) opaque; | ||
1276 | + struct omap_synctimer_s *s = opaque; | ||
1277 | uint32_t ret; | ||
1278 | |||
1279 | if (addr & 2) | ||
124 | -- | 1280 | -- |
125 | 2.25.1 | 1281 | 2.34.1 |
1282 | |||
1283 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Philippe Mathieu-Daudé <philmd@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | Convert SVE translation functions using do_sve2_zzzz_ool | 3 | Following docs/devel/style.rst guidelines, rename omap_gpif_s -> |
4 | to use TRANS_FEAT and gen_gvec_ool_arg_zzzz. | 4 | Omap1GpioState. This also remove a use of 'struct' in the |
5 | DECLARE_INSTANCE_CHECKER() macro call. | ||
5 | 6 | ||
6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 7 | Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> |
7 | Message-id: 20220527181907.189259-12-richard.henderson@linaro.org | 8 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> |
8 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 9 | Message-id: 20230109140306.23161-5-philmd@linaro.org |
9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
10 | --- | 11 | --- |
11 | target/arm/translate-sve.c | 263 +++++++++++-------------------------- | 12 | include/hw/arm/omap.h | 6 +++--- |
12 | 1 file changed, 79 insertions(+), 184 deletions(-) | 13 | hw/gpio/omap_gpio.c | 16 ++++++++-------- |
14 | 2 files changed, 11 insertions(+), 11 deletions(-) | ||
13 | 15 | ||
14 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | 16 | diff --git a/include/hw/arm/omap.h b/include/hw/arm/omap.h |
15 | index XXXXXXX..XXXXXXX 100644 | 17 | index XXXXXXX..XXXXXXX 100644 |
16 | --- a/target/arm/translate-sve.c | 18 | --- a/include/hw/arm/omap.h |
17 | +++ b/target/arm/translate-sve.c | 19 | +++ b/include/hw/arm/omap.h |
18 | @@ -XXX,XX +XXX,XX @@ static bool trans_SQCADD_rot270(DisasContext *s, arg_rrr_esz *a) | 20 | @@ -XXX,XX +XXX,XX @@ void omap_i2c_set_fclk(OMAPI2CState *i2c, omap_clk clk); |
19 | return do_cadd(s, a, true, true); | 21 | |
22 | /* omap_gpio.c */ | ||
23 | #define TYPE_OMAP1_GPIO "omap-gpio" | ||
24 | -DECLARE_INSTANCE_CHECKER(struct omap_gpif_s, OMAP1_GPIO, | ||
25 | +typedef struct Omap1GpioState Omap1GpioState; | ||
26 | +DECLARE_INSTANCE_CHECKER(Omap1GpioState, OMAP1_GPIO, | ||
27 | TYPE_OMAP1_GPIO) | ||
28 | |||
29 | #define TYPE_OMAP2_GPIO "omap2-gpio" | ||
30 | DECLARE_INSTANCE_CHECKER(struct omap2_gpif_s, OMAP2_GPIO, | ||
31 | TYPE_OMAP2_GPIO) | ||
32 | |||
33 | -typedef struct omap_gpif_s omap_gpif; | ||
34 | typedef struct omap2_gpif_s omap2_gpif; | ||
35 | |||
36 | /* TODO: clock framework (see above) */ | ||
37 | -void omap_gpio_set_clk(omap_gpif *gpio, omap_clk clk); | ||
38 | +void omap_gpio_set_clk(Omap1GpioState *gpio, omap_clk clk); | ||
39 | |||
40 | void omap2_gpio_set_iclk(omap2_gpif *gpio, omap_clk clk); | ||
41 | void omap2_gpio_set_fclk(omap2_gpif *gpio, uint8_t i, omap_clk clk); | ||
42 | diff --git a/hw/gpio/omap_gpio.c b/hw/gpio/omap_gpio.c | ||
43 | index XXXXXXX..XXXXXXX 100644 | ||
44 | --- a/hw/gpio/omap_gpio.c | ||
45 | +++ b/hw/gpio/omap_gpio.c | ||
46 | @@ -XXX,XX +XXX,XX @@ struct omap_gpio_s { | ||
47 | uint16_t pins; | ||
48 | }; | ||
49 | |||
50 | -struct omap_gpif_s { | ||
51 | +struct Omap1GpioState { | ||
52 | SysBusDevice parent_obj; | ||
53 | |||
54 | MemoryRegion iomem; | ||
55 | @@ -XXX,XX +XXX,XX @@ struct omap_gpif_s { | ||
56 | /* General-Purpose I/O of OMAP1 */ | ||
57 | static void omap_gpio_set(void *opaque, int line, int level) | ||
58 | { | ||
59 | - struct omap_gpif_s *p = opaque; | ||
60 | + Omap1GpioState *p = opaque; | ||
61 | struct omap_gpio_s *s = &p->omap1; | ||
62 | uint16_t prev = s->inputs; | ||
63 | |||
64 | @@ -XXX,XX +XXX,XX @@ static const MemoryRegionOps omap2_gpio_module_ops = { | ||
65 | |||
66 | static void omap_gpif_reset(DeviceState *dev) | ||
67 | { | ||
68 | - struct omap_gpif_s *s = OMAP1_GPIO(dev); | ||
69 | + Omap1GpioState *s = OMAP1_GPIO(dev); | ||
70 | |||
71 | omap_gpio_reset(&s->omap1); | ||
20 | } | 72 | } |
21 | 73 | @@ -XXX,XX +XXX,XX @@ static const MemoryRegionOps omap2_gpif_top_ops = { | |
22 | -static bool do_sve2_zzzz_ool(DisasContext *s, arg_rrrr_esz *a, | 74 | static void omap_gpio_init(Object *obj) |
23 | - gen_helper_gvec_4 *fn, int data) | ||
24 | -{ | ||
25 | - if (!dc_isar_feature(aa64_sve2, s)) { | ||
26 | - return false; | ||
27 | - } | ||
28 | - return gen_gvec_ool_arg_zzzz(s, fn, a, data); | ||
29 | -} | ||
30 | +static gen_helper_gvec_4 * const sabal_fns[4] = { | ||
31 | + NULL, gen_helper_sve2_sabal_h, | ||
32 | + gen_helper_sve2_sabal_s, gen_helper_sve2_sabal_d, | ||
33 | +}; | ||
34 | +TRANS_FEAT(SABALB, aa64_sve2, gen_gvec_ool_arg_zzzz, sabal_fns[a->esz], a, 0) | ||
35 | +TRANS_FEAT(SABALT, aa64_sve2, gen_gvec_ool_arg_zzzz, sabal_fns[a->esz], a, 1) | ||
36 | |||
37 | -static bool do_abal(DisasContext *s, arg_rrrr_esz *a, bool uns, bool sel) | ||
38 | -{ | ||
39 | - static gen_helper_gvec_4 * const fns[2][4] = { | ||
40 | - { NULL, gen_helper_sve2_sabal_h, | ||
41 | - gen_helper_sve2_sabal_s, gen_helper_sve2_sabal_d }, | ||
42 | - { NULL, gen_helper_sve2_uabal_h, | ||
43 | - gen_helper_sve2_uabal_s, gen_helper_sve2_uabal_d }, | ||
44 | - }; | ||
45 | - return do_sve2_zzzz_ool(s, a, fns[uns][a->esz], sel); | ||
46 | -} | ||
47 | - | ||
48 | -static bool trans_SABALB(DisasContext *s, arg_rrrr_esz *a) | ||
49 | -{ | ||
50 | - return do_abal(s, a, false, false); | ||
51 | -} | ||
52 | - | ||
53 | -static bool trans_SABALT(DisasContext *s, arg_rrrr_esz *a) | ||
54 | -{ | ||
55 | - return do_abal(s, a, false, true); | ||
56 | -} | ||
57 | - | ||
58 | -static bool trans_UABALB(DisasContext *s, arg_rrrr_esz *a) | ||
59 | -{ | ||
60 | - return do_abal(s, a, true, false); | ||
61 | -} | ||
62 | - | ||
63 | -static bool trans_UABALT(DisasContext *s, arg_rrrr_esz *a) | ||
64 | -{ | ||
65 | - return do_abal(s, a, true, true); | ||
66 | -} | ||
67 | +static gen_helper_gvec_4 * const uabal_fns[4] = { | ||
68 | + NULL, gen_helper_sve2_uabal_h, | ||
69 | + gen_helper_sve2_uabal_s, gen_helper_sve2_uabal_d, | ||
70 | +}; | ||
71 | +TRANS_FEAT(UABALB, aa64_sve2, gen_gvec_ool_arg_zzzz, uabal_fns[a->esz], a, 0) | ||
72 | +TRANS_FEAT(UABALT, aa64_sve2, gen_gvec_ool_arg_zzzz, uabal_fns[a->esz], a, 1) | ||
73 | |||
74 | static bool do_adcl(DisasContext *s, arg_rrrr_esz *a, bool sel) | ||
75 | { | 75 | { |
76 | @@ -XXX,XX +XXX,XX @@ static bool do_adcl(DisasContext *s, arg_rrrr_esz *a, bool sel) | 76 | DeviceState *dev = DEVICE(obj); |
77 | * Note that in this case the ESZ field encodes both size and sign. | 77 | - struct omap_gpif_s *s = OMAP1_GPIO(obj); |
78 | * Split out 'subtract' into bit 1 of the data field for the helper. | 78 | + Omap1GpioState *s = OMAP1_GPIO(obj); |
79 | */ | 79 | SysBusDevice *sbd = SYS_BUS_DEVICE(obj); |
80 | - return do_sve2_zzzz_ool(s, a, fns[a->esz & 1], (a->esz & 2) | sel); | 80 | |
81 | + return gen_gvec_ool_arg_zzzz(s, fns[a->esz & 1], a, (a->esz & 2) | sel); | 81 | qdev_init_gpio_in(dev, omap_gpio_set, 16); |
82 | @@ -XXX,XX +XXX,XX @@ static void omap_gpio_init(Object *obj) | ||
83 | |||
84 | static void omap_gpio_realize(DeviceState *dev, Error **errp) | ||
85 | { | ||
86 | - struct omap_gpif_s *s = OMAP1_GPIO(dev); | ||
87 | + Omap1GpioState *s = OMAP1_GPIO(dev); | ||
88 | |||
89 | if (!s->clk) { | ||
90 | error_setg(errp, "omap-gpio: clk not connected"); | ||
91 | @@ -XXX,XX +XXX,XX @@ static void omap2_gpio_realize(DeviceState *dev, Error **errp) | ||
92 | } | ||
82 | } | 93 | } |
83 | 94 | ||
84 | -static bool trans_ADCLB(DisasContext *s, arg_rrrr_esz *a) | 95 | -void omap_gpio_set_clk(omap_gpif *gpio, omap_clk clk) |
85 | -{ | 96 | +void omap_gpio_set_clk(Omap1GpioState *gpio, omap_clk clk) |
86 | - return do_adcl(s, a, false); | ||
87 | -} | ||
88 | - | ||
89 | -static bool trans_ADCLT(DisasContext *s, arg_rrrr_esz *a) | ||
90 | -{ | ||
91 | - return do_adcl(s, a, true); | ||
92 | -} | ||
93 | +TRANS_FEAT(ADCLB, aa64_sve2, do_adcl, a, false) | ||
94 | +TRANS_FEAT(ADCLT, aa64_sve2, do_adcl, a, true) | ||
95 | |||
96 | static bool do_sve2_fn2i(DisasContext *s, arg_rri_esz *a, GVecGen2iFn *fn) | ||
97 | { | 97 | { |
98 | @@ -XXX,XX +XXX,XX @@ static bool trans_FMMLA(DisasContext *s, arg_rrrr_esz *a) | 98 | gpio->clk = clk; |
99 | return true; | ||
100 | } | 99 | } |
101 | 100 | ||
102 | -static bool do_sqdmlal_zzzw(DisasContext *s, arg_rrrr_esz *a, | 101 | static Property omap_gpio_properties[] = { |
103 | - bool sel1, bool sel2) | 102 | - DEFINE_PROP_INT32("mpu_model", struct omap_gpif_s, mpu_model, 0), |
104 | -{ | 103 | + DEFINE_PROP_INT32("mpu_model", Omap1GpioState, mpu_model, 0), |
105 | - static gen_helper_gvec_4 * const fns[] = { | 104 | DEFINE_PROP_END_OF_LIST(), |
106 | - NULL, gen_helper_sve2_sqdmlal_zzzw_h, | 105 | }; |
107 | - gen_helper_sve2_sqdmlal_zzzw_s, gen_helper_sve2_sqdmlal_zzzw_d, | 106 | |
108 | - }; | 107 | @@ -XXX,XX +XXX,XX @@ static void omap_gpio_class_init(ObjectClass *klass, void *data) |
109 | - return do_sve2_zzzz_ool(s, a, fns[a->esz], (sel2 << 1) | sel1); | 108 | static const TypeInfo omap_gpio_info = { |
110 | -} | 109 | .name = TYPE_OMAP1_GPIO, |
111 | +static gen_helper_gvec_4 * const sqdmlal_zzzw_fns[] = { | 110 | .parent = TYPE_SYS_BUS_DEVICE, |
112 | + NULL, gen_helper_sve2_sqdmlal_zzzw_h, | 111 | - .instance_size = sizeof(struct omap_gpif_s), |
113 | + gen_helper_sve2_sqdmlal_zzzw_s, gen_helper_sve2_sqdmlal_zzzw_d, | 112 | + .instance_size = sizeof(Omap1GpioState), |
114 | +}; | 113 | .instance_init = omap_gpio_init, |
115 | +TRANS_FEAT(SQDMLALB_zzzw, aa64_sve2, gen_gvec_ool_arg_zzzz, | 114 | .class_init = omap_gpio_class_init, |
116 | + sqdmlal_zzzw_fns[a->esz], a, 0) | 115 | }; |
117 | +TRANS_FEAT(SQDMLALT_zzzw, aa64_sve2, gen_gvec_ool_arg_zzzz, | ||
118 | + sqdmlal_zzzw_fns[a->esz], a, 3) | ||
119 | +TRANS_FEAT(SQDMLALBT, aa64_sve2, gen_gvec_ool_arg_zzzz, | ||
120 | + sqdmlal_zzzw_fns[a->esz], a, 2) | ||
121 | |||
122 | -static bool do_sqdmlsl_zzzw(DisasContext *s, arg_rrrr_esz *a, | ||
123 | - bool sel1, bool sel2) | ||
124 | -{ | ||
125 | - static gen_helper_gvec_4 * const fns[] = { | ||
126 | - NULL, gen_helper_sve2_sqdmlsl_zzzw_h, | ||
127 | - gen_helper_sve2_sqdmlsl_zzzw_s, gen_helper_sve2_sqdmlsl_zzzw_d, | ||
128 | - }; | ||
129 | - return do_sve2_zzzz_ool(s, a, fns[a->esz], (sel2 << 1) | sel1); | ||
130 | -} | ||
131 | +static gen_helper_gvec_4 * const sqdmlsl_zzzw_fns[] = { | ||
132 | + NULL, gen_helper_sve2_sqdmlsl_zzzw_h, | ||
133 | + gen_helper_sve2_sqdmlsl_zzzw_s, gen_helper_sve2_sqdmlsl_zzzw_d, | ||
134 | +}; | ||
135 | +TRANS_FEAT(SQDMLSLB_zzzw, aa64_sve2, gen_gvec_ool_arg_zzzz, | ||
136 | + sqdmlsl_zzzw_fns[a->esz], a, 0) | ||
137 | +TRANS_FEAT(SQDMLSLT_zzzw, aa64_sve2, gen_gvec_ool_arg_zzzz, | ||
138 | + sqdmlsl_zzzw_fns[a->esz], a, 3) | ||
139 | +TRANS_FEAT(SQDMLSLBT, aa64_sve2, gen_gvec_ool_arg_zzzz, | ||
140 | + sqdmlsl_zzzw_fns[a->esz], a, 2) | ||
141 | |||
142 | -static bool trans_SQDMLALB_zzzw(DisasContext *s, arg_rrrr_esz *a) | ||
143 | -{ | ||
144 | - return do_sqdmlal_zzzw(s, a, false, false); | ||
145 | -} | ||
146 | +static gen_helper_gvec_4 * const sqrdmlah_fns[] = { | ||
147 | + gen_helper_sve2_sqrdmlah_b, gen_helper_sve2_sqrdmlah_h, | ||
148 | + gen_helper_sve2_sqrdmlah_s, gen_helper_sve2_sqrdmlah_d, | ||
149 | +}; | ||
150 | +TRANS_FEAT(SQRDMLAH_zzzz, aa64_sve2, gen_gvec_ool_arg_zzzz, | ||
151 | + sqrdmlah_fns[a->esz], a, 0) | ||
152 | |||
153 | -static bool trans_SQDMLALT_zzzw(DisasContext *s, arg_rrrr_esz *a) | ||
154 | -{ | ||
155 | - return do_sqdmlal_zzzw(s, a, true, true); | ||
156 | -} | ||
157 | +static gen_helper_gvec_4 * const sqrdmlsh_fns[] = { | ||
158 | + gen_helper_sve2_sqrdmlsh_b, gen_helper_sve2_sqrdmlsh_h, | ||
159 | + gen_helper_sve2_sqrdmlsh_s, gen_helper_sve2_sqrdmlsh_d, | ||
160 | +}; | ||
161 | +TRANS_FEAT(SQRDMLSH_zzzz, aa64_sve2, gen_gvec_ool_arg_zzzz, | ||
162 | + sqrdmlsh_fns[a->esz], a, 0) | ||
163 | |||
164 | -static bool trans_SQDMLALBT(DisasContext *s, arg_rrrr_esz *a) | ||
165 | -{ | ||
166 | - return do_sqdmlal_zzzw(s, a, false, true); | ||
167 | -} | ||
168 | +static gen_helper_gvec_4 * const smlal_zzzw_fns[] = { | ||
169 | + NULL, gen_helper_sve2_smlal_zzzw_h, | ||
170 | + gen_helper_sve2_smlal_zzzw_s, gen_helper_sve2_smlal_zzzw_d, | ||
171 | +}; | ||
172 | +TRANS_FEAT(SMLALB_zzzw, aa64_sve2, gen_gvec_ool_arg_zzzz, | ||
173 | + smlal_zzzw_fns[a->esz], a, 0) | ||
174 | +TRANS_FEAT(SMLALT_zzzw, aa64_sve2, gen_gvec_ool_arg_zzzz, | ||
175 | + smlal_zzzw_fns[a->esz], a, 1) | ||
176 | |||
177 | -static bool trans_SQDMLSLB_zzzw(DisasContext *s, arg_rrrr_esz *a) | ||
178 | -{ | ||
179 | - return do_sqdmlsl_zzzw(s, a, false, false); | ||
180 | -} | ||
181 | +static gen_helper_gvec_4 * const umlal_zzzw_fns[] = { | ||
182 | + NULL, gen_helper_sve2_umlal_zzzw_h, | ||
183 | + gen_helper_sve2_umlal_zzzw_s, gen_helper_sve2_umlal_zzzw_d, | ||
184 | +}; | ||
185 | +TRANS_FEAT(UMLALB_zzzw, aa64_sve2, gen_gvec_ool_arg_zzzz, | ||
186 | + umlal_zzzw_fns[a->esz], a, 0) | ||
187 | +TRANS_FEAT(UMLALT_zzzw, aa64_sve2, gen_gvec_ool_arg_zzzz, | ||
188 | + umlal_zzzw_fns[a->esz], a, 1) | ||
189 | |||
190 | -static bool trans_SQDMLSLT_zzzw(DisasContext *s, arg_rrrr_esz *a) | ||
191 | -{ | ||
192 | - return do_sqdmlsl_zzzw(s, a, true, true); | ||
193 | -} | ||
194 | +static gen_helper_gvec_4 * const smlsl_zzzw_fns[] = { | ||
195 | + NULL, gen_helper_sve2_smlsl_zzzw_h, | ||
196 | + gen_helper_sve2_smlsl_zzzw_s, gen_helper_sve2_smlsl_zzzw_d, | ||
197 | +}; | ||
198 | +TRANS_FEAT(SMLSLB_zzzw, aa64_sve2, gen_gvec_ool_arg_zzzz, | ||
199 | + smlsl_zzzw_fns[a->esz], a, 0) | ||
200 | +TRANS_FEAT(SMLSLT_zzzw, aa64_sve2, gen_gvec_ool_arg_zzzz, | ||
201 | + smlsl_zzzw_fns[a->esz], a, 1) | ||
202 | |||
203 | -static bool trans_SQDMLSLBT(DisasContext *s, arg_rrrr_esz *a) | ||
204 | -{ | ||
205 | - return do_sqdmlsl_zzzw(s, a, false, true); | ||
206 | -} | ||
207 | - | ||
208 | -static bool trans_SQRDMLAH_zzzz(DisasContext *s, arg_rrrr_esz *a) | ||
209 | -{ | ||
210 | - static gen_helper_gvec_4 * const fns[] = { | ||
211 | - gen_helper_sve2_sqrdmlah_b, gen_helper_sve2_sqrdmlah_h, | ||
212 | - gen_helper_sve2_sqrdmlah_s, gen_helper_sve2_sqrdmlah_d, | ||
213 | - }; | ||
214 | - return do_sve2_zzzz_ool(s, a, fns[a->esz], 0); | ||
215 | -} | ||
216 | - | ||
217 | -static bool trans_SQRDMLSH_zzzz(DisasContext *s, arg_rrrr_esz *a) | ||
218 | -{ | ||
219 | - static gen_helper_gvec_4 * const fns[] = { | ||
220 | - gen_helper_sve2_sqrdmlsh_b, gen_helper_sve2_sqrdmlsh_h, | ||
221 | - gen_helper_sve2_sqrdmlsh_s, gen_helper_sve2_sqrdmlsh_d, | ||
222 | - }; | ||
223 | - return do_sve2_zzzz_ool(s, a, fns[a->esz], 0); | ||
224 | -} | ||
225 | - | ||
226 | -static bool do_smlal_zzzw(DisasContext *s, arg_rrrr_esz *a, bool sel) | ||
227 | -{ | ||
228 | - static gen_helper_gvec_4 * const fns[] = { | ||
229 | - NULL, gen_helper_sve2_smlal_zzzw_h, | ||
230 | - gen_helper_sve2_smlal_zzzw_s, gen_helper_sve2_smlal_zzzw_d, | ||
231 | - }; | ||
232 | - return do_sve2_zzzz_ool(s, a, fns[a->esz], sel); | ||
233 | -} | ||
234 | - | ||
235 | -static bool trans_SMLALB_zzzw(DisasContext *s, arg_rrrr_esz *a) | ||
236 | -{ | ||
237 | - return do_smlal_zzzw(s, a, false); | ||
238 | -} | ||
239 | - | ||
240 | -static bool trans_SMLALT_zzzw(DisasContext *s, arg_rrrr_esz *a) | ||
241 | -{ | ||
242 | - return do_smlal_zzzw(s, a, true); | ||
243 | -} | ||
244 | - | ||
245 | -static bool do_umlal_zzzw(DisasContext *s, arg_rrrr_esz *a, bool sel) | ||
246 | -{ | ||
247 | - static gen_helper_gvec_4 * const fns[] = { | ||
248 | - NULL, gen_helper_sve2_umlal_zzzw_h, | ||
249 | - gen_helper_sve2_umlal_zzzw_s, gen_helper_sve2_umlal_zzzw_d, | ||
250 | - }; | ||
251 | - return do_sve2_zzzz_ool(s, a, fns[a->esz], sel); | ||
252 | -} | ||
253 | - | ||
254 | -static bool trans_UMLALB_zzzw(DisasContext *s, arg_rrrr_esz *a) | ||
255 | -{ | ||
256 | - return do_umlal_zzzw(s, a, false); | ||
257 | -} | ||
258 | - | ||
259 | -static bool trans_UMLALT_zzzw(DisasContext *s, arg_rrrr_esz *a) | ||
260 | -{ | ||
261 | - return do_umlal_zzzw(s, a, true); | ||
262 | -} | ||
263 | - | ||
264 | -static bool do_smlsl_zzzw(DisasContext *s, arg_rrrr_esz *a, bool sel) | ||
265 | -{ | ||
266 | - static gen_helper_gvec_4 * const fns[] = { | ||
267 | - NULL, gen_helper_sve2_smlsl_zzzw_h, | ||
268 | - gen_helper_sve2_smlsl_zzzw_s, gen_helper_sve2_smlsl_zzzw_d, | ||
269 | - }; | ||
270 | - return do_sve2_zzzz_ool(s, a, fns[a->esz], sel); | ||
271 | -} | ||
272 | - | ||
273 | -static bool trans_SMLSLB_zzzw(DisasContext *s, arg_rrrr_esz *a) | ||
274 | -{ | ||
275 | - return do_smlsl_zzzw(s, a, false); | ||
276 | -} | ||
277 | - | ||
278 | -static bool trans_SMLSLT_zzzw(DisasContext *s, arg_rrrr_esz *a) | ||
279 | -{ | ||
280 | - return do_smlsl_zzzw(s, a, true); | ||
281 | -} | ||
282 | - | ||
283 | -static bool do_umlsl_zzzw(DisasContext *s, arg_rrrr_esz *a, bool sel) | ||
284 | -{ | ||
285 | - static gen_helper_gvec_4 * const fns[] = { | ||
286 | - NULL, gen_helper_sve2_umlsl_zzzw_h, | ||
287 | - gen_helper_sve2_umlsl_zzzw_s, gen_helper_sve2_umlsl_zzzw_d, | ||
288 | - }; | ||
289 | - return do_sve2_zzzz_ool(s, a, fns[a->esz], sel); | ||
290 | -} | ||
291 | - | ||
292 | -static bool trans_UMLSLB_zzzw(DisasContext *s, arg_rrrr_esz *a) | ||
293 | -{ | ||
294 | - return do_umlsl_zzzw(s, a, false); | ||
295 | -} | ||
296 | - | ||
297 | -static bool trans_UMLSLT_zzzw(DisasContext *s, arg_rrrr_esz *a) | ||
298 | -{ | ||
299 | - return do_umlsl_zzzw(s, a, true); | ||
300 | -} | ||
301 | +static gen_helper_gvec_4 * const umlsl_zzzw_fns[] = { | ||
302 | + NULL, gen_helper_sve2_umlsl_zzzw_h, | ||
303 | + gen_helper_sve2_umlsl_zzzw_s, gen_helper_sve2_umlsl_zzzw_d, | ||
304 | +}; | ||
305 | +TRANS_FEAT(UMLSLB_zzzw, aa64_sve2, gen_gvec_ool_arg_zzzz, | ||
306 | + umlsl_zzzw_fns[a->esz], a, 0) | ||
307 | +TRANS_FEAT(UMLSLT_zzzw, aa64_sve2, gen_gvec_ool_arg_zzzz, | ||
308 | + umlsl_zzzw_fns[a->esz], a, 1) | ||
309 | |||
310 | static gen_helper_gvec_4 * const cmla_fns[] = { | ||
311 | gen_helper_sve2_cmla_zzzz_b, gen_helper_sve2_cmla_zzzz_h, | ||
312 | -- | 116 | -- |
313 | 2.25.1 | 117 | 2.34.1 |
118 | |||
119 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Philippe Mathieu-Daudé <philmd@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 3 | Following docs/devel/style.rst guidelines, rename omap2_gpif_s -> |
4 | Message-id: 20220527181907.189259-95-richard.henderson@linaro.org | 4 | Omap2GpioState. This also remove a use of 'struct' in the |
5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 5 | DECLARE_INSTANCE_CHECKER() macro call. |
6 | |||
7 | Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> | ||
8 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
9 | Message-id: 20230109140306.23161-6-philmd@linaro.org | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
7 | --- | 11 | --- |
8 | target/arm/translate-sve.c | 52 +++++++++++++++++--------------------- | 12 | include/hw/arm/omap.h | 9 ++++----- |
9 | 1 file changed, 23 insertions(+), 29 deletions(-) | 13 | hw/gpio/omap_gpio.c | 20 ++++++++++---------- |
14 | 2 files changed, 14 insertions(+), 15 deletions(-) | ||
10 | 15 | ||
11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | 16 | diff --git a/include/hw/arm/omap.h b/include/hw/arm/omap.h |
12 | index XXXXXXX..XXXXXXX 100644 | 17 | index XXXXXXX..XXXXXXX 100644 |
13 | --- a/target/arm/translate-sve.c | 18 | --- a/include/hw/arm/omap.h |
14 | +++ b/target/arm/translate-sve.c | 19 | +++ b/include/hw/arm/omap.h |
15 | @@ -XXX,XX +XXX,XX @@ TRANS_FEAT(FRINTX, aa64_sve, gen_gvec_fpst_arg_zpz, frintx_fns[a->esz], | 20 | @@ -XXX,XX +XXX,XX @@ DECLARE_INSTANCE_CHECKER(Omap1GpioState, OMAP1_GPIO, |
16 | static bool do_frint_mode(DisasContext *s, arg_rpr_esz *a, | 21 | TYPE_OMAP1_GPIO) |
17 | int mode, gen_helper_gvec_3_ptr *fn) | 22 | |
23 | #define TYPE_OMAP2_GPIO "omap2-gpio" | ||
24 | -DECLARE_INSTANCE_CHECKER(struct omap2_gpif_s, OMAP2_GPIO, | ||
25 | +typedef struct Omap2GpioState Omap2GpioState; | ||
26 | +DECLARE_INSTANCE_CHECKER(Omap2GpioState, OMAP2_GPIO, | ||
27 | TYPE_OMAP2_GPIO) | ||
28 | |||
29 | -typedef struct omap2_gpif_s omap2_gpif; | ||
30 | - | ||
31 | /* TODO: clock framework (see above) */ | ||
32 | void omap_gpio_set_clk(Omap1GpioState *gpio, omap_clk clk); | ||
33 | |||
34 | -void omap2_gpio_set_iclk(omap2_gpif *gpio, omap_clk clk); | ||
35 | -void omap2_gpio_set_fclk(omap2_gpif *gpio, uint8_t i, omap_clk clk); | ||
36 | +void omap2_gpio_set_iclk(Omap2GpioState *gpio, omap_clk clk); | ||
37 | +void omap2_gpio_set_fclk(Omap2GpioState *gpio, uint8_t i, omap_clk clk); | ||
38 | |||
39 | /* OMAP2 l4 Interconnect */ | ||
40 | struct omap_l4_s; | ||
41 | diff --git a/hw/gpio/omap_gpio.c b/hw/gpio/omap_gpio.c | ||
42 | index XXXXXXX..XXXXXXX 100644 | ||
43 | --- a/hw/gpio/omap_gpio.c | ||
44 | +++ b/hw/gpio/omap_gpio.c | ||
45 | @@ -XXX,XX +XXX,XX @@ struct omap2_gpio_s { | ||
46 | uint8_t delay; | ||
47 | }; | ||
48 | |||
49 | -struct omap2_gpif_s { | ||
50 | +struct Omap2GpioState { | ||
51 | SysBusDevice parent_obj; | ||
52 | |||
53 | MemoryRegion iomem; | ||
54 | @@ -XXX,XX +XXX,XX @@ static inline void omap2_gpio_module_int(struct omap2_gpio_s *s, int line) | ||
55 | |||
56 | static void omap2_gpio_set(void *opaque, int line, int level) | ||
18 | { | 57 | { |
19 | - if (sve_access_check(s)) { | 58 | - struct omap2_gpif_s *p = opaque; |
20 | - unsigned vsz = vec_full_reg_size(s); | 59 | + Omap2GpioState *p = opaque; |
21 | - TCGv_i32 tmode = tcg_const_i32(mode); | 60 | struct omap2_gpio_s *s = &p->modules[line >> 5]; |
22 | - TCGv_ptr status = fpstatus_ptr(a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); | 61 | |
23 | + unsigned vsz; | 62 | line &= 31; |
24 | + TCGv_i32 tmode; | 63 | @@ -XXX,XX +XXX,XX @@ static void omap_gpif_reset(DeviceState *dev) |
25 | + TCGv_ptr status; | 64 | |
26 | 65 | static void omap2_gpif_reset(DeviceState *dev) | |
27 | - gen_helper_set_rmode(tmode, tmode, status); | 66 | { |
28 | - | 67 | - struct omap2_gpif_s *s = OMAP2_GPIO(dev); |
29 | - tcg_gen_gvec_3_ptr(vec_full_reg_offset(s, a->rd), | 68 | + Omap2GpioState *s = OMAP2_GPIO(dev); |
30 | - vec_full_reg_offset(s, a->rn), | 69 | int i; |
31 | - pred_full_reg_offset(s, a->pg), | 70 | |
32 | - status, vsz, vsz, 0, fn); | 71 | for (i = 0; i < s->modulecount; i++) { |
33 | - | 72 | @@ -XXX,XX +XXX,XX @@ static void omap2_gpif_reset(DeviceState *dev) |
34 | - gen_helper_set_rmode(tmode, tmode, status); | 73 | |
35 | - tcg_temp_free_i32(tmode); | 74 | static uint64_t omap2_gpif_top_read(void *opaque, hwaddr addr, unsigned size) |
36 | - tcg_temp_free_ptr(status); | 75 | { |
37 | + if (fn == NULL) { | 76 | - struct omap2_gpif_s *s = opaque; |
38 | + return false; | 77 | + Omap2GpioState *s = opaque; |
39 | } | 78 | |
40 | + if (!sve_access_check(s)) { | 79 | switch (addr) { |
41 | + return true; | 80 | case 0x00: /* IPGENERICOCPSPL_REVISION */ |
42 | + } | 81 | @@ -XXX,XX +XXX,XX @@ static uint64_t omap2_gpif_top_read(void *opaque, hwaddr addr, unsigned size) |
43 | + | 82 | static void omap2_gpif_top_write(void *opaque, hwaddr addr, |
44 | + vsz = vec_full_reg_size(s); | 83 | uint64_t value, unsigned size) |
45 | + tmode = tcg_const_i32(mode); | 84 | { |
46 | + status = fpstatus_ptr(a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); | 85 | - struct omap2_gpif_s *s = opaque; |
47 | + | 86 | + Omap2GpioState *s = opaque; |
48 | + gen_helper_set_rmode(tmode, tmode, status); | 87 | |
49 | + | 88 | switch (addr) { |
50 | + tcg_gen_gvec_3_ptr(vec_full_reg_offset(s, a->rd), | 89 | case 0x00: /* IPGENERICOCPSPL_REVISION */ |
51 | + vec_full_reg_offset(s, a->rn), | 90 | @@ -XXX,XX +XXX,XX @@ static void omap_gpio_realize(DeviceState *dev, Error **errp) |
52 | + pred_full_reg_offset(s, a->pg), | 91 | |
53 | + status, vsz, vsz, 0, fn); | 92 | static void omap2_gpio_realize(DeviceState *dev, Error **errp) |
54 | + | 93 | { |
55 | + gen_helper_set_rmode(tmode, tmode, status); | 94 | - struct omap2_gpif_s *s = OMAP2_GPIO(dev); |
56 | + tcg_temp_free_i32(tmode); | 95 | + Omap2GpioState *s = OMAP2_GPIO(dev); |
57 | + tcg_temp_free_ptr(status); | 96 | SysBusDevice *sbd = SYS_BUS_DEVICE(dev); |
58 | return true; | 97 | int i; |
98 | |||
99 | @@ -XXX,XX +XXX,XX @@ static const TypeInfo omap_gpio_info = { | ||
100 | .class_init = omap_gpio_class_init, | ||
101 | }; | ||
102 | |||
103 | -void omap2_gpio_set_iclk(omap2_gpif *gpio, omap_clk clk) | ||
104 | +void omap2_gpio_set_iclk(Omap2GpioState *gpio, omap_clk clk) | ||
105 | { | ||
106 | gpio->iclk = clk; | ||
59 | } | 107 | } |
60 | 108 | ||
61 | static bool trans_FRINTN(DisasContext *s, arg_rpr_esz *a) | 109 | -void omap2_gpio_set_fclk(omap2_gpif *gpio, uint8_t i, omap_clk clk) |
110 | +void omap2_gpio_set_fclk(Omap2GpioState *gpio, uint8_t i, omap_clk clk) | ||
62 | { | 111 | { |
63 | - if (a->esz == 0) { | 112 | assert(i <= 5); |
64 | - return false; | 113 | gpio->fclk[i] = clk; |
65 | - } | ||
66 | return do_frint_mode(s, a, float_round_nearest_even, frint_fns[a->esz]); | ||
67 | } | 114 | } |
68 | 115 | ||
69 | static bool trans_FRINTP(DisasContext *s, arg_rpr_esz *a) | 116 | static Property omap2_gpio_properties[] = { |
70 | { | 117 | - DEFINE_PROP_INT32("mpu_model", struct omap2_gpif_s, mpu_model, 0), |
71 | - if (a->esz == 0) { | 118 | + DEFINE_PROP_INT32("mpu_model", Omap2GpioState, mpu_model, 0), |
72 | - return false; | 119 | DEFINE_PROP_END_OF_LIST(), |
73 | - } | 120 | }; |
74 | return do_frint_mode(s, a, float_round_up, frint_fns[a->esz]); | 121 | |
75 | } | 122 | @@ -XXX,XX +XXX,XX @@ static void omap2_gpio_class_init(ObjectClass *klass, void *data) |
76 | 123 | static const TypeInfo omap2_gpio_info = { | |
77 | static bool trans_FRINTM(DisasContext *s, arg_rpr_esz *a) | 124 | .name = TYPE_OMAP2_GPIO, |
78 | { | 125 | .parent = TYPE_SYS_BUS_DEVICE, |
79 | - if (a->esz == 0) { | 126 | - .instance_size = sizeof(struct omap2_gpif_s), |
80 | - return false; | 127 | + .instance_size = sizeof(Omap2GpioState), |
81 | - } | 128 | .class_init = omap2_gpio_class_init, |
82 | return do_frint_mode(s, a, float_round_down, frint_fns[a->esz]); | 129 | }; |
83 | } | ||
84 | |||
85 | static bool trans_FRINTZ(DisasContext *s, arg_rpr_esz *a) | ||
86 | { | ||
87 | - if (a->esz == 0) { | ||
88 | - return false; | ||
89 | - } | ||
90 | return do_frint_mode(s, a, float_round_to_zero, frint_fns[a->esz]); | ||
91 | } | ||
92 | |||
93 | static bool trans_FRINTA(DisasContext *s, arg_rpr_esz *a) | ||
94 | { | ||
95 | - if (a->esz == 0) { | ||
96 | - return false; | ||
97 | - } | ||
98 | return do_frint_mode(s, a, float_round_ties_away, frint_fns[a->esz]); | ||
99 | } | ||
100 | 130 | ||
101 | -- | 131 | -- |
102 | 2.25.1 | 132 | 2.34.1 |
133 | |||
134 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Philippe Mathieu-Daudé <philmd@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | Convert some SVE translation functions using | 3 | Following docs/devel/style.rst guidelines, rename |
4 | gen_gvec_ool_arg_zpzi to TRANS_FEAT. | 4 | omap_intr_handler_s -> OMAPIntcState. This also remove a |
5 | 5 | use of 'struct' in the DECLARE_INSTANCE_CHECKER() macro call. | |
6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 6 | |
7 | Message-id: 20220527181907.189259-25-richard.henderson@linaro.org | 7 | Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> |
8 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 8 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> |
9 | Message-id: 20230109140306.23161-7-philmd@linaro.org | ||
9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
10 | --- | 11 | --- |
11 | target/arm/translate-sve.c | 85 ++++++++++++++------------------------ | 12 | include/hw/arm/omap.h | 9 ++++----- |
12 | 1 file changed, 30 insertions(+), 55 deletions(-) | 13 | hw/intc/omap_intc.c | 38 +++++++++++++++++++------------------- |
13 | 14 | 2 files changed, 23 insertions(+), 24 deletions(-) | |
14 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | 15 | |
16 | diff --git a/include/hw/arm/omap.h b/include/hw/arm/omap.h | ||
15 | index XXXXXXX..XXXXXXX 100644 | 17 | index XXXXXXX..XXXXXXX 100644 |
16 | --- a/target/arm/translate-sve.c | 18 | --- a/include/hw/arm/omap.h |
17 | +++ b/target/arm/translate-sve.c | 19 | +++ b/include/hw/arm/omap.h |
18 | @@ -XXX,XX +XXX,XX @@ static bool trans_ASRD(DisasContext *s, arg_rpri_esz *a) | 20 | @@ -XXX,XX +XXX,XX @@ void omap_clk_reparent(omap_clk clk, omap_clk parent); |
21 | |||
22 | /* omap_intc.c */ | ||
23 | #define TYPE_OMAP_INTC "common-omap-intc" | ||
24 | -typedef struct omap_intr_handler_s omap_intr_handler; | ||
25 | -DECLARE_INSTANCE_CHECKER(omap_intr_handler, OMAP_INTC, | ||
26 | - TYPE_OMAP_INTC) | ||
27 | +typedef struct OMAPIntcState OMAPIntcState; | ||
28 | +DECLARE_INSTANCE_CHECKER(OMAPIntcState, OMAP_INTC, TYPE_OMAP_INTC) | ||
29 | |||
30 | |||
31 | /* | ||
32 | @@ -XXX,XX +XXX,XX @@ DECLARE_INSTANCE_CHECKER(omap_intr_handler, OMAP_INTC, | ||
33 | * (ie the struct omap_mpu_state_s*) to do the clockname to pointer | ||
34 | * translation.) | ||
35 | */ | ||
36 | -void omap_intc_set_iclk(omap_intr_handler *intc, omap_clk clk); | ||
37 | -void omap_intc_set_fclk(omap_intr_handler *intc, omap_clk clk); | ||
38 | +void omap_intc_set_iclk(OMAPIntcState *intc, omap_clk clk); | ||
39 | +void omap_intc_set_fclk(OMAPIntcState *intc, omap_clk clk); | ||
40 | |||
41 | /* omap_i2c.c */ | ||
42 | #define TYPE_OMAP_I2C "omap_i2c" | ||
43 | diff --git a/hw/intc/omap_intc.c b/hw/intc/omap_intc.c | ||
44 | index XXXXXXX..XXXXXXX 100644 | ||
45 | --- a/hw/intc/omap_intc.c | ||
46 | +++ b/hw/intc/omap_intc.c | ||
47 | @@ -XXX,XX +XXX,XX @@ struct omap_intr_handler_bank_s { | ||
48 | unsigned char priority[32]; | ||
49 | }; | ||
50 | |||
51 | -struct omap_intr_handler_s { | ||
52 | +struct OMAPIntcState { | ||
53 | SysBusDevice parent_obj; | ||
54 | |||
55 | qemu_irq *pins; | ||
56 | @@ -XXX,XX +XXX,XX @@ struct omap_intr_handler_s { | ||
57 | struct omap_intr_handler_bank_s bank[3]; | ||
58 | }; | ||
59 | |||
60 | -static void omap_inth_sir_update(struct omap_intr_handler_s *s, int is_fiq) | ||
61 | +static void omap_inth_sir_update(OMAPIntcState *s, int is_fiq) | ||
62 | { | ||
63 | int i, j, sir_intr, p_intr, p; | ||
64 | uint32_t level; | ||
65 | @@ -XXX,XX +XXX,XX @@ static void omap_inth_sir_update(struct omap_intr_handler_s *s, int is_fiq) | ||
66 | s->sir_intr[is_fiq] = sir_intr; | ||
67 | } | ||
68 | |||
69 | -static inline void omap_inth_update(struct omap_intr_handler_s *s, int is_fiq) | ||
70 | +static inline void omap_inth_update(OMAPIntcState *s, int is_fiq) | ||
71 | { | ||
72 | int i; | ||
73 | uint32_t has_intr = 0; | ||
74 | @@ -XXX,XX +XXX,XX @@ static inline void omap_inth_update(struct omap_intr_handler_s *s, int is_fiq) | ||
75 | |||
76 | static void omap_set_intr(void *opaque, int irq, int req) | ||
77 | { | ||
78 | - struct omap_intr_handler_s *ih = opaque; | ||
79 | + OMAPIntcState *ih = opaque; | ||
80 | uint32_t rise; | ||
81 | |||
82 | struct omap_intr_handler_bank_s *bank = &ih->bank[irq >> 5]; | ||
83 | @@ -XXX,XX +XXX,XX @@ static void omap_set_intr(void *opaque, int irq, int req) | ||
84 | /* Simplified version with no edge detection */ | ||
85 | static void omap_set_intr_noedge(void *opaque, int irq, int req) | ||
86 | { | ||
87 | - struct omap_intr_handler_s *ih = opaque; | ||
88 | + OMAPIntcState *ih = opaque; | ||
89 | uint32_t rise; | ||
90 | |||
91 | struct omap_intr_handler_bank_s *bank = &ih->bank[irq >> 5]; | ||
92 | @@ -XXX,XX +XXX,XX @@ static void omap_set_intr_noedge(void *opaque, int irq, int req) | ||
93 | static uint64_t omap_inth_read(void *opaque, hwaddr addr, | ||
94 | unsigned size) | ||
95 | { | ||
96 | - struct omap_intr_handler_s *s = opaque; | ||
97 | + OMAPIntcState *s = opaque; | ||
98 | int i, offset = addr; | ||
99 | int bank_no = offset >> 8; | ||
100 | int line_no; | ||
101 | @@ -XXX,XX +XXX,XX @@ static uint64_t omap_inth_read(void *opaque, hwaddr addr, | ||
102 | static void omap_inth_write(void *opaque, hwaddr addr, | ||
103 | uint64_t value, unsigned size) | ||
104 | { | ||
105 | - struct omap_intr_handler_s *s = opaque; | ||
106 | + OMAPIntcState *s = opaque; | ||
107 | int i, offset = addr; | ||
108 | int bank_no = offset >> 8; | ||
109 | struct omap_intr_handler_bank_s *bank = &s->bank[bank_no]; | ||
110 | @@ -XXX,XX +XXX,XX @@ static const MemoryRegionOps omap_inth_mem_ops = { | ||
111 | |||
112 | static void omap_inth_reset(DeviceState *dev) | ||
113 | { | ||
114 | - struct omap_intr_handler_s *s = OMAP_INTC(dev); | ||
115 | + OMAPIntcState *s = OMAP_INTC(dev); | ||
116 | int i; | ||
117 | |||
118 | for (i = 0; i < s->nbanks; ++i){ | ||
119 | @@ -XXX,XX +XXX,XX @@ static void omap_inth_reset(DeviceState *dev) | ||
120 | static void omap_intc_init(Object *obj) | ||
121 | { | ||
122 | DeviceState *dev = DEVICE(obj); | ||
123 | - struct omap_intr_handler_s *s = OMAP_INTC(obj); | ||
124 | + OMAPIntcState *s = OMAP_INTC(obj); | ||
125 | SysBusDevice *sbd = SYS_BUS_DEVICE(obj); | ||
126 | |||
127 | s->nbanks = 1; | ||
128 | @@ -XXX,XX +XXX,XX @@ static void omap_intc_init(Object *obj) | ||
129 | |||
130 | static void omap_intc_realize(DeviceState *dev, Error **errp) | ||
131 | { | ||
132 | - struct omap_intr_handler_s *s = OMAP_INTC(dev); | ||
133 | + OMAPIntcState *s = OMAP_INTC(dev); | ||
134 | |||
135 | if (!s->iclk) { | ||
136 | error_setg(errp, "omap-intc: clk not connected"); | ||
19 | } | 137 | } |
20 | } | 138 | } |
21 | 139 | ||
22 | -static bool trans_SQSHL_zpzi(DisasContext *s, arg_rpri_esz *a) | 140 | -void omap_intc_set_iclk(omap_intr_handler *intc, omap_clk clk) |
23 | -{ | 141 | +void omap_intc_set_iclk(OMAPIntcState *intc, omap_clk clk) |
24 | - static gen_helper_gvec_3 * const fns[4] = { | 142 | { |
25 | - gen_helper_sve2_sqshl_zpzi_b, gen_helper_sve2_sqshl_zpzi_h, | 143 | intc->iclk = clk; |
26 | - gen_helper_sve2_sqshl_zpzi_s, gen_helper_sve2_sqshl_zpzi_d, | 144 | } |
27 | - }; | 145 | |
28 | - if (a->esz < 0 || !dc_isar_feature(aa64_sve2, s)) { | 146 | -void omap_intc_set_fclk(omap_intr_handler *intc, omap_clk clk) |
29 | - return false; | 147 | +void omap_intc_set_fclk(OMAPIntcState *intc, omap_clk clk) |
30 | - } | 148 | { |
31 | - return gen_gvec_ool_arg_zpzi(s, fns[a->esz], a); | 149 | intc->fclk = clk; |
32 | -} | 150 | } |
33 | +static gen_helper_gvec_3 * const sqshl_zpzi_fns[4] = { | 151 | |
34 | + gen_helper_sve2_sqshl_zpzi_b, gen_helper_sve2_sqshl_zpzi_h, | 152 | static Property omap_intc_properties[] = { |
35 | + gen_helper_sve2_sqshl_zpzi_s, gen_helper_sve2_sqshl_zpzi_d, | 153 | - DEFINE_PROP_UINT32("size", struct omap_intr_handler_s, size, 0x100), |
36 | +}; | 154 | + DEFINE_PROP_UINT32("size", OMAPIntcState, size, 0x100), |
37 | +TRANS_FEAT(SQSHL_zpzi, aa64_sve2, gen_gvec_ool_arg_zpzi, | 155 | DEFINE_PROP_END_OF_LIST(), |
38 | + a->esz < 0 ? NULL : sqshl_zpzi_fns[a->esz], a) | 156 | }; |
39 | 157 | ||
40 | -static bool trans_UQSHL_zpzi(DisasContext *s, arg_rpri_esz *a) | 158 | @@ -XXX,XX +XXX,XX @@ static const TypeInfo omap_intc_info = { |
41 | -{ | 159 | static uint64_t omap2_inth_read(void *opaque, hwaddr addr, |
42 | - static gen_helper_gvec_3 * const fns[4] = { | 160 | unsigned size) |
43 | - gen_helper_sve2_uqshl_zpzi_b, gen_helper_sve2_uqshl_zpzi_h, | 161 | { |
44 | - gen_helper_sve2_uqshl_zpzi_s, gen_helper_sve2_uqshl_zpzi_d, | 162 | - struct omap_intr_handler_s *s = opaque; |
45 | - }; | 163 | + OMAPIntcState *s = opaque; |
46 | - if (a->esz < 0 || !dc_isar_feature(aa64_sve2, s)) { | 164 | int offset = addr; |
47 | - return false; | 165 | int bank_no, line_no; |
48 | - } | 166 | struct omap_intr_handler_bank_s *bank = NULL; |
49 | - return gen_gvec_ool_arg_zpzi(s, fns[a->esz], a); | 167 | @@ -XXX,XX +XXX,XX @@ static uint64_t omap2_inth_read(void *opaque, hwaddr addr, |
50 | -} | 168 | static void omap2_inth_write(void *opaque, hwaddr addr, |
51 | +static gen_helper_gvec_3 * const uqshl_zpzi_fns[4] = { | 169 | uint64_t value, unsigned size) |
52 | + gen_helper_sve2_uqshl_zpzi_b, gen_helper_sve2_uqshl_zpzi_h, | 170 | { |
53 | + gen_helper_sve2_uqshl_zpzi_s, gen_helper_sve2_uqshl_zpzi_d, | 171 | - struct omap_intr_handler_s *s = opaque; |
54 | +}; | 172 | + OMAPIntcState *s = opaque; |
55 | +TRANS_FEAT(UQSHL_zpzi, aa64_sve2, gen_gvec_ool_arg_zpzi, | 173 | int offset = addr; |
56 | + a->esz < 0 ? NULL : uqshl_zpzi_fns[a->esz], a) | 174 | int bank_no, line_no; |
57 | 175 | struct omap_intr_handler_bank_s *bank = NULL; | |
58 | -static bool trans_SRSHR(DisasContext *s, arg_rpri_esz *a) | 176 | @@ -XXX,XX +XXX,XX @@ static const MemoryRegionOps omap2_inth_mem_ops = { |
59 | -{ | 177 | static void omap2_intc_init(Object *obj) |
60 | - static gen_helper_gvec_3 * const fns[4] = { | 178 | { |
61 | - gen_helper_sve2_srshr_b, gen_helper_sve2_srshr_h, | 179 | DeviceState *dev = DEVICE(obj); |
62 | - gen_helper_sve2_srshr_s, gen_helper_sve2_srshr_d, | 180 | - struct omap_intr_handler_s *s = OMAP_INTC(obj); |
63 | - }; | 181 | + OMAPIntcState *s = OMAP_INTC(obj); |
64 | - if (a->esz < 0 || !dc_isar_feature(aa64_sve2, s)) { | 182 | SysBusDevice *sbd = SYS_BUS_DEVICE(obj); |
65 | - return false; | 183 | |
66 | - } | 184 | s->level_only = 1; |
67 | - return gen_gvec_ool_arg_zpzi(s, fns[a->esz], a); | 185 | @@ -XXX,XX +XXX,XX @@ static void omap2_intc_init(Object *obj) |
68 | -} | 186 | |
69 | +static gen_helper_gvec_3 * const srshr_fns[4] = { | 187 | static void omap2_intc_realize(DeviceState *dev, Error **errp) |
70 | + gen_helper_sve2_srshr_b, gen_helper_sve2_srshr_h, | 188 | { |
71 | + gen_helper_sve2_srshr_s, gen_helper_sve2_srshr_d, | 189 | - struct omap_intr_handler_s *s = OMAP_INTC(dev); |
72 | +}; | 190 | + OMAPIntcState *s = OMAP_INTC(dev); |
73 | +TRANS_FEAT(SRSHR, aa64_sve2, gen_gvec_ool_arg_zpzi, | 191 | |
74 | + a->esz < 0 ? NULL : srshr_fns[a->esz], a) | 192 | if (!s->iclk) { |
75 | 193 | error_setg(errp, "omap2-intc: iclk not connected"); | |
76 | -static bool trans_URSHR(DisasContext *s, arg_rpri_esz *a) | 194 | @@ -XXX,XX +XXX,XX @@ static void omap2_intc_realize(DeviceState *dev, Error **errp) |
77 | -{ | 195 | } |
78 | - static gen_helper_gvec_3 * const fns[4] = { | 196 | |
79 | - gen_helper_sve2_urshr_b, gen_helper_sve2_urshr_h, | 197 | static Property omap2_intc_properties[] = { |
80 | - gen_helper_sve2_urshr_s, gen_helper_sve2_urshr_d, | 198 | - DEFINE_PROP_UINT8("revision", struct omap_intr_handler_s, |
81 | - }; | 199 | + DEFINE_PROP_UINT8("revision", OMAPIntcState, |
82 | - if (a->esz < 0 || !dc_isar_feature(aa64_sve2, s)) { | 200 | revision, 0x21), |
83 | - return false; | 201 | DEFINE_PROP_END_OF_LIST(), |
84 | - } | 202 | }; |
85 | - return gen_gvec_ool_arg_zpzi(s, fns[a->esz], a); | 203 | @@ -XXX,XX +XXX,XX @@ static const TypeInfo omap2_intc_info = { |
86 | -} | 204 | static const TypeInfo omap_intc_type_info = { |
87 | +static gen_helper_gvec_3 * const urshr_fns[4] = { | 205 | .name = TYPE_OMAP_INTC, |
88 | + gen_helper_sve2_urshr_b, gen_helper_sve2_urshr_h, | 206 | .parent = TYPE_SYS_BUS_DEVICE, |
89 | + gen_helper_sve2_urshr_s, gen_helper_sve2_urshr_d, | 207 | - .instance_size = sizeof(omap_intr_handler), |
90 | +}; | 208 | + .instance_size = sizeof(OMAPIntcState), |
91 | +TRANS_FEAT(URSHR, aa64_sve2, gen_gvec_ool_arg_zpzi, | 209 | .abstract = true, |
92 | + a->esz < 0 ? NULL : urshr_fns[a->esz], a) | 210 | }; |
93 | 211 | ||
94 | -static bool trans_SQSHLU(DisasContext *s, arg_rpri_esz *a) | ||
95 | -{ | ||
96 | - static gen_helper_gvec_3 * const fns[4] = { | ||
97 | - gen_helper_sve2_sqshlu_b, gen_helper_sve2_sqshlu_h, | ||
98 | - gen_helper_sve2_sqshlu_s, gen_helper_sve2_sqshlu_d, | ||
99 | - }; | ||
100 | - if (a->esz < 0 || !dc_isar_feature(aa64_sve2, s)) { | ||
101 | - return false; | ||
102 | - } | ||
103 | - return gen_gvec_ool_arg_zpzi(s, fns[a->esz], a); | ||
104 | -} | ||
105 | +static gen_helper_gvec_3 * const sqshlu_fns[4] = { | ||
106 | + gen_helper_sve2_sqshlu_b, gen_helper_sve2_sqshlu_h, | ||
107 | + gen_helper_sve2_sqshlu_s, gen_helper_sve2_sqshlu_d, | ||
108 | +}; | ||
109 | +TRANS_FEAT(SQSHLU, aa64_sve2, gen_gvec_ool_arg_zpzi, | ||
110 | + a->esz < 0 ? NULL : sqshlu_fns[a->esz], a) | ||
111 | |||
112 | /* | ||
113 | *** SVE Bitwise Shift - Predicated Group | ||
114 | -- | 212 | -- |
115 | 2.25.1 | 213 | 2.34.1 |
214 | |||
215 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Philippe Mathieu-Daudé <philmd@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | Combined with the check already present in gen_mov_p, | 3 | Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> |
4 | we can simplify some special cases in trans_AND_pppp | 4 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> |
5 | and trans_BIC_pppp. | 5 | Message-id: 20230109140306.23161-8-philmd@linaro.org |
6 | |||
7 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
8 | Message-id: 20220527181907.189259-80-richard.henderson@linaro.org | ||
9 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
11 | --- | 7 | --- |
12 | target/arm/translate-sve.c | 30 ++++++++++++------------------ | 8 | hw/arm/stellaris.c | 6 +++--- |
13 | 1 file changed, 12 insertions(+), 18 deletions(-) | 9 | 1 file changed, 3 insertions(+), 3 deletions(-) |
14 | 10 | ||
15 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | 11 | diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c |
16 | index XXXXXXX..XXXXXXX 100644 | 12 | index XXXXXXX..XXXXXXX 100644 |
17 | --- a/target/arm/translate-sve.c | 13 | --- a/hw/arm/stellaris.c |
18 | +++ b/target/arm/translate-sve.c | 14 | +++ b/hw/arm/stellaris.c |
19 | @@ -XXX,XX +XXX,XX @@ static void do_dupi_z(DisasContext *s, int rd, uint64_t word) | 15 | @@ -XXX,XX +XXX,XX @@ static void stellaris_adc_update(stellaris_adc_state *s) |
20 | } | 16 | |
21 | 17 | static void stellaris_adc_trigger(void *opaque, int irq, int level) | |
22 | /* Invoke a vector expander on three Pregs. */ | ||
23 | -static void gen_gvec_fn_ppp(DisasContext *s, GVecGen3Fn *gvec_fn, | ||
24 | +static bool gen_gvec_fn_ppp(DisasContext *s, GVecGen3Fn *gvec_fn, | ||
25 | int rd, int rn, int rm) | ||
26 | { | 18 | { |
27 | - unsigned psz = pred_gvec_reg_size(s); | 19 | - stellaris_adc_state *s = (stellaris_adc_state *)opaque; |
28 | - gvec_fn(MO_64, pred_full_reg_offset(s, rd), | 20 | + stellaris_adc_state *s = opaque; |
29 | - pred_full_reg_offset(s, rn), | 21 | int n; |
30 | - pred_full_reg_offset(s, rm), psz, psz); | 22 | |
31 | + if (sve_access_check(s)) { | 23 | for (n = 0; n < 4; n++) { |
32 | + unsigned psz = pred_gvec_reg_size(s); | 24 | @@ -XXX,XX +XXX,XX @@ static void stellaris_adc_reset(stellaris_adc_state *s) |
33 | + gvec_fn(MO_64, pred_full_reg_offset(s, rd), | 25 | static uint64_t stellaris_adc_read(void *opaque, hwaddr offset, |
34 | + pred_full_reg_offset(s, rn), | 26 | unsigned size) |
35 | + pred_full_reg_offset(s, rm), psz, psz); | 27 | { |
36 | + } | 28 | - stellaris_adc_state *s = (stellaris_adc_state *)opaque; |
37 | + return true; | 29 | + stellaris_adc_state *s = opaque; |
38 | } | 30 | |
39 | 31 | /* TODO: Implement this. */ | |
40 | /* Invoke a vector move on two Pregs. */ | 32 | if (offset >= 0x40 && offset < 0xc0) { |
41 | @@ -XXX,XX +XXX,XX @@ static bool trans_AND_pppp(DisasContext *s, arg_rprr_s *a) | 33 | @@ -XXX,XX +XXX,XX @@ static uint64_t stellaris_adc_read(void *opaque, hwaddr offset, |
42 | }; | 34 | static void stellaris_adc_write(void *opaque, hwaddr offset, |
43 | 35 | uint64_t value, unsigned size) | |
44 | if (!a->s) { | 36 | { |
45 | - if (!sve_access_check(s)) { | 37 | - stellaris_adc_state *s = (stellaris_adc_state *)opaque; |
46 | - return true; | 38 | + stellaris_adc_state *s = opaque; |
47 | - } | 39 | |
48 | if (a->rn == a->rm) { | 40 | /* TODO: Implement this. */ |
49 | if (a->pg == a->rn) { | 41 | if (offset >= 0x40 && offset < 0xc0) { |
50 | - do_mov_p(s, a->rd, a->rn); | ||
51 | - } else { | ||
52 | - gen_gvec_fn_ppp(s, tcg_gen_gvec_and, a->rd, a->rn, a->pg); | ||
53 | + return do_mov_p(s, a->rd, a->rn); | ||
54 | } | ||
55 | - return true; | ||
56 | + return gen_gvec_fn_ppp(s, tcg_gen_gvec_and, a->rd, a->rn, a->pg); | ||
57 | } else if (a->pg == a->rn || a->pg == a->rm) { | ||
58 | - gen_gvec_fn_ppp(s, tcg_gen_gvec_and, a->rd, a->rn, a->rm); | ||
59 | - return true; | ||
60 | + return gen_gvec_fn_ppp(s, tcg_gen_gvec_and, a->rd, a->rn, a->rm); | ||
61 | } | ||
62 | } | ||
63 | return do_pppp_flags(s, a, &op); | ||
64 | @@ -XXX,XX +XXX,XX @@ static bool trans_BIC_pppp(DisasContext *s, arg_rprr_s *a) | ||
65 | }; | ||
66 | |||
67 | if (!a->s && a->pg == a->rn) { | ||
68 | - if (sve_access_check(s)) { | ||
69 | - gen_gvec_fn_ppp(s, tcg_gen_gvec_andc, a->rd, a->rn, a->rm); | ||
70 | - } | ||
71 | - return true; | ||
72 | + return gen_gvec_fn_ppp(s, tcg_gen_gvec_andc, a->rd, a->rn, a->rm); | ||
73 | } | ||
74 | return do_pppp_flags(s, a, &op); | ||
75 | } | ||
76 | -- | 42 | -- |
77 | 2.25.1 | 43 | 2.34.1 |
44 | |||
45 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Philippe Mathieu-Daudé <philmd@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | Use gen_gvec_ool_arg_zzz instead of gen_gvec_ool_zzz | 3 | Following docs/devel/style.rst guidelines, rename |
4 | when the arguments come from arg_rrr_esz. | 4 | stellaris_adc_state -> StellarisADCState. This also remove a |
5 | Replaces do_zzw_ool and do_zzz_data_ool. | 5 | use of 'struct' in the DECLARE_INSTANCE_CHECKER() macro call. |
6 | 6 | ||
7 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 7 | Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> |
8 | Message-id: 20220527181907.189259-6-richard.henderson@linaro.org | 8 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> |
9 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 9 | Message-id: 20230109140306.23161-9-philmd@linaro.org |
10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
11 | --- | 11 | --- |
12 | target/arm/translate-sve.c | 48 +++++++++++++++++--------------------- | 12 | hw/arm/stellaris.c | 73 +++++++++++++++++++++++----------------------- |
13 | 1 file changed, 21 insertions(+), 27 deletions(-) | 13 | 1 file changed, 36 insertions(+), 37 deletions(-) |
14 | 14 | ||
15 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | 15 | diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c |
16 | index XXXXXXX..XXXXXXX 100644 | 16 | index XXXXXXX..XXXXXXX 100644 |
17 | --- a/target/arm/translate-sve.c | 17 | --- a/hw/arm/stellaris.c |
18 | +++ b/target/arm/translate-sve.c | 18 | +++ b/hw/arm/stellaris.c |
19 | @@ -XXX,XX +XXX,XX @@ static bool gen_gvec_ool_zzz(DisasContext *s, gen_helper_gvec_3 *fn, | 19 | @@ -XXX,XX +XXX,XX @@ static void stellaris_i2c_init(Object *obj) |
20 | return true; | 20 | #define STELLARIS_ADC_FIFO_FULL 0x1000 |
21 | |||
22 | #define TYPE_STELLARIS_ADC "stellaris-adc" | ||
23 | -typedef struct StellarisADCState stellaris_adc_state; | ||
24 | -DECLARE_INSTANCE_CHECKER(stellaris_adc_state, STELLARIS_ADC, | ||
25 | - TYPE_STELLARIS_ADC) | ||
26 | +typedef struct StellarisADCState StellarisADCState; | ||
27 | +DECLARE_INSTANCE_CHECKER(StellarisADCState, STELLARIS_ADC, TYPE_STELLARIS_ADC) | ||
28 | |||
29 | struct StellarisADCState { | ||
30 | SysBusDevice parent_obj; | ||
31 | @@ -XXX,XX +XXX,XX @@ struct StellarisADCState { | ||
32 | qemu_irq irq[4]; | ||
33 | }; | ||
34 | |||
35 | -static uint32_t stellaris_adc_fifo_read(stellaris_adc_state *s, int n) | ||
36 | +static uint32_t stellaris_adc_fifo_read(StellarisADCState *s, int n) | ||
37 | { | ||
38 | int tail; | ||
39 | |||
40 | @@ -XXX,XX +XXX,XX @@ static uint32_t stellaris_adc_fifo_read(stellaris_adc_state *s, int n) | ||
41 | return s->fifo[n].data[tail]; | ||
21 | } | 42 | } |
22 | 43 | ||
23 | +static bool gen_gvec_ool_arg_zzz(DisasContext *s, gen_helper_gvec_3 *fn, | 44 | -static void stellaris_adc_fifo_write(stellaris_adc_state *s, int n, |
24 | + arg_rrr_esz *a, int data) | 45 | +static void stellaris_adc_fifo_write(StellarisADCState *s, int n, |
25 | +{ | 46 | uint32_t value) |
26 | + return gen_gvec_ool_zzz(s, fn, a->rd, a->rn, a->rm, data); | 47 | { |
27 | +} | 48 | int head; |
28 | + | 49 | @@ -XXX,XX +XXX,XX @@ static void stellaris_adc_fifo_write(stellaris_adc_state *s, int n, |
29 | /* Invoke an out-of-line helper on 4 Zregs. */ | 50 | s->fifo[n].state |= STELLARIS_ADC_FIFO_FULL; |
30 | static void gen_gvec_ool_zzzz(DisasContext *s, gen_helper_gvec_4 *fn, | ||
31 | int rd, int rn, int rm, int ra, int data) | ||
32 | @@ -XXX,XX +XXX,XX @@ static bool trans_LSL_zzi(DisasContext *s, arg_rri_esz *a) | ||
33 | return do_shift_imm(s, a, false, tcg_gen_gvec_shli); | ||
34 | } | 51 | } |
35 | 52 | ||
36 | -static bool do_zzw_ool(DisasContext *s, arg_rrr_esz *a, gen_helper_gvec_3 *fn) | 53 | -static void stellaris_adc_update(stellaris_adc_state *s) |
37 | -{ | 54 | +static void stellaris_adc_update(StellarisADCState *s) |
38 | - return gen_gvec_ool_zzz(s, fn, a->rd, a->rn, a->rm, 0); | 55 | { |
39 | -} | 56 | int level; |
40 | - | 57 | int n; |
41 | #define DO_ZZW(NAME, name) \ | 58 | @@ -XXX,XX +XXX,XX @@ static void stellaris_adc_update(stellaris_adc_state *s) |
42 | static bool trans_##NAME##_zzw(DisasContext *s, arg_rrr_esz *a) \ | 59 | |
43 | { \ | 60 | static void stellaris_adc_trigger(void *opaque, int irq, int level) |
44 | @@ -XXX,XX +XXX,XX @@ static bool trans_##NAME##_zzw(DisasContext *s, arg_rrr_esz *a) \ | 61 | { |
45 | gen_helper_sve_##name##_zzw_b, gen_helper_sve_##name##_zzw_h, \ | 62 | - stellaris_adc_state *s = opaque; |
46 | gen_helper_sve_##name##_zzw_s, NULL \ | 63 | + StellarisADCState *s = opaque; |
47 | }; \ | 64 | int n; |
48 | - return do_zzw_ool(s, a, fns[a->esz]); \ | 65 | |
49 | + return gen_gvec_ool_arg_zzz(s, fns[a->esz], a, 0); \ | 66 | for (n = 0; n < 4; n++) { |
67 | @@ -XXX,XX +XXX,XX @@ static void stellaris_adc_trigger(void *opaque, int irq, int level) | ||
68 | } | ||
50 | } | 69 | } |
51 | 70 | ||
52 | DO_ZZW(ASR, asr) | 71 | -static void stellaris_adc_reset(stellaris_adc_state *s) |
53 | @@ -XXX,XX +XXX,XX @@ static bool trans_FTSSEL(DisasContext *s, arg_rrr_esz *a) | 72 | +static void stellaris_adc_reset(StellarisADCState *s) |
54 | gen_helper_sve_ftssel_s, | 73 | { |
55 | gen_helper_sve_ftssel_d, | 74 | int n; |
56 | }; | 75 | |
57 | - return gen_gvec_ool_zzz(s, fns[a->esz], a->rd, a->rn, a->rm, 0); | 76 | @@ -XXX,XX +XXX,XX @@ static void stellaris_adc_reset(stellaris_adc_state *s) |
58 | + return gen_gvec_ool_arg_zzz(s, fns[a->esz], a, 0); | 77 | static uint64_t stellaris_adc_read(void *opaque, hwaddr offset, |
59 | } | 78 | unsigned size) |
60 | 79 | { | |
61 | /* | 80 | - stellaris_adc_state *s = opaque; |
62 | @@ -XXX,XX +XXX,XX @@ static bool trans_TBL(DisasContext *s, arg_rrr_esz *a) | 81 | + StellarisADCState *s = opaque; |
63 | gen_helper_sve_tbl_b, gen_helper_sve_tbl_h, | 82 | |
64 | gen_helper_sve_tbl_s, gen_helper_sve_tbl_d | 83 | /* TODO: Implement this. */ |
65 | }; | 84 | if (offset >= 0x40 && offset < 0xc0) { |
66 | - return gen_gvec_ool_zzz(s, fns[a->esz], a->rd, a->rn, a->rm, 0); | 85 | @@ -XXX,XX +XXX,XX @@ static uint64_t stellaris_adc_read(void *opaque, hwaddr offset, |
67 | + return gen_gvec_ool_arg_zzz(s, fns[a->esz], a, 0); | 86 | static void stellaris_adc_write(void *opaque, hwaddr offset, |
68 | } | 87 | uint64_t value, unsigned size) |
69 | 88 | { | |
70 | static bool trans_TBL_sve2(DisasContext *s, arg_rrr_esz *a) | 89 | - stellaris_adc_state *s = opaque; |
71 | @@ -XXX,XX +XXX,XX @@ static bool trans_TBX(DisasContext *s, arg_rrr_esz *a) | 90 | + StellarisADCState *s = opaque; |
72 | if (!dc_isar_feature(aa64_sve2, s)) { | 91 | |
73 | return false; | 92 | /* TODO: Implement this. */ |
93 | if (offset >= 0x40 && offset < 0xc0) { | ||
94 | @@ -XXX,XX +XXX,XX @@ static const VMStateDescription vmstate_stellaris_adc = { | ||
95 | .version_id = 1, | ||
96 | .minimum_version_id = 1, | ||
97 | .fields = (VMStateField[]) { | ||
98 | - VMSTATE_UINT32(actss, stellaris_adc_state), | ||
99 | - VMSTATE_UINT32(ris, stellaris_adc_state), | ||
100 | - VMSTATE_UINT32(im, stellaris_adc_state), | ||
101 | - VMSTATE_UINT32(emux, stellaris_adc_state), | ||
102 | - VMSTATE_UINT32(ostat, stellaris_adc_state), | ||
103 | - VMSTATE_UINT32(ustat, stellaris_adc_state), | ||
104 | - VMSTATE_UINT32(sspri, stellaris_adc_state), | ||
105 | - VMSTATE_UINT32(sac, stellaris_adc_state), | ||
106 | - VMSTATE_UINT32(fifo[0].state, stellaris_adc_state), | ||
107 | - VMSTATE_UINT32_ARRAY(fifo[0].data, stellaris_adc_state, 16), | ||
108 | - VMSTATE_UINT32(ssmux[0], stellaris_adc_state), | ||
109 | - VMSTATE_UINT32(ssctl[0], stellaris_adc_state), | ||
110 | - VMSTATE_UINT32(fifo[1].state, stellaris_adc_state), | ||
111 | - VMSTATE_UINT32_ARRAY(fifo[1].data, stellaris_adc_state, 16), | ||
112 | - VMSTATE_UINT32(ssmux[1], stellaris_adc_state), | ||
113 | - VMSTATE_UINT32(ssctl[1], stellaris_adc_state), | ||
114 | - VMSTATE_UINT32(fifo[2].state, stellaris_adc_state), | ||
115 | - VMSTATE_UINT32_ARRAY(fifo[2].data, stellaris_adc_state, 16), | ||
116 | - VMSTATE_UINT32(ssmux[2], stellaris_adc_state), | ||
117 | - VMSTATE_UINT32(ssctl[2], stellaris_adc_state), | ||
118 | - VMSTATE_UINT32(fifo[3].state, stellaris_adc_state), | ||
119 | - VMSTATE_UINT32_ARRAY(fifo[3].data, stellaris_adc_state, 16), | ||
120 | - VMSTATE_UINT32(ssmux[3], stellaris_adc_state), | ||
121 | - VMSTATE_UINT32(ssctl[3], stellaris_adc_state), | ||
122 | - VMSTATE_UINT32(noise, stellaris_adc_state), | ||
123 | + VMSTATE_UINT32(actss, StellarisADCState), | ||
124 | + VMSTATE_UINT32(ris, StellarisADCState), | ||
125 | + VMSTATE_UINT32(im, StellarisADCState), | ||
126 | + VMSTATE_UINT32(emux, StellarisADCState), | ||
127 | + VMSTATE_UINT32(ostat, StellarisADCState), | ||
128 | + VMSTATE_UINT32(ustat, StellarisADCState), | ||
129 | + VMSTATE_UINT32(sspri, StellarisADCState), | ||
130 | + VMSTATE_UINT32(sac, StellarisADCState), | ||
131 | + VMSTATE_UINT32(fifo[0].state, StellarisADCState), | ||
132 | + VMSTATE_UINT32_ARRAY(fifo[0].data, StellarisADCState, 16), | ||
133 | + VMSTATE_UINT32(ssmux[0], StellarisADCState), | ||
134 | + VMSTATE_UINT32(ssctl[0], StellarisADCState), | ||
135 | + VMSTATE_UINT32(fifo[1].state, StellarisADCState), | ||
136 | + VMSTATE_UINT32_ARRAY(fifo[1].data, StellarisADCState, 16), | ||
137 | + VMSTATE_UINT32(ssmux[1], StellarisADCState), | ||
138 | + VMSTATE_UINT32(ssctl[1], StellarisADCState), | ||
139 | + VMSTATE_UINT32(fifo[2].state, StellarisADCState), | ||
140 | + VMSTATE_UINT32_ARRAY(fifo[2].data, StellarisADCState, 16), | ||
141 | + VMSTATE_UINT32(ssmux[2], StellarisADCState), | ||
142 | + VMSTATE_UINT32(ssctl[2], StellarisADCState), | ||
143 | + VMSTATE_UINT32(fifo[3].state, StellarisADCState), | ||
144 | + VMSTATE_UINT32_ARRAY(fifo[3].data, StellarisADCState, 16), | ||
145 | + VMSTATE_UINT32(ssmux[3], StellarisADCState), | ||
146 | + VMSTATE_UINT32(ssctl[3], StellarisADCState), | ||
147 | + VMSTATE_UINT32(noise, StellarisADCState), | ||
148 | VMSTATE_END_OF_LIST() | ||
74 | } | 149 | } |
75 | - return gen_gvec_ool_zzz(s, fns[a->esz], a->rd, a->rn, a->rm, 0); | 150 | }; |
76 | + return gen_gvec_ool_arg_zzz(s, fns[a->esz], a, 0); | 151 | @@ -XXX,XX +XXX,XX @@ static const VMStateDescription vmstate_stellaris_adc = { |
77 | } | 152 | static void stellaris_adc_init(Object *obj) |
78 | |||
79 | static bool trans_UNPK(DisasContext *s, arg_UNPK *a) | ||
80 | @@ -XXX,XX +XXX,XX @@ static bool do_zip(DisasContext *s, arg_rrr_esz *a, bool high) | ||
81 | return true; | ||
82 | } | ||
83 | |||
84 | -static bool do_zzz_data_ool(DisasContext *s, arg_rrr_esz *a, int data, | ||
85 | - gen_helper_gvec_3 *fn) | ||
86 | -{ | ||
87 | - return gen_gvec_ool_zzz(s, fn, a->rd, a->rn, a->rm, data); | ||
88 | -} | ||
89 | - | ||
90 | static bool trans_ZIP1_z(DisasContext *s, arg_rrr_esz *a) | ||
91 | { | 153 | { |
92 | return do_zip(s, a, false); | 154 | DeviceState *dev = DEVICE(obj); |
93 | @@ -XXX,XX +XXX,XX @@ static gen_helper_gvec_3 * const uzp_fns[4] = { | 155 | - stellaris_adc_state *s = STELLARIS_ADC(obj); |
94 | 156 | + StellarisADCState *s = STELLARIS_ADC(obj); | |
95 | static bool trans_UZP1_z(DisasContext *s, arg_rrr_esz *a) | 157 | SysBusDevice *sbd = SYS_BUS_DEVICE(obj); |
96 | { | 158 | int n; |
97 | - return do_zzz_data_ool(s, a, 0, uzp_fns[a->esz]); | 159 | |
98 | + return gen_gvec_ool_arg_zzz(s, uzp_fns[a->esz], a, 0); | 160 | @@ -XXX,XX +XXX,XX @@ static void stellaris_adc_class_init(ObjectClass *klass, void *data) |
99 | } | 161 | static const TypeInfo stellaris_adc_info = { |
100 | 162 | .name = TYPE_STELLARIS_ADC, | |
101 | static bool trans_UZP2_z(DisasContext *s, arg_rrr_esz *a) | 163 | .parent = TYPE_SYS_BUS_DEVICE, |
102 | { | 164 | - .instance_size = sizeof(stellaris_adc_state), |
103 | - return do_zzz_data_ool(s, a, 1 << a->esz, uzp_fns[a->esz]); | 165 | + .instance_size = sizeof(StellarisADCState), |
104 | + return gen_gvec_ool_arg_zzz(s, uzp_fns[a->esz], a, 1 << a->esz); | 166 | .instance_init = stellaris_adc_init, |
105 | } | 167 | .class_init = stellaris_adc_class_init, |
106 | 168 | }; | |
107 | static bool trans_UZP1_q(DisasContext *s, arg_rrr_esz *a) | ||
108 | @@ -XXX,XX +XXX,XX @@ static bool trans_UZP1_q(DisasContext *s, arg_rrr_esz *a) | ||
109 | if (!dc_isar_feature(aa64_sve_f64mm, s)) { | ||
110 | return false; | ||
111 | } | ||
112 | - return do_zzz_data_ool(s, a, 0, gen_helper_sve2_uzp_q); | ||
113 | + return gen_gvec_ool_arg_zzz(s, gen_helper_sve2_uzp_q, a, 0); | ||
114 | } | ||
115 | |||
116 | static bool trans_UZP2_q(DisasContext *s, arg_rrr_esz *a) | ||
117 | @@ -XXX,XX +XXX,XX @@ static bool trans_UZP2_q(DisasContext *s, arg_rrr_esz *a) | ||
118 | if (!dc_isar_feature(aa64_sve_f64mm, s)) { | ||
119 | return false; | ||
120 | } | ||
121 | - return do_zzz_data_ool(s, a, 16, gen_helper_sve2_uzp_q); | ||
122 | + return gen_gvec_ool_arg_zzz(s, gen_helper_sve2_uzp_q, a, 16); | ||
123 | } | ||
124 | |||
125 | static gen_helper_gvec_3 * const trn_fns[4] = { | ||
126 | @@ -XXX,XX +XXX,XX @@ static gen_helper_gvec_3 * const trn_fns[4] = { | ||
127 | |||
128 | static bool trans_TRN1_z(DisasContext *s, arg_rrr_esz *a) | ||
129 | { | ||
130 | - return do_zzz_data_ool(s, a, 0, trn_fns[a->esz]); | ||
131 | + return gen_gvec_ool_arg_zzz(s, trn_fns[a->esz], a, 0); | ||
132 | } | ||
133 | |||
134 | static bool trans_TRN2_z(DisasContext *s, arg_rrr_esz *a) | ||
135 | { | ||
136 | - return do_zzz_data_ool(s, a, 1 << a->esz, trn_fns[a->esz]); | ||
137 | + return gen_gvec_ool_arg_zzz(s, trn_fns[a->esz], a, 1 << a->esz); | ||
138 | } | ||
139 | |||
140 | static bool trans_TRN1_q(DisasContext *s, arg_rrr_esz *a) | ||
141 | @@ -XXX,XX +XXX,XX @@ static bool trans_TRN1_q(DisasContext *s, arg_rrr_esz *a) | ||
142 | if (!dc_isar_feature(aa64_sve_f64mm, s)) { | ||
143 | return false; | ||
144 | } | ||
145 | - return do_zzz_data_ool(s, a, 0, gen_helper_sve2_trn_q); | ||
146 | + return gen_gvec_ool_arg_zzz(s, gen_helper_sve2_trn_q, a, 0); | ||
147 | } | ||
148 | |||
149 | static bool trans_TRN2_q(DisasContext *s, arg_rrr_esz *a) | ||
150 | @@ -XXX,XX +XXX,XX @@ static bool trans_TRN2_q(DisasContext *s, arg_rrr_esz *a) | ||
151 | if (!dc_isar_feature(aa64_sve_f64mm, s)) { | ||
152 | return false; | ||
153 | } | ||
154 | - return do_zzz_data_ool(s, a, 16, gen_helper_sve2_trn_q); | ||
155 | + return gen_gvec_ool_arg_zzz(s, gen_helper_sve2_trn_q, a, 16); | ||
156 | } | ||
157 | |||
158 | /* | ||
159 | @@ -XXX,XX +XXX,XX @@ static bool do_sve2_zzz_ool(DisasContext *s, arg_rrr_esz *a, | ||
160 | if (!dc_isar_feature(aa64_sve2, s)) { | ||
161 | return false; | ||
162 | } | ||
163 | - return gen_gvec_ool_zzz(s, fn, a->rd, a->rn, a->rm, 0); | ||
164 | + return gen_gvec_ool_arg_zzz(s, fn, a, 0); | ||
165 | } | ||
166 | |||
167 | static bool trans_SMULH_zzz(DisasContext *s, arg_rrr_esz *a) | ||
168 | @@ -XXX,XX +XXX,XX @@ static bool do_aese(DisasContext *s, arg_rrr_esz *a, bool decrypt) | ||
169 | if (!dc_isar_feature(aa64_sve2_aes, s)) { | ||
170 | return false; | ||
171 | } | ||
172 | - return gen_gvec_ool_zzz(s, gen_helper_crypto_aese, | ||
173 | - a->rd, a->rn, a->rm, decrypt); | ||
174 | + return gen_gvec_ool_arg_zzz(s, gen_helper_crypto_aese, a, decrypt); | ||
175 | } | ||
176 | |||
177 | static bool trans_AESE(DisasContext *s, arg_rrr_esz *a) | ||
178 | @@ -XXX,XX +XXX,XX @@ static bool do_sm4(DisasContext *s, arg_rrr_esz *a, gen_helper_gvec_3 *fn) | ||
179 | if (!dc_isar_feature(aa64_sve2_sm4, s)) { | ||
180 | return false; | ||
181 | } | ||
182 | - return gen_gvec_ool_zzz(s, fn, a->rd, a->rn, a->rm, 0); | ||
183 | + return gen_gvec_ool_arg_zzz(s, fn, a, 0); | ||
184 | } | ||
185 | |||
186 | static bool trans_SM4E(DisasContext *s, arg_rrr_esz *a) | ||
187 | -- | 169 | -- |
188 | 2.25.1 | 170 | 2.34.1 |
171 | |||
172 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Philippe Mathieu-Daudé <philmd@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | Being able to specify the feature predicate in TRANS_FEAT | 3 | The typedef and definitions are generated by the OBJECT_DECLARE_TYPE |
4 | makes it easier to split trans_FMMLA by element size, | 4 | macro in "hw/arm/bcm2836.h": |
5 | which also happens to simplify the decode. | ||
6 | 5 | ||
7 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 6 | 20 #define TYPE_BCM283X "bcm283x" |
8 | Message-id: 20220527181907.189259-79-richard.henderson@linaro.org | 7 | 21 OBJECT_DECLARE_TYPE(BCM283XState, BCM283XClass, BCM283X) |
9 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 8 | |
9 | The script ran in commit a489d1951c ("Use OBJECT_DECLARE_TYPE when | ||
10 | possible") missed them because they are declared in a different | ||
11 | file unit. Remove them. | ||
12 | |||
13 | Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> | ||
14 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
15 | Message-id: 20230109140306.23161-10-philmd@linaro.org | ||
10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 16 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
11 | --- | 17 | --- |
12 | target/arm/sve.decode | 7 +++---- | 18 | hw/arm/bcm2836.c | 9 ++------- |
13 | target/arm/translate-sve.c | 27 ++++----------------------- | 19 | 1 file changed, 2 insertions(+), 7 deletions(-) |
14 | 2 files changed, 7 insertions(+), 27 deletions(-) | ||
15 | 20 | ||
16 | diff --git a/target/arm/sve.decode b/target/arm/sve.decode | 21 | diff --git a/hw/arm/bcm2836.c b/hw/arm/bcm2836.c |
17 | index XXXXXXX..XXXXXXX 100644 | 22 | index XXXXXXX..XXXXXXX 100644 |
18 | --- a/target/arm/sve.decode | 23 | --- a/hw/arm/bcm2836.c |
19 | +++ b/target/arm/sve.decode | 24 | +++ b/hw/arm/bcm2836.c |
20 | @@ -XXX,XX +XXX,XX @@ SQRDCMLAH_zzzz 01000100 esz:2 0 rm:5 0011 rot:2 rn:5 rd:5 ra=%reg_movprfx | 25 | @@ -XXX,XX +XXX,XX @@ |
21 | USDOT_zzzz 01000100 .. 0 ..... 011 110 ..... ..... @rda_rn_rm | 26 | #include "hw/arm/raspi_platform.h" |
22 | 27 | #include "hw/sysbus.h" | |
23 | ### SVE2 floating point matrix multiply accumulate | 28 | |
24 | -{ | 29 | -typedef struct BCM283XClass { |
25 | - BFMMLA 01100100 01 1 ..... 111 001 ..... ..... @rda_rn_rm_e0 | 30 | +struct BCM283XClass { |
26 | - FMMLA 01100100 .. 1 ..... 111 001 ..... ..... @rda_rn_rm | 31 | /*< private >*/ |
27 | -} | 32 | DeviceClass parent_class; |
28 | +BFMMLA 01100100 01 1 ..... 111 001 ..... ..... @rda_rn_rm_e0 | 33 | /*< public >*/ |
29 | +FMMLA_s 01100100 10 1 ..... 111 001 ..... ..... @rda_rn_rm_e0 | 34 | @@ -XXX,XX +XXX,XX @@ typedef struct BCM283XClass { |
30 | +FMMLA_d 01100100 11 1 ..... 111 001 ..... ..... @rda_rn_rm_e0 | 35 | hwaddr peri_base; /* Peripheral base address seen by the CPU */ |
31 | 36 | hwaddr ctrl_base; /* Interrupt controller and mailboxes etc. */ | |
32 | ### SVE2 Memory Gather Load Group | 37 | int clusterid; |
33 | 38 | -} BCM283XClass; | |
34 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
35 | index XXXXXXX..XXXXXXX 100644 | ||
36 | --- a/target/arm/translate-sve.c | ||
37 | +++ b/target/arm/translate-sve.c | ||
38 | @@ -XXX,XX +XXX,XX @@ DO_SVE2_ZPZZ_FP(FMINP, fminp) | ||
39 | * SVE Integer Multiply-Add (unpredicated) | ||
40 | */ | ||
41 | |||
42 | -static bool trans_FMMLA(DisasContext *s, arg_rrrr_esz *a) | ||
43 | -{ | ||
44 | - gen_helper_gvec_4_ptr *fn; | ||
45 | - | 39 | - |
46 | - switch (a->esz) { | 40 | -#define BCM283X_CLASS(klass) \ |
47 | - case MO_32: | 41 | - OBJECT_CLASS_CHECK(BCM283XClass, (klass), TYPE_BCM283X) |
48 | - if (!dc_isar_feature(aa64_sve_f32mm, s)) { | 42 | -#define BCM283X_GET_CLASS(obj) \ |
49 | - return false; | 43 | - OBJECT_GET_CLASS(BCM283XClass, (obj), TYPE_BCM283X) |
50 | - } | 44 | +}; |
51 | - fn = gen_helper_fmmla_s; | 45 | |
52 | - break; | 46 | static Property bcm2836_enabled_cores_property = |
53 | - case MO_64: | 47 | DEFINE_PROP_UINT32("enabled-cpus", BCM283XState, enabled_cpus, 0); |
54 | - if (!dc_isar_feature(aa64_sve_f64mm, s)) { | ||
55 | - return false; | ||
56 | - } | ||
57 | - fn = gen_helper_fmmla_d; | ||
58 | - break; | ||
59 | - default: | ||
60 | - return false; | ||
61 | - } | ||
62 | - | ||
63 | - return gen_gvec_fpst_zzzz(s, fn, a->rd, a->rn, a->rm, a->ra, 0, FPST_FPCR); | ||
64 | -} | ||
65 | +TRANS_FEAT(FMMLA_s, aa64_sve_f32mm, gen_gvec_fpst_zzzz, gen_helper_fmmla_s, | ||
66 | + a->rd, a->rn, a->rm, a->ra, 0, FPST_FPCR) | ||
67 | +TRANS_FEAT(FMMLA_d, aa64_sve_f64mm, gen_gvec_fpst_zzzz, gen_helper_fmmla_d, | ||
68 | + a->rd, a->rn, a->rm, a->ra, 0, FPST_FPCR) | ||
69 | |||
70 | static gen_helper_gvec_4 * const sqdmlal_zzzw_fns[] = { | ||
71 | NULL, gen_helper_sve2_sqdmlal_zzzw_h, | ||
72 | -- | 48 | -- |
73 | 2.25.1 | 49 | 2.34.1 |
50 | |||
51 | diff view generated by jsdifflib |
1 | From: Icenowy Zheng <uwu@icenowy.me> | 1 | From: Philippe Mathieu-Daudé <philmd@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | U-Boot queries the FIFO water level to reduce checking status register | 3 | NPCM7XX models have been commited after the conversion from |
4 | when doing PIO SD card operation. | 4 | commit 8063396bf3 ("Use OBJECT_DECLARE_SIMPLE_TYPE when possible"). |
5 | 5 | Manually convert them. | |
6 | Report a FIFO water level of 1 when data is ready, to prevent the code | 6 | |
7 | from trying to read 0 words from the FIFO each time. | 7 | Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> |
8 | 8 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | |
9 | Signed-off-by: Icenowy Zheng <uwu@icenowy.me> | 9 | Message-id: 20230109140306.23161-11-philmd@linaro.org |
10 | Message-id: 20220520124200.2112699-1-uwu@icenowy.me | ||
11 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
12 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
13 | --- | 11 | --- |
14 | hw/sd/allwinner-sdhost.c | 7 +++++++ | 12 | include/hw/adc/npcm7xx_adc.h | 7 +++---- |
15 | 1 file changed, 7 insertions(+) | 13 | include/hw/arm/npcm7xx.h | 18 ++++++------------ |
16 | 14 | include/hw/i2c/npcm7xx_smbus.h | 7 +++---- | |
17 | diff --git a/hw/sd/allwinner-sdhost.c b/hw/sd/allwinner-sdhost.c | 15 | include/hw/misc/npcm7xx_clk.h | 2 +- |
18 | index XXXXXXX..XXXXXXX 100644 | 16 | include/hw/misc/npcm7xx_gcr.h | 6 +++--- |
19 | --- a/hw/sd/allwinner-sdhost.c | 17 | include/hw/misc/npcm7xx_mft.h | 7 +++---- |
20 | +++ b/hw/sd/allwinner-sdhost.c | 18 | include/hw/misc/npcm7xx_pwm.h | 3 +-- |
21 | @@ -XXX,XX +XXX,XX @@ enum { | 19 | include/hw/misc/npcm7xx_rng.h | 6 +++--- |
20 | include/hw/net/npcm7xx_emc.h | 5 +---- | ||
21 | include/hw/sd/npcm7xx_sdhci.h | 4 ++-- | ||
22 | 10 files changed, 26 insertions(+), 39 deletions(-) | ||
23 | |||
24 | diff --git a/include/hw/adc/npcm7xx_adc.h b/include/hw/adc/npcm7xx_adc.h | ||
25 | index XXXXXXX..XXXXXXX 100644 | ||
26 | --- a/include/hw/adc/npcm7xx_adc.h | ||
27 | +++ b/include/hw/adc/npcm7xx_adc.h | ||
28 | @@ -XXX,XX +XXX,XX @@ | ||
29 | * @iref: The internal reference voltage, initialized at launch time. | ||
30 | * @rv: The calibrated output values of 0.5V and 1.5V for the ADC. | ||
31 | */ | ||
32 | -typedef struct { | ||
33 | +struct NPCM7xxADCState { | ||
34 | SysBusDevice parent; | ||
35 | |||
36 | MemoryRegion iomem; | ||
37 | @@ -XXX,XX +XXX,XX @@ typedef struct { | ||
38 | uint32_t iref; | ||
39 | |||
40 | uint16_t calibration_r_values[NPCM7XX_ADC_NUM_CALIB]; | ||
41 | -} NPCM7xxADCState; | ||
42 | +}; | ||
43 | |||
44 | #define TYPE_NPCM7XX_ADC "npcm7xx-adc" | ||
45 | -#define NPCM7XX_ADC(obj) \ | ||
46 | - OBJECT_CHECK(NPCM7xxADCState, (obj), TYPE_NPCM7XX_ADC) | ||
47 | +OBJECT_DECLARE_SIMPLE_TYPE(NPCM7xxADCState, NPCM7XX_ADC) | ||
48 | |||
49 | #endif /* NPCM7XX_ADC_H */ | ||
50 | diff --git a/include/hw/arm/npcm7xx.h b/include/hw/arm/npcm7xx.h | ||
51 | index XXXXXXX..XXXXXXX 100644 | ||
52 | --- a/include/hw/arm/npcm7xx.h | ||
53 | +++ b/include/hw/arm/npcm7xx.h | ||
54 | @@ -XXX,XX +XXX,XX @@ | ||
55 | |||
56 | #define NPCM7XX_NR_PWM_MODULES 2 | ||
57 | |||
58 | -typedef struct NPCM7xxMachine { | ||
59 | +struct NPCM7xxMachine { | ||
60 | MachineState parent; | ||
61 | /* | ||
62 | * PWM fan splitter. each splitter connects to one PWM output and | ||
63 | @@ -XXX,XX +XXX,XX @@ typedef struct NPCM7xxMachine { | ||
64 | */ | ||
65 | SplitIRQ fan_splitter[NPCM7XX_NR_PWM_MODULES * | ||
66 | NPCM7XX_PWM_PER_MODULE]; | ||
67 | -} NPCM7xxMachine; | ||
68 | +}; | ||
69 | |||
70 | #define TYPE_NPCM7XX_MACHINE MACHINE_TYPE_NAME("npcm7xx") | ||
71 | -#define NPCM7XX_MACHINE(obj) \ | ||
72 | - OBJECT_CHECK(NPCM7xxMachine, (obj), TYPE_NPCM7XX_MACHINE) | ||
73 | +OBJECT_DECLARE_SIMPLE_TYPE(NPCM7xxMachine, NPCM7XX_MACHINE) | ||
74 | |||
75 | typedef struct NPCM7xxMachineClass { | ||
76 | MachineClass parent; | ||
77 | @@ -XXX,XX +XXX,XX @@ typedef struct NPCM7xxMachineClass { | ||
78 | #define NPCM7XX_MACHINE_GET_CLASS(obj) \ | ||
79 | OBJECT_GET_CLASS(NPCM7xxMachineClass, (obj), TYPE_NPCM7XX_MACHINE) | ||
80 | |||
81 | -typedef struct NPCM7xxState { | ||
82 | +struct NPCM7xxState { | ||
83 | DeviceState parent; | ||
84 | |||
85 | ARMCPU cpu[NPCM7XX_MAX_NUM_CPUS]; | ||
86 | @@ -XXX,XX +XXX,XX @@ typedef struct NPCM7xxState { | ||
87 | NPCM7xxFIUState fiu[2]; | ||
88 | NPCM7xxEMCState emc[2]; | ||
89 | NPCM7xxSDHCIState mmc; | ||
90 | -} NPCM7xxState; | ||
91 | +}; | ||
92 | |||
93 | #define TYPE_NPCM7XX "npcm7xx" | ||
94 | -#define NPCM7XX(obj) OBJECT_CHECK(NPCM7xxState, (obj), TYPE_NPCM7XX) | ||
95 | +OBJECT_DECLARE_TYPE(NPCM7xxState, NPCM7xxClass, NPCM7XX) | ||
96 | |||
97 | #define TYPE_NPCM730 "npcm730" | ||
98 | #define TYPE_NPCM750 "npcm750" | ||
99 | @@ -XXX,XX +XXX,XX @@ typedef struct NPCM7xxClass { | ||
100 | uint32_t num_cpus; | ||
101 | } NPCM7xxClass; | ||
102 | |||
103 | -#define NPCM7XX_CLASS(klass) \ | ||
104 | - OBJECT_CLASS_CHECK(NPCM7xxClass, (klass), TYPE_NPCM7XX) | ||
105 | -#define NPCM7XX_GET_CLASS(obj) \ | ||
106 | - OBJECT_GET_CLASS(NPCM7xxClass, (obj), TYPE_NPCM7XX) | ||
107 | - | ||
108 | /** | ||
109 | * npcm7xx_load_kernel - Loads memory with everything needed to boot | ||
110 | * @machine - The machine containing the SoC to be booted. | ||
111 | diff --git a/include/hw/i2c/npcm7xx_smbus.h b/include/hw/i2c/npcm7xx_smbus.h | ||
112 | index XXXXXXX..XXXXXXX 100644 | ||
113 | --- a/include/hw/i2c/npcm7xx_smbus.h | ||
114 | +++ b/include/hw/i2c/npcm7xx_smbus.h | ||
115 | @@ -XXX,XX +XXX,XX @@ typedef enum NPCM7xxSMBusStatus { | ||
116 | * @rx_cur: The current position of rx_fifo. | ||
117 | * @status: The current status of the SMBus. | ||
118 | */ | ||
119 | -typedef struct NPCM7xxSMBusState { | ||
120 | +struct NPCM7xxSMBusState { | ||
121 | SysBusDevice parent; | ||
122 | |||
123 | MemoryRegion iomem; | ||
124 | @@ -XXX,XX +XXX,XX @@ typedef struct NPCM7xxSMBusState { | ||
125 | uint8_t rx_cur; | ||
126 | |||
127 | NPCM7xxSMBusStatus status; | ||
128 | -} NPCM7xxSMBusState; | ||
129 | +}; | ||
130 | |||
131 | #define TYPE_NPCM7XX_SMBUS "npcm7xx-smbus" | ||
132 | -#define NPCM7XX_SMBUS(obj) OBJECT_CHECK(NPCM7xxSMBusState, (obj), \ | ||
133 | - TYPE_NPCM7XX_SMBUS) | ||
134 | +OBJECT_DECLARE_SIMPLE_TYPE(NPCM7xxSMBusState, NPCM7XX_SMBUS) | ||
135 | |||
136 | #endif /* NPCM7XX_SMBUS_H */ | ||
137 | diff --git a/include/hw/misc/npcm7xx_clk.h b/include/hw/misc/npcm7xx_clk.h | ||
138 | index XXXXXXX..XXXXXXX 100644 | ||
139 | --- a/include/hw/misc/npcm7xx_clk.h | ||
140 | +++ b/include/hw/misc/npcm7xx_clk.h | ||
141 | @@ -XXX,XX +XXX,XX @@ struct NPCM7xxCLKState { | ||
22 | }; | 142 | }; |
23 | 143 | ||
24 | enum { | 144 | #define TYPE_NPCM7XX_CLK "npcm7xx-clk" |
25 | + SD_STAR_FIFO_EMPTY = (1 << 2), | 145 | -#define NPCM7XX_CLK(obj) OBJECT_CHECK(NPCM7xxCLKState, (obj), TYPE_NPCM7XX_CLK) |
26 | SD_STAR_CARD_PRESENT = (1 << 8), | 146 | +OBJECT_DECLARE_SIMPLE_TYPE(NPCM7xxCLKState, NPCM7XX_CLK) |
27 | + SD_STAR_FIFO_LEVEL_1 = (1 << 17), | 147 | |
148 | #endif /* NPCM7XX_CLK_H */ | ||
149 | diff --git a/include/hw/misc/npcm7xx_gcr.h b/include/hw/misc/npcm7xx_gcr.h | ||
150 | index XXXXXXX..XXXXXXX 100644 | ||
151 | --- a/include/hw/misc/npcm7xx_gcr.h | ||
152 | +++ b/include/hw/misc/npcm7xx_gcr.h | ||
153 | @@ -XXX,XX +XXX,XX @@ | ||
154 | */ | ||
155 | #define NPCM7XX_GCR_NR_REGS (0x148 / sizeof(uint32_t)) | ||
156 | |||
157 | -typedef struct NPCM7xxGCRState { | ||
158 | +struct NPCM7xxGCRState { | ||
159 | SysBusDevice parent; | ||
160 | |||
161 | MemoryRegion iomem; | ||
162 | @@ -XXX,XX +XXX,XX @@ typedef struct NPCM7xxGCRState { | ||
163 | uint32_t reset_pwron; | ||
164 | uint32_t reset_mdlr; | ||
165 | uint32_t reset_intcr3; | ||
166 | -} NPCM7xxGCRState; | ||
167 | +}; | ||
168 | |||
169 | #define TYPE_NPCM7XX_GCR "npcm7xx-gcr" | ||
170 | -#define NPCM7XX_GCR(obj) OBJECT_CHECK(NPCM7xxGCRState, (obj), TYPE_NPCM7XX_GCR) | ||
171 | +OBJECT_DECLARE_SIMPLE_TYPE(NPCM7xxGCRState, NPCM7XX_GCR) | ||
172 | |||
173 | #endif /* NPCM7XX_GCR_H */ | ||
174 | diff --git a/include/hw/misc/npcm7xx_mft.h b/include/hw/misc/npcm7xx_mft.h | ||
175 | index XXXXXXX..XXXXXXX 100644 | ||
176 | --- a/include/hw/misc/npcm7xx_mft.h | ||
177 | +++ b/include/hw/misc/npcm7xx_mft.h | ||
178 | @@ -XXX,XX +XXX,XX @@ | ||
179 | * @max_rpm: The maximum rpm for fans. Order: A0, B0, A1, B1. | ||
180 | * @duty: The duty cycles for fans, relative to NPCM7XX_PWM_MAX_DUTY. | ||
181 | */ | ||
182 | -typedef struct NPCM7xxMFTState { | ||
183 | +struct NPCM7xxMFTState { | ||
184 | SysBusDevice parent; | ||
185 | |||
186 | MemoryRegion iomem; | ||
187 | @@ -XXX,XX +XXX,XX @@ typedef struct NPCM7xxMFTState { | ||
188 | |||
189 | uint32_t max_rpm[NPCM7XX_MFT_FANIN_COUNT]; | ||
190 | uint32_t duty[NPCM7XX_MFT_FANIN_COUNT]; | ||
191 | -} NPCM7xxMFTState; | ||
192 | +}; | ||
193 | |||
194 | #define TYPE_NPCM7XX_MFT "npcm7xx-mft" | ||
195 | -#define NPCM7XX_MFT(obj) \ | ||
196 | - OBJECT_CHECK(NPCM7xxMFTState, (obj), TYPE_NPCM7XX_MFT) | ||
197 | +OBJECT_DECLARE_SIMPLE_TYPE(NPCM7xxMFTState, NPCM7XX_MFT) | ||
198 | |||
199 | #endif /* NPCM7XX_MFT_H */ | ||
200 | diff --git a/include/hw/misc/npcm7xx_pwm.h b/include/hw/misc/npcm7xx_pwm.h | ||
201 | index XXXXXXX..XXXXXXX 100644 | ||
202 | --- a/include/hw/misc/npcm7xx_pwm.h | ||
203 | +++ b/include/hw/misc/npcm7xx_pwm.h | ||
204 | @@ -XXX,XX +XXX,XX @@ struct NPCM7xxPWMState { | ||
28 | }; | 205 | }; |
29 | 206 | ||
30 | enum { | 207 | #define TYPE_NPCM7XX_PWM "npcm7xx-pwm" |
31 | @@ -XXX,XX +XXX,XX @@ static uint64_t allwinner_sdhost_read(void *opaque, hwaddr offset, | 208 | -#define NPCM7XX_PWM(obj) \ |
32 | break; | 209 | - OBJECT_CHECK(NPCM7xxPWMState, (obj), TYPE_NPCM7XX_PWM) |
33 | case REG_SD_STAR: /* Status */ | 210 | +OBJECT_DECLARE_SIMPLE_TYPE(NPCM7xxPWMState, NPCM7XX_PWM) |
34 | res = s->status; | 211 | |
35 | + if (sdbus_data_ready(&s->sdbus)) { | 212 | #endif /* NPCM7XX_PWM_H */ |
36 | + res |= SD_STAR_FIFO_LEVEL_1; | 213 | diff --git a/include/hw/misc/npcm7xx_rng.h b/include/hw/misc/npcm7xx_rng.h |
37 | + } else { | 214 | index XXXXXXX..XXXXXXX 100644 |
38 | + res |= SD_STAR_FIFO_EMPTY; | 215 | --- a/include/hw/misc/npcm7xx_rng.h |
39 | + } | 216 | +++ b/include/hw/misc/npcm7xx_rng.h |
40 | break; | 217 | @@ -XXX,XX +XXX,XX @@ |
41 | case REG_SD_FWLR: /* FIFO Water Level */ | 218 | |
42 | res = s->fifo_wlevel; | 219 | #include "hw/sysbus.h" |
220 | |||
221 | -typedef struct NPCM7xxRNGState { | ||
222 | +struct NPCM7xxRNGState { | ||
223 | SysBusDevice parent; | ||
224 | |||
225 | MemoryRegion iomem; | ||
226 | @@ -XXX,XX +XXX,XX @@ typedef struct NPCM7xxRNGState { | ||
227 | uint8_t rngcs; | ||
228 | uint8_t rngd; | ||
229 | uint8_t rngmode; | ||
230 | -} NPCM7xxRNGState; | ||
231 | +}; | ||
232 | |||
233 | #define TYPE_NPCM7XX_RNG "npcm7xx-rng" | ||
234 | -#define NPCM7XX_RNG(obj) OBJECT_CHECK(NPCM7xxRNGState, (obj), TYPE_NPCM7XX_RNG) | ||
235 | +OBJECT_DECLARE_SIMPLE_TYPE(NPCM7xxRNGState, NPCM7XX_RNG) | ||
236 | |||
237 | #endif /* NPCM7XX_RNG_H */ | ||
238 | diff --git a/include/hw/net/npcm7xx_emc.h b/include/hw/net/npcm7xx_emc.h | ||
239 | index XXXXXXX..XXXXXXX 100644 | ||
240 | --- a/include/hw/net/npcm7xx_emc.h | ||
241 | +++ b/include/hw/net/npcm7xx_emc.h | ||
242 | @@ -XXX,XX +XXX,XX @@ struct NPCM7xxEMCState { | ||
243 | bool rx_active; | ||
244 | }; | ||
245 | |||
246 | -typedef struct NPCM7xxEMCState NPCM7xxEMCState; | ||
247 | - | ||
248 | #define TYPE_NPCM7XX_EMC "npcm7xx-emc" | ||
249 | -#define NPCM7XX_EMC(obj) \ | ||
250 | - OBJECT_CHECK(NPCM7xxEMCState, (obj), TYPE_NPCM7XX_EMC) | ||
251 | +OBJECT_DECLARE_SIMPLE_TYPE(NPCM7xxEMCState, NPCM7XX_EMC) | ||
252 | |||
253 | #endif /* NPCM7XX_EMC_H */ | ||
254 | diff --git a/include/hw/sd/npcm7xx_sdhci.h b/include/hw/sd/npcm7xx_sdhci.h | ||
255 | index XXXXXXX..XXXXXXX 100644 | ||
256 | --- a/include/hw/sd/npcm7xx_sdhci.h | ||
257 | +++ b/include/hw/sd/npcm7xx_sdhci.h | ||
258 | @@ -XXX,XX +XXX,XX @@ typedef struct NPCM7xxRegs { | ||
259 | uint32_t boottoctrl; | ||
260 | } NPCM7xxRegisters; | ||
261 | |||
262 | -typedef struct NPCM7xxSDHCIState { | ||
263 | +struct NPCM7xxSDHCIState { | ||
264 | SysBusDevice parent; | ||
265 | |||
266 | MemoryRegion container; | ||
267 | @@ -XXX,XX +XXX,XX @@ typedef struct NPCM7xxSDHCIState { | ||
268 | NPCM7xxRegisters regs; | ||
269 | |||
270 | SDHCIState sdhci; | ||
271 | -} NPCM7xxSDHCIState; | ||
272 | +}; | ||
273 | |||
274 | #endif /* NPCM7XX_SDHCI_H */ | ||
43 | -- | 275 | -- |
44 | 2.25.1 | 276 | 2.34.1 |
277 | |||
278 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Steal the idea for these leaf function expanders from PowerPC. | ||
4 | |||
5 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
6 | Message-id: 20220527181907.189259-2-richard.henderson@linaro.org | ||
7 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
9 | --- | ||
10 | target/arm/translate.h | 11 +++++++++++ | ||
11 | 1 file changed, 11 insertions(+) | ||
12 | |||
13 | diff --git a/target/arm/translate.h b/target/arm/translate.h | ||
14 | index XXXXXXX..XXXXXXX 100644 | ||
15 | --- a/target/arm/translate.h | ||
16 | +++ b/target/arm/translate.h | ||
17 | @@ -XXX,XX +XXX,XX @@ static inline MemOp finalize_memop(DisasContext *s, MemOp opc) | ||
18 | */ | ||
19 | uint64_t asimd_imm_const(uint32_t imm, int cmode, int op); | ||
20 | |||
21 | +/* | ||
22 | + * Helpers for implementing sets of trans_* functions. | ||
23 | + * Defer the implementation of NAME to FUNC, with optional extra arguments. | ||
24 | + */ | ||
25 | +#define TRANS(NAME, FUNC, ...) \ | ||
26 | + static bool trans_##NAME(DisasContext *s, arg_##NAME *a) \ | ||
27 | + { return FUNC(s, __VA_ARGS__); } | ||
28 | +#define TRANS_FEAT(NAME, FEAT, FUNC, ...) \ | ||
29 | + static bool trans_##NAME(DisasContext *s, arg_##NAME *a) \ | ||
30 | + { return dc_isar_feature(FEAT, s) && FUNC(s, __VA_ARGS__); } | ||
31 | + | ||
32 | #endif /* TARGET_ARM_TRANSLATE_H */ | ||
33 | -- | ||
34 | 2.25.1 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
4 | Message-id: 20220527181907.189259-3-richard.henderson@linaro.org | ||
5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | --- | ||
8 | target/arm/translate-sve.c | 36 +++++++++++++++--------------------- | ||
9 | 1 file changed, 15 insertions(+), 21 deletions(-) | ||
10 | |||
11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
12 | index XXXXXXX..XXXXXXX 100644 | ||
13 | --- a/target/arm/translate-sve.c | ||
14 | +++ b/target/arm/translate-sve.c | ||
15 | @@ -XXX,XX +XXX,XX @@ static int pred_gvec_reg_size(DisasContext *s) | ||
16 | } | ||
17 | |||
18 | /* Invoke an out-of-line helper on 2 Zregs. */ | ||
19 | -static void gen_gvec_ool_zz(DisasContext *s, gen_helper_gvec_2 *fn, | ||
20 | +static bool gen_gvec_ool_zz(DisasContext *s, gen_helper_gvec_2 *fn, | ||
21 | int rd, int rn, int data) | ||
22 | { | ||
23 | - unsigned vsz = vec_full_reg_size(s); | ||
24 | - tcg_gen_gvec_2_ool(vec_full_reg_offset(s, rd), | ||
25 | - vec_full_reg_offset(s, rn), | ||
26 | - vsz, vsz, data, fn); | ||
27 | + if (fn == NULL) { | ||
28 | + return false; | ||
29 | + } | ||
30 | + if (sve_access_check(s)) { | ||
31 | + unsigned vsz = vec_full_reg_size(s); | ||
32 | + tcg_gen_gvec_2_ool(vec_full_reg_offset(s, rd), | ||
33 | + vec_full_reg_offset(s, rn), | ||
34 | + vsz, vsz, data, fn); | ||
35 | + } | ||
36 | + return true; | ||
37 | } | ||
38 | |||
39 | /* Invoke an out-of-line helper on 3 Zregs. */ | ||
40 | @@ -XXX,XX +XXX,XX @@ static bool trans_FEXPA(DisasContext *s, arg_rr_esz *a) | ||
41 | gen_helper_sve_fexpa_s, | ||
42 | gen_helper_sve_fexpa_d, | ||
43 | }; | ||
44 | - if (a->esz == 0) { | ||
45 | - return false; | ||
46 | - } | ||
47 | - if (sve_access_check(s)) { | ||
48 | - gen_gvec_ool_zz(s, fns[a->esz], a->rd, a->rn, 0); | ||
49 | - } | ||
50 | - return true; | ||
51 | + return gen_gvec_ool_zz(s, fns[a->esz], a->rd, a->rn, 0); | ||
52 | } | ||
53 | |||
54 | static bool trans_FTSSEL(DisasContext *s, arg_rrr_esz *a) | ||
55 | @@ -XXX,XX +XXX,XX @@ static bool trans_REV_v(DisasContext *s, arg_rr_esz *a) | ||
56 | gen_helper_sve_rev_b, gen_helper_sve_rev_h, | ||
57 | gen_helper_sve_rev_s, gen_helper_sve_rev_d | ||
58 | }; | ||
59 | - | ||
60 | - if (sve_access_check(s)) { | ||
61 | - gen_gvec_ool_zz(s, fns[a->esz], a->rd, a->rn, 0); | ||
62 | - } | ||
63 | - return true; | ||
64 | + return gen_gvec_ool_zz(s, fns[a->esz], a->rd, a->rn, 0); | ||
65 | } | ||
66 | |||
67 | static bool trans_TBL(DisasContext *s, arg_rrr_esz *a) | ||
68 | @@ -XXX,XX +XXX,XX @@ static bool trans_AESMC(DisasContext *s, arg_AESMC *a) | ||
69 | if (!dc_isar_feature(aa64_sve2_aes, s)) { | ||
70 | return false; | ||
71 | } | ||
72 | - if (sve_access_check(s)) { | ||
73 | - gen_gvec_ool_zz(s, gen_helper_crypto_aesmc, a->rd, a->rd, a->decrypt); | ||
74 | - } | ||
75 | - return true; | ||
76 | + return gen_gvec_ool_zz(s, gen_helper_crypto_aesmc, | ||
77 | + a->rd, a->rd, a->decrypt); | ||
78 | } | ||
79 | |||
80 | static bool do_aese(DisasContext *s, arg_rrr_esz *a, bool decrypt) | ||
81 | -- | ||
82 | 2.25.1 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Convert SVE translation functions using gen_gvec_ool_zz to TRANS_FEAT. | ||
4 | |||
5 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
6 | Message-id: 20220527181907.189259-4-richard.henderson@linaro.org | ||
7 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
9 | --- | ||
10 | target/arm/translate-sve.c | 39 +++++++++++++------------------------- | ||
11 | 1 file changed, 13 insertions(+), 26 deletions(-) | ||
12 | |||
13 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
14 | index XXXXXXX..XXXXXXX 100644 | ||
15 | --- a/target/arm/translate-sve.c | ||
16 | +++ b/target/arm/translate-sve.c | ||
17 | @@ -XXX,XX +XXX,XX @@ static bool trans_ADR_u32(DisasContext *s, arg_rrri *a) | ||
18 | *** SVE Integer Misc - Unpredicated Group | ||
19 | */ | ||
20 | |||
21 | -static bool trans_FEXPA(DisasContext *s, arg_rr_esz *a) | ||
22 | -{ | ||
23 | - static gen_helper_gvec_2 * const fns[4] = { | ||
24 | - NULL, | ||
25 | - gen_helper_sve_fexpa_h, | ||
26 | - gen_helper_sve_fexpa_s, | ||
27 | - gen_helper_sve_fexpa_d, | ||
28 | - }; | ||
29 | - return gen_gvec_ool_zz(s, fns[a->esz], a->rd, a->rn, 0); | ||
30 | -} | ||
31 | +static gen_helper_gvec_2 * const fexpa_fns[4] = { | ||
32 | + NULL, gen_helper_sve_fexpa_h, | ||
33 | + gen_helper_sve_fexpa_s, gen_helper_sve_fexpa_d, | ||
34 | +}; | ||
35 | +TRANS_FEAT(FEXPA, aa64_sve, gen_gvec_ool_zz, | ||
36 | + fexpa_fns[a->esz], a->rd, a->rn, 0) | ||
37 | |||
38 | static bool trans_FTSSEL(DisasContext *s, arg_rrr_esz *a) | ||
39 | { | ||
40 | @@ -XXX,XX +XXX,XX @@ static bool trans_INSR_r(DisasContext *s, arg_rrr_esz *a) | ||
41 | return true; | ||
42 | } | ||
43 | |||
44 | -static bool trans_REV_v(DisasContext *s, arg_rr_esz *a) | ||
45 | -{ | ||
46 | - static gen_helper_gvec_2 * const fns[4] = { | ||
47 | - gen_helper_sve_rev_b, gen_helper_sve_rev_h, | ||
48 | - gen_helper_sve_rev_s, gen_helper_sve_rev_d | ||
49 | - }; | ||
50 | - return gen_gvec_ool_zz(s, fns[a->esz], a->rd, a->rn, 0); | ||
51 | -} | ||
52 | +static gen_helper_gvec_2 * const rev_fns[4] = { | ||
53 | + gen_helper_sve_rev_b, gen_helper_sve_rev_h, | ||
54 | + gen_helper_sve_rev_s, gen_helper_sve_rev_d | ||
55 | +}; | ||
56 | +TRANS_FEAT(REV_v, aa64_sve, gen_gvec_ool_zz, rev_fns[a->esz], a->rd, a->rn, 0) | ||
57 | |||
58 | static bool trans_TBL(DisasContext *s, arg_rrr_esz *a) | ||
59 | { | ||
60 | @@ -XXX,XX +XXX,XX @@ static bool trans_USDOT_zzzz(DisasContext *s, arg_USDOT_zzzz *a) | ||
61 | return true; | ||
62 | } | ||
63 | |||
64 | -static bool trans_AESMC(DisasContext *s, arg_AESMC *a) | ||
65 | -{ | ||
66 | - if (!dc_isar_feature(aa64_sve2_aes, s)) { | ||
67 | - return false; | ||
68 | - } | ||
69 | - return gen_gvec_ool_zz(s, gen_helper_crypto_aesmc, | ||
70 | - a->rd, a->rd, a->decrypt); | ||
71 | -} | ||
72 | +TRANS_FEAT(AESMC, aa64_sve2_aes, gen_gvec_ool_zz, | ||
73 | + gen_helper_crypto_aesmc, a->rd, a->rd, a->decrypt) | ||
74 | |||
75 | static bool do_aese(DisasContext *s, arg_rrr_esz *a, bool decrypt) | ||
76 | { | ||
77 | -- | ||
78 | 2.25.1 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
4 | Message-id: 20220527181907.189259-5-richard.henderson@linaro.org | ||
5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | --- | ||
8 | target/arm/translate-sve.c | 74 ++++++++++++-------------------------- | ||
9 | 1 file changed, 23 insertions(+), 51 deletions(-) | ||
10 | |||
11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
12 | index XXXXXXX..XXXXXXX 100644 | ||
13 | --- a/target/arm/translate-sve.c | ||
14 | +++ b/target/arm/translate-sve.c | ||
15 | @@ -XXX,XX +XXX,XX @@ static bool gen_gvec_ool_zz(DisasContext *s, gen_helper_gvec_2 *fn, | ||
16 | } | ||
17 | |||
18 | /* Invoke an out-of-line helper on 3 Zregs. */ | ||
19 | -static void gen_gvec_ool_zzz(DisasContext *s, gen_helper_gvec_3 *fn, | ||
20 | +static bool gen_gvec_ool_zzz(DisasContext *s, gen_helper_gvec_3 *fn, | ||
21 | int rd, int rn, int rm, int data) | ||
22 | { | ||
23 | - unsigned vsz = vec_full_reg_size(s); | ||
24 | - tcg_gen_gvec_3_ool(vec_full_reg_offset(s, rd), | ||
25 | - vec_full_reg_offset(s, rn), | ||
26 | - vec_full_reg_offset(s, rm), | ||
27 | - vsz, vsz, data, fn); | ||
28 | + if (fn == NULL) { | ||
29 | + return false; | ||
30 | + } | ||
31 | + if (sve_access_check(s)) { | ||
32 | + unsigned vsz = vec_full_reg_size(s); | ||
33 | + tcg_gen_gvec_3_ool(vec_full_reg_offset(s, rd), | ||
34 | + vec_full_reg_offset(s, rn), | ||
35 | + vec_full_reg_offset(s, rm), | ||
36 | + vsz, vsz, data, fn); | ||
37 | + } | ||
38 | + return true; | ||
39 | } | ||
40 | |||
41 | /* Invoke an out-of-line helper on 4 Zregs. */ | ||
42 | @@ -XXX,XX +XXX,XX @@ static bool trans_LSL_zzi(DisasContext *s, arg_rri_esz *a) | ||
43 | |||
44 | static bool do_zzw_ool(DisasContext *s, arg_rrr_esz *a, gen_helper_gvec_3 *fn) | ||
45 | { | ||
46 | - if (fn == NULL) { | ||
47 | - return false; | ||
48 | - } | ||
49 | - if (sve_access_check(s)) { | ||
50 | - gen_gvec_ool_zzz(s, fn, a->rd, a->rn, a->rm, 0); | ||
51 | - } | ||
52 | - return true; | ||
53 | + return gen_gvec_ool_zzz(s, fn, a->rd, a->rn, a->rm, 0); | ||
54 | } | ||
55 | |||
56 | #define DO_ZZW(NAME, name) \ | ||
57 | @@ -XXX,XX +XXX,XX @@ static bool trans_RDVL(DisasContext *s, arg_RDVL *a) | ||
58 | |||
59 | static bool do_adr(DisasContext *s, arg_rrri *a, gen_helper_gvec_3 *fn) | ||
60 | { | ||
61 | - if (sve_access_check(s)) { | ||
62 | - gen_gvec_ool_zzz(s, fn, a->rd, a->rn, a->rm, a->imm); | ||
63 | - } | ||
64 | - return true; | ||
65 | + return gen_gvec_ool_zzz(s, fn, a->rd, a->rn, a->rm, a->imm); | ||
66 | } | ||
67 | |||
68 | static bool trans_ADR_p32(DisasContext *s, arg_rrri *a) | ||
69 | @@ -XXX,XX +XXX,XX @@ static bool trans_FTSSEL(DisasContext *s, arg_rrr_esz *a) | ||
70 | gen_helper_sve_ftssel_s, | ||
71 | gen_helper_sve_ftssel_d, | ||
72 | }; | ||
73 | - if (a->esz == 0) { | ||
74 | - return false; | ||
75 | - } | ||
76 | - if (sve_access_check(s)) { | ||
77 | - gen_gvec_ool_zzz(s, fns[a->esz], a->rd, a->rn, a->rm, 0); | ||
78 | - } | ||
79 | - return true; | ||
80 | + return gen_gvec_ool_zzz(s, fns[a->esz], a->rd, a->rn, a->rm, 0); | ||
81 | } | ||
82 | |||
83 | /* | ||
84 | @@ -XXX,XX +XXX,XX @@ static bool trans_TBL(DisasContext *s, arg_rrr_esz *a) | ||
85 | gen_helper_sve_tbl_b, gen_helper_sve_tbl_h, | ||
86 | gen_helper_sve_tbl_s, gen_helper_sve_tbl_d | ||
87 | }; | ||
88 | - | ||
89 | - if (sve_access_check(s)) { | ||
90 | - gen_gvec_ool_zzz(s, fns[a->esz], a->rd, a->rn, a->rm, 0); | ||
91 | - } | ||
92 | - return true; | ||
93 | + return gen_gvec_ool_zzz(s, fns[a->esz], a->rd, a->rn, a->rm, 0); | ||
94 | } | ||
95 | |||
96 | static bool trans_TBL_sve2(DisasContext *s, arg_rrr_esz *a) | ||
97 | @@ -XXX,XX +XXX,XX @@ static bool trans_TBX(DisasContext *s, arg_rrr_esz *a) | ||
98 | if (!dc_isar_feature(aa64_sve2, s)) { | ||
99 | return false; | ||
100 | } | ||
101 | - if (sve_access_check(s)) { | ||
102 | - gen_gvec_ool_zzz(s, fns[a->esz], a->rd, a->rn, a->rm, 0); | ||
103 | - } | ||
104 | - return true; | ||
105 | + return gen_gvec_ool_zzz(s, fns[a->esz], a->rd, a->rn, a->rm, 0); | ||
106 | } | ||
107 | |||
108 | static bool trans_UNPK(DisasContext *s, arg_UNPK *a) | ||
109 | @@ -XXX,XX +XXX,XX @@ static bool do_zip(DisasContext *s, arg_rrr_esz *a, bool high) | ||
110 | static bool do_zzz_data_ool(DisasContext *s, arg_rrr_esz *a, int data, | ||
111 | gen_helper_gvec_3 *fn) | ||
112 | { | ||
113 | - if (sve_access_check(s)) { | ||
114 | - gen_gvec_ool_zzz(s, fn, a->rd, a->rn, a->rm, data); | ||
115 | - } | ||
116 | - return true; | ||
117 | + return gen_gvec_ool_zzz(s, fn, a->rd, a->rn, a->rm, data); | ||
118 | } | ||
119 | |||
120 | static bool trans_ZIP1_z(DisasContext *s, arg_rrr_esz *a) | ||
121 | @@ -XXX,XX +XXX,XX @@ static bool trans_MUL_zzz(DisasContext *s, arg_rrr_esz *a) | ||
122 | static bool do_sve2_zzz_ool(DisasContext *s, arg_rrr_esz *a, | ||
123 | gen_helper_gvec_3 *fn) | ||
124 | { | ||
125 | - if (fn == NULL || !dc_isar_feature(aa64_sve2, s)) { | ||
126 | + if (!dc_isar_feature(aa64_sve2, s)) { | ||
127 | return false; | ||
128 | } | ||
129 | - if (sve_access_check(s)) { | ||
130 | - gen_gvec_ool_zzz(s, fn, a->rd, a->rn, a->rm, 0); | ||
131 | - } | ||
132 | - return true; | ||
133 | + return gen_gvec_ool_zzz(s, fn, a->rd, a->rn, a->rm, 0); | ||
134 | } | ||
135 | |||
136 | static bool trans_SMULH_zzz(DisasContext *s, arg_rrr_esz *a) | ||
137 | @@ -XXX,XX +XXX,XX @@ static bool do_aese(DisasContext *s, arg_rrr_esz *a, bool decrypt) | ||
138 | if (!dc_isar_feature(aa64_sve2_aes, s)) { | ||
139 | return false; | ||
140 | } | ||
141 | - if (sve_access_check(s)) { | ||
142 | - gen_gvec_ool_zzz(s, gen_helper_crypto_aese, | ||
143 | - a->rd, a->rn, a->rm, decrypt); | ||
144 | - } | ||
145 | - return true; | ||
146 | + return gen_gvec_ool_zzz(s, gen_helper_crypto_aese, | ||
147 | + a->rd, a->rn, a->rm, decrypt); | ||
148 | } | ||
149 | |||
150 | static bool trans_AESE(DisasContext *s, arg_rrr_esz *a) | ||
151 | @@ -XXX,XX +XXX,XX @@ static bool do_sm4(DisasContext *s, arg_rrr_esz *a, gen_helper_gvec_3 *fn) | ||
152 | if (!dc_isar_feature(aa64_sve2_sm4, s)) { | ||
153 | return false; | ||
154 | } | ||
155 | - if (sve_access_check(s)) { | ||
156 | - gen_gvec_ool_zzz(s, fn, a->rd, a->rn, a->rm, 0); | ||
157 | - } | ||
158 | - return true; | ||
159 | + return gen_gvec_ool_zzz(s, fn, a->rd, a->rn, a->rm, 0); | ||
160 | } | ||
161 | |||
162 | static bool trans_SM4E(DisasContext *s, arg_rrr_esz *a) | ||
163 | -- | ||
164 | 2.25.1 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Convert SVE translation functions using | ||
4 | gen_gvec_ool_arg_zzz to TRANS_FEAT. | ||
5 | |||
6 | Remove trivial wrappers do_aese, do_sm4. | ||
7 | |||
8 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
9 | Message-id: 20220527181907.189259-7-richard.henderson@linaro.org | ||
10 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
11 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
12 | --- | ||
13 | target/arm/translate-sve.c | 165 ++++++++++--------------------------- | ||
14 | 1 file changed, 45 insertions(+), 120 deletions(-) | ||
15 | |||
16 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
17 | index XXXXXXX..XXXXXXX 100644 | ||
18 | --- a/target/arm/translate-sve.c | ||
19 | +++ b/target/arm/translate-sve.c | ||
20 | @@ -XXX,XX +XXX,XX @@ static bool trans_LSL_zzi(DisasContext *s, arg_rri_esz *a) | ||
21 | } | ||
22 | |||
23 | #define DO_ZZW(NAME, name) \ | ||
24 | -static bool trans_##NAME##_zzw(DisasContext *s, arg_rrr_esz *a) \ | ||
25 | -{ \ | ||
26 | - static gen_helper_gvec_3 * const fns[4] = { \ | ||
27 | + static gen_helper_gvec_3 * const name##_zzw_fns[4] = { \ | ||
28 | gen_helper_sve_##name##_zzw_b, gen_helper_sve_##name##_zzw_h, \ | ||
29 | gen_helper_sve_##name##_zzw_s, NULL \ | ||
30 | }; \ | ||
31 | - return gen_gvec_ool_arg_zzz(s, fns[a->esz], a, 0); \ | ||
32 | -} | ||
33 | + TRANS_FEAT(NAME, aa64_sve, gen_gvec_ool_arg_zzz, \ | ||
34 | + name##_zzw_fns[a->esz], a, 0) | ||
35 | |||
36 | -DO_ZZW(ASR, asr) | ||
37 | -DO_ZZW(LSR, lsr) | ||
38 | -DO_ZZW(LSL, lsl) | ||
39 | +DO_ZZW(ASR_zzw, asr) | ||
40 | +DO_ZZW(LSR_zzw, lsr) | ||
41 | +DO_ZZW(LSL_zzw, lsl) | ||
42 | |||
43 | #undef DO_ZZW | ||
44 | |||
45 | @@ -XXX,XX +XXX,XX @@ static gen_helper_gvec_2 * const fexpa_fns[4] = { | ||
46 | TRANS_FEAT(FEXPA, aa64_sve, gen_gvec_ool_zz, | ||
47 | fexpa_fns[a->esz], a->rd, a->rn, 0) | ||
48 | |||
49 | -static bool trans_FTSSEL(DisasContext *s, arg_rrr_esz *a) | ||
50 | -{ | ||
51 | - static gen_helper_gvec_3 * const fns[4] = { | ||
52 | - NULL, | ||
53 | - gen_helper_sve_ftssel_h, | ||
54 | - gen_helper_sve_ftssel_s, | ||
55 | - gen_helper_sve_ftssel_d, | ||
56 | - }; | ||
57 | - return gen_gvec_ool_arg_zzz(s, fns[a->esz], a, 0); | ||
58 | -} | ||
59 | +static gen_helper_gvec_3 * const ftssel_fns[4] = { | ||
60 | + NULL, gen_helper_sve_ftssel_h, | ||
61 | + gen_helper_sve_ftssel_s, gen_helper_sve_ftssel_d, | ||
62 | +}; | ||
63 | +TRANS_FEAT(FTSSEL, aa64_sve, gen_gvec_ool_arg_zzz, ftssel_fns[a->esz], a, 0) | ||
64 | |||
65 | /* | ||
66 | *** SVE Predicate Logical Operations Group | ||
67 | @@ -XXX,XX +XXX,XX @@ static gen_helper_gvec_2 * const rev_fns[4] = { | ||
68 | }; | ||
69 | TRANS_FEAT(REV_v, aa64_sve, gen_gvec_ool_zz, rev_fns[a->esz], a->rd, a->rn, 0) | ||
70 | |||
71 | -static bool trans_TBL(DisasContext *s, arg_rrr_esz *a) | ||
72 | -{ | ||
73 | - static gen_helper_gvec_3 * const fns[4] = { | ||
74 | - gen_helper_sve_tbl_b, gen_helper_sve_tbl_h, | ||
75 | - gen_helper_sve_tbl_s, gen_helper_sve_tbl_d | ||
76 | - }; | ||
77 | - return gen_gvec_ool_arg_zzz(s, fns[a->esz], a, 0); | ||
78 | -} | ||
79 | +static gen_helper_gvec_3 * const sve_tbl_fns[4] = { | ||
80 | + gen_helper_sve_tbl_b, gen_helper_sve_tbl_h, | ||
81 | + gen_helper_sve_tbl_s, gen_helper_sve_tbl_d | ||
82 | +}; | ||
83 | +TRANS_FEAT(TBL, aa64_sve, gen_gvec_ool_arg_zzz, sve_tbl_fns[a->esz], a, 0) | ||
84 | |||
85 | static bool trans_TBL_sve2(DisasContext *s, arg_rrr_esz *a) | ||
86 | { | ||
87 | @@ -XXX,XX +XXX,XX @@ static bool trans_TBL_sve2(DisasContext *s, arg_rrr_esz *a) | ||
88 | return true; | ||
89 | } | ||
90 | |||
91 | -static bool trans_TBX(DisasContext *s, arg_rrr_esz *a) | ||
92 | -{ | ||
93 | - static gen_helper_gvec_3 * const fns[4] = { | ||
94 | - gen_helper_sve2_tbx_b, gen_helper_sve2_tbx_h, | ||
95 | - gen_helper_sve2_tbx_s, gen_helper_sve2_tbx_d | ||
96 | - }; | ||
97 | - | ||
98 | - if (!dc_isar_feature(aa64_sve2, s)) { | ||
99 | - return false; | ||
100 | - } | ||
101 | - return gen_gvec_ool_arg_zzz(s, fns[a->esz], a, 0); | ||
102 | -} | ||
103 | +static gen_helper_gvec_3 * const tbx_fns[4] = { | ||
104 | + gen_helper_sve2_tbx_b, gen_helper_sve2_tbx_h, | ||
105 | + gen_helper_sve2_tbx_s, gen_helper_sve2_tbx_d | ||
106 | +}; | ||
107 | +TRANS_FEAT(TBX, aa64_sve2, gen_gvec_ool_arg_zzz, tbx_fns[a->esz], a, 0) | ||
108 | |||
109 | static bool trans_UNPK(DisasContext *s, arg_UNPK *a) | ||
110 | { | ||
111 | @@ -XXX,XX +XXX,XX @@ static gen_helper_gvec_3 * const uzp_fns[4] = { | ||
112 | gen_helper_sve_uzp_s, gen_helper_sve_uzp_d, | ||
113 | }; | ||
114 | |||
115 | -static bool trans_UZP1_z(DisasContext *s, arg_rrr_esz *a) | ||
116 | -{ | ||
117 | - return gen_gvec_ool_arg_zzz(s, uzp_fns[a->esz], a, 0); | ||
118 | -} | ||
119 | +TRANS_FEAT(UZP1_z, aa64_sve, gen_gvec_ool_arg_zzz, | ||
120 | + uzp_fns[a->esz], a, 0) | ||
121 | +TRANS_FEAT(UZP2_z, aa64_sve, gen_gvec_ool_arg_zzz, | ||
122 | + uzp_fns[a->esz], a, 1 << a->esz) | ||
123 | |||
124 | -static bool trans_UZP2_z(DisasContext *s, arg_rrr_esz *a) | ||
125 | -{ | ||
126 | - return gen_gvec_ool_arg_zzz(s, uzp_fns[a->esz], a, 1 << a->esz); | ||
127 | -} | ||
128 | - | ||
129 | -static bool trans_UZP1_q(DisasContext *s, arg_rrr_esz *a) | ||
130 | -{ | ||
131 | - if (!dc_isar_feature(aa64_sve_f64mm, s)) { | ||
132 | - return false; | ||
133 | - } | ||
134 | - return gen_gvec_ool_arg_zzz(s, gen_helper_sve2_uzp_q, a, 0); | ||
135 | -} | ||
136 | - | ||
137 | -static bool trans_UZP2_q(DisasContext *s, arg_rrr_esz *a) | ||
138 | -{ | ||
139 | - if (!dc_isar_feature(aa64_sve_f64mm, s)) { | ||
140 | - return false; | ||
141 | - } | ||
142 | - return gen_gvec_ool_arg_zzz(s, gen_helper_sve2_uzp_q, a, 16); | ||
143 | -} | ||
144 | +TRANS_FEAT(UZP1_q, aa64_sve_f64mm, gen_gvec_ool_arg_zzz, | ||
145 | + gen_helper_sve2_uzp_q, a, 0) | ||
146 | +TRANS_FEAT(UZP2_q, aa64_sve_f64mm, gen_gvec_ool_arg_zzz, | ||
147 | + gen_helper_sve2_uzp_q, a, 16) | ||
148 | |||
149 | static gen_helper_gvec_3 * const trn_fns[4] = { | ||
150 | gen_helper_sve_trn_b, gen_helper_sve_trn_h, | ||
151 | gen_helper_sve_trn_s, gen_helper_sve_trn_d, | ||
152 | }; | ||
153 | |||
154 | -static bool trans_TRN1_z(DisasContext *s, arg_rrr_esz *a) | ||
155 | -{ | ||
156 | - return gen_gvec_ool_arg_zzz(s, trn_fns[a->esz], a, 0); | ||
157 | -} | ||
158 | +TRANS_FEAT(TRN1_z, aa64_sve, gen_gvec_ool_arg_zzz, | ||
159 | + trn_fns[a->esz], a, 0) | ||
160 | +TRANS_FEAT(TRN2_z, aa64_sve, gen_gvec_ool_arg_zzz, | ||
161 | + trn_fns[a->esz], a, 1 << a->esz) | ||
162 | |||
163 | -static bool trans_TRN2_z(DisasContext *s, arg_rrr_esz *a) | ||
164 | -{ | ||
165 | - return gen_gvec_ool_arg_zzz(s, trn_fns[a->esz], a, 1 << a->esz); | ||
166 | -} | ||
167 | - | ||
168 | -static bool trans_TRN1_q(DisasContext *s, arg_rrr_esz *a) | ||
169 | -{ | ||
170 | - if (!dc_isar_feature(aa64_sve_f64mm, s)) { | ||
171 | - return false; | ||
172 | - } | ||
173 | - return gen_gvec_ool_arg_zzz(s, gen_helper_sve2_trn_q, a, 0); | ||
174 | -} | ||
175 | - | ||
176 | -static bool trans_TRN2_q(DisasContext *s, arg_rrr_esz *a) | ||
177 | -{ | ||
178 | - if (!dc_isar_feature(aa64_sve_f64mm, s)) { | ||
179 | - return false; | ||
180 | - } | ||
181 | - return gen_gvec_ool_arg_zzz(s, gen_helper_sve2_trn_q, a, 16); | ||
182 | -} | ||
183 | +TRANS_FEAT(TRN1_q, aa64_sve_f64mm, gen_gvec_ool_arg_zzz, | ||
184 | + gen_helper_sve2_trn_q, a, 0) | ||
185 | +TRANS_FEAT(TRN2_q, aa64_sve_f64mm, gen_gvec_ool_arg_zzz, | ||
186 | + gen_helper_sve2_trn_q, a, 16) | ||
187 | |||
188 | /* | ||
189 | *** SVE Permute Vector - Predicated Group | ||
190 | @@ -XXX,XX +XXX,XX @@ static bool trans_USDOT_zzzz(DisasContext *s, arg_USDOT_zzzz *a) | ||
191 | TRANS_FEAT(AESMC, aa64_sve2_aes, gen_gvec_ool_zz, | ||
192 | gen_helper_crypto_aesmc, a->rd, a->rd, a->decrypt) | ||
193 | |||
194 | -static bool do_aese(DisasContext *s, arg_rrr_esz *a, bool decrypt) | ||
195 | -{ | ||
196 | - if (!dc_isar_feature(aa64_sve2_aes, s)) { | ||
197 | - return false; | ||
198 | - } | ||
199 | - return gen_gvec_ool_arg_zzz(s, gen_helper_crypto_aese, a, decrypt); | ||
200 | -} | ||
201 | +TRANS_FEAT(AESE, aa64_sve2_aes, gen_gvec_ool_arg_zzz, | ||
202 | + gen_helper_crypto_aese, a, false) | ||
203 | +TRANS_FEAT(AESD, aa64_sve2_aes, gen_gvec_ool_arg_zzz, | ||
204 | + gen_helper_crypto_aese, a, true) | ||
205 | |||
206 | -static bool trans_AESE(DisasContext *s, arg_rrr_esz *a) | ||
207 | -{ | ||
208 | - return do_aese(s, a, false); | ||
209 | -} | ||
210 | - | ||
211 | -static bool trans_AESD(DisasContext *s, arg_rrr_esz *a) | ||
212 | -{ | ||
213 | - return do_aese(s, a, true); | ||
214 | -} | ||
215 | - | ||
216 | -static bool do_sm4(DisasContext *s, arg_rrr_esz *a, gen_helper_gvec_3 *fn) | ||
217 | -{ | ||
218 | - if (!dc_isar_feature(aa64_sve2_sm4, s)) { | ||
219 | - return false; | ||
220 | - } | ||
221 | - return gen_gvec_ool_arg_zzz(s, fn, a, 0); | ||
222 | -} | ||
223 | - | ||
224 | -static bool trans_SM4E(DisasContext *s, arg_rrr_esz *a) | ||
225 | -{ | ||
226 | - return do_sm4(s, a, gen_helper_crypto_sm4e); | ||
227 | -} | ||
228 | - | ||
229 | -static bool trans_SM4EKEY(DisasContext *s, arg_rrr_esz *a) | ||
230 | -{ | ||
231 | - return do_sm4(s, a, gen_helper_crypto_sm4ekey); | ||
232 | -} | ||
233 | +TRANS_FEAT(SM4E, aa64_sve2_sm4, gen_gvec_ool_arg_zzz, | ||
234 | + gen_helper_crypto_sm4e, a, 0) | ||
235 | +TRANS_FEAT(SM4EKEY, aa64_sve2_sm4, gen_gvec_ool_arg_zzz, | ||
236 | + gen_helper_crypto_sm4ekey, a, 0) | ||
237 | |||
238 | static bool trans_RAX1(DisasContext *s, arg_rrr_esz *a) | ||
239 | { | ||
240 | -- | ||
241 | 2.25.1 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Philippe Mathieu-Daudé <philmd@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | Remove the unparsed extractions in trans_ADD_zzi, trans_SUBR_zzi, | 3 | The structure is named SECUREECState. Rename the type accordingly. |
4 | and do_zzi_sat which are intended to reject an 8-bit shift of an | ||
5 | 8-bit constant for 8-bit element. | ||
6 | 4 | ||
7 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 5 | Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> |
8 | Message-id: 20220527181907.189259-73-richard.henderson@linaro.org | 6 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> |
9 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 7 | Message-id: 20230109140306.23161-12-philmd@linaro.org |
10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
11 | --- | 9 | --- |
12 | target/arm/sve.decode | 35 ++++++++++++++++++++++++++++------- | 10 | hw/misc/sbsa_ec.c | 13 +++++++------ |
13 | target/arm/translate-sve.c | 9 --------- | 11 | 1 file changed, 7 insertions(+), 6 deletions(-) |
14 | 2 files changed, 28 insertions(+), 16 deletions(-) | ||
15 | 12 | ||
16 | diff --git a/target/arm/sve.decode b/target/arm/sve.decode | 13 | diff --git a/hw/misc/sbsa_ec.c b/hw/misc/sbsa_ec.c |
17 | index XXXXXXX..XXXXXXX 100644 | 14 | index XXXXXXX..XXXXXXX 100644 |
18 | --- a/target/arm/sve.decode | 15 | --- a/hw/misc/sbsa_ec.c |
19 | +++ b/target/arm/sve.decode | 16 | +++ b/hw/misc/sbsa_ec.c |
20 | @@ -XXX,XX +XXX,XX @@ FDUP 00100101 esz:2 111 00 1110 imm:8 rd:5 | 17 | @@ -XXX,XX +XXX,XX @@ |
18 | #include "hw/sysbus.h" | ||
19 | #include "sysemu/runstate.h" | ||
20 | |||
21 | -typedef struct { | ||
22 | +typedef struct SECUREECState { | ||
23 | SysBusDevice parent_obj; | ||
24 | MemoryRegion iomem; | ||
25 | } SECUREECState; | ||
26 | |||
27 | -#define TYPE_SBSA_EC "sbsa-ec" | ||
28 | -#define SECURE_EC(obj) OBJECT_CHECK(SECUREECState, (obj), TYPE_SBSA_EC) | ||
29 | +#define TYPE_SBSA_SECURE_EC "sbsa-ec" | ||
30 | +#define SBSA_SECURE_EC(obj) \ | ||
31 | + OBJECT_CHECK(SECUREECState, (obj), TYPE_SBSA_SECURE_EC) | ||
32 | |||
33 | enum sbsa_ec_powerstates { | ||
34 | SBSA_EC_CMD_POWEROFF = 0x01, | ||
35 | @@ -XXX,XX +XXX,XX @@ static uint64_t sbsa_ec_read(void *opaque, hwaddr offset, unsigned size) | ||
21 | } | 36 | } |
22 | 37 | ||
23 | # SVE integer add/subtract immediate (unpredicated) | 38 | static void sbsa_ec_write(void *opaque, hwaddr offset, |
24 | -ADD_zzi 00100101 .. 100 000 11 . ........ ..... @rdn_sh_i8u | 39 | - uint64_t value, unsigned size) |
25 | -SUB_zzi 00100101 .. 100 001 11 . ........ ..... @rdn_sh_i8u | 40 | + uint64_t value, unsigned size) |
26 | -SUBR_zzi 00100101 .. 100 011 11 . ........ ..... @rdn_sh_i8u | ||
27 | -SQADD_zzi 00100101 .. 100 100 11 . ........ ..... @rdn_sh_i8u | ||
28 | -UQADD_zzi 00100101 .. 100 101 11 . ........ ..... @rdn_sh_i8u | ||
29 | -SQSUB_zzi 00100101 .. 100 110 11 . ........ ..... @rdn_sh_i8u | ||
30 | -UQSUB_zzi 00100101 .. 100 111 11 . ........ ..... @rdn_sh_i8u | ||
31 | +{ | ||
32 | + INVALID 00100101 00 100 000 11 1 -------- ----- | ||
33 | + ADD_zzi 00100101 .. 100 000 11 . ........ ..... @rdn_sh_i8u | ||
34 | +} | ||
35 | +{ | ||
36 | + INVALID 00100101 00 100 001 11 1 -------- ----- | ||
37 | + SUB_zzi 00100101 .. 100 001 11 . ........ ..... @rdn_sh_i8u | ||
38 | +} | ||
39 | +{ | ||
40 | + INVALID 00100101 00 100 011 11 1 -------- ----- | ||
41 | + SUBR_zzi 00100101 .. 100 011 11 . ........ ..... @rdn_sh_i8u | ||
42 | +} | ||
43 | +{ | ||
44 | + INVALID 00100101 00 100 100 11 1 -------- ----- | ||
45 | + SQADD_zzi 00100101 .. 100 100 11 . ........ ..... @rdn_sh_i8u | ||
46 | +} | ||
47 | +{ | ||
48 | + INVALID 00100101 00 100 101 11 1 -------- ----- | ||
49 | + UQADD_zzi 00100101 .. 100 101 11 . ........ ..... @rdn_sh_i8u | ||
50 | +} | ||
51 | +{ | ||
52 | + INVALID 00100101 00 100 110 11 1 -------- ----- | ||
53 | + SQSUB_zzi 00100101 .. 100 110 11 . ........ ..... @rdn_sh_i8u | ||
54 | +} | ||
55 | +{ | ||
56 | + INVALID 00100101 00 100 111 11 1 -------- ----- | ||
57 | + UQSUB_zzi 00100101 .. 100 111 11 . ........ ..... @rdn_sh_i8u | ||
58 | +} | ||
59 | |||
60 | # SVE integer min/max immediate (unpredicated) | ||
61 | SMAX_zzi 00100101 .. 101 000 110 ........ ..... @rdn_i8s | ||
62 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
63 | index XXXXXXX..XXXXXXX 100644 | ||
64 | --- a/target/arm/translate-sve.c | ||
65 | +++ b/target/arm/translate-sve.c | ||
66 | @@ -XXX,XX +XXX,XX @@ static bool trans_DUP_i(DisasContext *s, arg_DUP_i *a) | ||
67 | |||
68 | static bool trans_ADD_zzi(DisasContext *s, arg_rri_esz *a) | ||
69 | { | 41 | { |
70 | - if (a->esz == 0 && extract32(s->insn, 13, 1)) { | 42 | if (offset == 0) { /* PSCI machine power command register */ |
71 | - return false; | 43 | switch (value) { |
72 | - } | 44 | @@ -XXX,XX +XXX,XX @@ static const MemoryRegionOps sbsa_ec_ops = { |
73 | return gen_gvec_fn_arg_zzi(s, tcg_gen_gvec_addi, a); | 45 | |
46 | static void sbsa_ec_init(Object *obj) | ||
47 | { | ||
48 | - SECUREECState *s = SECURE_EC(obj); | ||
49 | + SECUREECState *s = SBSA_SECURE_EC(obj); | ||
50 | SysBusDevice *dev = SYS_BUS_DEVICE(obj); | ||
51 | |||
52 | memory_region_init_io(&s->iomem, obj, &sbsa_ec_ops, s, "sbsa-ec", | ||
53 | @@ -XXX,XX +XXX,XX @@ static void sbsa_ec_class_init(ObjectClass *klass, void *data) | ||
74 | } | 54 | } |
75 | 55 | ||
76 | @@ -XXX,XX +XXX,XX @@ static bool trans_SUBR_zzi(DisasContext *s, arg_rri_esz *a) | 56 | static const TypeInfo sbsa_ec_info = { |
77 | .scalar_first = true } | 57 | - .name = TYPE_SBSA_EC, |
78 | }; | 58 | + .name = TYPE_SBSA_SECURE_EC, |
79 | 59 | .parent = TYPE_SYS_BUS_DEVICE, | |
80 | - if (a->esz == 0 && extract32(s->insn, 13, 1)) { | 60 | .instance_size = sizeof(SECUREECState), |
81 | - return false; | 61 | .instance_init = sbsa_ec_init, |
82 | - } | ||
83 | if (sve_access_check(s)) { | ||
84 | unsigned vsz = vec_full_reg_size(s); | ||
85 | tcg_gen_gvec_2s(vec_full_reg_offset(s, a->rd), | ||
86 | @@ -XXX,XX +XXX,XX @@ TRANS_FEAT(MUL_zzi, aa64_sve, gen_gvec_fn_arg_zzi, tcg_gen_gvec_muli, a) | ||
87 | |||
88 | static bool do_zzi_sat(DisasContext *s, arg_rri_esz *a, bool u, bool d) | ||
89 | { | ||
90 | - if (a->esz == 0 && extract32(s->insn, 13, 1)) { | ||
91 | - return false; | ||
92 | - } | ||
93 | if (sve_access_check(s)) { | ||
94 | do_sat_addsub_vec(s, a->esz, a->rd, a->rn, | ||
95 | tcg_constant_i64(a->imm), u, d); | ||
96 | -- | 62 | -- |
97 | 2.25.1 | 63 | 2.34.1 |
64 | |||
65 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Philippe Mathieu-Daudé <philmd@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 3 | This model was merged few days before the QOM cleanup from |
4 | Message-id: 20220527181907.189259-77-richard.henderson@linaro.org | 4 | commit 8063396bf3 ("Use OBJECT_DECLARE_SIMPLE_TYPE when possible") |
5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 5 | was pulled and merged. Manually adapt. |
6 | |||
7 | Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> | ||
8 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
9 | Message-id: 20230109140306.23161-13-philmd@linaro.org | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
7 | --- | 11 | --- |
8 | target/arm/translate-sve.c | 7 ++----- | 12 | hw/misc/sbsa_ec.c | 3 +-- |
9 | 1 file changed, 2 insertions(+), 5 deletions(-) | 13 | 1 file changed, 1 insertion(+), 2 deletions(-) |
10 | 14 | ||
11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | 15 | diff --git a/hw/misc/sbsa_ec.c b/hw/misc/sbsa_ec.c |
12 | index XXXXXXX..XXXXXXX 100644 | 16 | index XXXXXXX..XXXXXXX 100644 |
13 | --- a/target/arm/translate-sve.c | 17 | --- a/hw/misc/sbsa_ec.c |
14 | +++ b/target/arm/translate-sve.c | 18 | +++ b/hw/misc/sbsa_ec.c |
15 | @@ -XXX,XX +XXX,XX @@ static bool do_zzi_ool(DisasContext *s, arg_rri_esz *a, gen_helper_gvec_2i *fn) | 19 | @@ -XXX,XX +XXX,XX @@ typedef struct SECUREECState { |
16 | } | 20 | } SECUREECState; |
17 | 21 | ||
18 | #define DO_ZZI(NAME, name) \ | 22 | #define TYPE_SBSA_SECURE_EC "sbsa-ec" |
19 | -static bool trans_##NAME##_zzi(DisasContext *s, arg_rri_esz *a) \ | 23 | -#define SBSA_SECURE_EC(obj) \ |
20 | -{ \ | 24 | - OBJECT_CHECK(SECUREECState, (obj), TYPE_SBSA_SECURE_EC) |
21 | - static gen_helper_gvec_2i * const fns[4] = { \ | 25 | +OBJECT_DECLARE_SIMPLE_TYPE(SECUREECState, SBSA_SECURE_EC) |
22 | + static gen_helper_gvec_2i * const name##i_fns[4] = { \ | 26 | |
23 | gen_helper_sve_##name##i_b, gen_helper_sve_##name##i_h, \ | 27 | enum sbsa_ec_powerstates { |
24 | gen_helper_sve_##name##i_s, gen_helper_sve_##name##i_d, \ | 28 | SBSA_EC_CMD_POWEROFF = 0x01, |
25 | }; \ | ||
26 | - return do_zzi_ool(s, a, fns[a->esz]); \ | ||
27 | -} | ||
28 | + TRANS_FEAT(NAME##_zzi, aa64_sve, do_zzi_ool, a, name##i_fns[a->esz]) | ||
29 | |||
30 | DO_ZZI(SMAX, smax) | ||
31 | DO_ZZI(UMAX, umax) | ||
32 | -- | 29 | -- |
33 | 2.25.1 | 30 | 2.34.1 |
31 | |||
32 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Philippe Mathieu-Daudé <philmd@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 3 | This remove a use of 'struct' in the DECLARE_INSTANCE_CHECKER() |
4 | Message-id: 20220527181907.189259-9-richard.henderson@linaro.org | 4 | macro call, to avoid after a QOM refactor: |
5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 5 | |
6 | hw/intc/xilinx_intc.c:45:1: error: declaration of anonymous struct must be a definition | ||
7 | DECLARE_INSTANCE_CHECKER(struct xlx_pic, XILINX_INTC, | ||
8 | ^ | ||
9 | |||
10 | Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> | ||
11 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
12 | Reviewed-by: Edgar E. Iglesias <edgar@zeroasic.com> | ||
13 | Message-id: 20230109140306.23161-14-philmd@linaro.org | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 14 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
7 | --- | 15 | --- |
8 | target/arm/translate-sve.c | 102 ++++++++++++++----------------------- | 16 | hw/intc/xilinx_intc.c | 28 +++++++++++++--------------- |
9 | 1 file changed, 38 insertions(+), 64 deletions(-) | 17 | 1 file changed, 13 insertions(+), 15 deletions(-) |
10 | 18 | ||
11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | 19 | diff --git a/hw/intc/xilinx_intc.c b/hw/intc/xilinx_intc.c |
12 | index XXXXXXX..XXXXXXX 100644 | 20 | index XXXXXXX..XXXXXXX 100644 |
13 | --- a/target/arm/translate-sve.c | 21 | --- a/hw/intc/xilinx_intc.c |
14 | +++ b/target/arm/translate-sve.c | 22 | +++ b/hw/intc/xilinx_intc.c |
15 | @@ -XXX,XX +XXX,XX @@ static bool gen_gvec_ool_arg_zzz(DisasContext *s, gen_helper_gvec_3 *fn, | 23 | @@ -XXX,XX +XXX,XX @@ |
24 | #define R_MAX 8 | ||
25 | |||
26 | #define TYPE_XILINX_INTC "xlnx.xps-intc" | ||
27 | -DECLARE_INSTANCE_CHECKER(struct xlx_pic, XILINX_INTC, | ||
28 | - TYPE_XILINX_INTC) | ||
29 | +typedef struct XpsIntc XpsIntc; | ||
30 | +DECLARE_INSTANCE_CHECKER(XpsIntc, XILINX_INTC, TYPE_XILINX_INTC) | ||
31 | |||
32 | -struct xlx_pic | ||
33 | +struct XpsIntc | ||
34 | { | ||
35 | SysBusDevice parent_obj; | ||
36 | |||
37 | @@ -XXX,XX +XXX,XX @@ struct xlx_pic | ||
38 | uint32_t irq_pin_state; | ||
39 | }; | ||
40 | |||
41 | -static void update_irq(struct xlx_pic *p) | ||
42 | +static void update_irq(XpsIntc *p) | ||
43 | { | ||
44 | uint32_t i; | ||
45 | |||
46 | @@ -XXX,XX +XXX,XX @@ static void update_irq(struct xlx_pic *p) | ||
47 | qemu_set_irq(p->parent_irq, (p->regs[R_MER] & 1) && p->regs[R_IPR]); | ||
16 | } | 48 | } |
17 | 49 | ||
18 | /* Invoke an out-of-line helper on 4 Zregs. */ | 50 | -static uint64_t |
19 | -static void gen_gvec_ool_zzzz(DisasContext *s, gen_helper_gvec_4 *fn, | 51 | -pic_read(void *opaque, hwaddr addr, unsigned int size) |
20 | +static bool gen_gvec_ool_zzzz(DisasContext *s, gen_helper_gvec_4 *fn, | 52 | +static uint64_t pic_read(void *opaque, hwaddr addr, unsigned int size) |
21 | int rd, int rn, int rm, int ra, int data) | ||
22 | { | 53 | { |
23 | - unsigned vsz = vec_full_reg_size(s); | 54 | - struct xlx_pic *p = opaque; |
24 | - tcg_gen_gvec_4_ool(vec_full_reg_offset(s, rd), | 55 | + XpsIntc *p = opaque; |
25 | - vec_full_reg_offset(s, rn), | 56 | uint32_t r = 0; |
26 | - vec_full_reg_offset(s, rm), | 57 | |
27 | - vec_full_reg_offset(s, ra), | 58 | addr >>= 2; |
28 | - vsz, vsz, data, fn); | 59 | @@ -XXX,XX +XXX,XX @@ pic_read(void *opaque, hwaddr addr, unsigned int size) |
29 | + if (fn == NULL) { | 60 | return r; |
30 | + return false; | ||
31 | + } | ||
32 | + if (sve_access_check(s)) { | ||
33 | + unsigned vsz = vec_full_reg_size(s); | ||
34 | + tcg_gen_gvec_4_ool(vec_full_reg_offset(s, rd), | ||
35 | + vec_full_reg_offset(s, rn), | ||
36 | + vec_full_reg_offset(s, rm), | ||
37 | + vec_full_reg_offset(s, ra), | ||
38 | + vsz, vsz, data, fn); | ||
39 | + } | ||
40 | + return true; | ||
41 | } | 61 | } |
42 | 62 | ||
43 | /* Invoke an out-of-line helper on 2 Zregs and a predicate. */ | 63 | -static void |
44 | @@ -XXX,XX +XXX,XX @@ static bool trans_TBL_sve2(DisasContext *s, arg_rrr_esz *a) | 64 | -pic_write(void *opaque, hwaddr addr, |
45 | if (!dc_isar_feature(aa64_sve2, s)) { | 65 | - uint64_t val64, unsigned int size) |
46 | return false; | 66 | +static void pic_write(void *opaque, hwaddr addr, |
47 | } | 67 | + uint64_t val64, unsigned int size) |
48 | - if (sve_access_check(s)) { | 68 | { |
49 | - gen_gvec_ool_zzzz(s, fns[a->esz], a->rd, a->rn, | 69 | - struct xlx_pic *p = opaque; |
50 | - (a->rn + 1) % 32, a->rm, 0); | 70 | + XpsIntc *p = opaque; |
51 | - } | 71 | uint32_t value = val64; |
52 | - return true; | 72 | |
53 | + return gen_gvec_ool_zzzz(s, fns[a->esz], a->rd, a->rn, | 73 | addr >>= 2; |
54 | + (a->rn + 1) % 32, a->rm, 0); | 74 | @@ -XXX,XX +XXX,XX @@ static const MemoryRegionOps pic_ops = { |
75 | |||
76 | static void irq_handler(void *opaque, int irq, int level) | ||
77 | { | ||
78 | - struct xlx_pic *p = opaque; | ||
79 | + XpsIntc *p = opaque; | ||
80 | |||
81 | /* edge triggered interrupt */ | ||
82 | if (p->c_kind_of_intr & (1 << irq) && p->regs[R_MER] & 2) { | ||
83 | @@ -XXX,XX +XXX,XX @@ static void irq_handler(void *opaque, int irq, int level) | ||
84 | |||
85 | static void xilinx_intc_init(Object *obj) | ||
86 | { | ||
87 | - struct xlx_pic *p = XILINX_INTC(obj); | ||
88 | + XpsIntc *p = XILINX_INTC(obj); | ||
89 | |||
90 | qdev_init_gpio_in(DEVICE(obj), irq_handler, 32); | ||
91 | sysbus_init_irq(SYS_BUS_DEVICE(obj), &p->parent_irq); | ||
92 | @@ -XXX,XX +XXX,XX @@ static void xilinx_intc_init(Object *obj) | ||
55 | } | 93 | } |
56 | 94 | ||
57 | static gen_helper_gvec_3 * const tbx_fns[4] = { | 95 | static Property xilinx_intc_properties[] = { |
58 | @@ -XXX,XX +XXX,XX @@ static bool trans_DOT_zzzz(DisasContext *s, arg_DOT_zzzz *a) | 96 | - DEFINE_PROP_UINT32("kind-of-intr", struct xlx_pic, c_kind_of_intr, 0), |
59 | { gen_helper_gvec_sdot_b, gen_helper_gvec_sdot_h }, | 97 | + DEFINE_PROP_UINT32("kind-of-intr", XpsIntc, c_kind_of_intr, 0), |
60 | { gen_helper_gvec_udot_b, gen_helper_gvec_udot_h } | 98 | DEFINE_PROP_END_OF_LIST(), |
61 | }; | 99 | }; |
62 | - | 100 | |
63 | - if (sve_access_check(s)) { | 101 | @@ -XXX,XX +XXX,XX @@ static void xilinx_intc_class_init(ObjectClass *klass, void *data) |
64 | - gen_gvec_ool_zzzz(s, fns[a->u][a->sz], a->rd, a->rn, a->rm, a->ra, 0); | 102 | static const TypeInfo xilinx_intc_info = { |
65 | - } | 103 | .name = TYPE_XILINX_INTC, |
66 | - return true; | 104 | .parent = TYPE_SYS_BUS_DEVICE, |
67 | + return gen_gvec_ool_zzzz(s, fns[a->u][a->sz], | 105 | - .instance_size = sizeof(struct xlx_pic), |
68 | + a->rd, a->rn, a->rm, a->ra, 0); | 106 | + .instance_size = sizeof(XpsIntc), |
69 | } | 107 | .instance_init = xilinx_intc_init, |
70 | 108 | .class_init = xilinx_intc_class_init, | |
71 | /* | 109 | }; |
72 | @@ -XXX,XX +XXX,XX @@ static bool trans_DOT_zzzz(DisasContext *s, arg_DOT_zzzz *a) | ||
73 | static bool do_zzxz_ool(DisasContext *s, arg_rrxr_esz *a, | ||
74 | gen_helper_gvec_4 *fn) | ||
75 | { | ||
76 | - if (fn == NULL) { | ||
77 | - return false; | ||
78 | - } | ||
79 | - if (sve_access_check(s)) { | ||
80 | - gen_gvec_ool_zzzz(s, fn, a->rd, a->rn, a->rm, a->ra, a->index); | ||
81 | - } | ||
82 | - return true; | ||
83 | + return gen_gvec_ool_zzzz(s, fn, a->rd, a->rn, a->rm, a->ra, a->index); | ||
84 | } | ||
85 | |||
86 | #define DO_RRXR(NAME, FUNC) \ | ||
87 | @@ -XXX,XX +XXX,XX @@ static bool trans_SQCADD_rot270(DisasContext *s, arg_rrr_esz *a) | ||
88 | static bool do_sve2_zzzz_ool(DisasContext *s, arg_rrrr_esz *a, | ||
89 | gen_helper_gvec_4 *fn, int data) | ||
90 | { | ||
91 | - if (fn == NULL || !dc_isar_feature(aa64_sve2, s)) { | ||
92 | + if (!dc_isar_feature(aa64_sve2, s)) { | ||
93 | return false; | ||
94 | } | ||
95 | - if (sve_access_check(s)) { | ||
96 | - gen_gvec_ool_zzzz(s, fn, a->rd, a->rn, a->rm, a->ra, data); | ||
97 | - } | ||
98 | - return true; | ||
99 | + return gen_gvec_ool_zzzz(s, fn, a->rd, a->rn, a->rm, a->ra, data); | ||
100 | } | ||
101 | |||
102 | static bool do_abal(DisasContext *s, arg_rrrr_esz *a, bool uns, bool sel) | ||
103 | @@ -XXX,XX +XXX,XX @@ static bool trans_CMLA_zzzz(DisasContext *s, arg_CMLA_zzzz *a) | ||
104 | if (!dc_isar_feature(aa64_sve2, s)) { | ||
105 | return false; | ||
106 | } | ||
107 | - if (sve_access_check(s)) { | ||
108 | - gen_gvec_ool_zzzz(s, fns[a->esz], a->rd, a->rn, a->rm, a->ra, a->rot); | ||
109 | - } | ||
110 | - return true; | ||
111 | + return gen_gvec_ool_zzzz(s, fns[a->esz], a->rd, a->rn, | ||
112 | + a->rm, a->ra, a->rot); | ||
113 | } | ||
114 | |||
115 | static bool trans_CDOT_zzzz(DisasContext *s, arg_CMLA_zzzz *a) | ||
116 | { | ||
117 | - if (!dc_isar_feature(aa64_sve2, s) || a->esz < MO_32) { | ||
118 | + static gen_helper_gvec_4 * const fns[] = { | ||
119 | + NULL, NULL, gen_helper_sve2_cdot_zzzz_s, gen_helper_sve2_cdot_zzzz_d | ||
120 | + }; | ||
121 | + | ||
122 | + if (!dc_isar_feature(aa64_sve2, s)) { | ||
123 | return false; | ||
124 | } | ||
125 | - if (sve_access_check(s)) { | ||
126 | - gen_helper_gvec_4 *fn = (a->esz == MO_32 | ||
127 | - ? gen_helper_sve2_cdot_zzzz_s | ||
128 | - : gen_helper_sve2_cdot_zzzz_d); | ||
129 | - gen_gvec_ool_zzzz(s, fn, a->rd, a->rn, a->rm, a->ra, a->rot); | ||
130 | - } | ||
131 | - return true; | ||
132 | + return gen_gvec_ool_zzzz(s, fns[a->esz], a->rd, a->rn, | ||
133 | + a->rm, a->ra, a->rot); | ||
134 | } | ||
135 | |||
136 | static bool trans_SQRDCMLAH_zzzz(DisasContext *s, arg_SQRDCMLAH_zzzz *a) | ||
137 | @@ -XXX,XX +XXX,XX @@ static bool trans_SQRDCMLAH_zzzz(DisasContext *s, arg_SQRDCMLAH_zzzz *a) | ||
138 | if (!dc_isar_feature(aa64_sve2, s)) { | ||
139 | return false; | ||
140 | } | ||
141 | - if (sve_access_check(s)) { | ||
142 | - gen_gvec_ool_zzzz(s, fns[a->esz], a->rd, a->rn, a->rm, a->ra, a->rot); | ||
143 | - } | ||
144 | - return true; | ||
145 | + return gen_gvec_ool_zzzz(s, fns[a->esz], a->rd, a->rn, | ||
146 | + a->rm, a->ra, a->rot); | ||
147 | } | ||
148 | |||
149 | static bool trans_USDOT_zzzz(DisasContext *s, arg_USDOT_zzzz *a) | ||
150 | @@ -XXX,XX +XXX,XX @@ static bool do_i8mm_zzzz_ool(DisasContext *s, arg_rrrr_esz *a, | ||
151 | if (!dc_isar_feature(aa64_sve_i8mm, s)) { | ||
152 | return false; | ||
153 | } | ||
154 | - if (sve_access_check(s)) { | ||
155 | - gen_gvec_ool_zzzz(s, fn, a->rd, a->rn, a->rm, a->ra, data); | ||
156 | - } | ||
157 | - return true; | ||
158 | + return gen_gvec_ool_zzzz(s, fn, a->rd, a->rn, a->rm, a->ra, data); | ||
159 | } | ||
160 | |||
161 | static bool trans_SMMLA(DisasContext *s, arg_rrrr_esz *a) | ||
162 | @@ -XXX,XX +XXX,XX @@ static bool trans_BFDOT_zzzz(DisasContext *s, arg_rrrr_esz *a) | ||
163 | if (!dc_isar_feature(aa64_sve_bf16, s)) { | ||
164 | return false; | ||
165 | } | ||
166 | - if (sve_access_check(s)) { | ||
167 | - gen_gvec_ool_zzzz(s, gen_helper_gvec_bfdot, | ||
168 | - a->rd, a->rn, a->rm, a->ra, 0); | ||
169 | - } | ||
170 | - return true; | ||
171 | + return gen_gvec_ool_zzzz(s, gen_helper_gvec_bfdot, | ||
172 | + a->rd, a->rn, a->rm, a->ra, 0); | ||
173 | } | ||
174 | |||
175 | static bool trans_BFDOT_zzxz(DisasContext *s, arg_rrxr_esz *a) | ||
176 | @@ -XXX,XX +XXX,XX @@ static bool trans_BFDOT_zzxz(DisasContext *s, arg_rrxr_esz *a) | ||
177 | if (!dc_isar_feature(aa64_sve_bf16, s)) { | ||
178 | return false; | ||
179 | } | ||
180 | - if (sve_access_check(s)) { | ||
181 | - gen_gvec_ool_zzzz(s, gen_helper_gvec_bfdot_idx, | ||
182 | - a->rd, a->rn, a->rm, a->ra, a->index); | ||
183 | - } | ||
184 | - return true; | ||
185 | + return gen_gvec_ool_zzzz(s, gen_helper_gvec_bfdot_idx, | ||
186 | + a->rd, a->rn, a->rm, a->ra, a->index); | ||
187 | } | ||
188 | |||
189 | static bool trans_BFMMLA(DisasContext *s, arg_rrrr_esz *a) | ||
190 | @@ -XXX,XX +XXX,XX @@ static bool trans_BFMMLA(DisasContext *s, arg_rrrr_esz *a) | ||
191 | if (!dc_isar_feature(aa64_sve_bf16, s)) { | ||
192 | return false; | ||
193 | } | ||
194 | - if (sve_access_check(s)) { | ||
195 | - gen_gvec_ool_zzzz(s, gen_helper_gvec_bfmmla, | ||
196 | - a->rd, a->rn, a->rm, a->ra, 0); | ||
197 | - } | ||
198 | - return true; | ||
199 | + return gen_gvec_ool_zzzz(s, gen_helper_gvec_bfmmla, | ||
200 | + a->rd, a->rn, a->rm, a->ra, 0); | ||
201 | } | ||
202 | |||
203 | static bool do_BFMLAL_zzzw(DisasContext *s, arg_rrrr_esz *a, bool sel) | ||
204 | -- | 110 | -- |
205 | 2.25.1 | 111 | 2.34.1 |
112 | |||
113 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Philippe Mathieu-Daudé <philmd@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | Convert SVE translation functions using do_sve2_zzz_ool | 3 | This remove a use of 'struct' in the DECLARE_INSTANCE_CHECKER() |
4 | to use TRANS_FEAT and gen_gvec_ool_arg_zzz. | 4 | macro call, to avoid after a QOM refactor: |
5 | 5 | ||
6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 6 | hw/timer/xilinx_timer.c:65:1: error: declaration of anonymous struct must be a definition |
7 | Message-id: 20220527181907.189259-8-richard.henderson@linaro.org | 7 | DECLARE_INSTANCE_CHECKER(struct timerblock, XILINX_TIMER, |
8 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 8 | ^ |
9 | |||
10 | Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> | ||
11 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
12 | Reviewed-by: Edgar E. Iglesias <edgar@zeroasic.com> | ||
13 | Message-id: 20230109140306.23161-15-philmd@linaro.org | ||
9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 14 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
10 | --- | 15 | --- |
11 | target/arm/translate-sve.c | 88 ++++++++++++++------------------------ | 16 | hw/timer/xilinx_timer.c | 27 +++++++++++++-------------- |
12 | 1 file changed, 31 insertions(+), 57 deletions(-) | 17 | 1 file changed, 13 insertions(+), 14 deletions(-) |
13 | 18 | ||
14 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | 19 | diff --git a/hw/timer/xilinx_timer.c b/hw/timer/xilinx_timer.c |
15 | index XXXXXXX..XXXXXXX 100644 | 20 | index XXXXXXX..XXXXXXX 100644 |
16 | --- a/target/arm/translate-sve.c | 21 | --- a/hw/timer/xilinx_timer.c |
17 | +++ b/target/arm/translate-sve.c | 22 | +++ b/hw/timer/xilinx_timer.c |
18 | @@ -XXX,XX +XXX,XX @@ static bool trans_MUL_zzz(DisasContext *s, arg_rrr_esz *a) | 23 | @@ -XXX,XX +XXX,XX @@ struct xlx_timer |
19 | return true; | 24 | }; |
25 | |||
26 | #define TYPE_XILINX_TIMER "xlnx.xps-timer" | ||
27 | -DECLARE_INSTANCE_CHECKER(struct timerblock, XILINX_TIMER, | ||
28 | - TYPE_XILINX_TIMER) | ||
29 | +typedef struct XpsTimerState XpsTimerState; | ||
30 | +DECLARE_INSTANCE_CHECKER(XpsTimerState, XILINX_TIMER, TYPE_XILINX_TIMER) | ||
31 | |||
32 | -struct timerblock | ||
33 | +struct XpsTimerState | ||
34 | { | ||
35 | SysBusDevice parent_obj; | ||
36 | |||
37 | @@ -XXX,XX +XXX,XX @@ struct timerblock | ||
38 | struct xlx_timer *timers; | ||
39 | }; | ||
40 | |||
41 | -static inline unsigned int num_timers(struct timerblock *t) | ||
42 | +static inline unsigned int num_timers(XpsTimerState *t) | ||
43 | { | ||
44 | return 2 - t->one_timer_only; | ||
20 | } | 45 | } |
21 | 46 | @@ -XXX,XX +XXX,XX @@ static inline unsigned int timer_from_addr(hwaddr addr) | |
22 | -static bool do_sve2_zzz_ool(DisasContext *s, arg_rrr_esz *a, | 47 | return addr >> 2; |
23 | - gen_helper_gvec_3 *fn) | ||
24 | -{ | ||
25 | - if (!dc_isar_feature(aa64_sve2, s)) { | ||
26 | - return false; | ||
27 | - } | ||
28 | - return gen_gvec_ool_arg_zzz(s, fn, a, 0); | ||
29 | -} | ||
30 | +static gen_helper_gvec_3 * const smulh_zzz_fns[4] = { | ||
31 | + gen_helper_gvec_smulh_b, gen_helper_gvec_smulh_h, | ||
32 | + gen_helper_gvec_smulh_s, gen_helper_gvec_smulh_d, | ||
33 | +}; | ||
34 | +TRANS_FEAT(SMULH_zzz, aa64_sve2, gen_gvec_ool_arg_zzz, | ||
35 | + smulh_zzz_fns[a->esz], a, 0) | ||
36 | |||
37 | -static bool trans_SMULH_zzz(DisasContext *s, arg_rrr_esz *a) | ||
38 | -{ | ||
39 | - static gen_helper_gvec_3 * const fns[4] = { | ||
40 | - gen_helper_gvec_smulh_b, gen_helper_gvec_smulh_h, | ||
41 | - gen_helper_gvec_smulh_s, gen_helper_gvec_smulh_d, | ||
42 | - }; | ||
43 | - return do_sve2_zzz_ool(s, a, fns[a->esz]); | ||
44 | -} | ||
45 | +static gen_helper_gvec_3 * const umulh_zzz_fns[4] = { | ||
46 | + gen_helper_gvec_umulh_b, gen_helper_gvec_umulh_h, | ||
47 | + gen_helper_gvec_umulh_s, gen_helper_gvec_umulh_d, | ||
48 | +}; | ||
49 | +TRANS_FEAT(UMULH_zzz, aa64_sve2, gen_gvec_ool_arg_zzz, | ||
50 | + umulh_zzz_fns[a->esz], a, 0) | ||
51 | |||
52 | -static bool trans_UMULH_zzz(DisasContext *s, arg_rrr_esz *a) | ||
53 | -{ | ||
54 | - static gen_helper_gvec_3 * const fns[4] = { | ||
55 | - gen_helper_gvec_umulh_b, gen_helper_gvec_umulh_h, | ||
56 | - gen_helper_gvec_umulh_s, gen_helper_gvec_umulh_d, | ||
57 | - }; | ||
58 | - return do_sve2_zzz_ool(s, a, fns[a->esz]); | ||
59 | -} | ||
60 | +TRANS_FEAT(PMUL_zzz, aa64_sve2, gen_gvec_ool_arg_zzz, | ||
61 | + gen_helper_gvec_pmul_b, a, 0) | ||
62 | |||
63 | -static bool trans_PMUL_zzz(DisasContext *s, arg_rrr_esz *a) | ||
64 | -{ | ||
65 | - return do_sve2_zzz_ool(s, a, gen_helper_gvec_pmul_b); | ||
66 | -} | ||
67 | +static gen_helper_gvec_3 * const sqdmulh_zzz_fns[4] = { | ||
68 | + gen_helper_sve2_sqdmulh_b, gen_helper_sve2_sqdmulh_h, | ||
69 | + gen_helper_sve2_sqdmulh_s, gen_helper_sve2_sqdmulh_d, | ||
70 | +}; | ||
71 | +TRANS_FEAT(SQDMULH_zzz, aa64_sve2, gen_gvec_ool_arg_zzz, | ||
72 | + sqdmulh_zzz_fns[a->esz], a, 0) | ||
73 | |||
74 | -static bool trans_SQDMULH_zzz(DisasContext *s, arg_rrr_esz *a) | ||
75 | -{ | ||
76 | - static gen_helper_gvec_3 * const fns[4] = { | ||
77 | - gen_helper_sve2_sqdmulh_b, gen_helper_sve2_sqdmulh_h, | ||
78 | - gen_helper_sve2_sqdmulh_s, gen_helper_sve2_sqdmulh_d, | ||
79 | - }; | ||
80 | - return do_sve2_zzz_ool(s, a, fns[a->esz]); | ||
81 | -} | ||
82 | - | ||
83 | -static bool trans_SQRDMULH_zzz(DisasContext *s, arg_rrr_esz *a) | ||
84 | -{ | ||
85 | - static gen_helper_gvec_3 * const fns[4] = { | ||
86 | - gen_helper_sve2_sqrdmulh_b, gen_helper_sve2_sqrdmulh_h, | ||
87 | - gen_helper_sve2_sqrdmulh_s, gen_helper_sve2_sqrdmulh_d, | ||
88 | - }; | ||
89 | - return do_sve2_zzz_ool(s, a, fns[a->esz]); | ||
90 | -} | ||
91 | +static gen_helper_gvec_3 * const sqrdmulh_zzz_fns[4] = { | ||
92 | + gen_helper_sve2_sqrdmulh_b, gen_helper_sve2_sqrdmulh_h, | ||
93 | + gen_helper_sve2_sqrdmulh_s, gen_helper_sve2_sqrdmulh_d, | ||
94 | +}; | ||
95 | +TRANS_FEAT(SQRDMULH_zzz, aa64_sve2, gen_gvec_ool_arg_zzz, | ||
96 | + sqrdmulh_zzz_fns[a->esz], a, 0) | ||
97 | |||
98 | /* | ||
99 | * SVE2 Integer - Predicated | ||
100 | @@ -XXX,XX +XXX,XX @@ static bool trans_UQRSHRNT(DisasContext *s, arg_rri_esz *a) | ||
101 | } | 48 | } |
102 | 49 | ||
103 | #define DO_SVE2_ZZZ_NARROW(NAME, name) \ | 50 | -static void timer_update_irq(struct timerblock *t) |
104 | -static bool trans_##NAME(DisasContext *s, arg_rrr_esz *a) \ | 51 | +static void timer_update_irq(XpsTimerState *t) |
105 | -{ \ | 52 | { |
106 | - static gen_helper_gvec_3 * const fns[4] = { \ | 53 | unsigned int i, irq = 0; |
107 | + static gen_helper_gvec_3 * const name##_fns[4] = { \ | 54 | uint32_t csr; |
108 | NULL, gen_helper_sve2_##name##_h, \ | 55 | @@ -XXX,XX +XXX,XX @@ static void timer_update_irq(struct timerblock *t) |
109 | gen_helper_sve2_##name##_s, gen_helper_sve2_##name##_d, \ | 56 | static uint64_t |
110 | }; \ | 57 | timer_read(void *opaque, hwaddr addr, unsigned int size) |
111 | - return do_sve2_zzz_ool(s, a, fns[a->esz]); \ | 58 | { |
112 | -} | 59 | - struct timerblock *t = opaque; |
113 | + TRANS_FEAT(NAME, aa64_sve2, gen_gvec_ool_arg_zzz, \ | 60 | + XpsTimerState *t = opaque; |
114 | + name##_fns[a->esz], a, 0) | 61 | struct xlx_timer *xt; |
115 | 62 | uint32_t r = 0; | |
116 | DO_SVE2_ZZZ_NARROW(ADDHNB, addhnb) | 63 | unsigned int timer; |
117 | DO_SVE2_ZZZ_NARROW(ADDHNT, addhnt) | 64 | @@ -XXX,XX +XXX,XX @@ static void |
118 | @@ -XXX,XX +XXX,XX @@ static bool trans_HISTCNT(DisasContext *s, arg_rprr_esz *a) | 65 | timer_write(void *opaque, hwaddr addr, |
119 | return do_sve2_zpzz_ool(s, a, fns[a->esz - 2]); | 66 | uint64_t val64, unsigned int size) |
67 | { | ||
68 | - struct timerblock *t = opaque; | ||
69 | + XpsTimerState *t = opaque; | ||
70 | struct xlx_timer *xt; | ||
71 | unsigned int timer; | ||
72 | uint32_t value = val64; | ||
73 | @@ -XXX,XX +XXX,XX @@ static const MemoryRegionOps timer_ops = { | ||
74 | static void timer_hit(void *opaque) | ||
75 | { | ||
76 | struct xlx_timer *xt = opaque; | ||
77 | - struct timerblock *t = xt->parent; | ||
78 | + XpsTimerState *t = xt->parent; | ||
79 | D(fprintf(stderr, "%s %d\n", __func__, xt->nr)); | ||
80 | xt->regs[R_TCSR] |= TCSR_TINT; | ||
81 | |||
82 | @@ -XXX,XX +XXX,XX @@ static void timer_hit(void *opaque) | ||
83 | |||
84 | static void xilinx_timer_realize(DeviceState *dev, Error **errp) | ||
85 | { | ||
86 | - struct timerblock *t = XILINX_TIMER(dev); | ||
87 | + XpsTimerState *t = XILINX_TIMER(dev); | ||
88 | unsigned int i; | ||
89 | |||
90 | /* Init all the ptimers. */ | ||
91 | @@ -XXX,XX +XXX,XX @@ static void xilinx_timer_realize(DeviceState *dev, Error **errp) | ||
92 | |||
93 | static void xilinx_timer_init(Object *obj) | ||
94 | { | ||
95 | - struct timerblock *t = XILINX_TIMER(obj); | ||
96 | + XpsTimerState *t = XILINX_TIMER(obj); | ||
97 | |||
98 | /* All timers share a single irq line. */ | ||
99 | sysbus_init_irq(SYS_BUS_DEVICE(obj), &t->irq); | ||
120 | } | 100 | } |
121 | 101 | ||
122 | -static bool trans_HISTSEG(DisasContext *s, arg_rrr_esz *a) | 102 | static Property xilinx_timer_properties[] = { |
123 | -{ | 103 | - DEFINE_PROP_UINT32("clock-frequency", struct timerblock, freq_hz, |
124 | - if (a->esz != 0) { | 104 | - 62 * 1000000), |
125 | - return false; | 105 | - DEFINE_PROP_UINT8("one-timer-only", struct timerblock, one_timer_only, 0), |
126 | - } | 106 | + DEFINE_PROP_UINT32("clock-frequency", XpsTimerState, freq_hz, 62 * 1000000), |
127 | - return do_sve2_zzz_ool(s, a, gen_helper_sve2_histseg); | 107 | + DEFINE_PROP_UINT8("one-timer-only", XpsTimerState, one_timer_only, 0), |
128 | -} | 108 | DEFINE_PROP_END_OF_LIST(), |
129 | +TRANS_FEAT(HISTSEG, aa64_sve2, gen_gvec_ool_arg_zzz, | 109 | }; |
130 | + a->esz == 0 ? gen_helper_sve2_histseg : NULL, a, 0) | 110 | |
131 | 111 | @@ -XXX,XX +XXX,XX @@ static void xilinx_timer_class_init(ObjectClass *klass, void *data) | |
132 | static bool do_sve2_zpzz_fp(DisasContext *s, arg_rprr_esz *a, | 112 | static const TypeInfo xilinx_timer_info = { |
133 | gen_helper_gvec_4_ptr *fn) | 113 | .name = TYPE_XILINX_TIMER, |
114 | .parent = TYPE_SYS_BUS_DEVICE, | ||
115 | - .instance_size = sizeof(struct timerblock), | ||
116 | + .instance_size = sizeof(XpsTimerState), | ||
117 | .instance_init = xilinx_timer_init, | ||
118 | .class_init = xilinx_timer_class_init, | ||
119 | }; | ||
134 | -- | 120 | -- |
135 | 2.25.1 | 121 | 2.34.1 |
122 | |||
123 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Convert SVE translation functions directly using | ||
4 | gen_gvec_ool_zzzz to TRANS_FEAT. | ||
5 | |||
6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
7 | Message-id: 20220527181907.189259-10-richard.henderson@linaro.org | ||
8 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
10 | --- | ||
11 | target/arm/translate-sve.c | 89 +++++++++++++------------------------- | ||
12 | 1 file changed, 29 insertions(+), 60 deletions(-) | ||
13 | |||
14 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
15 | index XXXXXXX..XXXXXXX 100644 | ||
16 | --- a/target/arm/translate-sve.c | ||
17 | +++ b/target/arm/translate-sve.c | ||
18 | @@ -XXX,XX +XXX,XX @@ static gen_helper_gvec_3 * const sve_tbl_fns[4] = { | ||
19 | }; | ||
20 | TRANS_FEAT(TBL, aa64_sve, gen_gvec_ool_arg_zzz, sve_tbl_fns[a->esz], a, 0) | ||
21 | |||
22 | -static bool trans_TBL_sve2(DisasContext *s, arg_rrr_esz *a) | ||
23 | -{ | ||
24 | - static gen_helper_gvec_4 * const fns[4] = { | ||
25 | - gen_helper_sve2_tbl_b, gen_helper_sve2_tbl_h, | ||
26 | - gen_helper_sve2_tbl_s, gen_helper_sve2_tbl_d | ||
27 | - }; | ||
28 | - | ||
29 | - if (!dc_isar_feature(aa64_sve2, s)) { | ||
30 | - return false; | ||
31 | - } | ||
32 | - return gen_gvec_ool_zzzz(s, fns[a->esz], a->rd, a->rn, | ||
33 | - (a->rn + 1) % 32, a->rm, 0); | ||
34 | -} | ||
35 | +static gen_helper_gvec_4 * const sve2_tbl_fns[4] = { | ||
36 | + gen_helper_sve2_tbl_b, gen_helper_sve2_tbl_h, | ||
37 | + gen_helper_sve2_tbl_s, gen_helper_sve2_tbl_d | ||
38 | +}; | ||
39 | +TRANS_FEAT(TBL_sve2, aa64_sve2, gen_gvec_ool_zzzz, sve2_tbl_fns[a->esz], | ||
40 | + a->rd, a->rn, (a->rn + 1) % 32, a->rm, 0) | ||
41 | |||
42 | static gen_helper_gvec_3 * const tbx_fns[4] = { | ||
43 | gen_helper_sve2_tbx_b, gen_helper_sve2_tbx_h, | ||
44 | @@ -XXX,XX +XXX,XX @@ DO_ZZI(UMIN, umin) | ||
45 | |||
46 | #undef DO_ZZI | ||
47 | |||
48 | -static bool trans_DOT_zzzz(DisasContext *s, arg_DOT_zzzz *a) | ||
49 | -{ | ||
50 | - static gen_helper_gvec_4 * const fns[2][2] = { | ||
51 | - { gen_helper_gvec_sdot_b, gen_helper_gvec_sdot_h }, | ||
52 | - { gen_helper_gvec_udot_b, gen_helper_gvec_udot_h } | ||
53 | - }; | ||
54 | - return gen_gvec_ool_zzzz(s, fns[a->u][a->sz], | ||
55 | - a->rd, a->rn, a->rm, a->ra, 0); | ||
56 | -} | ||
57 | +static gen_helper_gvec_4 * const dot_fns[2][2] = { | ||
58 | + { gen_helper_gvec_sdot_b, gen_helper_gvec_sdot_h }, | ||
59 | + { gen_helper_gvec_udot_b, gen_helper_gvec_udot_h } | ||
60 | +}; | ||
61 | +TRANS_FEAT(DOT_zzzz, aa64_sve, gen_gvec_ool_zzzz, | ||
62 | + dot_fns[a->u][a->sz], a->rd, a->rn, a->rm, a->ra, 0) | ||
63 | |||
64 | /* | ||
65 | * SVE Multiply - Indexed | ||
66 | @@ -XXX,XX +XXX,XX @@ static bool trans_UMLSLT_zzzw(DisasContext *s, arg_rrrr_esz *a) | ||
67 | return do_umlsl_zzzw(s, a, true); | ||
68 | } | ||
69 | |||
70 | -static bool trans_CMLA_zzzz(DisasContext *s, arg_CMLA_zzzz *a) | ||
71 | -{ | ||
72 | - static gen_helper_gvec_4 * const fns[] = { | ||
73 | - gen_helper_sve2_cmla_zzzz_b, gen_helper_sve2_cmla_zzzz_h, | ||
74 | - gen_helper_sve2_cmla_zzzz_s, gen_helper_sve2_cmla_zzzz_d, | ||
75 | - }; | ||
76 | +static gen_helper_gvec_4 * const cmla_fns[] = { | ||
77 | + gen_helper_sve2_cmla_zzzz_b, gen_helper_sve2_cmla_zzzz_h, | ||
78 | + gen_helper_sve2_cmla_zzzz_s, gen_helper_sve2_cmla_zzzz_d, | ||
79 | +}; | ||
80 | +TRANS_FEAT(CMLA_zzzz, aa64_sve2, gen_gvec_ool_zzzz, | ||
81 | + cmla_fns[a->esz], a->rd, a->rn, a->rm, a->ra, a->rot) | ||
82 | |||
83 | - if (!dc_isar_feature(aa64_sve2, s)) { | ||
84 | - return false; | ||
85 | - } | ||
86 | - return gen_gvec_ool_zzzz(s, fns[a->esz], a->rd, a->rn, | ||
87 | - a->rm, a->ra, a->rot); | ||
88 | -} | ||
89 | +static gen_helper_gvec_4 * const cdot_fns[] = { | ||
90 | + NULL, NULL, gen_helper_sve2_cdot_zzzz_s, gen_helper_sve2_cdot_zzzz_d | ||
91 | +}; | ||
92 | +TRANS_FEAT(CDOT_zzzz, aa64_sve2, gen_gvec_ool_zzzz, | ||
93 | + cdot_fns[a->esz], a->rd, a->rn, a->rm, a->ra, a->rot) | ||
94 | |||
95 | -static bool trans_CDOT_zzzz(DisasContext *s, arg_CMLA_zzzz *a) | ||
96 | -{ | ||
97 | - static gen_helper_gvec_4 * const fns[] = { | ||
98 | - NULL, NULL, gen_helper_sve2_cdot_zzzz_s, gen_helper_sve2_cdot_zzzz_d | ||
99 | - }; | ||
100 | - | ||
101 | - if (!dc_isar_feature(aa64_sve2, s)) { | ||
102 | - return false; | ||
103 | - } | ||
104 | - return gen_gvec_ool_zzzz(s, fns[a->esz], a->rd, a->rn, | ||
105 | - a->rm, a->ra, a->rot); | ||
106 | -} | ||
107 | - | ||
108 | -static bool trans_SQRDCMLAH_zzzz(DisasContext *s, arg_SQRDCMLAH_zzzz *a) | ||
109 | -{ | ||
110 | - static gen_helper_gvec_4 * const fns[] = { | ||
111 | - gen_helper_sve2_sqrdcmlah_zzzz_b, gen_helper_sve2_sqrdcmlah_zzzz_h, | ||
112 | - gen_helper_sve2_sqrdcmlah_zzzz_s, gen_helper_sve2_sqrdcmlah_zzzz_d, | ||
113 | - }; | ||
114 | - | ||
115 | - if (!dc_isar_feature(aa64_sve2, s)) { | ||
116 | - return false; | ||
117 | - } | ||
118 | - return gen_gvec_ool_zzzz(s, fns[a->esz], a->rd, a->rn, | ||
119 | - a->rm, a->ra, a->rot); | ||
120 | -} | ||
121 | +static gen_helper_gvec_4 * const sqrdcmlah_fns[] = { | ||
122 | + gen_helper_sve2_sqrdcmlah_zzzz_b, gen_helper_sve2_sqrdcmlah_zzzz_h, | ||
123 | + gen_helper_sve2_sqrdcmlah_zzzz_s, gen_helper_sve2_sqrdcmlah_zzzz_d, | ||
124 | +}; | ||
125 | +TRANS_FEAT(SQRDCMLAH_zzzz, aa64_sve2, gen_gvec_ool_zzzz, | ||
126 | + sqrdcmlah_fns[a->esz], a->rd, a->rn, a->rm, a->ra, a->rot) | ||
127 | |||
128 | static bool trans_USDOT_zzzz(DisasContext *s, arg_USDOT_zzzz *a) | ||
129 | { | ||
130 | -- | ||
131 | 2.25.1 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Convert SVE translation functions directly using | ||
4 | gen_gvec_ool_arg_zzzz to TRANS_FEAT. | ||
5 | |||
6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
7 | Message-id: 20220527181907.189259-13-richard.henderson@linaro.org | ||
8 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
10 | --- | ||
11 | target/arm/translate-sve.c | 47 ++++++++------------------------------ | ||
12 | 1 file changed, 10 insertions(+), 37 deletions(-) | ||
13 | |||
14 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
15 | index XXXXXXX..XXXXXXX 100644 | ||
16 | --- a/target/arm/translate-sve.c | ||
17 | +++ b/target/arm/translate-sve.c | ||
18 | @@ -XXX,XX +XXX,XX @@ static bool trans_FMLSLT_zzxw(DisasContext *s, arg_rrxr_esz *a) | ||
19 | return do_FMLAL_zzxw(s, a, true, true); | ||
20 | } | ||
21 | |||
22 | -static bool do_i8mm_zzzz_ool(DisasContext *s, arg_rrrr_esz *a, | ||
23 | - gen_helper_gvec_4 *fn, int data) | ||
24 | -{ | ||
25 | - if (!dc_isar_feature(aa64_sve_i8mm, s)) { | ||
26 | - return false; | ||
27 | - } | ||
28 | - return gen_gvec_ool_arg_zzzz(s, fn, a, data); | ||
29 | -} | ||
30 | +TRANS_FEAT(SMMLA, aa64_sve_i8mm, gen_gvec_ool_arg_zzzz, | ||
31 | + gen_helper_gvec_smmla_b, a, 0) | ||
32 | +TRANS_FEAT(USMMLA, aa64_sve_i8mm, gen_gvec_ool_arg_zzzz, | ||
33 | + gen_helper_gvec_usmmla_b, a, 0) | ||
34 | +TRANS_FEAT(UMMLA, aa64_sve_i8mm, gen_gvec_ool_arg_zzzz, | ||
35 | + gen_helper_gvec_ummla_b, a, 0) | ||
36 | |||
37 | -static bool trans_SMMLA(DisasContext *s, arg_rrrr_esz *a) | ||
38 | -{ | ||
39 | - return do_i8mm_zzzz_ool(s, a, gen_helper_gvec_smmla_b, 0); | ||
40 | -} | ||
41 | - | ||
42 | -static bool trans_USMMLA(DisasContext *s, arg_rrrr_esz *a) | ||
43 | -{ | ||
44 | - return do_i8mm_zzzz_ool(s, a, gen_helper_gvec_usmmla_b, 0); | ||
45 | -} | ||
46 | - | ||
47 | -static bool trans_UMMLA(DisasContext *s, arg_rrrr_esz *a) | ||
48 | -{ | ||
49 | - return do_i8mm_zzzz_ool(s, a, gen_helper_gvec_ummla_b, 0); | ||
50 | -} | ||
51 | - | ||
52 | -static bool trans_BFDOT_zzzz(DisasContext *s, arg_rrrr_esz *a) | ||
53 | -{ | ||
54 | - if (!dc_isar_feature(aa64_sve_bf16, s)) { | ||
55 | - return false; | ||
56 | - } | ||
57 | - return gen_gvec_ool_arg_zzzz(s, gen_helper_gvec_bfdot, a, 0); | ||
58 | -} | ||
59 | +TRANS_FEAT(BFDOT_zzzz, aa64_sve_bf16, gen_gvec_ool_arg_zzzz, | ||
60 | + gen_helper_gvec_bfdot, a, 0) | ||
61 | |||
62 | static bool trans_BFDOT_zzxz(DisasContext *s, arg_rrxr_esz *a) | ||
63 | { | ||
64 | @@ -XXX,XX +XXX,XX @@ static bool trans_BFDOT_zzxz(DisasContext *s, arg_rrxr_esz *a) | ||
65 | a->rd, a->rn, a->rm, a->ra, a->index); | ||
66 | } | ||
67 | |||
68 | -static bool trans_BFMMLA(DisasContext *s, arg_rrrr_esz *a) | ||
69 | -{ | ||
70 | - if (!dc_isar_feature(aa64_sve_bf16, s)) { | ||
71 | - return false; | ||
72 | - } | ||
73 | - return gen_gvec_ool_arg_zzzz(s, gen_helper_gvec_bfmmla, a, 0); | ||
74 | -} | ||
75 | +TRANS_FEAT(BFMMLA, aa64_sve_bf16, gen_gvec_ool_arg_zzzz, | ||
76 | + gen_helper_gvec_bfmmla, a, 0) | ||
77 | |||
78 | static bool do_BFMLAL_zzzw(DisasContext *s, arg_rrrr_esz *a, bool sel) | ||
79 | { | ||
80 | -- | ||
81 | 2.25.1 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Rename the function to match gen_gvec_ool_arg_zzzz, | ||
4 | and move to be adjacent. | ||
5 | |||
6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
7 | Message-id: 20220527181907.189259-14-richard.henderson@linaro.org | ||
8 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
10 | --- | ||
11 | target/arm/translate-sve.c | 18 +++++++++--------- | ||
12 | 1 file changed, 9 insertions(+), 9 deletions(-) | ||
13 | |||
14 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
15 | index XXXXXXX..XXXXXXX 100644 | ||
16 | --- a/target/arm/translate-sve.c | ||
17 | +++ b/target/arm/translate-sve.c | ||
18 | @@ -XXX,XX +XXX,XX @@ static bool gen_gvec_ool_arg_zzzz(DisasContext *s, gen_helper_gvec_4 *fn, | ||
19 | return gen_gvec_ool_zzzz(s, fn, a->rd, a->rn, a->rm, a->ra, data); | ||
20 | } | ||
21 | |||
22 | +static bool gen_gvec_ool_arg_zzxz(DisasContext *s, gen_helper_gvec_4 *fn, | ||
23 | + arg_rrxr_esz *a) | ||
24 | +{ | ||
25 | + return gen_gvec_ool_zzzz(s, fn, a->rd, a->rn, a->rm, a->ra, a->index); | ||
26 | +} | ||
27 | + | ||
28 | /* Invoke an out-of-line helper on 2 Zregs and a predicate. */ | ||
29 | static void gen_gvec_ool_zzp(DisasContext *s, gen_helper_gvec_3 *fn, | ||
30 | int rd, int rn, int pg, int data) | ||
31 | @@ -XXX,XX +XXX,XX @@ TRANS_FEAT(DOT_zzzz, aa64_sve, gen_gvec_ool_zzzz, | ||
32 | * SVE Multiply - Indexed | ||
33 | */ | ||
34 | |||
35 | -static bool do_zzxz_ool(DisasContext *s, arg_rrxr_esz *a, | ||
36 | - gen_helper_gvec_4 *fn) | ||
37 | -{ | ||
38 | - return gen_gvec_ool_zzzz(s, fn, a->rd, a->rn, a->rm, a->ra, a->index); | ||
39 | -} | ||
40 | - | ||
41 | #define DO_RRXR(NAME, FUNC) \ | ||
42 | static bool NAME(DisasContext *s, arg_rrxr_esz *a) \ | ||
43 | - { return do_zzxz_ool(s, a, FUNC); } | ||
44 | + { return gen_gvec_ool_arg_zzxz(s, FUNC, a); } | ||
45 | |||
46 | DO_RRXR(trans_SDOT_zzxw_s, gen_helper_gvec_sdot_idx_b) | ||
47 | DO_RRXR(trans_SDOT_zzxw_d, gen_helper_gvec_sdot_idx_h) | ||
48 | @@ -XXX,XX +XXX,XX @@ static bool trans_SUDOT_zzxw_s(DisasContext *s, arg_rrxr_esz *a) | ||
49 | if (!dc_isar_feature(aa64_sve_i8mm, s)) { | ||
50 | return false; | ||
51 | } | ||
52 | - return do_zzxz_ool(s, a, gen_helper_gvec_sudot_idx_b); | ||
53 | + return gen_gvec_ool_arg_zzxz(s, gen_helper_gvec_sudot_idx_b, a); | ||
54 | } | ||
55 | |||
56 | static bool trans_USDOT_zzxw_s(DisasContext *s, arg_rrxr_esz *a) | ||
57 | @@ -XXX,XX +XXX,XX @@ static bool trans_USDOT_zzxw_s(DisasContext *s, arg_rrxr_esz *a) | ||
58 | if (!dc_isar_feature(aa64_sve_i8mm, s)) { | ||
59 | return false; | ||
60 | } | ||
61 | - return do_zzxz_ool(s, a, gen_helper_gvec_usdot_idx_b); | ||
62 | + return gen_gvec_ool_arg_zzxz(s, gen_helper_gvec_usdot_idx_b, a); | ||
63 | } | ||
64 | |||
65 | #undef DO_RRXR | ||
66 | -- | ||
67 | 2.25.1 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Convert SVE translation functions directly using | ||
4 | gen_gvec_ool_arg_zzxz to TRANS_FEAT. Also include | ||
5 | BFDOT_zzxz, which was using gen_gvec_ool_zzzz. | ||
6 | |||
7 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
8 | Message-id: 20220527181907.189259-15-richard.henderson@linaro.org | ||
9 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
11 | --- | ||
12 | target/arm/translate-sve.c | 48 +++++++++++--------------------------- | ||
13 | 1 file changed, 14 insertions(+), 34 deletions(-) | ||
14 | |||
15 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
16 | index XXXXXXX..XXXXXXX 100644 | ||
17 | --- a/target/arm/translate-sve.c | ||
18 | +++ b/target/arm/translate-sve.c | ||
19 | @@ -XXX,XX +XXX,XX @@ TRANS_FEAT(DOT_zzzz, aa64_sve, gen_gvec_ool_zzzz, | ||
20 | * SVE Multiply - Indexed | ||
21 | */ | ||
22 | |||
23 | -#define DO_RRXR(NAME, FUNC) \ | ||
24 | - static bool NAME(DisasContext *s, arg_rrxr_esz *a) \ | ||
25 | - { return gen_gvec_ool_arg_zzxz(s, FUNC, a); } | ||
26 | +TRANS_FEAT(SDOT_zzxw_s, aa64_sve, gen_gvec_ool_arg_zzxz, | ||
27 | + gen_helper_gvec_sdot_idx_b, a) | ||
28 | +TRANS_FEAT(SDOT_zzxw_d, aa64_sve, gen_gvec_ool_arg_zzxz, | ||
29 | + gen_helper_gvec_sdot_idx_h, a) | ||
30 | +TRANS_FEAT(UDOT_zzxw_s, aa64_sve, gen_gvec_ool_arg_zzxz, | ||
31 | + gen_helper_gvec_udot_idx_b, a) | ||
32 | +TRANS_FEAT(UDOT_zzxw_d, aa64_sve, gen_gvec_ool_arg_zzxz, | ||
33 | + gen_helper_gvec_udot_idx_h, a) | ||
34 | |||
35 | -DO_RRXR(trans_SDOT_zzxw_s, gen_helper_gvec_sdot_idx_b) | ||
36 | -DO_RRXR(trans_SDOT_zzxw_d, gen_helper_gvec_sdot_idx_h) | ||
37 | -DO_RRXR(trans_UDOT_zzxw_s, gen_helper_gvec_udot_idx_b) | ||
38 | -DO_RRXR(trans_UDOT_zzxw_d, gen_helper_gvec_udot_idx_h) | ||
39 | - | ||
40 | -static bool trans_SUDOT_zzxw_s(DisasContext *s, arg_rrxr_esz *a) | ||
41 | -{ | ||
42 | - if (!dc_isar_feature(aa64_sve_i8mm, s)) { | ||
43 | - return false; | ||
44 | - } | ||
45 | - return gen_gvec_ool_arg_zzxz(s, gen_helper_gvec_sudot_idx_b, a); | ||
46 | -} | ||
47 | - | ||
48 | -static bool trans_USDOT_zzxw_s(DisasContext *s, arg_rrxr_esz *a) | ||
49 | -{ | ||
50 | - if (!dc_isar_feature(aa64_sve_i8mm, s)) { | ||
51 | - return false; | ||
52 | - } | ||
53 | - return gen_gvec_ool_arg_zzxz(s, gen_helper_gvec_usdot_idx_b, a); | ||
54 | -} | ||
55 | - | ||
56 | -#undef DO_RRXR | ||
57 | +TRANS_FEAT(SUDOT_zzxw_s, aa64_sve_i8mm, gen_gvec_ool_arg_zzxz, | ||
58 | + gen_helper_gvec_sudot_idx_b, a) | ||
59 | +TRANS_FEAT(USDOT_zzxw_s, aa64_sve_i8mm, gen_gvec_ool_arg_zzxz, | ||
60 | + gen_helper_gvec_usdot_idx_b, a) | ||
61 | |||
62 | static bool do_sve2_zzz_data(DisasContext *s, int rd, int rn, int rm, int data, | ||
63 | gen_helper_gvec_3 *fn) | ||
64 | @@ -XXX,XX +XXX,XX @@ TRANS_FEAT(UMMLA, aa64_sve_i8mm, gen_gvec_ool_arg_zzzz, | ||
65 | |||
66 | TRANS_FEAT(BFDOT_zzzz, aa64_sve_bf16, gen_gvec_ool_arg_zzzz, | ||
67 | gen_helper_gvec_bfdot, a, 0) | ||
68 | - | ||
69 | -static bool trans_BFDOT_zzxz(DisasContext *s, arg_rrxr_esz *a) | ||
70 | -{ | ||
71 | - if (!dc_isar_feature(aa64_sve_bf16, s)) { | ||
72 | - return false; | ||
73 | - } | ||
74 | - return gen_gvec_ool_zzzz(s, gen_helper_gvec_bfdot_idx, | ||
75 | - a->rd, a->rn, a->rm, a->ra, a->index); | ||
76 | -} | ||
77 | +TRANS_FEAT(BFDOT_zzxz, aa64_sve_bf16, gen_gvec_ool_arg_zzxz, | ||
78 | + gen_helper_gvec_bfdot_idx, a) | ||
79 | |||
80 | TRANS_FEAT(BFMMLA, aa64_sve_bf16, gen_gvec_ool_arg_zzzz, | ||
81 | gen_helper_gvec_bfmmla, a, 0) | ||
82 | -- | ||
83 | 2.25.1 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Convert SVE translation functions using do_sve2_zzz_data | ||
4 | to use TRANS_FEAT and gen_gvec_ool_zzz. | ||
5 | |||
6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
7 | Message-id: 20220527181907.189259-16-richard.henderson@linaro.org | ||
8 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
10 | --- | ||
11 | target/arm/translate-sve.c | 69 ++++++++++++++------------------------ | ||
12 | 1 file changed, 25 insertions(+), 44 deletions(-) | ||
13 | |||
14 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
15 | index XXXXXXX..XXXXXXX 100644 | ||
16 | --- a/target/arm/translate-sve.c | ||
17 | +++ b/target/arm/translate-sve.c | ||
18 | @@ -XXX,XX +XXX,XX @@ TRANS_FEAT(SUDOT_zzxw_s, aa64_sve_i8mm, gen_gvec_ool_arg_zzxz, | ||
19 | TRANS_FEAT(USDOT_zzxw_s, aa64_sve_i8mm, gen_gvec_ool_arg_zzxz, | ||
20 | gen_helper_gvec_usdot_idx_b, a) | ||
21 | |||
22 | -static bool do_sve2_zzz_data(DisasContext *s, int rd, int rn, int rm, int data, | ||
23 | - gen_helper_gvec_3 *fn) | ||
24 | -{ | ||
25 | - if (fn == NULL || !dc_isar_feature(aa64_sve2, s)) { | ||
26 | - return false; | ||
27 | - } | ||
28 | - if (sve_access_check(s)) { | ||
29 | - unsigned vsz = vec_full_reg_size(s); | ||
30 | - tcg_gen_gvec_3_ool(vec_full_reg_offset(s, rd), | ||
31 | - vec_full_reg_offset(s, rn), | ||
32 | - vec_full_reg_offset(s, rm), | ||
33 | - vsz, vsz, data, fn); | ||
34 | - } | ||
35 | - return true; | ||
36 | -} | ||
37 | - | ||
38 | #define DO_SVE2_RRX(NAME, FUNC) \ | ||
39 | - static bool NAME(DisasContext *s, arg_rrx_esz *a) \ | ||
40 | - { return do_sve2_zzz_data(s, a->rd, a->rn, a->rm, a->index, FUNC); } | ||
41 | + TRANS_FEAT(NAME, aa64_sve, gen_gvec_ool_zzz, FUNC, \ | ||
42 | + a->rd, a->rn, a->rm, a->index) | ||
43 | |||
44 | -DO_SVE2_RRX(trans_MUL_zzx_h, gen_helper_gvec_mul_idx_h) | ||
45 | -DO_SVE2_RRX(trans_MUL_zzx_s, gen_helper_gvec_mul_idx_s) | ||
46 | -DO_SVE2_RRX(trans_MUL_zzx_d, gen_helper_gvec_mul_idx_d) | ||
47 | +DO_SVE2_RRX(MUL_zzx_h, gen_helper_gvec_mul_idx_h) | ||
48 | +DO_SVE2_RRX(MUL_zzx_s, gen_helper_gvec_mul_idx_s) | ||
49 | +DO_SVE2_RRX(MUL_zzx_d, gen_helper_gvec_mul_idx_d) | ||
50 | |||
51 | -DO_SVE2_RRX(trans_SQDMULH_zzx_h, gen_helper_sve2_sqdmulh_idx_h) | ||
52 | -DO_SVE2_RRX(trans_SQDMULH_zzx_s, gen_helper_sve2_sqdmulh_idx_s) | ||
53 | -DO_SVE2_RRX(trans_SQDMULH_zzx_d, gen_helper_sve2_sqdmulh_idx_d) | ||
54 | +DO_SVE2_RRX(SQDMULH_zzx_h, gen_helper_sve2_sqdmulh_idx_h) | ||
55 | +DO_SVE2_RRX(SQDMULH_zzx_s, gen_helper_sve2_sqdmulh_idx_s) | ||
56 | +DO_SVE2_RRX(SQDMULH_zzx_d, gen_helper_sve2_sqdmulh_idx_d) | ||
57 | |||
58 | -DO_SVE2_RRX(trans_SQRDMULH_zzx_h, gen_helper_sve2_sqrdmulh_idx_h) | ||
59 | -DO_SVE2_RRX(trans_SQRDMULH_zzx_s, gen_helper_sve2_sqrdmulh_idx_s) | ||
60 | -DO_SVE2_RRX(trans_SQRDMULH_zzx_d, gen_helper_sve2_sqrdmulh_idx_d) | ||
61 | +DO_SVE2_RRX(SQRDMULH_zzx_h, gen_helper_sve2_sqrdmulh_idx_h) | ||
62 | +DO_SVE2_RRX(SQRDMULH_zzx_s, gen_helper_sve2_sqrdmulh_idx_s) | ||
63 | +DO_SVE2_RRX(SQRDMULH_zzx_d, gen_helper_sve2_sqrdmulh_idx_d) | ||
64 | |||
65 | #undef DO_SVE2_RRX | ||
66 | |||
67 | #define DO_SVE2_RRX_TB(NAME, FUNC, TOP) \ | ||
68 | - static bool NAME(DisasContext *s, arg_rrx_esz *a) \ | ||
69 | - { \ | ||
70 | - return do_sve2_zzz_data(s, a->rd, a->rn, a->rm, \ | ||
71 | - (a->index << 1) | TOP, FUNC); \ | ||
72 | - } | ||
73 | + TRANS_FEAT(NAME, aa64_sve, gen_gvec_ool_zzz, FUNC, \ | ||
74 | + a->rd, a->rn, a->rm, (a->index << 1) | TOP) | ||
75 | |||
76 | -DO_SVE2_RRX_TB(trans_SQDMULLB_zzx_s, gen_helper_sve2_sqdmull_idx_s, false) | ||
77 | -DO_SVE2_RRX_TB(trans_SQDMULLB_zzx_d, gen_helper_sve2_sqdmull_idx_d, false) | ||
78 | -DO_SVE2_RRX_TB(trans_SQDMULLT_zzx_s, gen_helper_sve2_sqdmull_idx_s, true) | ||
79 | -DO_SVE2_RRX_TB(trans_SQDMULLT_zzx_d, gen_helper_sve2_sqdmull_idx_d, true) | ||
80 | +DO_SVE2_RRX_TB(SQDMULLB_zzx_s, gen_helper_sve2_sqdmull_idx_s, false) | ||
81 | +DO_SVE2_RRX_TB(SQDMULLB_zzx_d, gen_helper_sve2_sqdmull_idx_d, false) | ||
82 | +DO_SVE2_RRX_TB(SQDMULLT_zzx_s, gen_helper_sve2_sqdmull_idx_s, true) | ||
83 | +DO_SVE2_RRX_TB(SQDMULLT_zzx_d, gen_helper_sve2_sqdmull_idx_d, true) | ||
84 | |||
85 | -DO_SVE2_RRX_TB(trans_SMULLB_zzx_s, gen_helper_sve2_smull_idx_s, false) | ||
86 | -DO_SVE2_RRX_TB(trans_SMULLB_zzx_d, gen_helper_sve2_smull_idx_d, false) | ||
87 | -DO_SVE2_RRX_TB(trans_SMULLT_zzx_s, gen_helper_sve2_smull_idx_s, true) | ||
88 | -DO_SVE2_RRX_TB(trans_SMULLT_zzx_d, gen_helper_sve2_smull_idx_d, true) | ||
89 | +DO_SVE2_RRX_TB(SMULLB_zzx_s, gen_helper_sve2_smull_idx_s, false) | ||
90 | +DO_SVE2_RRX_TB(SMULLB_zzx_d, gen_helper_sve2_smull_idx_d, false) | ||
91 | +DO_SVE2_RRX_TB(SMULLT_zzx_s, gen_helper_sve2_smull_idx_s, true) | ||
92 | +DO_SVE2_RRX_TB(SMULLT_zzx_d, gen_helper_sve2_smull_idx_d, true) | ||
93 | |||
94 | -DO_SVE2_RRX_TB(trans_UMULLB_zzx_s, gen_helper_sve2_umull_idx_s, false) | ||
95 | -DO_SVE2_RRX_TB(trans_UMULLB_zzx_d, gen_helper_sve2_umull_idx_d, false) | ||
96 | -DO_SVE2_RRX_TB(trans_UMULLT_zzx_s, gen_helper_sve2_umull_idx_s, true) | ||
97 | -DO_SVE2_RRX_TB(trans_UMULLT_zzx_d, gen_helper_sve2_umull_idx_d, true) | ||
98 | +DO_SVE2_RRX_TB(UMULLB_zzx_s, gen_helper_sve2_umull_idx_s, false) | ||
99 | +DO_SVE2_RRX_TB(UMULLB_zzx_d, gen_helper_sve2_umull_idx_d, false) | ||
100 | +DO_SVE2_RRX_TB(UMULLT_zzx_s, gen_helper_sve2_umull_idx_s, true) | ||
101 | +DO_SVE2_RRX_TB(UMULLT_zzx_d, gen_helper_sve2_umull_idx_d, true) | ||
102 | |||
103 | #undef DO_SVE2_RRX_TB | ||
104 | |||
105 | -- | ||
106 | 2.25.1 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Convert SVE translation functions using do_sve2_zzzz_data | ||
4 | to use TRANS_FEAT and gen_gvec_ool_{zzzz,zzxz}. | ||
5 | |||
6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
7 | Message-id: 20220527181907.189259-17-richard.henderson@linaro.org | ||
8 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
10 | --- | ||
11 | target/arm/translate-sve.c | 106 ++++++++++++++----------------------- | ||
12 | 1 file changed, 41 insertions(+), 65 deletions(-) | ||
13 | |||
14 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
15 | index XXXXXXX..XXXXXXX 100644 | ||
16 | --- a/target/arm/translate-sve.c | ||
17 | +++ b/target/arm/translate-sve.c | ||
18 | @@ -XXX,XX +XXX,XX @@ DO_SVE2_RRX_TB(UMULLT_zzx_d, gen_helper_sve2_umull_idx_d, true) | ||
19 | |||
20 | #undef DO_SVE2_RRX_TB | ||
21 | |||
22 | -static bool do_sve2_zzzz_data(DisasContext *s, int rd, int rn, int rm, int ra, | ||
23 | - int data, gen_helper_gvec_4 *fn) | ||
24 | -{ | ||
25 | - if (fn == NULL || !dc_isar_feature(aa64_sve2, s)) { | ||
26 | - return false; | ||
27 | - } | ||
28 | - if (sve_access_check(s)) { | ||
29 | - unsigned vsz = vec_full_reg_size(s); | ||
30 | - tcg_gen_gvec_4_ool(vec_full_reg_offset(s, rd), | ||
31 | - vec_full_reg_offset(s, rn), | ||
32 | - vec_full_reg_offset(s, rm), | ||
33 | - vec_full_reg_offset(s, ra), | ||
34 | - vsz, vsz, data, fn); | ||
35 | - } | ||
36 | - return true; | ||
37 | -} | ||
38 | - | ||
39 | #define DO_SVE2_RRXR(NAME, FUNC) \ | ||
40 | - static bool NAME(DisasContext *s, arg_rrxr_esz *a) \ | ||
41 | - { return do_sve2_zzzz_data(s, a->rd, a->rn, a->rm, a->ra, a->index, FUNC); } | ||
42 | + TRANS_FEAT(NAME, aa64_sve2, gen_gvec_ool_arg_zzxz, FUNC, a) | ||
43 | |||
44 | -DO_SVE2_RRXR(trans_MLA_zzxz_h, gen_helper_gvec_mla_idx_h) | ||
45 | -DO_SVE2_RRXR(trans_MLA_zzxz_s, gen_helper_gvec_mla_idx_s) | ||
46 | -DO_SVE2_RRXR(trans_MLA_zzxz_d, gen_helper_gvec_mla_idx_d) | ||
47 | +DO_SVE2_RRXR(MLA_zzxz_h, gen_helper_gvec_mla_idx_h) | ||
48 | +DO_SVE2_RRXR(MLA_zzxz_s, gen_helper_gvec_mla_idx_s) | ||
49 | +DO_SVE2_RRXR(MLA_zzxz_d, gen_helper_gvec_mla_idx_d) | ||
50 | |||
51 | -DO_SVE2_RRXR(trans_MLS_zzxz_h, gen_helper_gvec_mls_idx_h) | ||
52 | -DO_SVE2_RRXR(trans_MLS_zzxz_s, gen_helper_gvec_mls_idx_s) | ||
53 | -DO_SVE2_RRXR(trans_MLS_zzxz_d, gen_helper_gvec_mls_idx_d) | ||
54 | +DO_SVE2_RRXR(MLS_zzxz_h, gen_helper_gvec_mls_idx_h) | ||
55 | +DO_SVE2_RRXR(MLS_zzxz_s, gen_helper_gvec_mls_idx_s) | ||
56 | +DO_SVE2_RRXR(MLS_zzxz_d, gen_helper_gvec_mls_idx_d) | ||
57 | |||
58 | -DO_SVE2_RRXR(trans_SQRDMLAH_zzxz_h, gen_helper_sve2_sqrdmlah_idx_h) | ||
59 | -DO_SVE2_RRXR(trans_SQRDMLAH_zzxz_s, gen_helper_sve2_sqrdmlah_idx_s) | ||
60 | -DO_SVE2_RRXR(trans_SQRDMLAH_zzxz_d, gen_helper_sve2_sqrdmlah_idx_d) | ||
61 | +DO_SVE2_RRXR(SQRDMLAH_zzxz_h, gen_helper_sve2_sqrdmlah_idx_h) | ||
62 | +DO_SVE2_RRXR(SQRDMLAH_zzxz_s, gen_helper_sve2_sqrdmlah_idx_s) | ||
63 | +DO_SVE2_RRXR(SQRDMLAH_zzxz_d, gen_helper_sve2_sqrdmlah_idx_d) | ||
64 | |||
65 | -DO_SVE2_RRXR(trans_SQRDMLSH_zzxz_h, gen_helper_sve2_sqrdmlsh_idx_h) | ||
66 | -DO_SVE2_RRXR(trans_SQRDMLSH_zzxz_s, gen_helper_sve2_sqrdmlsh_idx_s) | ||
67 | -DO_SVE2_RRXR(trans_SQRDMLSH_zzxz_d, gen_helper_sve2_sqrdmlsh_idx_d) | ||
68 | +DO_SVE2_RRXR(SQRDMLSH_zzxz_h, gen_helper_sve2_sqrdmlsh_idx_h) | ||
69 | +DO_SVE2_RRXR(SQRDMLSH_zzxz_s, gen_helper_sve2_sqrdmlsh_idx_s) | ||
70 | +DO_SVE2_RRXR(SQRDMLSH_zzxz_d, gen_helper_sve2_sqrdmlsh_idx_d) | ||
71 | |||
72 | #undef DO_SVE2_RRXR | ||
73 | |||
74 | #define DO_SVE2_RRXR_TB(NAME, FUNC, TOP) \ | ||
75 | - static bool NAME(DisasContext *s, arg_rrxr_esz *a) \ | ||
76 | - { \ | ||
77 | - return do_sve2_zzzz_data(s, a->rd, a->rn, a->rm, a->rd, \ | ||
78 | - (a->index << 1) | TOP, FUNC); \ | ||
79 | - } | ||
80 | + TRANS_FEAT(NAME, aa64_sve2, gen_gvec_ool_zzzz, FUNC, \ | ||
81 | + a->rd, a->rn, a->rm, a->ra, (a->index << 1) | TOP) | ||
82 | |||
83 | -DO_SVE2_RRXR_TB(trans_SQDMLALB_zzxw_s, gen_helper_sve2_sqdmlal_idx_s, false) | ||
84 | -DO_SVE2_RRXR_TB(trans_SQDMLALB_zzxw_d, gen_helper_sve2_sqdmlal_idx_d, false) | ||
85 | -DO_SVE2_RRXR_TB(trans_SQDMLALT_zzxw_s, gen_helper_sve2_sqdmlal_idx_s, true) | ||
86 | -DO_SVE2_RRXR_TB(trans_SQDMLALT_zzxw_d, gen_helper_sve2_sqdmlal_idx_d, true) | ||
87 | +DO_SVE2_RRXR_TB(SQDMLALB_zzxw_s, gen_helper_sve2_sqdmlal_idx_s, false) | ||
88 | +DO_SVE2_RRXR_TB(SQDMLALB_zzxw_d, gen_helper_sve2_sqdmlal_idx_d, false) | ||
89 | +DO_SVE2_RRXR_TB(SQDMLALT_zzxw_s, gen_helper_sve2_sqdmlal_idx_s, true) | ||
90 | +DO_SVE2_RRXR_TB(SQDMLALT_zzxw_d, gen_helper_sve2_sqdmlal_idx_d, true) | ||
91 | |||
92 | -DO_SVE2_RRXR_TB(trans_SQDMLSLB_zzxw_s, gen_helper_sve2_sqdmlsl_idx_s, false) | ||
93 | -DO_SVE2_RRXR_TB(trans_SQDMLSLB_zzxw_d, gen_helper_sve2_sqdmlsl_idx_d, false) | ||
94 | -DO_SVE2_RRXR_TB(trans_SQDMLSLT_zzxw_s, gen_helper_sve2_sqdmlsl_idx_s, true) | ||
95 | -DO_SVE2_RRXR_TB(trans_SQDMLSLT_zzxw_d, gen_helper_sve2_sqdmlsl_idx_d, true) | ||
96 | +DO_SVE2_RRXR_TB(SQDMLSLB_zzxw_s, gen_helper_sve2_sqdmlsl_idx_s, false) | ||
97 | +DO_SVE2_RRXR_TB(SQDMLSLB_zzxw_d, gen_helper_sve2_sqdmlsl_idx_d, false) | ||
98 | +DO_SVE2_RRXR_TB(SQDMLSLT_zzxw_s, gen_helper_sve2_sqdmlsl_idx_s, true) | ||
99 | +DO_SVE2_RRXR_TB(SQDMLSLT_zzxw_d, gen_helper_sve2_sqdmlsl_idx_d, true) | ||
100 | |||
101 | -DO_SVE2_RRXR_TB(trans_SMLALB_zzxw_s, gen_helper_sve2_smlal_idx_s, false) | ||
102 | -DO_SVE2_RRXR_TB(trans_SMLALB_zzxw_d, gen_helper_sve2_smlal_idx_d, false) | ||
103 | -DO_SVE2_RRXR_TB(trans_SMLALT_zzxw_s, gen_helper_sve2_smlal_idx_s, true) | ||
104 | -DO_SVE2_RRXR_TB(trans_SMLALT_zzxw_d, gen_helper_sve2_smlal_idx_d, true) | ||
105 | +DO_SVE2_RRXR_TB(SMLALB_zzxw_s, gen_helper_sve2_smlal_idx_s, false) | ||
106 | +DO_SVE2_RRXR_TB(SMLALB_zzxw_d, gen_helper_sve2_smlal_idx_d, false) | ||
107 | +DO_SVE2_RRXR_TB(SMLALT_zzxw_s, gen_helper_sve2_smlal_idx_s, true) | ||
108 | +DO_SVE2_RRXR_TB(SMLALT_zzxw_d, gen_helper_sve2_smlal_idx_d, true) | ||
109 | |||
110 | -DO_SVE2_RRXR_TB(trans_UMLALB_zzxw_s, gen_helper_sve2_umlal_idx_s, false) | ||
111 | -DO_SVE2_RRXR_TB(trans_UMLALB_zzxw_d, gen_helper_sve2_umlal_idx_d, false) | ||
112 | -DO_SVE2_RRXR_TB(trans_UMLALT_zzxw_s, gen_helper_sve2_umlal_idx_s, true) | ||
113 | -DO_SVE2_RRXR_TB(trans_UMLALT_zzxw_d, gen_helper_sve2_umlal_idx_d, true) | ||
114 | +DO_SVE2_RRXR_TB(UMLALB_zzxw_s, gen_helper_sve2_umlal_idx_s, false) | ||
115 | +DO_SVE2_RRXR_TB(UMLALB_zzxw_d, gen_helper_sve2_umlal_idx_d, false) | ||
116 | +DO_SVE2_RRXR_TB(UMLALT_zzxw_s, gen_helper_sve2_umlal_idx_s, true) | ||
117 | +DO_SVE2_RRXR_TB(UMLALT_zzxw_d, gen_helper_sve2_umlal_idx_d, true) | ||
118 | |||
119 | -DO_SVE2_RRXR_TB(trans_SMLSLB_zzxw_s, gen_helper_sve2_smlsl_idx_s, false) | ||
120 | -DO_SVE2_RRXR_TB(trans_SMLSLB_zzxw_d, gen_helper_sve2_smlsl_idx_d, false) | ||
121 | -DO_SVE2_RRXR_TB(trans_SMLSLT_zzxw_s, gen_helper_sve2_smlsl_idx_s, true) | ||
122 | -DO_SVE2_RRXR_TB(trans_SMLSLT_zzxw_d, gen_helper_sve2_smlsl_idx_d, true) | ||
123 | +DO_SVE2_RRXR_TB(SMLSLB_zzxw_s, gen_helper_sve2_smlsl_idx_s, false) | ||
124 | +DO_SVE2_RRXR_TB(SMLSLB_zzxw_d, gen_helper_sve2_smlsl_idx_d, false) | ||
125 | +DO_SVE2_RRXR_TB(SMLSLT_zzxw_s, gen_helper_sve2_smlsl_idx_s, true) | ||
126 | +DO_SVE2_RRXR_TB(SMLSLT_zzxw_d, gen_helper_sve2_smlsl_idx_d, true) | ||
127 | |||
128 | -DO_SVE2_RRXR_TB(trans_UMLSLB_zzxw_s, gen_helper_sve2_umlsl_idx_s, false) | ||
129 | -DO_SVE2_RRXR_TB(trans_UMLSLB_zzxw_d, gen_helper_sve2_umlsl_idx_d, false) | ||
130 | -DO_SVE2_RRXR_TB(trans_UMLSLT_zzxw_s, gen_helper_sve2_umlsl_idx_s, true) | ||
131 | -DO_SVE2_RRXR_TB(trans_UMLSLT_zzxw_d, gen_helper_sve2_umlsl_idx_d, true) | ||
132 | +DO_SVE2_RRXR_TB(UMLSLB_zzxw_s, gen_helper_sve2_umlsl_idx_s, false) | ||
133 | +DO_SVE2_RRXR_TB(UMLSLB_zzxw_d, gen_helper_sve2_umlsl_idx_d, false) | ||
134 | +DO_SVE2_RRXR_TB(UMLSLT_zzxw_s, gen_helper_sve2_umlsl_idx_s, true) | ||
135 | +DO_SVE2_RRXR_TB(UMLSLT_zzxw_d, gen_helper_sve2_umlsl_idx_d, true) | ||
136 | |||
137 | #undef DO_SVE2_RRXR_TB | ||
138 | |||
139 | #define DO_SVE2_RRXR_ROT(NAME, FUNC) \ | ||
140 | - static bool trans_##NAME(DisasContext *s, arg_##NAME *a) \ | ||
141 | - { \ | ||
142 | - return do_sve2_zzzz_data(s, a->rd, a->rn, a->rm, a->ra, \ | ||
143 | - (a->index << 2) | a->rot, FUNC); \ | ||
144 | - } | ||
145 | + TRANS_FEAT(NAME, aa64_sve2, gen_gvec_ool_zzzz, FUNC, \ | ||
146 | + a->rd, a->rn, a->rm, a->ra, (a->index << 2) | a->rot) | ||
147 | |||
148 | DO_SVE2_RRXR_ROT(CMLA_zzxz_h, gen_helper_sve2_cmla_idx_h) | ||
149 | DO_SVE2_RRXR_ROT(CMLA_zzxz_s, gen_helper_sve2_cmla_idx_s) | ||
150 | -- | ||
151 | 2.25.1 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Convert SVE translation functions using do_sve2_zzw_data | ||
4 | to use TRANS_FEAT and gen_gvec_ool_arg_zzz. | ||
5 | |||
6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
7 | Message-id: 20220527181907.189259-18-richard.henderson@linaro.org | ||
8 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
10 | --- | ||
11 | target/arm/translate-sve.c | 297 ++++++++++++++++++------------------- | ||
12 | 1 file changed, 145 insertions(+), 152 deletions(-) | ||
13 | |||
14 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
15 | index XXXXXXX..XXXXXXX 100644 | ||
16 | --- a/target/arm/translate-sve.c | ||
17 | +++ b/target/arm/translate-sve.c | ||
18 | @@ -XXX,XX +XXX,XX @@ DO_SVE2_ZPZZ(USQADD, usqadd) | ||
19 | * SVE2 Widening Integer Arithmetic | ||
20 | */ | ||
21 | |||
22 | -static bool do_sve2_zzw_ool(DisasContext *s, arg_rrr_esz *a, | ||
23 | - gen_helper_gvec_3 *fn, int data) | ||
24 | -{ | ||
25 | - if (fn == NULL || !dc_isar_feature(aa64_sve2, s)) { | ||
26 | - return false; | ||
27 | - } | ||
28 | - if (sve_access_check(s)) { | ||
29 | - unsigned vsz = vec_full_reg_size(s); | ||
30 | - tcg_gen_gvec_3_ool(vec_full_reg_offset(s, a->rd), | ||
31 | - vec_full_reg_offset(s, a->rn), | ||
32 | - vec_full_reg_offset(s, a->rm), | ||
33 | - vsz, vsz, data, fn); | ||
34 | - } | ||
35 | - return true; | ||
36 | -} | ||
37 | +static gen_helper_gvec_3 * const saddl_fns[4] = { | ||
38 | + NULL, gen_helper_sve2_saddl_h, | ||
39 | + gen_helper_sve2_saddl_s, gen_helper_sve2_saddl_d, | ||
40 | +}; | ||
41 | +TRANS_FEAT(SADDLB, aa64_sve2, gen_gvec_ool_arg_zzz, | ||
42 | + saddl_fns[a->esz], a, 0) | ||
43 | +TRANS_FEAT(SADDLT, aa64_sve2, gen_gvec_ool_arg_zzz, | ||
44 | + saddl_fns[a->esz], a, 3) | ||
45 | +TRANS_FEAT(SADDLBT, aa64_sve2, gen_gvec_ool_arg_zzz, | ||
46 | + saddl_fns[a->esz], a, 2) | ||
47 | |||
48 | -#define DO_SVE2_ZZZ_TB(NAME, name, SEL1, SEL2) \ | ||
49 | -static bool trans_##NAME(DisasContext *s, arg_rrr_esz *a) \ | ||
50 | -{ \ | ||
51 | - static gen_helper_gvec_3 * const fns[4] = { \ | ||
52 | - NULL, gen_helper_sve2_##name##_h, \ | ||
53 | - gen_helper_sve2_##name##_s, gen_helper_sve2_##name##_d, \ | ||
54 | - }; \ | ||
55 | - return do_sve2_zzw_ool(s, a, fns[a->esz], (SEL2 << 1) | SEL1); \ | ||
56 | -} | ||
57 | +static gen_helper_gvec_3 * const ssubl_fns[4] = { | ||
58 | + NULL, gen_helper_sve2_ssubl_h, | ||
59 | + gen_helper_sve2_ssubl_s, gen_helper_sve2_ssubl_d, | ||
60 | +}; | ||
61 | +TRANS_FEAT(SSUBLB, aa64_sve2, gen_gvec_ool_arg_zzz, | ||
62 | + ssubl_fns[a->esz], a, 0) | ||
63 | +TRANS_FEAT(SSUBLT, aa64_sve2, gen_gvec_ool_arg_zzz, | ||
64 | + ssubl_fns[a->esz], a, 3) | ||
65 | +TRANS_FEAT(SSUBLBT, aa64_sve2, gen_gvec_ool_arg_zzz, | ||
66 | + ssubl_fns[a->esz], a, 2) | ||
67 | +TRANS_FEAT(SSUBLTB, aa64_sve2, gen_gvec_ool_arg_zzz, | ||
68 | + ssubl_fns[a->esz], a, 1) | ||
69 | |||
70 | -DO_SVE2_ZZZ_TB(SADDLB, saddl, false, false) | ||
71 | -DO_SVE2_ZZZ_TB(SSUBLB, ssubl, false, false) | ||
72 | -DO_SVE2_ZZZ_TB(SABDLB, sabdl, false, false) | ||
73 | +static gen_helper_gvec_3 * const sabdl_fns[4] = { | ||
74 | + NULL, gen_helper_sve2_sabdl_h, | ||
75 | + gen_helper_sve2_sabdl_s, gen_helper_sve2_sabdl_d, | ||
76 | +}; | ||
77 | +TRANS_FEAT(SABDLB, aa64_sve2, gen_gvec_ool_arg_zzz, | ||
78 | + sabdl_fns[a->esz], a, 0) | ||
79 | +TRANS_FEAT(SABDLT, aa64_sve2, gen_gvec_ool_arg_zzz, | ||
80 | + sabdl_fns[a->esz], a, 3) | ||
81 | |||
82 | -DO_SVE2_ZZZ_TB(UADDLB, uaddl, false, false) | ||
83 | -DO_SVE2_ZZZ_TB(USUBLB, usubl, false, false) | ||
84 | -DO_SVE2_ZZZ_TB(UABDLB, uabdl, false, false) | ||
85 | +static gen_helper_gvec_3 * const uaddl_fns[4] = { | ||
86 | + NULL, gen_helper_sve2_uaddl_h, | ||
87 | + gen_helper_sve2_uaddl_s, gen_helper_sve2_uaddl_d, | ||
88 | +}; | ||
89 | +TRANS_FEAT(UADDLB, aa64_sve2, gen_gvec_ool_arg_zzz, | ||
90 | + uaddl_fns[a->esz], a, 0) | ||
91 | +TRANS_FEAT(UADDLT, aa64_sve2, gen_gvec_ool_arg_zzz, | ||
92 | + uaddl_fns[a->esz], a, 3) | ||
93 | |||
94 | -DO_SVE2_ZZZ_TB(SADDLT, saddl, true, true) | ||
95 | -DO_SVE2_ZZZ_TB(SSUBLT, ssubl, true, true) | ||
96 | -DO_SVE2_ZZZ_TB(SABDLT, sabdl, true, true) | ||
97 | +static gen_helper_gvec_3 * const usubl_fns[4] = { | ||
98 | + NULL, gen_helper_sve2_usubl_h, | ||
99 | + gen_helper_sve2_usubl_s, gen_helper_sve2_usubl_d, | ||
100 | +}; | ||
101 | +TRANS_FEAT(USUBLB, aa64_sve2, gen_gvec_ool_arg_zzz, | ||
102 | + usubl_fns[a->esz], a, 0) | ||
103 | +TRANS_FEAT(USUBLT, aa64_sve2, gen_gvec_ool_arg_zzz, | ||
104 | + usubl_fns[a->esz], a, 3) | ||
105 | |||
106 | -DO_SVE2_ZZZ_TB(UADDLT, uaddl, true, true) | ||
107 | -DO_SVE2_ZZZ_TB(USUBLT, usubl, true, true) | ||
108 | -DO_SVE2_ZZZ_TB(UABDLT, uabdl, true, true) | ||
109 | +static gen_helper_gvec_3 * const uabdl_fns[4] = { | ||
110 | + NULL, gen_helper_sve2_uabdl_h, | ||
111 | + gen_helper_sve2_uabdl_s, gen_helper_sve2_uabdl_d, | ||
112 | +}; | ||
113 | +TRANS_FEAT(UABDLB, aa64_sve2, gen_gvec_ool_arg_zzz, | ||
114 | + uabdl_fns[a->esz], a, 0) | ||
115 | +TRANS_FEAT(UABDLT, aa64_sve2, gen_gvec_ool_arg_zzz, | ||
116 | + uabdl_fns[a->esz], a, 3) | ||
117 | |||
118 | -DO_SVE2_ZZZ_TB(SADDLBT, saddl, false, true) | ||
119 | -DO_SVE2_ZZZ_TB(SSUBLBT, ssubl, false, true) | ||
120 | -DO_SVE2_ZZZ_TB(SSUBLTB, ssubl, true, false) | ||
121 | +static gen_helper_gvec_3 * const sqdmull_fns[4] = { | ||
122 | + NULL, gen_helper_sve2_sqdmull_zzz_h, | ||
123 | + gen_helper_sve2_sqdmull_zzz_s, gen_helper_sve2_sqdmull_zzz_d, | ||
124 | +}; | ||
125 | +TRANS_FEAT(SQDMULLB_zzz, aa64_sve2, gen_gvec_ool_arg_zzz, | ||
126 | + sqdmull_fns[a->esz], a, 0) | ||
127 | +TRANS_FEAT(SQDMULLT_zzz, aa64_sve2, gen_gvec_ool_arg_zzz, | ||
128 | + sqdmull_fns[a->esz], a, 3) | ||
129 | |||
130 | -DO_SVE2_ZZZ_TB(SQDMULLB_zzz, sqdmull_zzz, false, false) | ||
131 | -DO_SVE2_ZZZ_TB(SQDMULLT_zzz, sqdmull_zzz, true, true) | ||
132 | +static gen_helper_gvec_3 * const smull_fns[4] = { | ||
133 | + NULL, gen_helper_sve2_smull_zzz_h, | ||
134 | + gen_helper_sve2_smull_zzz_s, gen_helper_sve2_smull_zzz_d, | ||
135 | +}; | ||
136 | +TRANS_FEAT(SMULLB_zzz, aa64_sve2, gen_gvec_ool_arg_zzz, | ||
137 | + smull_fns[a->esz], a, 0) | ||
138 | +TRANS_FEAT(SMULLT_zzz, aa64_sve2, gen_gvec_ool_arg_zzz, | ||
139 | + smull_fns[a->esz], a, 3) | ||
140 | |||
141 | -DO_SVE2_ZZZ_TB(SMULLB_zzz, smull_zzz, false, false) | ||
142 | -DO_SVE2_ZZZ_TB(SMULLT_zzz, smull_zzz, true, true) | ||
143 | +static gen_helper_gvec_3 * const umull_fns[4] = { | ||
144 | + NULL, gen_helper_sve2_umull_zzz_h, | ||
145 | + gen_helper_sve2_umull_zzz_s, gen_helper_sve2_umull_zzz_d, | ||
146 | +}; | ||
147 | +TRANS_FEAT(UMULLB_zzz, aa64_sve2, gen_gvec_ool_arg_zzz, | ||
148 | + umull_fns[a->esz], a, 0) | ||
149 | +TRANS_FEAT(UMULLT_zzz, aa64_sve2, gen_gvec_ool_arg_zzz, | ||
150 | + umull_fns[a->esz], a, 3) | ||
151 | |||
152 | -DO_SVE2_ZZZ_TB(UMULLB_zzz, umull_zzz, false, false) | ||
153 | -DO_SVE2_ZZZ_TB(UMULLT_zzz, umull_zzz, true, true) | ||
154 | - | ||
155 | -static bool do_eor_tb(DisasContext *s, arg_rrr_esz *a, bool sel1) | ||
156 | -{ | ||
157 | - static gen_helper_gvec_3 * const fns[4] = { | ||
158 | - gen_helper_sve2_eoril_b, gen_helper_sve2_eoril_h, | ||
159 | - gen_helper_sve2_eoril_s, gen_helper_sve2_eoril_d, | ||
160 | - }; | ||
161 | - return do_sve2_zzw_ool(s, a, fns[a->esz], (!sel1 << 1) | sel1); | ||
162 | -} | ||
163 | - | ||
164 | -static bool trans_EORBT(DisasContext *s, arg_rrr_esz *a) | ||
165 | -{ | ||
166 | - return do_eor_tb(s, a, false); | ||
167 | -} | ||
168 | - | ||
169 | -static bool trans_EORTB(DisasContext *s, arg_rrr_esz *a) | ||
170 | -{ | ||
171 | - return do_eor_tb(s, a, true); | ||
172 | -} | ||
173 | +static gen_helper_gvec_3 * const eoril_fns[4] = { | ||
174 | + gen_helper_sve2_eoril_b, gen_helper_sve2_eoril_h, | ||
175 | + gen_helper_sve2_eoril_s, gen_helper_sve2_eoril_d, | ||
176 | +}; | ||
177 | +TRANS_FEAT(EORBT, aa64_sve2, gen_gvec_ool_arg_zzz, eoril_fns[a->esz], a, 2) | ||
178 | +TRANS_FEAT(EORTB, aa64_sve2, gen_gvec_ool_arg_zzz, eoril_fns[a->esz], a, 1) | ||
179 | |||
180 | static bool do_trans_pmull(DisasContext *s, arg_rrr_esz *a, bool sel) | ||
181 | { | ||
182 | @@ -XXX,XX +XXX,XX @@ static bool do_trans_pmull(DisasContext *s, arg_rrr_esz *a, bool sel) | ||
183 | if (a->esz == 0 && !dc_isar_feature(aa64_sve2_pmull128, s)) { | ||
184 | return false; | ||
185 | } | ||
186 | - return do_sve2_zzw_ool(s, a, fns[a->esz], sel); | ||
187 | + return gen_gvec_ool_arg_zzz(s, fns[a->esz], a, sel); | ||
188 | } | ||
189 | |||
190 | -static bool trans_PMULLB(DisasContext *s, arg_rrr_esz *a) | ||
191 | -{ | ||
192 | - return do_trans_pmull(s, a, false); | ||
193 | -} | ||
194 | +TRANS_FEAT(PMULLB, aa64_sve2, do_trans_pmull, a, false) | ||
195 | +TRANS_FEAT(PMULLT, aa64_sve2, do_trans_pmull, a, true) | ||
196 | |||
197 | -static bool trans_PMULLT(DisasContext *s, arg_rrr_esz *a) | ||
198 | -{ | ||
199 | - return do_trans_pmull(s, a, true); | ||
200 | -} | ||
201 | +static gen_helper_gvec_3 * const saddw_fns[4] = { | ||
202 | + NULL, gen_helper_sve2_saddw_h, | ||
203 | + gen_helper_sve2_saddw_s, gen_helper_sve2_saddw_d, | ||
204 | +}; | ||
205 | +TRANS_FEAT(SADDWB, aa64_sve2, gen_gvec_ool_arg_zzz, saddw_fns[a->esz], a, 0) | ||
206 | +TRANS_FEAT(SADDWT, aa64_sve2, gen_gvec_ool_arg_zzz, saddw_fns[a->esz], a, 1) | ||
207 | |||
208 | -#define DO_SVE2_ZZZ_WTB(NAME, name, SEL2) \ | ||
209 | -static bool trans_##NAME(DisasContext *s, arg_rrr_esz *a) \ | ||
210 | -{ \ | ||
211 | - static gen_helper_gvec_3 * const fns[4] = { \ | ||
212 | - NULL, gen_helper_sve2_##name##_h, \ | ||
213 | - gen_helper_sve2_##name##_s, gen_helper_sve2_##name##_d, \ | ||
214 | - }; \ | ||
215 | - return do_sve2_zzw_ool(s, a, fns[a->esz], SEL2); \ | ||
216 | -} | ||
217 | +static gen_helper_gvec_3 * const ssubw_fns[4] = { | ||
218 | + NULL, gen_helper_sve2_ssubw_h, | ||
219 | + gen_helper_sve2_ssubw_s, gen_helper_sve2_ssubw_d, | ||
220 | +}; | ||
221 | +TRANS_FEAT(SSUBWB, aa64_sve2, gen_gvec_ool_arg_zzz, ssubw_fns[a->esz], a, 0) | ||
222 | +TRANS_FEAT(SSUBWT, aa64_sve2, gen_gvec_ool_arg_zzz, ssubw_fns[a->esz], a, 1) | ||
223 | |||
224 | -DO_SVE2_ZZZ_WTB(SADDWB, saddw, false) | ||
225 | -DO_SVE2_ZZZ_WTB(SADDWT, saddw, true) | ||
226 | -DO_SVE2_ZZZ_WTB(SSUBWB, ssubw, false) | ||
227 | -DO_SVE2_ZZZ_WTB(SSUBWT, ssubw, true) | ||
228 | +static gen_helper_gvec_3 * const uaddw_fns[4] = { | ||
229 | + NULL, gen_helper_sve2_uaddw_h, | ||
230 | + gen_helper_sve2_uaddw_s, gen_helper_sve2_uaddw_d, | ||
231 | +}; | ||
232 | +TRANS_FEAT(UADDWB, aa64_sve2, gen_gvec_ool_arg_zzz, uaddw_fns[a->esz], a, 0) | ||
233 | +TRANS_FEAT(UADDWT, aa64_sve2, gen_gvec_ool_arg_zzz, uaddw_fns[a->esz], a, 1) | ||
234 | |||
235 | -DO_SVE2_ZZZ_WTB(UADDWB, uaddw, false) | ||
236 | -DO_SVE2_ZZZ_WTB(UADDWT, uaddw, true) | ||
237 | -DO_SVE2_ZZZ_WTB(USUBWB, usubw, false) | ||
238 | -DO_SVE2_ZZZ_WTB(USUBWT, usubw, true) | ||
239 | +static gen_helper_gvec_3 * const usubw_fns[4] = { | ||
240 | + NULL, gen_helper_sve2_usubw_h, | ||
241 | + gen_helper_sve2_usubw_s, gen_helper_sve2_usubw_d, | ||
242 | +}; | ||
243 | +TRANS_FEAT(USUBWB, aa64_sve2, gen_gvec_ool_arg_zzz, usubw_fns[a->esz], a, 0) | ||
244 | +TRANS_FEAT(USUBWT, aa64_sve2, gen_gvec_ool_arg_zzz, usubw_fns[a->esz], a, 1) | ||
245 | |||
246 | static void gen_sshll_vec(unsigned vece, TCGv_vec d, TCGv_vec n, int64_t imm) | ||
247 | { | ||
248 | @@ -XXX,XX +XXX,XX @@ static bool trans_USHLLT(DisasContext *s, arg_rri_esz *a) | ||
249 | return do_sve2_shll_tb(s, a, true, true); | ||
250 | } | ||
251 | |||
252 | -static bool trans_BEXT(DisasContext *s, arg_rrr_esz *a) | ||
253 | -{ | ||
254 | - static gen_helper_gvec_3 * const fns[4] = { | ||
255 | - gen_helper_sve2_bext_b, gen_helper_sve2_bext_h, | ||
256 | - gen_helper_sve2_bext_s, gen_helper_sve2_bext_d, | ||
257 | - }; | ||
258 | - if (!dc_isar_feature(aa64_sve2_bitperm, s)) { | ||
259 | - return false; | ||
260 | - } | ||
261 | - return do_sve2_zzw_ool(s, a, fns[a->esz], 0); | ||
262 | -} | ||
263 | +static gen_helper_gvec_3 * const bext_fns[4] = { | ||
264 | + gen_helper_sve2_bext_b, gen_helper_sve2_bext_h, | ||
265 | + gen_helper_sve2_bext_s, gen_helper_sve2_bext_d, | ||
266 | +}; | ||
267 | +TRANS_FEAT(BEXT, aa64_sve2_bitperm, gen_gvec_ool_arg_zzz, | ||
268 | + bext_fns[a->esz], a, 0) | ||
269 | |||
270 | -static bool trans_BDEP(DisasContext *s, arg_rrr_esz *a) | ||
271 | -{ | ||
272 | - static gen_helper_gvec_3 * const fns[4] = { | ||
273 | - gen_helper_sve2_bdep_b, gen_helper_sve2_bdep_h, | ||
274 | - gen_helper_sve2_bdep_s, gen_helper_sve2_bdep_d, | ||
275 | - }; | ||
276 | - if (!dc_isar_feature(aa64_sve2_bitperm, s)) { | ||
277 | - return false; | ||
278 | - } | ||
279 | - return do_sve2_zzw_ool(s, a, fns[a->esz], 0); | ||
280 | -} | ||
281 | +static gen_helper_gvec_3 * const bdep_fns[4] = { | ||
282 | + gen_helper_sve2_bdep_b, gen_helper_sve2_bdep_h, | ||
283 | + gen_helper_sve2_bdep_s, gen_helper_sve2_bdep_d, | ||
284 | +}; | ||
285 | +TRANS_FEAT(BDEP, aa64_sve2_bitperm, gen_gvec_ool_arg_zzz, | ||
286 | + bdep_fns[a->esz], a, 0) | ||
287 | |||
288 | -static bool trans_BGRP(DisasContext *s, arg_rrr_esz *a) | ||
289 | -{ | ||
290 | - static gen_helper_gvec_3 * const fns[4] = { | ||
291 | - gen_helper_sve2_bgrp_b, gen_helper_sve2_bgrp_h, | ||
292 | - gen_helper_sve2_bgrp_s, gen_helper_sve2_bgrp_d, | ||
293 | - }; | ||
294 | - if (!dc_isar_feature(aa64_sve2_bitperm, s)) { | ||
295 | - return false; | ||
296 | - } | ||
297 | - return do_sve2_zzw_ool(s, a, fns[a->esz], 0); | ||
298 | -} | ||
299 | +static gen_helper_gvec_3 * const bgrp_fns[4] = { | ||
300 | + gen_helper_sve2_bgrp_b, gen_helper_sve2_bgrp_h, | ||
301 | + gen_helper_sve2_bgrp_s, gen_helper_sve2_bgrp_d, | ||
302 | +}; | ||
303 | +TRANS_FEAT(BGRP, aa64_sve2_bitperm, gen_gvec_ool_arg_zzz, | ||
304 | + bgrp_fns[a->esz], a, 0) | ||
305 | |||
306 | -static bool do_cadd(DisasContext *s, arg_rrr_esz *a, bool sq, bool rot) | ||
307 | -{ | ||
308 | - static gen_helper_gvec_3 * const fns[2][4] = { | ||
309 | - { gen_helper_sve2_cadd_b, gen_helper_sve2_cadd_h, | ||
310 | - gen_helper_sve2_cadd_s, gen_helper_sve2_cadd_d }, | ||
311 | - { gen_helper_sve2_sqcadd_b, gen_helper_sve2_sqcadd_h, | ||
312 | - gen_helper_sve2_sqcadd_s, gen_helper_sve2_sqcadd_d }, | ||
313 | - }; | ||
314 | - return do_sve2_zzw_ool(s, a, fns[sq][a->esz], rot); | ||
315 | -} | ||
316 | +static gen_helper_gvec_3 * const cadd_fns[4] = { | ||
317 | + gen_helper_sve2_cadd_b, gen_helper_sve2_cadd_h, | ||
318 | + gen_helper_sve2_cadd_s, gen_helper_sve2_cadd_d, | ||
319 | +}; | ||
320 | +TRANS_FEAT(CADD_rot90, aa64_sve2, gen_gvec_ool_arg_zzz, | ||
321 | + cadd_fns[a->esz], a, 0) | ||
322 | +TRANS_FEAT(CADD_rot270, aa64_sve2, gen_gvec_ool_arg_zzz, | ||
323 | + cadd_fns[a->esz], a, 1) | ||
324 | |||
325 | -static bool trans_CADD_rot90(DisasContext *s, arg_rrr_esz *a) | ||
326 | -{ | ||
327 | - return do_cadd(s, a, false, false); | ||
328 | -} | ||
329 | - | ||
330 | -static bool trans_CADD_rot270(DisasContext *s, arg_rrr_esz *a) | ||
331 | -{ | ||
332 | - return do_cadd(s, a, false, true); | ||
333 | -} | ||
334 | - | ||
335 | -static bool trans_SQCADD_rot90(DisasContext *s, arg_rrr_esz *a) | ||
336 | -{ | ||
337 | - return do_cadd(s, a, true, false); | ||
338 | -} | ||
339 | - | ||
340 | -static bool trans_SQCADD_rot270(DisasContext *s, arg_rrr_esz *a) | ||
341 | -{ | ||
342 | - return do_cadd(s, a, true, true); | ||
343 | -} | ||
344 | +static gen_helper_gvec_3 * const sqcadd_fns[4] = { | ||
345 | + gen_helper_sve2_sqcadd_b, gen_helper_sve2_sqcadd_h, | ||
346 | + gen_helper_sve2_sqcadd_s, gen_helper_sve2_sqcadd_d, | ||
347 | +}; | ||
348 | +TRANS_FEAT(SQCADD_rot90, aa64_sve2, gen_gvec_ool_arg_zzz, | ||
349 | + sqcadd_fns[a->esz], a, 0) | ||
350 | +TRANS_FEAT(SQCADD_rot270, aa64_sve2, gen_gvec_ool_arg_zzz, | ||
351 | + sqcadd_fns[a->esz], a, 1) | ||
352 | |||
353 | static gen_helper_gvec_4 * const sabal_fns[4] = { | ||
354 | NULL, gen_helper_sve2_sabal_h, | ||
355 | -- | ||
356 | 2.25.1 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | This is the last direct user of tcg_gen_gvec_4_ool. | ||
4 | |||
5 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
6 | Message-id: 20220527181907.189259-19-richard.henderson@linaro.org | ||
7 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
9 | --- | ||
10 | target/arm/translate-sve.c | 17 ++--------------- | ||
11 | 1 file changed, 2 insertions(+), 15 deletions(-) | ||
12 | |||
13 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
14 | index XXXXXXX..XXXXXXX 100644 | ||
15 | --- a/target/arm/translate-sve.c | ||
16 | +++ b/target/arm/translate-sve.c | ||
17 | @@ -XXX,XX +XXX,XX @@ static gen_helper_gvec_4 * const sqrdcmlah_fns[] = { | ||
18 | TRANS_FEAT(SQRDCMLAH_zzzz, aa64_sve2, gen_gvec_ool_zzzz, | ||
19 | sqrdcmlah_fns[a->esz], a->rd, a->rn, a->rm, a->ra, a->rot) | ||
20 | |||
21 | -static bool trans_USDOT_zzzz(DisasContext *s, arg_USDOT_zzzz *a) | ||
22 | -{ | ||
23 | - if (a->esz != 2 || !dc_isar_feature(aa64_sve_i8mm, s)) { | ||
24 | - return false; | ||
25 | - } | ||
26 | - if (sve_access_check(s)) { | ||
27 | - unsigned vsz = vec_full_reg_size(s); | ||
28 | - tcg_gen_gvec_4_ool(vec_full_reg_offset(s, a->rd), | ||
29 | - vec_full_reg_offset(s, a->rn), | ||
30 | - vec_full_reg_offset(s, a->rm), | ||
31 | - vec_full_reg_offset(s, a->ra), | ||
32 | - vsz, vsz, 0, gen_helper_gvec_usdot_b); | ||
33 | - } | ||
34 | - return true; | ||
35 | -} | ||
36 | +TRANS_FEAT(USDOT_zzzz, aa64_sve_i8mm, gen_gvec_ool_arg_zzzz, | ||
37 | + a->esz == 2 ? gen_helper_gvec_usdot_b : NULL, a, 0) | ||
38 | |||
39 | TRANS_FEAT(AESMC, aa64_sve2_aes, gen_gvec_ool_zz, | ||
40 | gen_helper_crypto_aesmc, a->rd, a->rd, a->decrypt) | ||
41 | -- | ||
42 | 2.25.1 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
4 | Message-id: 20220527181907.189259-20-richard.henderson@linaro.org | ||
5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | --- | ||
8 | target/arm/translate-sve.c | 37 +++++++++++++++---------------------- | ||
9 | 1 file changed, 15 insertions(+), 22 deletions(-) | ||
10 | |||
11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
12 | index XXXXXXX..XXXXXXX 100644 | ||
13 | --- a/target/arm/translate-sve.c | ||
14 | +++ b/target/arm/translate-sve.c | ||
15 | @@ -XXX,XX +XXX,XX @@ static bool gen_gvec_ool_arg_zzxz(DisasContext *s, gen_helper_gvec_4 *fn, | ||
16 | } | ||
17 | |||
18 | /* Invoke an out-of-line helper on 2 Zregs and a predicate. */ | ||
19 | -static void gen_gvec_ool_zzp(DisasContext *s, gen_helper_gvec_3 *fn, | ||
20 | +static bool gen_gvec_ool_zzp(DisasContext *s, gen_helper_gvec_3 *fn, | ||
21 | int rd, int rn, int pg, int data) | ||
22 | { | ||
23 | - unsigned vsz = vec_full_reg_size(s); | ||
24 | - tcg_gen_gvec_3_ool(vec_full_reg_offset(s, rd), | ||
25 | - vec_full_reg_offset(s, rn), | ||
26 | - pred_full_reg_offset(s, pg), | ||
27 | - vsz, vsz, data, fn); | ||
28 | + if (fn == NULL) { | ||
29 | + return false; | ||
30 | + } | ||
31 | + if (sve_access_check(s)) { | ||
32 | + unsigned vsz = vec_full_reg_size(s); | ||
33 | + tcg_gen_gvec_3_ool(vec_full_reg_offset(s, rd), | ||
34 | + vec_full_reg_offset(s, rn), | ||
35 | + pred_full_reg_offset(s, pg), | ||
36 | + vsz, vsz, data, fn); | ||
37 | + } | ||
38 | + return true; | ||
39 | } | ||
40 | |||
41 | /* Invoke an out-of-line helper on 3 Zregs and a predicate. */ | ||
42 | @@ -XXX,XX +XXX,XX @@ static bool trans_SEL_zpzz(DisasContext *s, arg_rprr_esz *a) | ||
43 | |||
44 | static bool do_zpz_ool(DisasContext *s, arg_rpr_esz *a, gen_helper_gvec_3 *fn) | ||
45 | { | ||
46 | - if (fn == NULL) { | ||
47 | - return false; | ||
48 | - } | ||
49 | - if (sve_access_check(s)) { | ||
50 | - gen_gvec_ool_zzp(s, fn, a->rd, a->rn, a->pg, 0); | ||
51 | - } | ||
52 | - return true; | ||
53 | + return gen_gvec_ool_zzp(s, fn, a->rd, a->rn, a->pg, 0); | ||
54 | } | ||
55 | |||
56 | #define DO_ZPZ(NAME, name) \ | ||
57 | @@ -XXX,XX +XXX,XX @@ static bool do_movz_zpz(DisasContext *s, int rd, int rn, int pg, | ||
58 | gen_helper_sve_movz_b, gen_helper_sve_movz_h, | ||
59 | gen_helper_sve_movz_s, gen_helper_sve_movz_d, | ||
60 | }; | ||
61 | - | ||
62 | - if (sve_access_check(s)) { | ||
63 | - gen_gvec_ool_zzp(s, fns[esz], rd, rn, pg, invert); | ||
64 | - } | ||
65 | - return true; | ||
66 | + return gen_gvec_ool_zzp(s, fns[esz], rd, rn, pg, invert); | ||
67 | } | ||
68 | |||
69 | static bool do_zpzi_ool(DisasContext *s, arg_rpri_esz *a, | ||
70 | gen_helper_gvec_3 *fn) | ||
71 | { | ||
72 | - if (sve_access_check(s)) { | ||
73 | - gen_gvec_ool_zzp(s, fn, a->rd, a->rn, a->pg, a->imm); | ||
74 | - } | ||
75 | - return true; | ||
76 | + return gen_gvec_ool_zzp(s, fn, a->rd, a->rn, a->pg, a->imm); | ||
77 | } | ||
78 | |||
79 | static bool trans_ASR_zpzi(DisasContext *s, arg_rpri_esz *a) | ||
80 | -- | ||
81 | 2.25.1 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Use gen_gvec_ool_arg_zpz instead of gen_gvec_ool_zzp | ||
4 | when the arguments come from arg_rpr_esz. | ||
5 | Replaces do_zpz_ool. | ||
6 | |||
7 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
8 | Message-id: 20220527181907.189259-21-richard.henderson@linaro.org | ||
9 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
11 | --- | ||
12 | target/arm/translate-sve.c | 45 +++++++++++++++++++++----------------- | ||
13 | 1 file changed, 25 insertions(+), 20 deletions(-) | ||
14 | |||
15 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
16 | index XXXXXXX..XXXXXXX 100644 | ||
17 | --- a/target/arm/translate-sve.c | ||
18 | +++ b/target/arm/translate-sve.c | ||
19 | @@ -XXX,XX +XXX,XX @@ static bool gen_gvec_ool_zzp(DisasContext *s, gen_helper_gvec_3 *fn, | ||
20 | return true; | ||
21 | } | ||
22 | |||
23 | +static bool gen_gvec_ool_arg_zpz(DisasContext *s, gen_helper_gvec_3 *fn, | ||
24 | + arg_rpr_esz *a, int data) | ||
25 | +{ | ||
26 | + return gen_gvec_ool_zzp(s, fn, a->rd, a->rn, a->pg, data); | ||
27 | +} | ||
28 | + | ||
29 | + | ||
30 | /* Invoke an out-of-line helper on 3 Zregs and a predicate. */ | ||
31 | static void gen_gvec_ool_zzzp(DisasContext *s, gen_helper_gvec_4 *fn, | ||
32 | int rd, int rn, int rm, int pg, int data) | ||
33 | @@ -XXX,XX +XXX,XX @@ static bool trans_SEL_zpzz(DisasContext *s, arg_rprr_esz *a) | ||
34 | *** SVE Integer Arithmetic - Unary Predicated Group | ||
35 | */ | ||
36 | |||
37 | -static bool do_zpz_ool(DisasContext *s, arg_rpr_esz *a, gen_helper_gvec_3 *fn) | ||
38 | -{ | ||
39 | - return gen_gvec_ool_zzp(s, fn, a->rd, a->rn, a->pg, 0); | ||
40 | -} | ||
41 | - | ||
42 | #define DO_ZPZ(NAME, name) \ | ||
43 | static bool trans_##NAME(DisasContext *s, arg_rpr_esz *a) \ | ||
44 | { \ | ||
45 | @@ -XXX,XX +XXX,XX @@ static bool trans_##NAME(DisasContext *s, arg_rpr_esz *a) \ | ||
46 | gen_helper_sve_##name##_b, gen_helper_sve_##name##_h, \ | ||
47 | gen_helper_sve_##name##_s, gen_helper_sve_##name##_d, \ | ||
48 | }; \ | ||
49 | - return do_zpz_ool(s, a, fns[a->esz]); \ | ||
50 | + return gen_gvec_ool_arg_zpz(s, fns[a->esz], a, 0); \ | ||
51 | } | ||
52 | |||
53 | DO_ZPZ(CLS, cls) | ||
54 | @@ -XXX,XX +XXX,XX @@ static bool trans_FABS(DisasContext *s, arg_rpr_esz *a) | ||
55 | gen_helper_sve_fabs_s, | ||
56 | gen_helper_sve_fabs_d | ||
57 | }; | ||
58 | - return do_zpz_ool(s, a, fns[a->esz]); | ||
59 | + return gen_gvec_ool_arg_zpz(s, fns[a->esz], a, 0); | ||
60 | } | ||
61 | |||
62 | static bool trans_FNEG(DisasContext *s, arg_rpr_esz *a) | ||
63 | @@ -XXX,XX +XXX,XX @@ static bool trans_FNEG(DisasContext *s, arg_rpr_esz *a) | ||
64 | gen_helper_sve_fneg_s, | ||
65 | gen_helper_sve_fneg_d | ||
66 | }; | ||
67 | - return do_zpz_ool(s, a, fns[a->esz]); | ||
68 | + return gen_gvec_ool_arg_zpz(s, fns[a->esz], a, 0); | ||
69 | } | ||
70 | |||
71 | static bool trans_SXTB(DisasContext *s, arg_rpr_esz *a) | ||
72 | @@ -XXX,XX +XXX,XX @@ static bool trans_SXTB(DisasContext *s, arg_rpr_esz *a) | ||
73 | gen_helper_sve_sxtb_s, | ||
74 | gen_helper_sve_sxtb_d | ||
75 | }; | ||
76 | - return do_zpz_ool(s, a, fns[a->esz]); | ||
77 | + return gen_gvec_ool_arg_zpz(s, fns[a->esz], a, 0); | ||
78 | } | ||
79 | |||
80 | static bool trans_UXTB(DisasContext *s, arg_rpr_esz *a) | ||
81 | @@ -XXX,XX +XXX,XX @@ static bool trans_UXTB(DisasContext *s, arg_rpr_esz *a) | ||
82 | gen_helper_sve_uxtb_s, | ||
83 | gen_helper_sve_uxtb_d | ||
84 | }; | ||
85 | - return do_zpz_ool(s, a, fns[a->esz]); | ||
86 | + return gen_gvec_ool_arg_zpz(s, fns[a->esz], a, 0); | ||
87 | } | ||
88 | |||
89 | static bool trans_SXTH(DisasContext *s, arg_rpr_esz *a) | ||
90 | @@ -XXX,XX +XXX,XX @@ static bool trans_SXTH(DisasContext *s, arg_rpr_esz *a) | ||
91 | gen_helper_sve_sxth_s, | ||
92 | gen_helper_sve_sxth_d | ||
93 | }; | ||
94 | - return do_zpz_ool(s, a, fns[a->esz]); | ||
95 | + return gen_gvec_ool_arg_zpz(s, fns[a->esz], a, 0); | ||
96 | } | ||
97 | |||
98 | static bool trans_UXTH(DisasContext *s, arg_rpr_esz *a) | ||
99 | @@ -XXX,XX +XXX,XX @@ static bool trans_UXTH(DisasContext *s, arg_rpr_esz *a) | ||
100 | gen_helper_sve_uxth_s, | ||
101 | gen_helper_sve_uxth_d | ||
102 | }; | ||
103 | - return do_zpz_ool(s, a, fns[a->esz]); | ||
104 | + return gen_gvec_ool_arg_zpz(s, fns[a->esz], a, 0); | ||
105 | } | ||
106 | |||
107 | static bool trans_SXTW(DisasContext *s, arg_rpr_esz *a) | ||
108 | { | ||
109 | - return do_zpz_ool(s, a, a->esz == 3 ? gen_helper_sve_sxtw_d : NULL); | ||
110 | + return gen_gvec_ool_arg_zpz(s, a->esz == 3 ? gen_helper_sve_sxtw_d | ||
111 | + : NULL, a, 0); | ||
112 | } | ||
113 | |||
114 | static bool trans_UXTW(DisasContext *s, arg_rpr_esz *a) | ||
115 | { | ||
116 | - return do_zpz_ool(s, a, a->esz == 3 ? gen_helper_sve_uxtw_d : NULL); | ||
117 | + return gen_gvec_ool_arg_zpz(s, a->esz == 3 ? gen_helper_sve_uxtw_d | ||
118 | + : NULL, a, 0); | ||
119 | } | ||
120 | |||
121 | #undef DO_ZPZ | ||
122 | @@ -XXX,XX +XXX,XX @@ static bool trans_COMPACT(DisasContext *s, arg_rpr_esz *a) | ||
123 | static gen_helper_gvec_3 * const fns[4] = { | ||
124 | NULL, NULL, gen_helper_sve_compact_s, gen_helper_sve_compact_d | ||
125 | }; | ||
126 | - return do_zpz_ool(s, a, fns[a->esz]); | ||
127 | + return gen_gvec_ool_arg_zpz(s, fns[a->esz], a, 0); | ||
128 | } | ||
129 | |||
130 | /* Call the helper that computes the ARM LastActiveElement pseudocode | ||
131 | @@ -XXX,XX +XXX,XX @@ static bool trans_REVB(DisasContext *s, arg_rpr_esz *a) | ||
132 | gen_helper_sve_revb_s, | ||
133 | gen_helper_sve_revb_d, | ||
134 | }; | ||
135 | - return do_zpz_ool(s, a, fns[a->esz]); | ||
136 | + return gen_gvec_ool_arg_zpz(s, fns[a->esz], a, 0); | ||
137 | } | ||
138 | |||
139 | static bool trans_REVH(DisasContext *s, arg_rpr_esz *a) | ||
140 | @@ -XXX,XX +XXX,XX @@ static bool trans_REVH(DisasContext *s, arg_rpr_esz *a) | ||
141 | gen_helper_sve_revh_s, | ||
142 | gen_helper_sve_revh_d, | ||
143 | }; | ||
144 | - return do_zpz_ool(s, a, fns[a->esz]); | ||
145 | + return gen_gvec_ool_arg_zpz(s, fns[a->esz], a, 0); | ||
146 | } | ||
147 | |||
148 | static bool trans_REVW(DisasContext *s, arg_rpr_esz *a) | ||
149 | { | ||
150 | - return do_zpz_ool(s, a, a->esz == 3 ? gen_helper_sve_revw_d : NULL); | ||
151 | + return gen_gvec_ool_arg_zpz(s, a->esz == 3 ? gen_helper_sve_revw_d | ||
152 | + : NULL, a, 0); | ||
153 | } | ||
154 | |||
155 | static bool trans_RBIT(DisasContext *s, arg_rpr_esz *a) | ||
156 | @@ -XXX,XX +XXX,XX @@ static bool trans_RBIT(DisasContext *s, arg_rpr_esz *a) | ||
157 | gen_helper_sve_rbit_s, | ||
158 | gen_helper_sve_rbit_d, | ||
159 | }; | ||
160 | - return do_zpz_ool(s, a, fns[a->esz]); | ||
161 | + return gen_gvec_ool_arg_zpz(s, fns[a->esz], a, 0); | ||
162 | } | ||
163 | |||
164 | static bool trans_SPLICE(DisasContext *s, arg_rprr_esz *a) | ||
165 | @@ -XXX,XX +XXX,XX @@ static bool do_sve2_zpz_ool(DisasContext *s, arg_rpr_esz *a, | ||
166 | if (!dc_isar_feature(aa64_sve2, s)) { | ||
167 | return false; | ||
168 | } | ||
169 | - return do_zpz_ool(s, a, fn); | ||
170 | + return gen_gvec_ool_arg_zpz(s, fn, a, 0); | ||
171 | } | ||
172 | |||
173 | static bool trans_URECPE(DisasContext *s, arg_rpr_esz *a) | ||
174 | -- | ||
175 | 2.25.1 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Convert SVE translation functions directly using | ||
4 | gen_gvec_ool_arg_zpz to TRANS_FEAT. | ||
5 | |||
6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
7 | Message-id: 20220527181907.189259-22-richard.henderson@linaro.org | ||
8 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
10 | --- | ||
11 | target/arm/translate-sve.c | 189 ++++++++++++------------------------- | ||
12 | 1 file changed, 60 insertions(+), 129 deletions(-) | ||
13 | |||
14 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
15 | index XXXXXXX..XXXXXXX 100644 | ||
16 | --- a/target/arm/translate-sve.c | ||
17 | +++ b/target/arm/translate-sve.c | ||
18 | @@ -XXX,XX +XXX,XX @@ static bool trans_SEL_zpzz(DisasContext *s, arg_rprr_esz *a) | ||
19 | *** SVE Integer Arithmetic - Unary Predicated Group | ||
20 | */ | ||
21 | |||
22 | -#define DO_ZPZ(NAME, name) \ | ||
23 | -static bool trans_##NAME(DisasContext *s, arg_rpr_esz *a) \ | ||
24 | -{ \ | ||
25 | - static gen_helper_gvec_3 * const fns[4] = { \ | ||
26 | - gen_helper_sve_##name##_b, gen_helper_sve_##name##_h, \ | ||
27 | - gen_helper_sve_##name##_s, gen_helper_sve_##name##_d, \ | ||
28 | +#define DO_ZPZ(NAME, FEAT, name) \ | ||
29 | + static gen_helper_gvec_3 * const name##_fns[4] = { \ | ||
30 | + gen_helper_##name##_b, gen_helper_##name##_h, \ | ||
31 | + gen_helper_##name##_s, gen_helper_##name##_d, \ | ||
32 | }; \ | ||
33 | - return gen_gvec_ool_arg_zpz(s, fns[a->esz], a, 0); \ | ||
34 | -} | ||
35 | + TRANS_FEAT(NAME, FEAT, gen_gvec_ool_arg_zpz, name##_fns[a->esz], a, 0) | ||
36 | |||
37 | -DO_ZPZ(CLS, cls) | ||
38 | -DO_ZPZ(CLZ, clz) | ||
39 | -DO_ZPZ(CNT_zpz, cnt_zpz) | ||
40 | -DO_ZPZ(CNOT, cnot) | ||
41 | -DO_ZPZ(NOT_zpz, not_zpz) | ||
42 | -DO_ZPZ(ABS, abs) | ||
43 | -DO_ZPZ(NEG, neg) | ||
44 | +DO_ZPZ(CLS, aa64_sve, sve_cls) | ||
45 | +DO_ZPZ(CLZ, aa64_sve, sve_clz) | ||
46 | +DO_ZPZ(CNT_zpz, aa64_sve, sve_cnt_zpz) | ||
47 | +DO_ZPZ(CNOT, aa64_sve, sve_cnot) | ||
48 | +DO_ZPZ(NOT_zpz, aa64_sve, sve_not_zpz) | ||
49 | +DO_ZPZ(ABS, aa64_sve, sve_abs) | ||
50 | +DO_ZPZ(NEG, aa64_sve, sve_neg) | ||
51 | +DO_ZPZ(RBIT, aa64_sve, sve_rbit) | ||
52 | |||
53 | -static bool trans_FABS(DisasContext *s, arg_rpr_esz *a) | ||
54 | -{ | ||
55 | - static gen_helper_gvec_3 * const fns[4] = { | ||
56 | - NULL, | ||
57 | - gen_helper_sve_fabs_h, | ||
58 | - gen_helper_sve_fabs_s, | ||
59 | - gen_helper_sve_fabs_d | ||
60 | - }; | ||
61 | - return gen_gvec_ool_arg_zpz(s, fns[a->esz], a, 0); | ||
62 | -} | ||
63 | +static gen_helper_gvec_3 * const fabs_fns[4] = { | ||
64 | + NULL, gen_helper_sve_fabs_h, | ||
65 | + gen_helper_sve_fabs_s, gen_helper_sve_fabs_d, | ||
66 | +}; | ||
67 | +TRANS_FEAT(FABS, aa64_sve, gen_gvec_ool_arg_zpz, fabs_fns[a->esz], a, 0) | ||
68 | |||
69 | -static bool trans_FNEG(DisasContext *s, arg_rpr_esz *a) | ||
70 | -{ | ||
71 | - static gen_helper_gvec_3 * const fns[4] = { | ||
72 | - NULL, | ||
73 | - gen_helper_sve_fneg_h, | ||
74 | - gen_helper_sve_fneg_s, | ||
75 | - gen_helper_sve_fneg_d | ||
76 | - }; | ||
77 | - return gen_gvec_ool_arg_zpz(s, fns[a->esz], a, 0); | ||
78 | -} | ||
79 | +static gen_helper_gvec_3 * const fneg_fns[4] = { | ||
80 | + NULL, gen_helper_sve_fneg_h, | ||
81 | + gen_helper_sve_fneg_s, gen_helper_sve_fneg_d, | ||
82 | +}; | ||
83 | +TRANS_FEAT(FNEG, aa64_sve, gen_gvec_ool_arg_zpz, fneg_fns[a->esz], a, 0) | ||
84 | |||
85 | -static bool trans_SXTB(DisasContext *s, arg_rpr_esz *a) | ||
86 | -{ | ||
87 | - static gen_helper_gvec_3 * const fns[4] = { | ||
88 | - NULL, | ||
89 | - gen_helper_sve_sxtb_h, | ||
90 | - gen_helper_sve_sxtb_s, | ||
91 | - gen_helper_sve_sxtb_d | ||
92 | - }; | ||
93 | - return gen_gvec_ool_arg_zpz(s, fns[a->esz], a, 0); | ||
94 | -} | ||
95 | +static gen_helper_gvec_3 * const sxtb_fns[4] = { | ||
96 | + NULL, gen_helper_sve_sxtb_h, | ||
97 | + gen_helper_sve_sxtb_s, gen_helper_sve_sxtb_d, | ||
98 | +}; | ||
99 | +TRANS_FEAT(SXTB, aa64_sve, gen_gvec_ool_arg_zpz, sxtb_fns[a->esz], a, 0) | ||
100 | |||
101 | -static bool trans_UXTB(DisasContext *s, arg_rpr_esz *a) | ||
102 | -{ | ||
103 | - static gen_helper_gvec_3 * const fns[4] = { | ||
104 | - NULL, | ||
105 | - gen_helper_sve_uxtb_h, | ||
106 | - gen_helper_sve_uxtb_s, | ||
107 | - gen_helper_sve_uxtb_d | ||
108 | - }; | ||
109 | - return gen_gvec_ool_arg_zpz(s, fns[a->esz], a, 0); | ||
110 | -} | ||
111 | +static gen_helper_gvec_3 * const uxtb_fns[4] = { | ||
112 | + NULL, gen_helper_sve_uxtb_h, | ||
113 | + gen_helper_sve_uxtb_s, gen_helper_sve_uxtb_d, | ||
114 | +}; | ||
115 | +TRANS_FEAT(UXTB, aa64_sve, gen_gvec_ool_arg_zpz, uxtb_fns[a->esz], a, 0) | ||
116 | |||
117 | -static bool trans_SXTH(DisasContext *s, arg_rpr_esz *a) | ||
118 | -{ | ||
119 | - static gen_helper_gvec_3 * const fns[4] = { | ||
120 | - NULL, NULL, | ||
121 | - gen_helper_sve_sxth_s, | ||
122 | - gen_helper_sve_sxth_d | ||
123 | - }; | ||
124 | - return gen_gvec_ool_arg_zpz(s, fns[a->esz], a, 0); | ||
125 | -} | ||
126 | +static gen_helper_gvec_3 * const sxth_fns[4] = { | ||
127 | + NULL, NULL, gen_helper_sve_sxth_s, gen_helper_sve_sxth_d | ||
128 | +}; | ||
129 | +TRANS_FEAT(SXTH, aa64_sve, gen_gvec_ool_arg_zpz, sxth_fns[a->esz], a, 0) | ||
130 | |||
131 | -static bool trans_UXTH(DisasContext *s, arg_rpr_esz *a) | ||
132 | -{ | ||
133 | - static gen_helper_gvec_3 * const fns[4] = { | ||
134 | - NULL, NULL, | ||
135 | - gen_helper_sve_uxth_s, | ||
136 | - gen_helper_sve_uxth_d | ||
137 | - }; | ||
138 | - return gen_gvec_ool_arg_zpz(s, fns[a->esz], a, 0); | ||
139 | -} | ||
140 | +static gen_helper_gvec_3 * const uxth_fns[4] = { | ||
141 | + NULL, NULL, gen_helper_sve_uxth_s, gen_helper_sve_uxth_d | ||
142 | +}; | ||
143 | +TRANS_FEAT(UXTH, aa64_sve, gen_gvec_ool_arg_zpz, uxth_fns[a->esz], a, 0) | ||
144 | |||
145 | -static bool trans_SXTW(DisasContext *s, arg_rpr_esz *a) | ||
146 | -{ | ||
147 | - return gen_gvec_ool_arg_zpz(s, a->esz == 3 ? gen_helper_sve_sxtw_d | ||
148 | - : NULL, a, 0); | ||
149 | -} | ||
150 | - | ||
151 | -static bool trans_UXTW(DisasContext *s, arg_rpr_esz *a) | ||
152 | -{ | ||
153 | - return gen_gvec_ool_arg_zpz(s, a->esz == 3 ? gen_helper_sve_uxtw_d | ||
154 | - : NULL, a, 0); | ||
155 | -} | ||
156 | - | ||
157 | -#undef DO_ZPZ | ||
158 | +TRANS_FEAT(SXTW, aa64_sve, gen_gvec_ool_arg_zpz, | ||
159 | + a->esz == 3 ? gen_helper_sve_sxtw_d : NULL, a, 0) | ||
160 | +TRANS_FEAT(UXTW, aa64_sve, gen_gvec_ool_arg_zpz, | ||
161 | + a->esz == 3 ? gen_helper_sve_uxtw_d : NULL, a, 0) | ||
162 | |||
163 | /* | ||
164 | *** SVE Integer Reduction Group | ||
165 | @@ -XXX,XX +XXX,XX @@ TRANS_FEAT(TRN2_q, aa64_sve_f64mm, gen_gvec_ool_arg_zzz, | ||
166 | *** SVE Permute Vector - Predicated Group | ||
167 | */ | ||
168 | |||
169 | -static bool trans_COMPACT(DisasContext *s, arg_rpr_esz *a) | ||
170 | -{ | ||
171 | - static gen_helper_gvec_3 * const fns[4] = { | ||
172 | - NULL, NULL, gen_helper_sve_compact_s, gen_helper_sve_compact_d | ||
173 | - }; | ||
174 | - return gen_gvec_ool_arg_zpz(s, fns[a->esz], a, 0); | ||
175 | -} | ||
176 | +static gen_helper_gvec_3 * const compact_fns[4] = { | ||
177 | + NULL, NULL, gen_helper_sve_compact_s, gen_helper_sve_compact_d | ||
178 | +}; | ||
179 | +TRANS_FEAT(COMPACT, aa64_sve, gen_gvec_ool_arg_zpz, compact_fns[a->esz], a, 0) | ||
180 | |||
181 | /* Call the helper that computes the ARM LastActiveElement pseudocode | ||
182 | * function, scaled by the element size. This includes the not found | ||
183 | @@ -XXX,XX +XXX,XX @@ static bool trans_CPY_m_v(DisasContext *s, arg_rpr_esz *a) | ||
184 | return true; | ||
185 | } | ||
186 | |||
187 | -static bool trans_REVB(DisasContext *s, arg_rpr_esz *a) | ||
188 | -{ | ||
189 | - static gen_helper_gvec_3 * const fns[4] = { | ||
190 | - NULL, | ||
191 | - gen_helper_sve_revb_h, | ||
192 | - gen_helper_sve_revb_s, | ||
193 | - gen_helper_sve_revb_d, | ||
194 | - }; | ||
195 | - return gen_gvec_ool_arg_zpz(s, fns[a->esz], a, 0); | ||
196 | -} | ||
197 | +static gen_helper_gvec_3 * const revb_fns[4] = { | ||
198 | + NULL, gen_helper_sve_revb_h, | ||
199 | + gen_helper_sve_revb_s, gen_helper_sve_revb_d, | ||
200 | +}; | ||
201 | +TRANS_FEAT(REVB, aa64_sve, gen_gvec_ool_arg_zpz, revb_fns[a->esz], a, 0) | ||
202 | |||
203 | -static bool trans_REVH(DisasContext *s, arg_rpr_esz *a) | ||
204 | -{ | ||
205 | - static gen_helper_gvec_3 * const fns[4] = { | ||
206 | - NULL, | ||
207 | - NULL, | ||
208 | - gen_helper_sve_revh_s, | ||
209 | - gen_helper_sve_revh_d, | ||
210 | - }; | ||
211 | - return gen_gvec_ool_arg_zpz(s, fns[a->esz], a, 0); | ||
212 | -} | ||
213 | +static gen_helper_gvec_3 * const revh_fns[4] = { | ||
214 | + NULL, NULL, gen_helper_sve_revh_s, gen_helper_sve_revh_d, | ||
215 | +}; | ||
216 | +TRANS_FEAT(REVH, aa64_sve, gen_gvec_ool_arg_zpz, revh_fns[a->esz], a, 0) | ||
217 | |||
218 | -static bool trans_REVW(DisasContext *s, arg_rpr_esz *a) | ||
219 | -{ | ||
220 | - return gen_gvec_ool_arg_zpz(s, a->esz == 3 ? gen_helper_sve_revw_d | ||
221 | - : NULL, a, 0); | ||
222 | -} | ||
223 | - | ||
224 | -static bool trans_RBIT(DisasContext *s, arg_rpr_esz *a) | ||
225 | -{ | ||
226 | - static gen_helper_gvec_3 * const fns[4] = { | ||
227 | - gen_helper_sve_rbit_b, | ||
228 | - gen_helper_sve_rbit_h, | ||
229 | - gen_helper_sve_rbit_s, | ||
230 | - gen_helper_sve_rbit_d, | ||
231 | - }; | ||
232 | - return gen_gvec_ool_arg_zpz(s, fns[a->esz], a, 0); | ||
233 | -} | ||
234 | +TRANS_FEAT(REVW, aa64_sve, gen_gvec_ool_arg_zpz, | ||
235 | + a->esz == 3 ? gen_helper_sve_revw_d : NULL, a, 0) | ||
236 | |||
237 | static bool trans_SPLICE(DisasContext *s, arg_rprr_esz *a) | ||
238 | { | ||
239 | -- | ||
240 | 2.25.1 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Convert SVE translation functions using do_sve2_zpz_data | ||
4 | to use TRANS_FEAT and gen_gvec_ool_arg_zpz. | ||
5 | |||
6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
7 | Message-id: 20220527181907.189259-23-richard.henderson@linaro.org | ||
8 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
10 | --- | ||
11 | target/arm/translate-sve.c | 53 ++++++++++---------------------------- | ||
12 | 1 file changed, 14 insertions(+), 39 deletions(-) | ||
13 | |||
14 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
15 | index XXXXXXX..XXXXXXX 100644 | ||
16 | --- a/target/arm/translate-sve.c | ||
17 | +++ b/target/arm/translate-sve.c | ||
18 | @@ -XXX,XX +XXX,XX @@ static bool trans_UADALP_zpzz(DisasContext *s, arg_rprr_esz *a) | ||
19 | * SVE2 integer unary operations (predicated) | ||
20 | */ | ||
21 | |||
22 | -static bool do_sve2_zpz_ool(DisasContext *s, arg_rpr_esz *a, | ||
23 | - gen_helper_gvec_3 *fn) | ||
24 | -{ | ||
25 | - if (!dc_isar_feature(aa64_sve2, s)) { | ||
26 | - return false; | ||
27 | - } | ||
28 | - return gen_gvec_ool_arg_zpz(s, fn, a, 0); | ||
29 | -} | ||
30 | +TRANS_FEAT(URECPE, aa64_sve2, gen_gvec_ool_arg_zpz, | ||
31 | + a->esz == 2 ? gen_helper_sve2_urecpe_s : NULL, a, 0) | ||
32 | |||
33 | -static bool trans_URECPE(DisasContext *s, arg_rpr_esz *a) | ||
34 | -{ | ||
35 | - if (a->esz != 2) { | ||
36 | - return false; | ||
37 | - } | ||
38 | - return do_sve2_zpz_ool(s, a, gen_helper_sve2_urecpe_s); | ||
39 | -} | ||
40 | +TRANS_FEAT(URSQRTE, aa64_sve2, gen_gvec_ool_arg_zpz, | ||
41 | + a->esz == 2 ? gen_helper_sve2_ursqrte_s : NULL, a, 0) | ||
42 | |||
43 | -static bool trans_URSQRTE(DisasContext *s, arg_rpr_esz *a) | ||
44 | -{ | ||
45 | - if (a->esz != 2) { | ||
46 | - return false; | ||
47 | - } | ||
48 | - return do_sve2_zpz_ool(s, a, gen_helper_sve2_ursqrte_s); | ||
49 | -} | ||
50 | +static gen_helper_gvec_3 * const sqabs_fns[4] = { | ||
51 | + gen_helper_sve2_sqabs_b, gen_helper_sve2_sqabs_h, | ||
52 | + gen_helper_sve2_sqabs_s, gen_helper_sve2_sqabs_d, | ||
53 | +}; | ||
54 | +TRANS_FEAT(SQABS, aa64_sve2, gen_gvec_ool_arg_zpz, sqabs_fns[a->esz], a, 0) | ||
55 | |||
56 | -static bool trans_SQABS(DisasContext *s, arg_rpr_esz *a) | ||
57 | -{ | ||
58 | - static gen_helper_gvec_3 * const fns[4] = { | ||
59 | - gen_helper_sve2_sqabs_b, gen_helper_sve2_sqabs_h, | ||
60 | - gen_helper_sve2_sqabs_s, gen_helper_sve2_sqabs_d, | ||
61 | - }; | ||
62 | - return do_sve2_zpz_ool(s, a, fns[a->esz]); | ||
63 | -} | ||
64 | - | ||
65 | -static bool trans_SQNEG(DisasContext *s, arg_rpr_esz *a) | ||
66 | -{ | ||
67 | - static gen_helper_gvec_3 * const fns[4] = { | ||
68 | - gen_helper_sve2_sqneg_b, gen_helper_sve2_sqneg_h, | ||
69 | - gen_helper_sve2_sqneg_s, gen_helper_sve2_sqneg_d, | ||
70 | - }; | ||
71 | - return do_sve2_zpz_ool(s, a, fns[a->esz]); | ||
72 | -} | ||
73 | +static gen_helper_gvec_3 * const sqneg_fns[4] = { | ||
74 | + gen_helper_sve2_sqneg_b, gen_helper_sve2_sqneg_h, | ||
75 | + gen_helper_sve2_sqneg_s, gen_helper_sve2_sqneg_d, | ||
76 | +}; | ||
77 | +TRANS_FEAT(SQNEG, aa64_sve2, gen_gvec_ool_arg_zpz, sqneg_fns[a->esz], a, 0) | ||
78 | |||
79 | #define DO_SVE2_ZPZZ(NAME, name) \ | ||
80 | static bool trans_##NAME(DisasContext *s, arg_rprr_esz *a) \ | ||
81 | -- | ||
82 | 2.25.1 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
4 | Message-id: 20220527181907.189259-26-richard.henderson@linaro.org | ||
5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | --- | ||
8 | target/arm/translate-sve.c | 42 ++++++++++++++++---------------------- | ||
9 | 1 file changed, 18 insertions(+), 24 deletions(-) | ||
10 | |||
11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
12 | index XXXXXXX..XXXXXXX 100644 | ||
13 | --- a/target/arm/translate-sve.c | ||
14 | +++ b/target/arm/translate-sve.c | ||
15 | @@ -XXX,XX +XXX,XX @@ static bool gen_gvec_ool_arg_zpzi(DisasContext *s, gen_helper_gvec_3 *fn, | ||
16 | } | ||
17 | |||
18 | /* Invoke an out-of-line helper on 3 Zregs and a predicate. */ | ||
19 | -static void gen_gvec_ool_zzzp(DisasContext *s, gen_helper_gvec_4 *fn, | ||
20 | +static bool gen_gvec_ool_zzzp(DisasContext *s, gen_helper_gvec_4 *fn, | ||
21 | int rd, int rn, int rm, int pg, int data) | ||
22 | { | ||
23 | - unsigned vsz = vec_full_reg_size(s); | ||
24 | - tcg_gen_gvec_4_ool(vec_full_reg_offset(s, rd), | ||
25 | - vec_full_reg_offset(s, rn), | ||
26 | - vec_full_reg_offset(s, rm), | ||
27 | - pred_full_reg_offset(s, pg), | ||
28 | - vsz, vsz, data, fn); | ||
29 | + if (fn == NULL) { | ||
30 | + return false; | ||
31 | + } | ||
32 | + if (sve_access_check(s)) { | ||
33 | + unsigned vsz = vec_full_reg_size(s); | ||
34 | + tcg_gen_gvec_4_ool(vec_full_reg_offset(s, rd), | ||
35 | + vec_full_reg_offset(s, rn), | ||
36 | + vec_full_reg_offset(s, rm), | ||
37 | + pred_full_reg_offset(s, pg), | ||
38 | + vsz, vsz, data, fn); | ||
39 | + } | ||
40 | + return true; | ||
41 | } | ||
42 | |||
43 | /* Invoke a vector expander on two Zregs. */ | ||
44 | @@ -XXX,XX +XXX,XX @@ static bool trans_UQSUB_zzz(DisasContext *s, arg_rrr_esz *a) | ||
45 | |||
46 | static bool do_zpzz_ool(DisasContext *s, arg_rprr_esz *a, gen_helper_gvec_4 *fn) | ||
47 | { | ||
48 | - if (fn == NULL) { | ||
49 | - return false; | ||
50 | - } | ||
51 | - if (sve_access_check(s)) { | ||
52 | - gen_gvec_ool_zzzp(s, fn, a->rd, a->rn, a->rm, a->pg, 0); | ||
53 | - } | ||
54 | - return true; | ||
55 | + return gen_gvec_ool_zzzp(s, fn, a->rd, a->rn, a->rm, a->pg, 0); | ||
56 | } | ||
57 | |||
58 | /* Select active elememnts from Zn and inactive elements from Zm, | ||
59 | @@ -XXX,XX +XXX,XX @@ TRANS_FEAT(REVW, aa64_sve, gen_gvec_ool_arg_zpz, | ||
60 | |||
61 | static bool trans_SPLICE(DisasContext *s, arg_rprr_esz *a) | ||
62 | { | ||
63 | - if (sve_access_check(s)) { | ||
64 | - gen_gvec_ool_zzzp(s, gen_helper_sve_splice, | ||
65 | - a->rd, a->rn, a->rm, a->pg, a->esz); | ||
66 | - } | ||
67 | - return true; | ||
68 | + return gen_gvec_ool_zzzp(s, gen_helper_sve_splice, | ||
69 | + a->rd, a->rn, a->rm, a->pg, a->esz); | ||
70 | } | ||
71 | |||
72 | static bool trans_SPLICE_sve2(DisasContext *s, arg_rpr_esz *a) | ||
73 | @@ -XXX,XX +XXX,XX @@ static bool trans_SPLICE_sve2(DisasContext *s, arg_rpr_esz *a) | ||
74 | if (!dc_isar_feature(aa64_sve2, s)) { | ||
75 | return false; | ||
76 | } | ||
77 | - if (sve_access_check(s)) { | ||
78 | - gen_gvec_ool_zzzp(s, gen_helper_sve_splice, | ||
79 | - a->rd, a->rn, (a->rn + 1) % 32, a->pg, a->esz); | ||
80 | - } | ||
81 | - return true; | ||
82 | + return gen_gvec_ool_zzzp(s, gen_helper_sve_splice, | ||
83 | + a->rd, a->rn, (a->rn + 1) % 32, a->pg, a->esz); | ||
84 | } | ||
85 | |||
86 | /* | ||
87 | -- | ||
88 | 2.25.1 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Use gen_gvec_ool_arg_zpzz instead of gen_gvec_ool_zzzp | ||
4 | when the arguments come from arg_rprr_esz. | ||
5 | Replaces do_zpzz_ool. | ||
6 | |||
7 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
8 | Message-id: 20220527181907.189259-27-richard.henderson@linaro.org | ||
9 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
11 | --- | ||
12 | target/arm/translate-sve.c | 21 +++++++++++---------- | ||
13 | 1 file changed, 11 insertions(+), 10 deletions(-) | ||
14 | |||
15 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
16 | index XXXXXXX..XXXXXXX 100644 | ||
17 | --- a/target/arm/translate-sve.c | ||
18 | +++ b/target/arm/translate-sve.c | ||
19 | @@ -XXX,XX +XXX,XX @@ static bool gen_gvec_ool_zzzp(DisasContext *s, gen_helper_gvec_4 *fn, | ||
20 | return true; | ||
21 | } | ||
22 | |||
23 | +static bool gen_gvec_ool_arg_zpzz(DisasContext *s, gen_helper_gvec_4 *fn, | ||
24 | + arg_rprr_esz *a, int data) | ||
25 | +{ | ||
26 | + return gen_gvec_ool_zzzp(s, fn, a->rd, a->rn, a->rm, a->pg, data); | ||
27 | +} | ||
28 | + | ||
29 | /* Invoke a vector expander on two Zregs. */ | ||
30 | static void gen_gvec_fn_zz(DisasContext *s, GVecGen2Fn *gvec_fn, | ||
31 | int esz, int rd, int rn) | ||
32 | @@ -XXX,XX +XXX,XX @@ static bool trans_UQSUB_zzz(DisasContext *s, arg_rrr_esz *a) | ||
33 | *** SVE Integer Arithmetic - Binary Predicated Group | ||
34 | */ | ||
35 | |||
36 | -static bool do_zpzz_ool(DisasContext *s, arg_rprr_esz *a, gen_helper_gvec_4 *fn) | ||
37 | -{ | ||
38 | - return gen_gvec_ool_zzzp(s, fn, a->rd, a->rn, a->rm, a->pg, 0); | ||
39 | -} | ||
40 | - | ||
41 | /* Select active elememnts from Zn and inactive elements from Zm, | ||
42 | * storing the result in Zd. | ||
43 | */ | ||
44 | @@ -XXX,XX +XXX,XX @@ static bool trans_##NAME##_zpzz(DisasContext *s, arg_rprr_esz *a) \ | ||
45 | gen_helper_sve_##name##_zpzz_b, gen_helper_sve_##name##_zpzz_h, \ | ||
46 | gen_helper_sve_##name##_zpzz_s, gen_helper_sve_##name##_zpzz_d, \ | ||
47 | }; \ | ||
48 | - return do_zpzz_ool(s, a, fns[a->esz]); \ | ||
49 | + return gen_gvec_ool_arg_zpzz(s, fns[a->esz], a, 0); \ | ||
50 | } | ||
51 | |||
52 | DO_ZPZZ(AND, and) | ||
53 | @@ -XXX,XX +XXX,XX @@ static bool trans_SDIV_zpzz(DisasContext *s, arg_rprr_esz *a) | ||
54 | static gen_helper_gvec_4 * const fns[4] = { | ||
55 | NULL, NULL, gen_helper_sve_sdiv_zpzz_s, gen_helper_sve_sdiv_zpzz_d | ||
56 | }; | ||
57 | - return do_zpzz_ool(s, a, fns[a->esz]); | ||
58 | + return gen_gvec_ool_arg_zpzz(s, fns[a->esz], a, 0); | ||
59 | } | ||
60 | |||
61 | static bool trans_UDIV_zpzz(DisasContext *s, arg_rprr_esz *a) | ||
62 | @@ -XXX,XX +XXX,XX @@ static bool trans_UDIV_zpzz(DisasContext *s, arg_rprr_esz *a) | ||
63 | static gen_helper_gvec_4 * const fns[4] = { | ||
64 | NULL, NULL, gen_helper_sve_udiv_zpzz_s, gen_helper_sve_udiv_zpzz_d | ||
65 | }; | ||
66 | - return do_zpzz_ool(s, a, fns[a->esz]); | ||
67 | + return gen_gvec_ool_arg_zpzz(s, fns[a->esz], a, 0); | ||
68 | } | ||
69 | |||
70 | static bool trans_SEL_zpzz(DisasContext *s, arg_rprr_esz *a) | ||
71 | @@ -XXX,XX +XXX,XX @@ static bool trans_##NAME##_zpzw(DisasContext *s, arg_rprr_esz *a) \ | ||
72 | if (a->esz < 0 || a->esz >= 3) { \ | ||
73 | return false; \ | ||
74 | } \ | ||
75 | - return do_zpzz_ool(s, a, fns[a->esz]); \ | ||
76 | + return gen_gvec_ool_arg_zpzz(s, fns[a->esz], a, 0); \ | ||
77 | } | ||
78 | |||
79 | DO_ZPZW(ASR, asr) | ||
80 | @@ -XXX,XX +XXX,XX @@ static bool do_sve2_zpzz_ool(DisasContext *s, arg_rprr_esz *a, | ||
81 | if (!dc_isar_feature(aa64_sve2, s)) { | ||
82 | return false; | ||
83 | } | ||
84 | - return do_zpzz_ool(s, a, fn); | ||
85 | + return gen_gvec_ool_arg_zpzz(s, fn, a, 0); | ||
86 | } | ||
87 | |||
88 | static bool trans_SADALP_zpzz(DisasContext *s, arg_rprr_esz *a) | ||
89 | -- | ||
90 | 2.25.1 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Convert SVE translation functions directly using | ||
4 | gen_gvec_ool_arg_zpzz to TRANS_FEAT. | ||
5 | |||
6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
7 | Message-id: 20220527181907.189259-28-richard.henderson@linaro.org | ||
8 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
10 | --- | ||
11 | target/arm/translate-sve.c | 85 ++++++++++++++++---------------------- | ||
12 | 1 file changed, 36 insertions(+), 49 deletions(-) | ||
13 | |||
14 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
15 | index XXXXXXX..XXXXXXX 100644 | ||
16 | --- a/target/arm/translate-sve.c | ||
17 | +++ b/target/arm/translate-sve.c | ||
18 | @@ -XXX,XX +XXX,XX @@ static void do_sel_z(DisasContext *s, int rd, int rn, int rm, int pg, int esz) | ||
19 | gen_gvec_ool_zzzp(s, fns[esz], rd, rn, rm, pg, 0); | ||
20 | } | ||
21 | |||
22 | -#define DO_ZPZZ(NAME, name) \ | ||
23 | -static bool trans_##NAME##_zpzz(DisasContext *s, arg_rprr_esz *a) \ | ||
24 | -{ \ | ||
25 | - static gen_helper_gvec_4 * const fns[4] = { \ | ||
26 | - gen_helper_sve_##name##_zpzz_b, gen_helper_sve_##name##_zpzz_h, \ | ||
27 | - gen_helper_sve_##name##_zpzz_s, gen_helper_sve_##name##_zpzz_d, \ | ||
28 | +#define DO_ZPZZ(NAME, FEAT, name) \ | ||
29 | + static gen_helper_gvec_4 * const name##_zpzz_fns[4] = { \ | ||
30 | + gen_helper_##name##_zpzz_b, gen_helper_##name##_zpzz_h, \ | ||
31 | + gen_helper_##name##_zpzz_s, gen_helper_##name##_zpzz_d, \ | ||
32 | }; \ | ||
33 | - return gen_gvec_ool_arg_zpzz(s, fns[a->esz], a, 0); \ | ||
34 | -} | ||
35 | + TRANS_FEAT(NAME, FEAT, gen_gvec_ool_arg_zpzz, \ | ||
36 | + name##_zpzz_fns[a->esz], a, 0) | ||
37 | |||
38 | -DO_ZPZZ(AND, and) | ||
39 | -DO_ZPZZ(EOR, eor) | ||
40 | -DO_ZPZZ(ORR, orr) | ||
41 | -DO_ZPZZ(BIC, bic) | ||
42 | +DO_ZPZZ(AND_zpzz, aa64_sve, sve_and) | ||
43 | +DO_ZPZZ(EOR_zpzz, aa64_sve, sve_eor) | ||
44 | +DO_ZPZZ(ORR_zpzz, aa64_sve, sve_orr) | ||
45 | +DO_ZPZZ(BIC_zpzz, aa64_sve, sve_bic) | ||
46 | |||
47 | -DO_ZPZZ(ADD, add) | ||
48 | -DO_ZPZZ(SUB, sub) | ||
49 | +DO_ZPZZ(ADD_zpzz, aa64_sve, sve_add) | ||
50 | +DO_ZPZZ(SUB_zpzz, aa64_sve, sve_sub) | ||
51 | |||
52 | -DO_ZPZZ(SMAX, smax) | ||
53 | -DO_ZPZZ(UMAX, umax) | ||
54 | -DO_ZPZZ(SMIN, smin) | ||
55 | -DO_ZPZZ(UMIN, umin) | ||
56 | -DO_ZPZZ(SABD, sabd) | ||
57 | -DO_ZPZZ(UABD, uabd) | ||
58 | +DO_ZPZZ(SMAX_zpzz, aa64_sve, sve_smax) | ||
59 | +DO_ZPZZ(UMAX_zpzz, aa64_sve, sve_umax) | ||
60 | +DO_ZPZZ(SMIN_zpzz, aa64_sve, sve_smin) | ||
61 | +DO_ZPZZ(UMIN_zpzz, aa64_sve, sve_umin) | ||
62 | +DO_ZPZZ(SABD_zpzz, aa64_sve, sve_sabd) | ||
63 | +DO_ZPZZ(UABD_zpzz, aa64_sve, sve_uabd) | ||
64 | |||
65 | -DO_ZPZZ(MUL, mul) | ||
66 | -DO_ZPZZ(SMULH, smulh) | ||
67 | -DO_ZPZZ(UMULH, umulh) | ||
68 | +DO_ZPZZ(MUL_zpzz, aa64_sve, sve_mul) | ||
69 | +DO_ZPZZ(SMULH_zpzz, aa64_sve, sve_smulh) | ||
70 | +DO_ZPZZ(UMULH_zpzz, aa64_sve, sve_umulh) | ||
71 | |||
72 | -DO_ZPZZ(ASR, asr) | ||
73 | -DO_ZPZZ(LSR, lsr) | ||
74 | -DO_ZPZZ(LSL, lsl) | ||
75 | +DO_ZPZZ(ASR_zpzz, aa64_sve, sve_asr) | ||
76 | +DO_ZPZZ(LSR_zpzz, aa64_sve, sve_lsr) | ||
77 | +DO_ZPZZ(LSL_zpzz, aa64_sve, sve_lsl) | ||
78 | |||
79 | -static bool trans_SDIV_zpzz(DisasContext *s, arg_rprr_esz *a) | ||
80 | -{ | ||
81 | - static gen_helper_gvec_4 * const fns[4] = { | ||
82 | - NULL, NULL, gen_helper_sve_sdiv_zpzz_s, gen_helper_sve_sdiv_zpzz_d | ||
83 | - }; | ||
84 | - return gen_gvec_ool_arg_zpzz(s, fns[a->esz], a, 0); | ||
85 | -} | ||
86 | +static gen_helper_gvec_4 * const sdiv_fns[4] = { | ||
87 | + NULL, NULL, gen_helper_sve_sdiv_zpzz_s, gen_helper_sve_sdiv_zpzz_d | ||
88 | +}; | ||
89 | +TRANS_FEAT(SDIV_zpzz, aa64_sve, gen_gvec_ool_arg_zpzz, sdiv_fns[a->esz], a, 0) | ||
90 | |||
91 | -static bool trans_UDIV_zpzz(DisasContext *s, arg_rprr_esz *a) | ||
92 | -{ | ||
93 | - static gen_helper_gvec_4 * const fns[4] = { | ||
94 | - NULL, NULL, gen_helper_sve_udiv_zpzz_s, gen_helper_sve_udiv_zpzz_d | ||
95 | - }; | ||
96 | - return gen_gvec_ool_arg_zpzz(s, fns[a->esz], a, 0); | ||
97 | -} | ||
98 | +static gen_helper_gvec_4 * const udiv_fns[4] = { | ||
99 | + NULL, NULL, gen_helper_sve_udiv_zpzz_s, gen_helper_sve_udiv_zpzz_d | ||
100 | +}; | ||
101 | +TRANS_FEAT(UDIV_zpzz, aa64_sve, gen_gvec_ool_arg_zpzz, udiv_fns[a->esz], a, 0) | ||
102 | |||
103 | static bool trans_SEL_zpzz(DisasContext *s, arg_rprr_esz *a) | ||
104 | { | ||
105 | @@ -XXX,XX +XXX,XX @@ TRANS_FEAT(SQSHLU, aa64_sve2, gen_gvec_ool_arg_zpzi, | ||
106 | */ | ||
107 | |||
108 | #define DO_ZPZW(NAME, name) \ | ||
109 | -static bool trans_##NAME##_zpzw(DisasContext *s, arg_rprr_esz *a) \ | ||
110 | -{ \ | ||
111 | - static gen_helper_gvec_4 * const fns[3] = { \ | ||
112 | + static gen_helper_gvec_4 * const name##_zpzw_fns[4] = { \ | ||
113 | gen_helper_sve_##name##_zpzw_b, gen_helper_sve_##name##_zpzw_h, \ | ||
114 | - gen_helper_sve_##name##_zpzw_s, \ | ||
115 | + gen_helper_sve_##name##_zpzw_s, NULL \ | ||
116 | }; \ | ||
117 | - if (a->esz < 0 || a->esz >= 3) { \ | ||
118 | - return false; \ | ||
119 | - } \ | ||
120 | - return gen_gvec_ool_arg_zpzz(s, fns[a->esz], a, 0); \ | ||
121 | -} | ||
122 | + TRANS_FEAT(NAME##_zpzw, aa64_sve, gen_gvec_ool_arg_zpzz, \ | ||
123 | + a->esz < 0 ? NULL : name##_zpzw_fns[a->esz], a, 0) | ||
124 | |||
125 | DO_ZPZW(ASR, asr) | ||
126 | DO_ZPZW(LSR, lsr) | ||
127 | -- | ||
128 | 2.25.1 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Convert SVE translation functions using do_sve2_zpzz_ool | ||
4 | to use TRANS_FEAT and gen_gvec_ool_arg_zpzz. | ||
5 | |||
6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
7 | Message-id: 20220527181907.189259-29-richard.henderson@linaro.org | ||
8 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
10 | --- | ||
11 | target/arm/translate-sve.c | 118 +++++++++++++------------------------ | ||
12 | 1 file changed, 40 insertions(+), 78 deletions(-) | ||
13 | |||
14 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
15 | index XXXXXXX..XXXXXXX 100644 | ||
16 | --- a/target/arm/translate-sve.c | ||
17 | +++ b/target/arm/translate-sve.c | ||
18 | @@ -XXX,XX +XXX,XX @@ static bool trans_SEL_zpzz(DisasContext *s, arg_rprr_esz *a) | ||
19 | return true; | ||
20 | } | ||
21 | |||
22 | -#undef DO_ZPZZ | ||
23 | - | ||
24 | /* | ||
25 | *** SVE Integer Arithmetic - Unary Predicated Group | ||
26 | */ | ||
27 | @@ -XXX,XX +XXX,XX @@ TRANS_FEAT(SQRDMULH_zzz, aa64_sve2, gen_gvec_ool_arg_zzz, | ||
28 | * SVE2 Integer - Predicated | ||
29 | */ | ||
30 | |||
31 | -static bool do_sve2_zpzz_ool(DisasContext *s, arg_rprr_esz *a, | ||
32 | - gen_helper_gvec_4 *fn) | ||
33 | -{ | ||
34 | - if (!dc_isar_feature(aa64_sve2, s)) { | ||
35 | - return false; | ||
36 | - } | ||
37 | - return gen_gvec_ool_arg_zpzz(s, fn, a, 0); | ||
38 | -} | ||
39 | +static gen_helper_gvec_4 * const sadlp_fns[4] = { | ||
40 | + NULL, gen_helper_sve2_sadalp_zpzz_h, | ||
41 | + gen_helper_sve2_sadalp_zpzz_s, gen_helper_sve2_sadalp_zpzz_d, | ||
42 | +}; | ||
43 | +TRANS_FEAT(SADALP_zpzz, aa64_sve2, gen_gvec_ool_arg_zpzz, | ||
44 | + sadlp_fns[a->esz], a, 0) | ||
45 | |||
46 | -static bool trans_SADALP_zpzz(DisasContext *s, arg_rprr_esz *a) | ||
47 | -{ | ||
48 | - static gen_helper_gvec_4 * const fns[3] = { | ||
49 | - gen_helper_sve2_sadalp_zpzz_h, | ||
50 | - gen_helper_sve2_sadalp_zpzz_s, | ||
51 | - gen_helper_sve2_sadalp_zpzz_d, | ||
52 | - }; | ||
53 | - if (a->esz == 0) { | ||
54 | - return false; | ||
55 | - } | ||
56 | - return do_sve2_zpzz_ool(s, a, fns[a->esz - 1]); | ||
57 | -} | ||
58 | - | ||
59 | -static bool trans_UADALP_zpzz(DisasContext *s, arg_rprr_esz *a) | ||
60 | -{ | ||
61 | - static gen_helper_gvec_4 * const fns[3] = { | ||
62 | - gen_helper_sve2_uadalp_zpzz_h, | ||
63 | - gen_helper_sve2_uadalp_zpzz_s, | ||
64 | - gen_helper_sve2_uadalp_zpzz_d, | ||
65 | - }; | ||
66 | - if (a->esz == 0) { | ||
67 | - return false; | ||
68 | - } | ||
69 | - return do_sve2_zpzz_ool(s, a, fns[a->esz - 1]); | ||
70 | -} | ||
71 | +static gen_helper_gvec_4 * const uadlp_fns[4] = { | ||
72 | + NULL, gen_helper_sve2_uadalp_zpzz_h, | ||
73 | + gen_helper_sve2_uadalp_zpzz_s, gen_helper_sve2_uadalp_zpzz_d, | ||
74 | +}; | ||
75 | +TRANS_FEAT(UADALP_zpzz, aa64_sve2, gen_gvec_ool_arg_zpzz, | ||
76 | + uadlp_fns[a->esz], a, 0) | ||
77 | |||
78 | /* | ||
79 | * SVE2 integer unary operations (predicated) | ||
80 | @@ -XXX,XX +XXX,XX @@ static gen_helper_gvec_3 * const sqneg_fns[4] = { | ||
81 | }; | ||
82 | TRANS_FEAT(SQNEG, aa64_sve2, gen_gvec_ool_arg_zpz, sqneg_fns[a->esz], a, 0) | ||
83 | |||
84 | -#define DO_SVE2_ZPZZ(NAME, name) \ | ||
85 | -static bool trans_##NAME(DisasContext *s, arg_rprr_esz *a) \ | ||
86 | -{ \ | ||
87 | - static gen_helper_gvec_4 * const fns[4] = { \ | ||
88 | - gen_helper_sve2_##name##_zpzz_b, gen_helper_sve2_##name##_zpzz_h, \ | ||
89 | - gen_helper_sve2_##name##_zpzz_s, gen_helper_sve2_##name##_zpzz_d, \ | ||
90 | - }; \ | ||
91 | - return do_sve2_zpzz_ool(s, a, fns[a->esz]); \ | ||
92 | -} | ||
93 | +DO_ZPZZ(SQSHL, aa64_sve2, sve2_sqshl) | ||
94 | +DO_ZPZZ(SQRSHL, aa64_sve2, sve2_sqrshl) | ||
95 | +DO_ZPZZ(SRSHL, aa64_sve2, sve2_srshl) | ||
96 | |||
97 | -DO_SVE2_ZPZZ(SQSHL, sqshl) | ||
98 | -DO_SVE2_ZPZZ(SQRSHL, sqrshl) | ||
99 | -DO_SVE2_ZPZZ(SRSHL, srshl) | ||
100 | +DO_ZPZZ(UQSHL, aa64_sve2, sve2_uqshl) | ||
101 | +DO_ZPZZ(UQRSHL, aa64_sve2, sve2_uqrshl) | ||
102 | +DO_ZPZZ(URSHL, aa64_sve2, sve2_urshl) | ||
103 | |||
104 | -DO_SVE2_ZPZZ(UQSHL, uqshl) | ||
105 | -DO_SVE2_ZPZZ(UQRSHL, uqrshl) | ||
106 | -DO_SVE2_ZPZZ(URSHL, urshl) | ||
107 | +DO_ZPZZ(SHADD, aa64_sve2, sve2_shadd) | ||
108 | +DO_ZPZZ(SRHADD, aa64_sve2, sve2_srhadd) | ||
109 | +DO_ZPZZ(SHSUB, aa64_sve2, sve2_shsub) | ||
110 | |||
111 | -DO_SVE2_ZPZZ(SHADD, shadd) | ||
112 | -DO_SVE2_ZPZZ(SRHADD, srhadd) | ||
113 | -DO_SVE2_ZPZZ(SHSUB, shsub) | ||
114 | +DO_ZPZZ(UHADD, aa64_sve2, sve2_uhadd) | ||
115 | +DO_ZPZZ(URHADD, aa64_sve2, sve2_urhadd) | ||
116 | +DO_ZPZZ(UHSUB, aa64_sve2, sve2_uhsub) | ||
117 | |||
118 | -DO_SVE2_ZPZZ(UHADD, uhadd) | ||
119 | -DO_SVE2_ZPZZ(URHADD, urhadd) | ||
120 | -DO_SVE2_ZPZZ(UHSUB, uhsub) | ||
121 | +DO_ZPZZ(ADDP, aa64_sve2, sve2_addp) | ||
122 | +DO_ZPZZ(SMAXP, aa64_sve2, sve2_smaxp) | ||
123 | +DO_ZPZZ(UMAXP, aa64_sve2, sve2_umaxp) | ||
124 | +DO_ZPZZ(SMINP, aa64_sve2, sve2_sminp) | ||
125 | +DO_ZPZZ(UMINP, aa64_sve2, sve2_uminp) | ||
126 | |||
127 | -DO_SVE2_ZPZZ(ADDP, addp) | ||
128 | -DO_SVE2_ZPZZ(SMAXP, smaxp) | ||
129 | -DO_SVE2_ZPZZ(UMAXP, umaxp) | ||
130 | -DO_SVE2_ZPZZ(SMINP, sminp) | ||
131 | -DO_SVE2_ZPZZ(UMINP, uminp) | ||
132 | - | ||
133 | -DO_SVE2_ZPZZ(SQADD_zpzz, sqadd) | ||
134 | -DO_SVE2_ZPZZ(UQADD_zpzz, uqadd) | ||
135 | -DO_SVE2_ZPZZ(SQSUB_zpzz, sqsub) | ||
136 | -DO_SVE2_ZPZZ(UQSUB_zpzz, uqsub) | ||
137 | -DO_SVE2_ZPZZ(SUQADD, suqadd) | ||
138 | -DO_SVE2_ZPZZ(USQADD, usqadd) | ||
139 | +DO_ZPZZ(SQADD_zpzz, aa64_sve2, sve2_sqadd) | ||
140 | +DO_ZPZZ(UQADD_zpzz, aa64_sve2, sve2_uqadd) | ||
141 | +DO_ZPZZ(SQSUB_zpzz, aa64_sve2, sve2_sqsub) | ||
142 | +DO_ZPZZ(UQSUB_zpzz, aa64_sve2, sve2_uqsub) | ||
143 | +DO_ZPZZ(SUQADD, aa64_sve2, sve2_suqadd) | ||
144 | +DO_ZPZZ(USQADD, aa64_sve2, sve2_usqadd) | ||
145 | |||
146 | /* | ||
147 | * SVE2 Widening Integer Arithmetic | ||
148 | @@ -XXX,XX +XXX,XX @@ static bool trans_##NAME(DisasContext *s, arg_rprr_esz *a) \ | ||
149 | DO_SVE2_PPZZ_MATCH(MATCH, match) | ||
150 | DO_SVE2_PPZZ_MATCH(NMATCH, nmatch) | ||
151 | |||
152 | -static bool trans_HISTCNT(DisasContext *s, arg_rprr_esz *a) | ||
153 | -{ | ||
154 | - static gen_helper_gvec_4 * const fns[2] = { | ||
155 | - gen_helper_sve2_histcnt_s, gen_helper_sve2_histcnt_d | ||
156 | - }; | ||
157 | - if (a->esz < 2) { | ||
158 | - return false; | ||
159 | - } | ||
160 | - return do_sve2_zpzz_ool(s, a, fns[a->esz - 2]); | ||
161 | -} | ||
162 | +static gen_helper_gvec_4 * const histcnt_fns[4] = { | ||
163 | + NULL, NULL, gen_helper_sve2_histcnt_s, gen_helper_sve2_histcnt_d | ||
164 | +}; | ||
165 | +TRANS_FEAT(HISTCNT, aa64_sve2, gen_gvec_ool_arg_zpzz, | ||
166 | + histcnt_fns[a->esz], a, 0) | ||
167 | |||
168 | TRANS_FEAT(HISTSEG, aa64_sve2, gen_gvec_ool_arg_zzz, | ||
169 | a->esz == 0 ? gen_helper_sve2_histseg : NULL, a, 0) | ||
170 | -- | ||
171 | 2.25.1 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | There is only one caller for gen_gvec_fn_zz; inline it. | ||
4 | |||
5 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
6 | Message-id: 20220527181907.189259-30-richard.henderson@linaro.org | ||
7 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
9 | --- | ||
10 | target/arm/translate-sve.c | 13 +++---------- | ||
11 | 1 file changed, 3 insertions(+), 10 deletions(-) | ||
12 | |||
13 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
14 | index XXXXXXX..XXXXXXX 100644 | ||
15 | --- a/target/arm/translate-sve.c | ||
16 | +++ b/target/arm/translate-sve.c | ||
17 | @@ -XXX,XX +XXX,XX @@ static bool gen_gvec_ool_arg_zpzz(DisasContext *s, gen_helper_gvec_4 *fn, | ||
18 | return gen_gvec_ool_zzzp(s, fn, a->rd, a->rn, a->rm, a->pg, data); | ||
19 | } | ||
20 | |||
21 | -/* Invoke a vector expander on two Zregs. */ | ||
22 | -static void gen_gvec_fn_zz(DisasContext *s, GVecGen2Fn *gvec_fn, | ||
23 | - int esz, int rd, int rn) | ||
24 | -{ | ||
25 | - unsigned vsz = vec_full_reg_size(s); | ||
26 | - gvec_fn(esz, vec_full_reg_offset(s, rd), | ||
27 | - vec_full_reg_offset(s, rn), vsz, vsz); | ||
28 | -} | ||
29 | - | ||
30 | /* Invoke a vector expander on three Zregs. */ | ||
31 | static void gen_gvec_fn_zzz(DisasContext *s, GVecGen3Fn *gvec_fn, | ||
32 | int esz, int rd, int rn, int rm) | ||
33 | @@ -XXX,XX +XXX,XX @@ static void gen_gvec_fn_zzzz(DisasContext *s, GVecGen4Fn *gvec_fn, | ||
34 | static bool do_mov_z(DisasContext *s, int rd, int rn) | ||
35 | { | ||
36 | if (sve_access_check(s)) { | ||
37 | - gen_gvec_fn_zz(s, tcg_gen_gvec_mov, MO_8, rd, rn); | ||
38 | + unsigned vsz = vec_full_reg_size(s); | ||
39 | + tcg_gen_gvec_mov(MO_8, vec_full_reg_offset(s, rd), | ||
40 | + vec_full_reg_offset(s, rn), vsz, vsz); | ||
41 | } | ||
42 | return true; | ||
43 | } | ||
44 | -- | ||
45 | 2.25.1 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
4 | Message-id: 20220527181907.189259-31-richard.henderson@linaro.org | ||
5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | --- | ||
8 | target/arm/translate-sve.c | 36 +++++++++++++++--------------------- | ||
9 | 1 file changed, 15 insertions(+), 21 deletions(-) | ||
10 | |||
11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
12 | index XXXXXXX..XXXXXXX 100644 | ||
13 | --- a/target/arm/translate-sve.c | ||
14 | +++ b/target/arm/translate-sve.c | ||
15 | @@ -XXX,XX +XXX,XX @@ static bool gen_gvec_ool_arg_zpzz(DisasContext *s, gen_helper_gvec_4 *fn, | ||
16 | } | ||
17 | |||
18 | /* Invoke a vector expander on three Zregs. */ | ||
19 | -static void gen_gvec_fn_zzz(DisasContext *s, GVecGen3Fn *gvec_fn, | ||
20 | +static bool gen_gvec_fn_zzz(DisasContext *s, GVecGen3Fn *gvec_fn, | ||
21 | int esz, int rd, int rn, int rm) | ||
22 | { | ||
23 | - unsigned vsz = vec_full_reg_size(s); | ||
24 | - gvec_fn(esz, vec_full_reg_offset(s, rd), | ||
25 | - vec_full_reg_offset(s, rn), | ||
26 | - vec_full_reg_offset(s, rm), vsz, vsz); | ||
27 | + if (gvec_fn == NULL) { | ||
28 | + return false; | ||
29 | + } | ||
30 | + if (sve_access_check(s)) { | ||
31 | + unsigned vsz = vec_full_reg_size(s); | ||
32 | + gvec_fn(esz, vec_full_reg_offset(s, rd), | ||
33 | + vec_full_reg_offset(s, rn), | ||
34 | + vec_full_reg_offset(s, rm), vsz, vsz); | ||
35 | + } | ||
36 | + return true; | ||
37 | } | ||
38 | |||
39 | /* Invoke a vector expander on four Zregs. */ | ||
40 | @@ -XXX,XX +XXX,XX @@ const uint64_t pred_esz_masks[4] = { | ||
41 | |||
42 | static bool do_zzz_fn(DisasContext *s, arg_rrr_esz *a, GVecGen3Fn *gvec_fn) | ||
43 | { | ||
44 | - if (sve_access_check(s)) { | ||
45 | - gen_gvec_fn_zzz(s, gvec_fn, a->esz, a->rd, a->rn, a->rm); | ||
46 | - } | ||
47 | - return true; | ||
48 | + return gen_gvec_fn_zzz(s, gvec_fn, a->esz, a->rd, a->rn, a->rm); | ||
49 | } | ||
50 | |||
51 | static bool trans_AND_zzz(DisasContext *s, arg_rrr_esz *a) | ||
52 | @@ -XXX,XX +XXX,XX @@ static bool trans_MUL_zzz(DisasContext *s, arg_rrr_esz *a) | ||
53 | if (!dc_isar_feature(aa64_sve2, s)) { | ||
54 | return false; | ||
55 | } | ||
56 | - if (sve_access_check(s)) { | ||
57 | - gen_gvec_fn_zzz(s, tcg_gen_gvec_mul, a->esz, a->rd, a->rn, a->rm); | ||
58 | - } | ||
59 | - return true; | ||
60 | + return gen_gvec_fn_zzz(s, tcg_gen_gvec_mul, a->esz, a->rd, a->rn, a->rm); | ||
61 | } | ||
62 | |||
63 | static gen_helper_gvec_3 * const smulh_zzz_fns[4] = { | ||
64 | @@ -XXX,XX +XXX,XX @@ static bool do_sve2_fn_zzz(DisasContext *s, arg_rrr_esz *a, GVecGen3Fn *fn) | ||
65 | if (!dc_isar_feature(aa64_sve2, s)) { | ||
66 | return false; | ||
67 | } | ||
68 | - if (sve_access_check(s)) { | ||
69 | - gen_gvec_fn_zzz(s, fn, a->esz, a->rd, a->rn, a->rm); | ||
70 | - } | ||
71 | - return true; | ||
72 | + return gen_gvec_fn_zzz(s, fn, a->esz, a->rd, a->rn, a->rm); | ||
73 | } | ||
74 | |||
75 | static bool trans_SABA(DisasContext *s, arg_rrr_esz *a) | ||
76 | @@ -XXX,XX +XXX,XX @@ static bool trans_RAX1(DisasContext *s, arg_rrr_esz *a) | ||
77 | if (!dc_isar_feature(aa64_sve2_sha3, s)) { | ||
78 | return false; | ||
79 | } | ||
80 | - if (sve_access_check(s)) { | ||
81 | - gen_gvec_fn_zzz(s, gen_gvec_rax1, MO_64, a->rd, a->rn, a->rm); | ||
82 | - } | ||
83 | - return true; | ||
84 | + return gen_gvec_fn_zzz(s, gen_gvec_rax1, MO_64, a->rd, a->rn, a->rm); | ||
85 | } | ||
86 | |||
87 | static bool trans_FCVTNT_sh(DisasContext *s, arg_rpr_esz *a) | ||
88 | -- | ||
89 | 2.25.1 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Rename the function to match gen_gvec_fn_zzz, | ||
4 | and move to be adjacent. | ||
5 | |||
6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
7 | Message-id: 20220527181907.189259-32-richard.henderson@linaro.org | ||
8 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
10 | --- | ||
11 | target/arm/translate-sve.c | 31 ++++++++++++++++--------------- | ||
12 | 1 file changed, 16 insertions(+), 15 deletions(-) | ||
13 | |||
14 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
15 | index XXXXXXX..XXXXXXX 100644 | ||
16 | --- a/target/arm/translate-sve.c | ||
17 | +++ b/target/arm/translate-sve.c | ||
18 | @@ -XXX,XX +XXX,XX @@ static bool gen_gvec_fn_zzz(DisasContext *s, GVecGen3Fn *gvec_fn, | ||
19 | return true; | ||
20 | } | ||
21 | |||
22 | +static bool gen_gvec_fn_arg_zzz(DisasContext *s, GVecGen3Fn *fn, | ||
23 | + arg_rrr_esz *a) | ||
24 | +{ | ||
25 | + return gen_gvec_fn_zzz(s, fn, a->esz, a->rd, a->rn, a->rm); | ||
26 | +} | ||
27 | + | ||
28 | /* Invoke a vector expander on four Zregs. */ | ||
29 | static void gen_gvec_fn_zzzz(DisasContext *s, GVecGen4Fn *gvec_fn, | ||
30 | int esz, int rd, int rn, int rm, int ra) | ||
31 | @@ -XXX,XX +XXX,XX @@ const uint64_t pred_esz_masks[4] = { | ||
32 | *** SVE Logical - Unpredicated Group | ||
33 | */ | ||
34 | |||
35 | -static bool do_zzz_fn(DisasContext *s, arg_rrr_esz *a, GVecGen3Fn *gvec_fn) | ||
36 | -{ | ||
37 | - return gen_gvec_fn_zzz(s, gvec_fn, a->esz, a->rd, a->rn, a->rm); | ||
38 | -} | ||
39 | - | ||
40 | static bool trans_AND_zzz(DisasContext *s, arg_rrr_esz *a) | ||
41 | { | ||
42 | - return do_zzz_fn(s, a, tcg_gen_gvec_and); | ||
43 | + return gen_gvec_fn_arg_zzz(s, tcg_gen_gvec_and, a); | ||
44 | } | ||
45 | |||
46 | static bool trans_ORR_zzz(DisasContext *s, arg_rrr_esz *a) | ||
47 | { | ||
48 | - return do_zzz_fn(s, a, tcg_gen_gvec_or); | ||
49 | + return gen_gvec_fn_arg_zzz(s, tcg_gen_gvec_or, a); | ||
50 | } | ||
51 | |||
52 | static bool trans_EOR_zzz(DisasContext *s, arg_rrr_esz *a) | ||
53 | { | ||
54 | - return do_zzz_fn(s, a, tcg_gen_gvec_xor); | ||
55 | + return gen_gvec_fn_arg_zzz(s, tcg_gen_gvec_xor, a); | ||
56 | } | ||
57 | |||
58 | static bool trans_BIC_zzz(DisasContext *s, arg_rrr_esz *a) | ||
59 | { | ||
60 | - return do_zzz_fn(s, a, tcg_gen_gvec_andc); | ||
61 | + return gen_gvec_fn_arg_zzz(s, tcg_gen_gvec_andc, a); | ||
62 | } | ||
63 | |||
64 | static void gen_xar8_i64(TCGv_i64 d, TCGv_i64 n, TCGv_i64 m, int64_t sh) | ||
65 | @@ -XXX,XX +XXX,XX @@ static bool trans_NBSL(DisasContext *s, arg_rrrr_esz *a) | ||
66 | |||
67 | static bool trans_ADD_zzz(DisasContext *s, arg_rrr_esz *a) | ||
68 | { | ||
69 | - return do_zzz_fn(s, a, tcg_gen_gvec_add); | ||
70 | + return gen_gvec_fn_arg_zzz(s, tcg_gen_gvec_add, a); | ||
71 | } | ||
72 | |||
73 | static bool trans_SUB_zzz(DisasContext *s, arg_rrr_esz *a) | ||
74 | { | ||
75 | - return do_zzz_fn(s, a, tcg_gen_gvec_sub); | ||
76 | + return gen_gvec_fn_arg_zzz(s, tcg_gen_gvec_sub, a); | ||
77 | } | ||
78 | |||
79 | static bool trans_SQADD_zzz(DisasContext *s, arg_rrr_esz *a) | ||
80 | { | ||
81 | - return do_zzz_fn(s, a, tcg_gen_gvec_ssadd); | ||
82 | + return gen_gvec_fn_arg_zzz(s, tcg_gen_gvec_ssadd, a); | ||
83 | } | ||
84 | |||
85 | static bool trans_SQSUB_zzz(DisasContext *s, arg_rrr_esz *a) | ||
86 | { | ||
87 | - return do_zzz_fn(s, a, tcg_gen_gvec_sssub); | ||
88 | + return gen_gvec_fn_arg_zzz(s, tcg_gen_gvec_sssub, a); | ||
89 | } | ||
90 | |||
91 | static bool trans_UQADD_zzz(DisasContext *s, arg_rrr_esz *a) | ||
92 | { | ||
93 | - return do_zzz_fn(s, a, tcg_gen_gvec_usadd); | ||
94 | + return gen_gvec_fn_arg_zzz(s, tcg_gen_gvec_usadd, a); | ||
95 | } | ||
96 | |||
97 | static bool trans_UQSUB_zzz(DisasContext *s, arg_rrr_esz *a) | ||
98 | { | ||
99 | - return do_zzz_fn(s, a, tcg_gen_gvec_ussub); | ||
100 | + return gen_gvec_fn_arg_zzz(s, tcg_gen_gvec_ussub, a); | ||
101 | } | ||
102 | |||
103 | /* | ||
104 | -- | ||
105 | 2.25.1 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Two uses of gen_gvec_fn_zzz can pass on arg_rrr_esz instead. | ||
4 | |||
5 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
6 | Message-id: 20220527181907.189259-33-richard.henderson@linaro.org | ||
7 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
9 | --- | ||
10 | target/arm/translate-sve.c | 4 ++-- | ||
11 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
12 | |||
13 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
14 | index XXXXXXX..XXXXXXX 100644 | ||
15 | --- a/target/arm/translate-sve.c | ||
16 | +++ b/target/arm/translate-sve.c | ||
17 | @@ -XXX,XX +XXX,XX @@ static bool trans_MUL_zzz(DisasContext *s, arg_rrr_esz *a) | ||
18 | if (!dc_isar_feature(aa64_sve2, s)) { | ||
19 | return false; | ||
20 | } | ||
21 | - return gen_gvec_fn_zzz(s, tcg_gen_gvec_mul, a->esz, a->rd, a->rn, a->rm); | ||
22 | + return gen_gvec_fn_arg_zzz(s, tcg_gen_gvec_mul, a); | ||
23 | } | ||
24 | |||
25 | static gen_helper_gvec_3 * const smulh_zzz_fns[4] = { | ||
26 | @@ -XXX,XX +XXX,XX @@ static bool do_sve2_fn_zzz(DisasContext *s, arg_rrr_esz *a, GVecGen3Fn *fn) | ||
27 | if (!dc_isar_feature(aa64_sve2, s)) { | ||
28 | return false; | ||
29 | } | ||
30 | - return gen_gvec_fn_zzz(s, fn, a->esz, a->rd, a->rn, a->rm); | ||
31 | + return gen_gvec_fn_arg_zzz(s, fn, a); | ||
32 | } | ||
33 | |||
34 | static bool trans_SABA(DisasContext *s, arg_rrr_esz *a) | ||
35 | -- | ||
36 | 2.25.1 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Convert SVE translation functions directly using | ||
4 | gen_gvec_fn_arg_zzz to TRANS_FEAT. | ||
5 | |||
6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
7 | Message-id: 20220527181907.189259-34-richard.henderson@linaro.org | ||
8 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
10 | --- | ||
11 | target/arm/translate-sve.c | 66 +++++++------------------------------- | ||
12 | 1 file changed, 11 insertions(+), 55 deletions(-) | ||
13 | |||
14 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
15 | index XXXXXXX..XXXXXXX 100644 | ||
16 | --- a/target/arm/translate-sve.c | ||
17 | +++ b/target/arm/translate-sve.c | ||
18 | @@ -XXX,XX +XXX,XX @@ const uint64_t pred_esz_masks[4] = { | ||
19 | *** SVE Logical - Unpredicated Group | ||
20 | */ | ||
21 | |||
22 | -static bool trans_AND_zzz(DisasContext *s, arg_rrr_esz *a) | ||
23 | -{ | ||
24 | - return gen_gvec_fn_arg_zzz(s, tcg_gen_gvec_and, a); | ||
25 | -} | ||
26 | - | ||
27 | -static bool trans_ORR_zzz(DisasContext *s, arg_rrr_esz *a) | ||
28 | -{ | ||
29 | - return gen_gvec_fn_arg_zzz(s, tcg_gen_gvec_or, a); | ||
30 | -} | ||
31 | - | ||
32 | -static bool trans_EOR_zzz(DisasContext *s, arg_rrr_esz *a) | ||
33 | -{ | ||
34 | - return gen_gvec_fn_arg_zzz(s, tcg_gen_gvec_xor, a); | ||
35 | -} | ||
36 | - | ||
37 | -static bool trans_BIC_zzz(DisasContext *s, arg_rrr_esz *a) | ||
38 | -{ | ||
39 | - return gen_gvec_fn_arg_zzz(s, tcg_gen_gvec_andc, a); | ||
40 | -} | ||
41 | +TRANS_FEAT(AND_zzz, aa64_sve, gen_gvec_fn_arg_zzz, tcg_gen_gvec_and, a) | ||
42 | +TRANS_FEAT(ORR_zzz, aa64_sve, gen_gvec_fn_arg_zzz, tcg_gen_gvec_or, a) | ||
43 | +TRANS_FEAT(EOR_zzz, aa64_sve, gen_gvec_fn_arg_zzz, tcg_gen_gvec_xor, a) | ||
44 | +TRANS_FEAT(BIC_zzz, aa64_sve, gen_gvec_fn_arg_zzz, tcg_gen_gvec_andc, a) | ||
45 | |||
46 | static void gen_xar8_i64(TCGv_i64 d, TCGv_i64 n, TCGv_i64 m, int64_t sh) | ||
47 | { | ||
48 | @@ -XXX,XX +XXX,XX @@ static bool trans_NBSL(DisasContext *s, arg_rrrr_esz *a) | ||
49 | *** SVE Integer Arithmetic - Unpredicated Group | ||
50 | */ | ||
51 | |||
52 | -static bool trans_ADD_zzz(DisasContext *s, arg_rrr_esz *a) | ||
53 | -{ | ||
54 | - return gen_gvec_fn_arg_zzz(s, tcg_gen_gvec_add, a); | ||
55 | -} | ||
56 | - | ||
57 | -static bool trans_SUB_zzz(DisasContext *s, arg_rrr_esz *a) | ||
58 | -{ | ||
59 | - return gen_gvec_fn_arg_zzz(s, tcg_gen_gvec_sub, a); | ||
60 | -} | ||
61 | - | ||
62 | -static bool trans_SQADD_zzz(DisasContext *s, arg_rrr_esz *a) | ||
63 | -{ | ||
64 | - return gen_gvec_fn_arg_zzz(s, tcg_gen_gvec_ssadd, a); | ||
65 | -} | ||
66 | - | ||
67 | -static bool trans_SQSUB_zzz(DisasContext *s, arg_rrr_esz *a) | ||
68 | -{ | ||
69 | - return gen_gvec_fn_arg_zzz(s, tcg_gen_gvec_sssub, a); | ||
70 | -} | ||
71 | - | ||
72 | -static bool trans_UQADD_zzz(DisasContext *s, arg_rrr_esz *a) | ||
73 | -{ | ||
74 | - return gen_gvec_fn_arg_zzz(s, tcg_gen_gvec_usadd, a); | ||
75 | -} | ||
76 | - | ||
77 | -static bool trans_UQSUB_zzz(DisasContext *s, arg_rrr_esz *a) | ||
78 | -{ | ||
79 | - return gen_gvec_fn_arg_zzz(s, tcg_gen_gvec_ussub, a); | ||
80 | -} | ||
81 | +TRANS_FEAT(ADD_zzz, aa64_sve, gen_gvec_fn_arg_zzz, tcg_gen_gvec_add, a) | ||
82 | +TRANS_FEAT(SUB_zzz, aa64_sve, gen_gvec_fn_arg_zzz, tcg_gen_gvec_sub, a) | ||
83 | +TRANS_FEAT(SQADD_zzz, aa64_sve, gen_gvec_fn_arg_zzz, tcg_gen_gvec_ssadd, a) | ||
84 | +TRANS_FEAT(SQSUB_zzz, aa64_sve, gen_gvec_fn_arg_zzz, tcg_gen_gvec_sssub, a) | ||
85 | +TRANS_FEAT(UQADD_zzz, aa64_sve, gen_gvec_fn_arg_zzz, tcg_gen_gvec_usadd, a) | ||
86 | +TRANS_FEAT(UQSUB_zzz, aa64_sve, gen_gvec_fn_arg_zzz, tcg_gen_gvec_ussub, a) | ||
87 | |||
88 | /* | ||
89 | *** SVE Integer Arithmetic - Binary Predicated Group | ||
90 | @@ -XXX,XX +XXX,XX @@ static bool trans_MOVPRFX_z(DisasContext *s, arg_rpr_esz *a) | ||
91 | * SVE2 Integer Multiply - Unpredicated | ||
92 | */ | ||
93 | |||
94 | -static bool trans_MUL_zzz(DisasContext *s, arg_rrr_esz *a) | ||
95 | -{ | ||
96 | - if (!dc_isar_feature(aa64_sve2, s)) { | ||
97 | - return false; | ||
98 | - } | ||
99 | - return gen_gvec_fn_arg_zzz(s, tcg_gen_gvec_mul, a); | ||
100 | -} | ||
101 | +TRANS_FEAT(MUL_zzz, aa64_sve2, gen_gvec_fn_arg_zzz, tcg_gen_gvec_mul, a) | ||
102 | |||
103 | static gen_helper_gvec_3 * const smulh_zzz_fns[4] = { | ||
104 | gen_helper_gvec_smulh_b, gen_helper_gvec_smulh_h, | ||
105 | -- | ||
106 | 2.25.1 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Convert SVE translation functions using do_sve2_fn_zzz | ||
4 | to use TRANS_FEAT and gen_gvec_fn_arg_zzz. | ||
5 | |||
6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
7 | Message-id: 20220527181907.189259-35-richard.henderson@linaro.org | ||
8 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
10 | --- | ||
11 | target/arm/translate-sve.c | 19 ++----------------- | ||
12 | 1 file changed, 2 insertions(+), 17 deletions(-) | ||
13 | |||
14 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
15 | index XXXXXXX..XXXXXXX 100644 | ||
16 | --- a/target/arm/translate-sve.c | ||
17 | +++ b/target/arm/translate-sve.c | ||
18 | @@ -XXX,XX +XXX,XX @@ static bool trans_SLI(DisasContext *s, arg_rri_esz *a) | ||
19 | return do_sve2_fn2i(s, a, gen_gvec_sli); | ||
20 | } | ||
21 | |||
22 | -static bool do_sve2_fn_zzz(DisasContext *s, arg_rrr_esz *a, GVecGen3Fn *fn) | ||
23 | -{ | ||
24 | - if (!dc_isar_feature(aa64_sve2, s)) { | ||
25 | - return false; | ||
26 | - } | ||
27 | - return gen_gvec_fn_arg_zzz(s, fn, a); | ||
28 | -} | ||
29 | - | ||
30 | -static bool trans_SABA(DisasContext *s, arg_rrr_esz *a) | ||
31 | -{ | ||
32 | - return do_sve2_fn_zzz(s, a, gen_gvec_saba); | ||
33 | -} | ||
34 | - | ||
35 | -static bool trans_UABA(DisasContext *s, arg_rrr_esz *a) | ||
36 | -{ | ||
37 | - return do_sve2_fn_zzz(s, a, gen_gvec_uaba); | ||
38 | -} | ||
39 | +TRANS_FEAT(SABA, aa64_sve2, gen_gvec_fn_arg_zzz, gen_gvec_saba, a) | ||
40 | +TRANS_FEAT(UABA, aa64_sve2, gen_gvec_fn_arg_zzz, gen_gvec_uaba, a) | ||
41 | |||
42 | static bool do_sve2_narrow_extract(DisasContext *s, arg_rri_esz *a, | ||
43 | const GVecGen2 ops[3]) | ||
44 | -- | ||
45 | 2.25.1 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | The decode for RAX1 sets esz to MO_8, because that's what | ||
4 | we use by default for "no esz present". We changed that | ||
5 | to MO_64 during translation because it is more logical for | ||
6 | the operation. However, the esz argument to gen_gvec_rax1 | ||
7 | is unused and forces MO_64 within that function, so there | ||
8 | is no need to do it here as well. | ||
9 | |||
10 | Simplify to use gen_gvec_fn_arg_zzz and TRANS_FEAT. | ||
11 | |||
12 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
13 | Message-id: 20220527181907.189259-36-richard.henderson@linaro.org | ||
14 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
15 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
16 | --- | ||
17 | target/arm/translate-sve.c | 8 +------- | ||
18 | 1 file changed, 1 insertion(+), 7 deletions(-) | ||
19 | |||
20 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
21 | index XXXXXXX..XXXXXXX 100644 | ||
22 | --- a/target/arm/translate-sve.c | ||
23 | +++ b/target/arm/translate-sve.c | ||
24 | @@ -XXX,XX +XXX,XX @@ TRANS_FEAT(SM4E, aa64_sve2_sm4, gen_gvec_ool_arg_zzz, | ||
25 | TRANS_FEAT(SM4EKEY, aa64_sve2_sm4, gen_gvec_ool_arg_zzz, | ||
26 | gen_helper_crypto_sm4ekey, a, 0) | ||
27 | |||
28 | -static bool trans_RAX1(DisasContext *s, arg_rrr_esz *a) | ||
29 | -{ | ||
30 | - if (!dc_isar_feature(aa64_sve2_sha3, s)) { | ||
31 | - return false; | ||
32 | - } | ||
33 | - return gen_gvec_fn_zzz(s, gen_gvec_rax1, MO_64, a->rd, a->rn, a->rm); | ||
34 | -} | ||
35 | +TRANS_FEAT(RAX1, aa64_sve2_sha3, gen_gvec_fn_arg_zzz, gen_gvec_rax1, a) | ||
36 | |||
37 | static bool trans_FCVTNT_sh(DisasContext *s, arg_rpr_esz *a) | ||
38 | { | ||
39 | -- | ||
40 | 2.25.1 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Merge gen_gvec_fn_zzzz with the sve access check and the | ||
4 | dereference of arg_rrrr_esz. | ||
5 | |||
6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
7 | Message-id: 20220527181907.189259-37-richard.henderson@linaro.org | ||
8 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
10 | --- | ||
11 | target/arm/translate-sve.c | 25 ++++++++++++++----------- | ||
12 | 1 file changed, 14 insertions(+), 11 deletions(-) | ||
13 | |||
14 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
15 | index XXXXXXX..XXXXXXX 100644 | ||
16 | --- a/target/arm/translate-sve.c | ||
17 | +++ b/target/arm/translate-sve.c | ||
18 | @@ -XXX,XX +XXX,XX @@ static bool gen_gvec_fn_arg_zzz(DisasContext *s, GVecGen3Fn *fn, | ||
19 | } | ||
20 | |||
21 | /* Invoke a vector expander on four Zregs. */ | ||
22 | -static void gen_gvec_fn_zzzz(DisasContext *s, GVecGen4Fn *gvec_fn, | ||
23 | - int esz, int rd, int rn, int rm, int ra) | ||
24 | +static bool gen_gvec_fn_arg_zzzz(DisasContext *s, GVecGen4Fn *gvec_fn, | ||
25 | + arg_rrrr_esz *a) | ||
26 | { | ||
27 | - unsigned vsz = vec_full_reg_size(s); | ||
28 | - gvec_fn(esz, vec_full_reg_offset(s, rd), | ||
29 | - vec_full_reg_offset(s, rn), | ||
30 | - vec_full_reg_offset(s, rm), | ||
31 | - vec_full_reg_offset(s, ra), vsz, vsz); | ||
32 | + if (gvec_fn == NULL) { | ||
33 | + return false; | ||
34 | + } | ||
35 | + if (sve_access_check(s)) { | ||
36 | + unsigned vsz = vec_full_reg_size(s); | ||
37 | + gvec_fn(a->esz, vec_full_reg_offset(s, a->rd), | ||
38 | + vec_full_reg_offset(s, a->rn), | ||
39 | + vec_full_reg_offset(s, a->rm), | ||
40 | + vec_full_reg_offset(s, a->ra), vsz, vsz); | ||
41 | + } | ||
42 | + return true; | ||
43 | } | ||
44 | |||
45 | /* Invoke a vector move on two Zregs. */ | ||
46 | @@ -XXX,XX +XXX,XX @@ static bool do_sve2_zzzz_fn(DisasContext *s, arg_rrrr_esz *a, GVecGen4Fn *fn) | ||
47 | if (!dc_isar_feature(aa64_sve2, s)) { | ||
48 | return false; | ||
49 | } | ||
50 | - if (sve_access_check(s)) { | ||
51 | - gen_gvec_fn_zzzz(s, fn, a->esz, a->rd, a->rn, a->rm, a->ra); | ||
52 | - } | ||
53 | - return true; | ||
54 | + return gen_gvec_fn_arg_zzzz(s, fn, a); | ||
55 | } | ||
56 | |||
57 | static void gen_eor3_i64(TCGv_i64 d, TCGv_i64 n, TCGv_i64 m, TCGv_i64 k) | ||
58 | -- | ||
59 | 2.25.1 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Convert SVE translation functions using do_sve2_zzzz_fn | ||
4 | to use TRANS_FEAT and gen_gvec_fn_arg_zzzz. | ||
5 | |||
6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
7 | Message-id: 20220527181907.189259-38-richard.henderson@linaro.org | ||
8 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
10 | --- | ||
11 | target/arm/translate-sve.c | 38 ++++++-------------------------------- | ||
12 | 1 file changed, 6 insertions(+), 32 deletions(-) | ||
13 | |||
14 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
15 | index XXXXXXX..XXXXXXX 100644 | ||
16 | --- a/target/arm/translate-sve.c | ||
17 | +++ b/target/arm/translate-sve.c | ||
18 | @@ -XXX,XX +XXX,XX @@ static bool trans_XAR(DisasContext *s, arg_rrri_esz *a) | ||
19 | return true; | ||
20 | } | ||
21 | |||
22 | -static bool do_sve2_zzzz_fn(DisasContext *s, arg_rrrr_esz *a, GVecGen4Fn *fn) | ||
23 | -{ | ||
24 | - if (!dc_isar_feature(aa64_sve2, s)) { | ||
25 | - return false; | ||
26 | - } | ||
27 | - return gen_gvec_fn_arg_zzzz(s, fn, a); | ||
28 | -} | ||
29 | - | ||
30 | static void gen_eor3_i64(TCGv_i64 d, TCGv_i64 n, TCGv_i64 m, TCGv_i64 k) | ||
31 | { | ||
32 | tcg_gen_xor_i64(d, n, m); | ||
33 | @@ -XXX,XX +XXX,XX @@ static void gen_eor3(unsigned vece, uint32_t d, uint32_t n, uint32_t m, | ||
34 | tcg_gen_gvec_4(d, n, m, a, oprsz, maxsz, &op); | ||
35 | } | ||
36 | |||
37 | -static bool trans_EOR3(DisasContext *s, arg_rrrr_esz *a) | ||
38 | -{ | ||
39 | - return do_sve2_zzzz_fn(s, a, gen_eor3); | ||
40 | -} | ||
41 | +TRANS_FEAT(EOR3, aa64_sve2, gen_gvec_fn_arg_zzzz, gen_eor3, a) | ||
42 | |||
43 | static void gen_bcax_i64(TCGv_i64 d, TCGv_i64 n, TCGv_i64 m, TCGv_i64 k) | ||
44 | { | ||
45 | @@ -XXX,XX +XXX,XX @@ static void gen_bcax(unsigned vece, uint32_t d, uint32_t n, uint32_t m, | ||
46 | tcg_gen_gvec_4(d, n, m, a, oprsz, maxsz, &op); | ||
47 | } | ||
48 | |||
49 | -static bool trans_BCAX(DisasContext *s, arg_rrrr_esz *a) | ||
50 | -{ | ||
51 | - return do_sve2_zzzz_fn(s, a, gen_bcax); | ||
52 | -} | ||
53 | +TRANS_FEAT(BCAX, aa64_sve2, gen_gvec_fn_arg_zzzz, gen_bcax, a) | ||
54 | |||
55 | static void gen_bsl(unsigned vece, uint32_t d, uint32_t n, uint32_t m, | ||
56 | uint32_t a, uint32_t oprsz, uint32_t maxsz) | ||
57 | @@ -XXX,XX +XXX,XX @@ static void gen_bsl(unsigned vece, uint32_t d, uint32_t n, uint32_t m, | ||
58 | tcg_gen_gvec_bitsel(vece, d, a, n, m, oprsz, maxsz); | ||
59 | } | ||
60 | |||
61 | -static bool trans_BSL(DisasContext *s, arg_rrrr_esz *a) | ||
62 | -{ | ||
63 | - return do_sve2_zzzz_fn(s, a, gen_bsl); | ||
64 | -} | ||
65 | +TRANS_FEAT(BSL, aa64_sve2, gen_gvec_fn_arg_zzzz, gen_bsl, a) | ||
66 | |||
67 | static void gen_bsl1n_i64(TCGv_i64 d, TCGv_i64 n, TCGv_i64 m, TCGv_i64 k) | ||
68 | { | ||
69 | @@ -XXX,XX +XXX,XX @@ static void gen_bsl1n(unsigned vece, uint32_t d, uint32_t n, uint32_t m, | ||
70 | tcg_gen_gvec_4(d, n, m, a, oprsz, maxsz, &op); | ||
71 | } | ||
72 | |||
73 | -static bool trans_BSL1N(DisasContext *s, arg_rrrr_esz *a) | ||
74 | -{ | ||
75 | - return do_sve2_zzzz_fn(s, a, gen_bsl1n); | ||
76 | -} | ||
77 | +TRANS_FEAT(BSL1N, aa64_sve2, gen_gvec_fn_arg_zzzz, gen_bsl1n, a) | ||
78 | |||
79 | static void gen_bsl2n_i64(TCGv_i64 d, TCGv_i64 n, TCGv_i64 m, TCGv_i64 k) | ||
80 | { | ||
81 | @@ -XXX,XX +XXX,XX @@ static void gen_bsl2n(unsigned vece, uint32_t d, uint32_t n, uint32_t m, | ||
82 | tcg_gen_gvec_4(d, n, m, a, oprsz, maxsz, &op); | ||
83 | } | ||
84 | |||
85 | -static bool trans_BSL2N(DisasContext *s, arg_rrrr_esz *a) | ||
86 | -{ | ||
87 | - return do_sve2_zzzz_fn(s, a, gen_bsl2n); | ||
88 | -} | ||
89 | +TRANS_FEAT(BSL2N, aa64_sve2, gen_gvec_fn_arg_zzzz, gen_bsl2n, a) | ||
90 | |||
91 | static void gen_nbsl_i64(TCGv_i64 d, TCGv_i64 n, TCGv_i64 m, TCGv_i64 k) | ||
92 | { | ||
93 | @@ -XXX,XX +XXX,XX @@ static void gen_nbsl(unsigned vece, uint32_t d, uint32_t n, uint32_t m, | ||
94 | tcg_gen_gvec_4(d, n, m, a, oprsz, maxsz, &op); | ||
95 | } | ||
96 | |||
97 | -static bool trans_NBSL(DisasContext *s, arg_rrrr_esz *a) | ||
98 | -{ | ||
99 | - return do_sve2_zzzz_fn(s, a, gen_nbsl); | ||
100 | -} | ||
101 | +TRANS_FEAT(NBSL, aa64_sve2, gen_gvec_fn_arg_zzzz, gen_nbsl, a) | ||
102 | |||
103 | /* | ||
104 | *** SVE Integer Arithmetic - Unpredicated Group | ||
105 | -- | ||
106 | 2.25.1 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | We have two places that perform this particular operation. | ||
4 | |||
5 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
6 | Message-id: 20220527181907.189259-39-richard.henderson@linaro.org | ||
7 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
9 | --- | ||
10 | target/arm/translate-sve.c | 30 +++++++++++++++++------------- | ||
11 | 1 file changed, 17 insertions(+), 13 deletions(-) | ||
12 | |||
13 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
14 | index XXXXXXX..XXXXXXX 100644 | ||
15 | --- a/target/arm/translate-sve.c | ||
16 | +++ b/target/arm/translate-sve.c | ||
17 | @@ -XXX,XX +XXX,XX @@ static bool gen_gvec_ool_arg_zpzz(DisasContext *s, gen_helper_gvec_4 *fn, | ||
18 | return gen_gvec_ool_zzzp(s, fn, a->rd, a->rn, a->rm, a->pg, data); | ||
19 | } | ||
20 | |||
21 | +/* Invoke a vector expander on two Zregs and an immediate. */ | ||
22 | +static bool gen_gvec_fn_zzi(DisasContext *s, GVecGen2iFn *gvec_fn, | ||
23 | + int esz, int rd, int rn, uint64_t imm) | ||
24 | +{ | ||
25 | + if (gvec_fn == NULL) { | ||
26 | + return false; | ||
27 | + } | ||
28 | + if (sve_access_check(s)) { | ||
29 | + unsigned vsz = vec_full_reg_size(s); | ||
30 | + gvec_fn(esz, vec_full_reg_offset(s, rd), | ||
31 | + vec_full_reg_offset(s, rn), imm, vsz, vsz); | ||
32 | + } | ||
33 | + return true; | ||
34 | +} | ||
35 | + | ||
36 | /* Invoke a vector expander on three Zregs. */ | ||
37 | static bool gen_gvec_fn_zzz(DisasContext *s, GVecGen3Fn *gvec_fn, | ||
38 | int esz, int rd, int rn, int rm) | ||
39 | @@ -XXX,XX +XXX,XX @@ static bool do_zz_dbm(DisasContext *s, arg_rr_dbm *a, GVecGen2iFn *gvec_fn) | ||
40 | extract32(a->dbm, 6, 6))) { | ||
41 | return false; | ||
42 | } | ||
43 | - if (sve_access_check(s)) { | ||
44 | - unsigned vsz = vec_full_reg_size(s); | ||
45 | - gvec_fn(MO_64, vec_full_reg_offset(s, a->rd), | ||
46 | - vec_full_reg_offset(s, a->rn), imm, vsz, vsz); | ||
47 | - } | ||
48 | - return true; | ||
49 | + return gen_gvec_fn_zzi(s, gvec_fn, MO_64, a->rd, a->rn, imm); | ||
50 | } | ||
51 | |||
52 | static bool trans_AND_zzi(DisasContext *s, arg_rr_dbm *a) | ||
53 | @@ -XXX,XX +XXX,XX @@ static bool do_sve2_fn2i(DisasContext *s, arg_rri_esz *a, GVecGen2iFn *fn) | ||
54 | if (a->esz < 0 || !dc_isar_feature(aa64_sve2, s)) { | ||
55 | return false; | ||
56 | } | ||
57 | - if (sve_access_check(s)) { | ||
58 | - unsigned vsz = vec_full_reg_size(s); | ||
59 | - unsigned rd_ofs = vec_full_reg_offset(s, a->rd); | ||
60 | - unsigned rn_ofs = vec_full_reg_offset(s, a->rn); | ||
61 | - fn(a->esz, rd_ofs, rn_ofs, a->imm, vsz, vsz); | ||
62 | - } | ||
63 | - return true; | ||
64 | + return gen_gvec_fn_zzi(s, fn, a->esz, a->rd, a->rn, a->imm); | ||
65 | } | ||
66 | |||
67 | static bool trans_SSRA(DisasContext *s, arg_rri_esz *a) | ||
68 | -- | ||
69 | 2.25.1 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
4 | Message-id: 20220527181907.189259-40-richard.henderson@linaro.org | ||
5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | --- | ||
8 | target/arm/translate-sve.c | 17 +++-------------- | ||
9 | 1 file changed, 3 insertions(+), 14 deletions(-) | ||
10 | |||
11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
12 | index XXXXXXX..XXXXXXX 100644 | ||
13 | --- a/target/arm/translate-sve.c | ||
14 | +++ b/target/arm/translate-sve.c | ||
15 | @@ -XXX,XX +XXX,XX @@ static bool do_zz_dbm(DisasContext *s, arg_rr_dbm *a, GVecGen2iFn *gvec_fn) | ||
16 | return gen_gvec_fn_zzi(s, gvec_fn, MO_64, a->rd, a->rn, imm); | ||
17 | } | ||
18 | |||
19 | -static bool trans_AND_zzi(DisasContext *s, arg_rr_dbm *a) | ||
20 | -{ | ||
21 | - return do_zz_dbm(s, a, tcg_gen_gvec_andi); | ||
22 | -} | ||
23 | - | ||
24 | -static bool trans_ORR_zzi(DisasContext *s, arg_rr_dbm *a) | ||
25 | -{ | ||
26 | - return do_zz_dbm(s, a, tcg_gen_gvec_ori); | ||
27 | -} | ||
28 | - | ||
29 | -static bool trans_EOR_zzi(DisasContext *s, arg_rr_dbm *a) | ||
30 | -{ | ||
31 | - return do_zz_dbm(s, a, tcg_gen_gvec_xori); | ||
32 | -} | ||
33 | +TRANS_FEAT(AND_zzi, aa64_sve, do_zz_dbm, a, tcg_gen_gvec_andi) | ||
34 | +TRANS_FEAT(ORR_zzi, aa64_sve, do_zz_dbm, a, tcg_gen_gvec_ori) | ||
35 | +TRANS_FEAT(EOR_zzi, aa64_sve, do_zz_dbm, a, tcg_gen_gvec_xori) | ||
36 | |||
37 | static bool trans_DUPM(DisasContext *s, arg_DUPM *a) | ||
38 | { | ||
39 | -- | ||
40 | 2.25.1 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | The check is already done in gen_gvec_ool_zzzp, | ||
4 | which is called by do_sel_z; remove from callers. | ||
5 | |||
6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
7 | Message-id: 20220527181907.189259-41-richard.henderson@linaro.org | ||
8 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
10 | --- | ||
11 | target/arm/translate-sve.c | 14 ++++---------- | ||
12 | 1 file changed, 4 insertions(+), 10 deletions(-) | ||
13 | |||
14 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
15 | index XXXXXXX..XXXXXXX 100644 | ||
16 | --- a/target/arm/translate-sve.c | ||
17 | +++ b/target/arm/translate-sve.c | ||
18 | @@ -XXX,XX +XXX,XX @@ TRANS_FEAT(UQSUB_zzz, aa64_sve, gen_gvec_fn_arg_zzz, tcg_gen_gvec_ussub, a) | ||
19 | /* Select active elememnts from Zn and inactive elements from Zm, | ||
20 | * storing the result in Zd. | ||
21 | */ | ||
22 | -static void do_sel_z(DisasContext *s, int rd, int rn, int rm, int pg, int esz) | ||
23 | +static bool do_sel_z(DisasContext *s, int rd, int rn, int rm, int pg, int esz) | ||
24 | { | ||
25 | static gen_helper_gvec_4 * const fns[4] = { | ||
26 | gen_helper_sve_sel_zpzz_b, gen_helper_sve_sel_zpzz_h, | ||
27 | gen_helper_sve_sel_zpzz_s, gen_helper_sve_sel_zpzz_d | ||
28 | }; | ||
29 | - gen_gvec_ool_zzzp(s, fns[esz], rd, rn, rm, pg, 0); | ||
30 | + return gen_gvec_ool_zzzp(s, fns[esz], rd, rn, rm, pg, 0); | ||
31 | } | ||
32 | |||
33 | #define DO_ZPZZ(NAME, FEAT, name) \ | ||
34 | @@ -XXX,XX +XXX,XX @@ TRANS_FEAT(UDIV_zpzz, aa64_sve, gen_gvec_ool_arg_zpzz, udiv_fns[a->esz], a, 0) | ||
35 | |||
36 | static bool trans_SEL_zpzz(DisasContext *s, arg_rprr_esz *a) | ||
37 | { | ||
38 | - if (sve_access_check(s)) { | ||
39 | - do_sel_z(s, a->rd, a->rn, a->rm, a->pg, a->esz); | ||
40 | - } | ||
41 | - return true; | ||
42 | + return do_sel_z(s, a->rd, a->rn, a->rm, a->pg, a->esz); | ||
43 | } | ||
44 | |||
45 | /* | ||
46 | @@ -XXX,XX +XXX,XX @@ static bool trans_MOVPRFX(DisasContext *s, arg_MOVPRFX *a) | ||
47 | |||
48 | static bool trans_MOVPRFX_m(DisasContext *s, arg_rpr_esz *a) | ||
49 | { | ||
50 | - if (sve_access_check(s)) { | ||
51 | - do_sel_z(s, a->rd, a->rn, a->rd, a->pg, a->esz); | ||
52 | - } | ||
53 | - return true; | ||
54 | + return do_sel_z(s, a->rd, a->rn, a->rd, a->pg, a->esz); | ||
55 | } | ||
56 | |||
57 | static bool trans_MOVPRFX_z(DisasContext *s, arg_rpr_esz *a) | ||
58 | -- | ||
59 | 2.25.1 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | We have two places that perform this particular operation. | ||
4 | |||
5 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
6 | Message-id: 20220527181907.189259-42-richard.henderson@linaro.org | ||
7 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
9 | --- | ||
10 | target/arm/translate-sve.c | 21 +++++++++++++-------- | ||
11 | 1 file changed, 13 insertions(+), 8 deletions(-) | ||
12 | |||
13 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
14 | index XXXXXXX..XXXXXXX 100644 | ||
15 | --- a/target/arm/translate-sve.c | ||
16 | +++ b/target/arm/translate-sve.c | ||
17 | @@ -XXX,XX +XXX,XX @@ static bool gen_gvec_fn_zzi(DisasContext *s, GVecGen2iFn *gvec_fn, | ||
18 | return true; | ||
19 | } | ||
20 | |||
21 | +static bool gen_gvec_fn_arg_zzi(DisasContext *s, GVecGen2iFn *gvec_fn, | ||
22 | + arg_rri_esz *a) | ||
23 | +{ | ||
24 | + if (a->esz < 0) { | ||
25 | + /* Invalid tsz encoding -- see tszimm_esz. */ | ||
26 | + return false; | ||
27 | + } | ||
28 | + return gen_gvec_fn_zzi(s, gvec_fn, a->esz, a->rd, a->rn, a->imm); | ||
29 | +} | ||
30 | + | ||
31 | /* Invoke a vector expander on three Zregs. */ | ||
32 | static bool gen_gvec_fn_zzz(DisasContext *s, GVecGen3Fn *gvec_fn, | ||
33 | int esz, int rd, int rn, int rm) | ||
34 | @@ -XXX,XX +XXX,XX @@ static bool trans_ADD_zzi(DisasContext *s, arg_rri_esz *a) | ||
35 | if (a->esz == 0 && extract32(s->insn, 13, 1)) { | ||
36 | return false; | ||
37 | } | ||
38 | - if (sve_access_check(s)) { | ||
39 | - unsigned vsz = vec_full_reg_size(s); | ||
40 | - tcg_gen_gvec_addi(a->esz, vec_full_reg_offset(s, a->rd), | ||
41 | - vec_full_reg_offset(s, a->rn), a->imm, vsz, vsz); | ||
42 | - } | ||
43 | - return true; | ||
44 | + return gen_gvec_fn_arg_zzi(s, tcg_gen_gvec_addi, a); | ||
45 | } | ||
46 | |||
47 | static bool trans_SUB_zzi(DisasContext *s, arg_rri_esz *a) | ||
48 | @@ -XXX,XX +XXX,XX @@ TRANS_FEAT(ADCLT, aa64_sve2, do_adcl, a, true) | ||
49 | |||
50 | static bool do_sve2_fn2i(DisasContext *s, arg_rri_esz *a, GVecGen2iFn *fn) | ||
51 | { | ||
52 | - if (a->esz < 0 || !dc_isar_feature(aa64_sve2, s)) { | ||
53 | + if (!dc_isar_feature(aa64_sve2, s)) { | ||
54 | return false; | ||
55 | } | ||
56 | - return gen_gvec_fn_zzi(s, fn, a->esz, a->rd, a->rn, a->imm); | ||
57 | + return gen_gvec_fn_arg_zzi(s, fn, a); | ||
58 | } | ||
59 | |||
60 | static bool trans_SSRA(DisasContext *s, arg_rri_esz *a) | ||
61 | -- | ||
62 | 2.25.1 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Convert SVE translation functions using do_sve2_fn2i | ||
4 | to use TRANS_FEAT and gen_gvec_fn_arg_zzi. | ||
5 | |||
6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
7 | Message-id: 20220527181907.189259-43-richard.henderson@linaro.org | ||
8 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
10 | --- | ||
11 | target/arm/translate-sve.c | 43 ++++++-------------------------------- | ||
12 | 1 file changed, 6 insertions(+), 37 deletions(-) | ||
13 | |||
14 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
15 | index XXXXXXX..XXXXXXX 100644 | ||
16 | --- a/target/arm/translate-sve.c | ||
17 | +++ b/target/arm/translate-sve.c | ||
18 | @@ -XXX,XX +XXX,XX @@ static bool do_adcl(DisasContext *s, arg_rrrr_esz *a, bool sel) | ||
19 | TRANS_FEAT(ADCLB, aa64_sve2, do_adcl, a, false) | ||
20 | TRANS_FEAT(ADCLT, aa64_sve2, do_adcl, a, true) | ||
21 | |||
22 | -static bool do_sve2_fn2i(DisasContext *s, arg_rri_esz *a, GVecGen2iFn *fn) | ||
23 | -{ | ||
24 | - if (!dc_isar_feature(aa64_sve2, s)) { | ||
25 | - return false; | ||
26 | - } | ||
27 | - return gen_gvec_fn_arg_zzi(s, fn, a); | ||
28 | -} | ||
29 | - | ||
30 | -static bool trans_SSRA(DisasContext *s, arg_rri_esz *a) | ||
31 | -{ | ||
32 | - return do_sve2_fn2i(s, a, gen_gvec_ssra); | ||
33 | -} | ||
34 | - | ||
35 | -static bool trans_USRA(DisasContext *s, arg_rri_esz *a) | ||
36 | -{ | ||
37 | - return do_sve2_fn2i(s, a, gen_gvec_usra); | ||
38 | -} | ||
39 | - | ||
40 | -static bool trans_SRSRA(DisasContext *s, arg_rri_esz *a) | ||
41 | -{ | ||
42 | - return do_sve2_fn2i(s, a, gen_gvec_srsra); | ||
43 | -} | ||
44 | - | ||
45 | -static bool trans_URSRA(DisasContext *s, arg_rri_esz *a) | ||
46 | -{ | ||
47 | - return do_sve2_fn2i(s, a, gen_gvec_ursra); | ||
48 | -} | ||
49 | - | ||
50 | -static bool trans_SRI(DisasContext *s, arg_rri_esz *a) | ||
51 | -{ | ||
52 | - return do_sve2_fn2i(s, a, gen_gvec_sri); | ||
53 | -} | ||
54 | - | ||
55 | -static bool trans_SLI(DisasContext *s, arg_rri_esz *a) | ||
56 | -{ | ||
57 | - return do_sve2_fn2i(s, a, gen_gvec_sli); | ||
58 | -} | ||
59 | +TRANS_FEAT(SSRA, aa64_sve2, gen_gvec_fn_arg_zzi, gen_gvec_ssra, a) | ||
60 | +TRANS_FEAT(USRA, aa64_sve2, gen_gvec_fn_arg_zzi, gen_gvec_usra, a) | ||
61 | +TRANS_FEAT(SRSRA, aa64_sve2, gen_gvec_fn_arg_zzi, gen_gvec_srsra, a) | ||
62 | +TRANS_FEAT(URSRA, aa64_sve2, gen_gvec_fn_arg_zzi, gen_gvec_ursra, a) | ||
63 | +TRANS_FEAT(SRI, aa64_sve2, gen_gvec_fn_arg_zzi, gen_gvec_sri, a) | ||
64 | +TRANS_FEAT(SLI, aa64_sve2, gen_gvec_fn_arg_zzi, gen_gvec_sli, a) | ||
65 | |||
66 | TRANS_FEAT(SABA, aa64_sve2, gen_gvec_fn_arg_zzz, gen_gvec_saba, a) | ||
67 | TRANS_FEAT(UABA, aa64_sve2, gen_gvec_fn_arg_zzz, gen_gvec_uaba, a) | ||
68 | -- | ||
69 | 2.25.1 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
4 | Message-id: 20220527181907.189259-45-richard.henderson@linaro.org | ||
5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | --- | ||
8 | target/arm/translate-sve.c | 17 +++-------------- | ||
9 | 1 file changed, 3 insertions(+), 14 deletions(-) | ||
10 | |||
11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
12 | index XXXXXXX..XXXXXXX 100644 | ||
13 | --- a/target/arm/translate-sve.c | ||
14 | +++ b/target/arm/translate-sve.c | ||
15 | @@ -XXX,XX +XXX,XX @@ static bool do_shift_imm(DisasContext *s, arg_rri_esz *a, bool asr, | ||
16 | return true; | ||
17 | } | ||
18 | |||
19 | -static bool trans_ASR_zzi(DisasContext *s, arg_rri_esz *a) | ||
20 | -{ | ||
21 | - return do_shift_imm(s, a, true, tcg_gen_gvec_sari); | ||
22 | -} | ||
23 | - | ||
24 | -static bool trans_LSR_zzi(DisasContext *s, arg_rri_esz *a) | ||
25 | -{ | ||
26 | - return do_shift_imm(s, a, false, tcg_gen_gvec_shri); | ||
27 | -} | ||
28 | - | ||
29 | -static bool trans_LSL_zzi(DisasContext *s, arg_rri_esz *a) | ||
30 | -{ | ||
31 | - return do_shift_imm(s, a, false, tcg_gen_gvec_shli); | ||
32 | -} | ||
33 | +TRANS_FEAT(ASR_zzi, aa64_sve, do_shift_imm, a, true, tcg_gen_gvec_sari) | ||
34 | +TRANS_FEAT(LSR_zzi, aa64_sve, do_shift_imm, a, false, tcg_gen_gvec_shri) | ||
35 | +TRANS_FEAT(LSL_zzi, aa64_sve, do_shift_imm, a, false, tcg_gen_gvec_shli) | ||
36 | |||
37 | #define DO_ZZW(NAME, name) \ | ||
38 | static gen_helper_gvec_3 * const name##_zzw_fns[4] = { \ | ||
39 | -- | ||
40 | 2.25.1 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
4 | Message-id: 20220527181907.189259-47-richard.henderson@linaro.org | ||
5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | --- | ||
8 | target/arm/translate-sve.c | 52 +++++++++++++++----------------------- | ||
9 | 1 file changed, 20 insertions(+), 32 deletions(-) | ||
10 | |||
11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
12 | index XXXXXXX..XXXXXXX 100644 | ||
13 | --- a/target/arm/translate-sve.c | ||
14 | +++ b/target/arm/translate-sve.c | ||
15 | @@ -XXX,XX +XXX,XX @@ static bool do_shift_zpzi(DisasContext *s, arg_rpri_esz *a, bool asr, | ||
16 | return gen_gvec_ool_arg_zpzi(s, fns[a->esz], a); | ||
17 | } | ||
18 | |||
19 | -static bool trans_ASR_zpzi(DisasContext *s, arg_rpri_esz *a) | ||
20 | -{ | ||
21 | - static gen_helper_gvec_3 * const fns[4] = { | ||
22 | - gen_helper_sve_asr_zpzi_b, gen_helper_sve_asr_zpzi_h, | ||
23 | - gen_helper_sve_asr_zpzi_s, gen_helper_sve_asr_zpzi_d, | ||
24 | - }; | ||
25 | - return do_shift_zpzi(s, a, true, fns); | ||
26 | -} | ||
27 | +static gen_helper_gvec_3 * const asr_zpzi_fns[4] = { | ||
28 | + gen_helper_sve_asr_zpzi_b, gen_helper_sve_asr_zpzi_h, | ||
29 | + gen_helper_sve_asr_zpzi_s, gen_helper_sve_asr_zpzi_d, | ||
30 | +}; | ||
31 | +TRANS_FEAT(ASR_zpzi, aa64_sve, do_shift_zpzi, a, true, asr_zpzi_fns) | ||
32 | |||
33 | -static bool trans_LSR_zpzi(DisasContext *s, arg_rpri_esz *a) | ||
34 | -{ | ||
35 | - static gen_helper_gvec_3 * const fns[4] = { | ||
36 | - gen_helper_sve_lsr_zpzi_b, gen_helper_sve_lsr_zpzi_h, | ||
37 | - gen_helper_sve_lsr_zpzi_s, gen_helper_sve_lsr_zpzi_d, | ||
38 | - }; | ||
39 | - return do_shift_zpzi(s, a, false, fns); | ||
40 | -} | ||
41 | +static gen_helper_gvec_3 * const lsr_zpzi_fns[4] = { | ||
42 | + gen_helper_sve_lsr_zpzi_b, gen_helper_sve_lsr_zpzi_h, | ||
43 | + gen_helper_sve_lsr_zpzi_s, gen_helper_sve_lsr_zpzi_d, | ||
44 | +}; | ||
45 | +TRANS_FEAT(LSR_zpzi, aa64_sve, do_shift_zpzi, a, false, lsr_zpzi_fns) | ||
46 | |||
47 | -static bool trans_LSL_zpzi(DisasContext *s, arg_rpri_esz *a) | ||
48 | -{ | ||
49 | - static gen_helper_gvec_3 * const fns[4] = { | ||
50 | - gen_helper_sve_lsl_zpzi_b, gen_helper_sve_lsl_zpzi_h, | ||
51 | - gen_helper_sve_lsl_zpzi_s, gen_helper_sve_lsl_zpzi_d, | ||
52 | - }; | ||
53 | - return do_shift_zpzi(s, a, false, fns); | ||
54 | -} | ||
55 | +static gen_helper_gvec_3 * const lsl_zpzi_fns[4] = { | ||
56 | + gen_helper_sve_lsl_zpzi_b, gen_helper_sve_lsl_zpzi_h, | ||
57 | + gen_helper_sve_lsl_zpzi_s, gen_helper_sve_lsl_zpzi_d, | ||
58 | +}; | ||
59 | +TRANS_FEAT(LSL_zpzi, aa64_sve, do_shift_zpzi, a, false, lsl_zpzi_fns) | ||
60 | |||
61 | -static bool trans_ASRD(DisasContext *s, arg_rpri_esz *a) | ||
62 | -{ | ||
63 | - static gen_helper_gvec_3 * const fns[4] = { | ||
64 | - gen_helper_sve_asrd_b, gen_helper_sve_asrd_h, | ||
65 | - gen_helper_sve_asrd_s, gen_helper_sve_asrd_d, | ||
66 | - }; | ||
67 | - return do_shift_zpzi(s, a, false, fns); | ||
68 | -} | ||
69 | +static gen_helper_gvec_3 * const asrd_fns[4] = { | ||
70 | + gen_helper_sve_asrd_b, gen_helper_sve_asrd_h, | ||
71 | + gen_helper_sve_asrd_s, gen_helper_sve_asrd_d, | ||
72 | +}; | ||
73 | +TRANS_FEAT(ASRD, aa64_sve, do_shift_zpzi, a, false, asrd_fns) | ||
74 | |||
75 | static gen_helper_gvec_3 * const sqshl_zpzi_fns[4] = { | ||
76 | gen_helper_sve2_sqshl_zpzi_b, gen_helper_sve2_sqshl_zpzi_h, | ||
77 | -- | ||
78 | 2.25.1 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Remove the DO_ZPZZZ macro, as it had just the two uses. | ||
4 | |||
5 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
6 | Message-id: 20220527181907.189259-48-richard.henderson@linaro.org | ||
7 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
9 | --- | ||
10 | target/arm/translate-sve.c | 23 ++++++++++------------- | ||
11 | 1 file changed, 10 insertions(+), 13 deletions(-) | ||
12 | |||
13 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
14 | index XXXXXXX..XXXXXXX 100644 | ||
15 | --- a/target/arm/translate-sve.c | ||
16 | +++ b/target/arm/translate-sve.c | ||
17 | @@ -XXX,XX +XXX,XX @@ static bool do_zpzzz_ool(DisasContext *s, arg_rprrr_esz *a, | ||
18 | return true; | ||
19 | } | ||
20 | |||
21 | -#define DO_ZPZZZ(NAME, name) \ | ||
22 | -static bool trans_##NAME(DisasContext *s, arg_rprrr_esz *a) \ | ||
23 | -{ \ | ||
24 | - static gen_helper_gvec_5 * const fns[4] = { \ | ||
25 | - gen_helper_sve_##name##_b, gen_helper_sve_##name##_h, \ | ||
26 | - gen_helper_sve_##name##_s, gen_helper_sve_##name##_d, \ | ||
27 | - }; \ | ||
28 | - return do_zpzzz_ool(s, a, fns[a->esz]); \ | ||
29 | -} | ||
30 | +static gen_helper_gvec_5 * const mla_fns[4] = { | ||
31 | + gen_helper_sve_mla_b, gen_helper_sve_mla_h, | ||
32 | + gen_helper_sve_mla_s, gen_helper_sve_mla_d, | ||
33 | +}; | ||
34 | +TRANS_FEAT(MLA, aa64_sve, do_zpzzz_ool, a, mla_fns[a->esz]) | ||
35 | |||
36 | -DO_ZPZZZ(MLA, mla) | ||
37 | -DO_ZPZZZ(MLS, mls) | ||
38 | - | ||
39 | -#undef DO_ZPZZZ | ||
40 | +static gen_helper_gvec_5 * const mls_fns[4] = { | ||
41 | + gen_helper_sve_mls_b, gen_helper_sve_mls_h, | ||
42 | + gen_helper_sve_mls_s, gen_helper_sve_mls_d, | ||
43 | +}; | ||
44 | +TRANS_FEAT(MLS, aa64_sve, do_zpzzz_ool, a, mls_fns[a->esz]) | ||
45 | |||
46 | /* | ||
47 | *** SVE Index Generation Group | ||
48 | -- | ||
49 | 2.25.1 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
4 | Message-id: 20220527181907.189259-50-richard.henderson@linaro.org | ||
5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | --- | ||
8 | target/arm/translate-sve.c | 35 ++++++++--------------------------- | ||
9 | 1 file changed, 8 insertions(+), 27 deletions(-) | ||
10 | |||
11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
12 | index XXXXXXX..XXXXXXX 100644 | ||
13 | --- a/target/arm/translate-sve.c | ||
14 | +++ b/target/arm/translate-sve.c | ||
15 | @@ -XXX,XX +XXX,XX @@ static bool do_index(DisasContext *s, int esz, int rd, | ||
16 | return true; | ||
17 | } | ||
18 | |||
19 | -static bool trans_INDEX_ii(DisasContext *s, arg_INDEX_ii *a) | ||
20 | -{ | ||
21 | - TCGv_i64 start = tcg_constant_i64(a->imm1); | ||
22 | - TCGv_i64 incr = tcg_constant_i64(a->imm2); | ||
23 | - return do_index(s, a->esz, a->rd, start, incr); | ||
24 | -} | ||
25 | - | ||
26 | -static bool trans_INDEX_ir(DisasContext *s, arg_INDEX_ir *a) | ||
27 | -{ | ||
28 | - TCGv_i64 start = tcg_constant_i64(a->imm); | ||
29 | - TCGv_i64 incr = cpu_reg(s, a->rm); | ||
30 | - return do_index(s, a->esz, a->rd, start, incr); | ||
31 | -} | ||
32 | - | ||
33 | -static bool trans_INDEX_ri(DisasContext *s, arg_INDEX_ri *a) | ||
34 | -{ | ||
35 | - TCGv_i64 start = cpu_reg(s, a->rn); | ||
36 | - TCGv_i64 incr = tcg_constant_i64(a->imm); | ||
37 | - return do_index(s, a->esz, a->rd, start, incr); | ||
38 | -} | ||
39 | - | ||
40 | -static bool trans_INDEX_rr(DisasContext *s, arg_INDEX_rr *a) | ||
41 | -{ | ||
42 | - TCGv_i64 start = cpu_reg(s, a->rn); | ||
43 | - TCGv_i64 incr = cpu_reg(s, a->rm); | ||
44 | - return do_index(s, a->esz, a->rd, start, incr); | ||
45 | -} | ||
46 | +TRANS_FEAT(INDEX_ii, aa64_sve, do_index, a->esz, a->rd, | ||
47 | + tcg_constant_i64(a->imm1), tcg_constant_i64(a->imm2)) | ||
48 | +TRANS_FEAT(INDEX_ir, aa64_sve, do_index, a->esz, a->rd, | ||
49 | + tcg_constant_i64(a->imm), cpu_reg(s, a->rm)) | ||
50 | +TRANS_FEAT(INDEX_ri, aa64_sve, do_index, a->esz, a->rd, | ||
51 | + cpu_reg(s, a->rn), tcg_constant_i64(a->imm)) | ||
52 | +TRANS_FEAT(INDEX_rr, aa64_sve, do_index, a->esz, a->rd, | ||
53 | + cpu_reg(s, a->rn), cpu_reg(s, a->rm)) | ||
54 | |||
55 | /* | ||
56 | *** SVE Stack Allocation Group | ||
57 | -- | ||
58 | 2.25.1 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
4 | Message-id: 20220527181907.189259-51-richard.henderson@linaro.org | ||
5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | --- | ||
8 | target/arm/translate-sve.c | 23 ++++------------------- | ||
9 | 1 file changed, 4 insertions(+), 19 deletions(-) | ||
10 | |||
11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
12 | index XXXXXXX..XXXXXXX 100644 | ||
13 | --- a/target/arm/translate-sve.c | ||
14 | +++ b/target/arm/translate-sve.c | ||
15 | @@ -XXX,XX +XXX,XX @@ static bool do_adr(DisasContext *s, arg_rrri *a, gen_helper_gvec_3 *fn) | ||
16 | return gen_gvec_ool_zzz(s, fn, a->rd, a->rn, a->rm, a->imm); | ||
17 | } | ||
18 | |||
19 | -static bool trans_ADR_p32(DisasContext *s, arg_rrri *a) | ||
20 | -{ | ||
21 | - return do_adr(s, a, gen_helper_sve_adr_p32); | ||
22 | -} | ||
23 | - | ||
24 | -static bool trans_ADR_p64(DisasContext *s, arg_rrri *a) | ||
25 | -{ | ||
26 | - return do_adr(s, a, gen_helper_sve_adr_p64); | ||
27 | -} | ||
28 | - | ||
29 | -static bool trans_ADR_s32(DisasContext *s, arg_rrri *a) | ||
30 | -{ | ||
31 | - return do_adr(s, a, gen_helper_sve_adr_s32); | ||
32 | -} | ||
33 | - | ||
34 | -static bool trans_ADR_u32(DisasContext *s, arg_rrri *a) | ||
35 | -{ | ||
36 | - return do_adr(s, a, gen_helper_sve_adr_u32); | ||
37 | -} | ||
38 | +TRANS_FEAT(ADR_p32, aa64_sve, do_adr, a, gen_helper_sve_adr_p32) | ||
39 | +TRANS_FEAT(ADR_p64, aa64_sve, do_adr, a, gen_helper_sve_adr_p64) | ||
40 | +TRANS_FEAT(ADR_s32, aa64_sve, do_adr, a, gen_helper_sve_adr_s32) | ||
41 | +TRANS_FEAT(ADR_u32, aa64_sve, do_adr, a, gen_helper_sve_adr_u32) | ||
42 | |||
43 | /* | ||
44 | *** SVE Integer Misc - Unpredicated Group | ||
45 | -- | ||
46 | 2.25.1 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
4 | Message-id: 20220527181907.189259-52-richard.henderson@linaro.org | ||
5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | --- | ||
8 | target/arm/translate-sve.c | 19 +++++-------------- | ||
9 | 1 file changed, 5 insertions(+), 14 deletions(-) | ||
10 | |||
11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
12 | index XXXXXXX..XXXXXXX 100644 | ||
13 | --- a/target/arm/translate-sve.c | ||
14 | +++ b/target/arm/translate-sve.c | ||
15 | @@ -XXX,XX +XXX,XX @@ static bool do_predset(DisasContext *s, int esz, int rd, int pat, bool setflag) | ||
16 | return true; | ||
17 | } | ||
18 | |||
19 | -static bool trans_PTRUE(DisasContext *s, arg_PTRUE *a) | ||
20 | -{ | ||
21 | - return do_predset(s, a->esz, a->rd, a->pat, a->s); | ||
22 | -} | ||
23 | +TRANS_FEAT(PTRUE, aa64_sve, do_predset, a->esz, a->rd, a->pat, a->s) | ||
24 | |||
25 | -static bool trans_SETFFR(DisasContext *s, arg_SETFFR *a) | ||
26 | -{ | ||
27 | - /* Note pat == 31 is #all, to set all elements. */ | ||
28 | - return do_predset(s, 0, FFR_PRED_NUM, 31, false); | ||
29 | -} | ||
30 | +/* Note pat == 31 is #all, to set all elements. */ | ||
31 | +TRANS_FEAT(SETFFR, aa64_sve, do_predset, 0, FFR_PRED_NUM, 31, false) | ||
32 | |||
33 | -static bool trans_PFALSE(DisasContext *s, arg_PFALSE *a) | ||
34 | -{ | ||
35 | - /* Note pat == 32 is #unimp, to set no elements. */ | ||
36 | - return do_predset(s, 0, a->rd, 32, false); | ||
37 | -} | ||
38 | +/* Note pat == 32 is #unimp, to set no elements. */ | ||
39 | +TRANS_FEAT(PFALSE, aa64_sve, do_predset, 0, a->rd, 32, false) | ||
40 | |||
41 | static bool trans_RDFFR_p(DisasContext *s, arg_RDFFR_p *a) | ||
42 | { | ||
43 | -- | ||
44 | 2.25.1 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
4 | Message-id: 20220527181907.189259-53-richard.henderson@linaro.org | ||
5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | --- | ||
8 | target/arm/translate-sve.c | 11 ++--------- | ||
9 | 1 file changed, 2 insertions(+), 9 deletions(-) | ||
10 | |||
11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
12 | index XXXXXXX..XXXXXXX 100644 | ||
13 | --- a/target/arm/translate-sve.c | ||
14 | +++ b/target/arm/translate-sve.c | ||
15 | @@ -XXX,XX +XXX,XX @@ static bool trans_RDFFR_p(DisasContext *s, arg_RDFFR_p *a) | ||
16 | return trans_AND_pppp(s, &alt_a); | ||
17 | } | ||
18 | |||
19 | -static bool trans_RDFFR(DisasContext *s, arg_RDFFR *a) | ||
20 | -{ | ||
21 | - return do_mov_p(s, a->rd, FFR_PRED_NUM); | ||
22 | -} | ||
23 | - | ||
24 | -static bool trans_WRFFR(DisasContext *s, arg_WRFFR *a) | ||
25 | -{ | ||
26 | - return do_mov_p(s, FFR_PRED_NUM, a->rn); | ||
27 | -} | ||
28 | +TRANS_FEAT(RDFFR, aa64_sve, do_mov_p, a->rd, FFR_PRED_NUM) | ||
29 | +TRANS_FEAT(WRFFR, aa64_sve, do_mov_p, FFR_PRED_NUM, a->rn) | ||
30 | |||
31 | static bool do_pfirst_pnext(DisasContext *s, arg_rr_esz *a, | ||
32 | void (*gen_fn)(TCGv_i32, TCGv_ptr, | ||
33 | -- | ||
34 | 2.25.1 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
4 | Message-id: 20220527181907.189259-54-richard.henderson@linaro.org | ||
5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | --- | ||
8 | target/arm/translate-sve.c | 11 ++--------- | ||
9 | 1 file changed, 2 insertions(+), 9 deletions(-) | ||
10 | |||
11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
12 | index XXXXXXX..XXXXXXX 100644 | ||
13 | --- a/target/arm/translate-sve.c | ||
14 | +++ b/target/arm/translate-sve.c | ||
15 | @@ -XXX,XX +XXX,XX @@ static bool do_pfirst_pnext(DisasContext *s, arg_rr_esz *a, | ||
16 | return true; | ||
17 | } | ||
18 | |||
19 | -static bool trans_PFIRST(DisasContext *s, arg_rr_esz *a) | ||
20 | -{ | ||
21 | - return do_pfirst_pnext(s, a, gen_helper_sve_pfirst); | ||
22 | -} | ||
23 | - | ||
24 | -static bool trans_PNEXT(DisasContext *s, arg_rr_esz *a) | ||
25 | -{ | ||
26 | - return do_pfirst_pnext(s, a, gen_helper_sve_pnext); | ||
27 | -} | ||
28 | +TRANS_FEAT(PFIRST, aa64_sve, do_pfirst_pnext, a, gen_helper_sve_pfirst) | ||
29 | +TRANS_FEAT(PNEXT, aa64_sve, do_pfirst_pnext, a, gen_helper_sve_pnext) | ||
30 | |||
31 | /* | ||
32 | *** SVE Element Count Group | ||
33 | -- | ||
34 | 2.25.1 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
4 | Message-id: 20220527181907.189259-55-richard.henderson@linaro.org | ||
5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | --- | ||
8 | target/arm/translate-sve.c | 14 ++------------ | ||
9 | 1 file changed, 2 insertions(+), 12 deletions(-) | ||
10 | |||
11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
12 | index XXXXXXX..XXXXXXX 100644 | ||
13 | --- a/target/arm/translate-sve.c | ||
14 | +++ b/target/arm/translate-sve.c | ||
15 | @@ -XXX,XX +XXX,XX @@ static bool do_EXT(DisasContext *s, int rd, int rn, int rm, int imm) | ||
16 | return true; | ||
17 | } | ||
18 | |||
19 | -static bool trans_EXT(DisasContext *s, arg_EXT *a) | ||
20 | -{ | ||
21 | - return do_EXT(s, a->rd, a->rn, a->rm, a->imm); | ||
22 | -} | ||
23 | - | ||
24 | -static bool trans_EXT_sve2(DisasContext *s, arg_rri *a) | ||
25 | -{ | ||
26 | - if (!dc_isar_feature(aa64_sve2, s)) { | ||
27 | - return false; | ||
28 | - } | ||
29 | - return do_EXT(s, a->rd, a->rn, (a->rn + 1) % 32, a->imm); | ||
30 | -} | ||
31 | +TRANS_FEAT(EXT, aa64_sve, do_EXT, a->rd, a->rn, a->rm, a->imm) | ||
32 | +TRANS_FEAT(EXT_sve2, aa64_sve2, do_EXT, a->rd, a->rn, (a->rn + 1) % 32, a->imm) | ||
33 | |||
34 | /* | ||
35 | *** SVE Permute - Unpredicated Group | ||
36 | -- | ||
37 | 2.25.1 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
4 | Message-id: 20220527181907.189259-56-richard.henderson@linaro.org | ||
5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | --- | ||
8 | target/arm/translate-sve.c | 35 ++++++----------------------------- | ||
9 | 1 file changed, 6 insertions(+), 29 deletions(-) | ||
10 | |||
11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
12 | index XXXXXXX..XXXXXXX 100644 | ||
13 | --- a/target/arm/translate-sve.c | ||
14 | +++ b/target/arm/translate-sve.c | ||
15 | @@ -XXX,XX +XXX,XX @@ static bool do_perm_pred2(DisasContext *s, arg_rr_esz *a, bool high_odd, | ||
16 | return true; | ||
17 | } | ||
18 | |||
19 | -static bool trans_ZIP1_p(DisasContext *s, arg_rrr_esz *a) | ||
20 | -{ | ||
21 | - return do_perm_pred3(s, a, 0, gen_helper_sve_zip_p); | ||
22 | -} | ||
23 | - | ||
24 | -static bool trans_ZIP2_p(DisasContext *s, arg_rrr_esz *a) | ||
25 | -{ | ||
26 | - return do_perm_pred3(s, a, 1, gen_helper_sve_zip_p); | ||
27 | -} | ||
28 | - | ||
29 | -static bool trans_UZP1_p(DisasContext *s, arg_rrr_esz *a) | ||
30 | -{ | ||
31 | - return do_perm_pred3(s, a, 0, gen_helper_sve_uzp_p); | ||
32 | -} | ||
33 | - | ||
34 | -static bool trans_UZP2_p(DisasContext *s, arg_rrr_esz *a) | ||
35 | -{ | ||
36 | - return do_perm_pred3(s, a, 1, gen_helper_sve_uzp_p); | ||
37 | -} | ||
38 | - | ||
39 | -static bool trans_TRN1_p(DisasContext *s, arg_rrr_esz *a) | ||
40 | -{ | ||
41 | - return do_perm_pred3(s, a, 0, gen_helper_sve_trn_p); | ||
42 | -} | ||
43 | - | ||
44 | -static bool trans_TRN2_p(DisasContext *s, arg_rrr_esz *a) | ||
45 | -{ | ||
46 | - return do_perm_pred3(s, a, 1, gen_helper_sve_trn_p); | ||
47 | -} | ||
48 | +TRANS_FEAT(ZIP1_p, aa64_sve, do_perm_pred3, a, 0, gen_helper_sve_zip_p) | ||
49 | +TRANS_FEAT(ZIP2_p, aa64_sve, do_perm_pred3, a, 1, gen_helper_sve_zip_p) | ||
50 | +TRANS_FEAT(UZP1_p, aa64_sve, do_perm_pred3, a, 0, gen_helper_sve_uzp_p) | ||
51 | +TRANS_FEAT(UZP2_p, aa64_sve, do_perm_pred3, a, 1, gen_helper_sve_uzp_p) | ||
52 | +TRANS_FEAT(TRN1_p, aa64_sve, do_perm_pred3, a, 0, gen_helper_sve_trn_p) | ||
53 | +TRANS_FEAT(TRN2_p, aa64_sve, do_perm_pred3, a, 1, gen_helper_sve_trn_p) | ||
54 | |||
55 | static bool trans_REV_p(DisasContext *s, arg_rr_esz *a) | ||
56 | { | ||
57 | -- | ||
58 | 2.25.1 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
4 | Message-id: 20220527181907.189259-57-richard.henderson@linaro.org | ||
5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | --- | ||
8 | target/arm/translate-sve.c | 17 +++-------------- | ||
9 | 1 file changed, 3 insertions(+), 14 deletions(-) | ||
10 | |||
11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
12 | index XXXXXXX..XXXXXXX 100644 | ||
13 | --- a/target/arm/translate-sve.c | ||
14 | +++ b/target/arm/translate-sve.c | ||
15 | @@ -XXX,XX +XXX,XX @@ TRANS_FEAT(UZP2_p, aa64_sve, do_perm_pred3, a, 1, gen_helper_sve_uzp_p) | ||
16 | TRANS_FEAT(TRN1_p, aa64_sve, do_perm_pred3, a, 0, gen_helper_sve_trn_p) | ||
17 | TRANS_FEAT(TRN2_p, aa64_sve, do_perm_pred3, a, 1, gen_helper_sve_trn_p) | ||
18 | |||
19 | -static bool trans_REV_p(DisasContext *s, arg_rr_esz *a) | ||
20 | -{ | ||
21 | - return do_perm_pred2(s, a, 0, gen_helper_sve_rev_p); | ||
22 | -} | ||
23 | - | ||
24 | -static bool trans_PUNPKLO(DisasContext *s, arg_PUNPKLO *a) | ||
25 | -{ | ||
26 | - return do_perm_pred2(s, a, 0, gen_helper_sve_punpk_p); | ||
27 | -} | ||
28 | - | ||
29 | -static bool trans_PUNPKHI(DisasContext *s, arg_PUNPKHI *a) | ||
30 | -{ | ||
31 | - return do_perm_pred2(s, a, 1, gen_helper_sve_punpk_p); | ||
32 | -} | ||
33 | +TRANS_FEAT(REV_p, aa64_sve, do_perm_pred2, a, 0, gen_helper_sve_rev_p) | ||
34 | +TRANS_FEAT(PUNPKLO, aa64_sve, do_perm_pred2, a, 0, gen_helper_sve_punpk_p) | ||
35 | +TRANS_FEAT(PUNPKHI, aa64_sve, do_perm_pred2, a, 1, gen_helper_sve_punpk_p) | ||
36 | |||
37 | /* | ||
38 | *** SVE Permute - Interleaving Group | ||
39 | -- | ||
40 | 2.25.1 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
4 | Message-id: 20220527181907.189259-59-richard.henderson@linaro.org | ||
5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | --- | ||
8 | target/arm/translate-sve.c | 25 +++++++------------------ | ||
9 | 1 file changed, 7 insertions(+), 18 deletions(-) | ||
10 | |||
11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
12 | index XXXXXXX..XXXXXXX 100644 | ||
13 | --- a/target/arm/translate-sve.c | ||
14 | +++ b/target/arm/translate-sve.c | ||
15 | @@ -XXX,XX +XXX,XX @@ static bool do_zip(DisasContext *s, arg_rrr_esz *a, bool high) | ||
16 | gen_helper_sve_zip_b, gen_helper_sve_zip_h, | ||
17 | gen_helper_sve_zip_s, gen_helper_sve_zip_d, | ||
18 | }; | ||
19 | + unsigned vsz = vec_full_reg_size(s); | ||
20 | + unsigned high_ofs = high ? vsz / 2 : 0; | ||
21 | |||
22 | - if (sve_access_check(s)) { | ||
23 | - unsigned vsz = vec_full_reg_size(s); | ||
24 | - unsigned high_ofs = high ? vsz / 2 : 0; | ||
25 | - tcg_gen_gvec_3_ool(vec_full_reg_offset(s, a->rd), | ||
26 | - vec_full_reg_offset(s, a->rn), | ||
27 | - vec_full_reg_offset(s, a->rm), | ||
28 | - vsz, vsz, high_ofs, fns[a->esz]); | ||
29 | - } | ||
30 | - return true; | ||
31 | + return gen_gvec_ool_arg_zzz(s, fns[a->esz], a, high_ofs); | ||
32 | } | ||
33 | |||
34 | static bool trans_ZIP1_z(DisasContext *s, arg_rrr_esz *a) | ||
35 | @@ -XXX,XX +XXX,XX @@ static bool trans_ZIP2_z(DisasContext *s, arg_rrr_esz *a) | ||
36 | |||
37 | static bool do_zip_q(DisasContext *s, arg_rrr_esz *a, bool high) | ||
38 | { | ||
39 | + unsigned vsz = vec_full_reg_size(s); | ||
40 | + unsigned high_ofs = high ? QEMU_ALIGN_DOWN(vsz, 32) / 2 : 0; | ||
41 | + | ||
42 | if (!dc_isar_feature(aa64_sve_f64mm, s)) { | ||
43 | return false; | ||
44 | } | ||
45 | - if (sve_access_check(s)) { | ||
46 | - unsigned vsz = vec_full_reg_size(s); | ||
47 | - unsigned high_ofs = high ? QEMU_ALIGN_DOWN(vsz, 32) / 2 : 0; | ||
48 | - tcg_gen_gvec_3_ool(vec_full_reg_offset(s, a->rd), | ||
49 | - vec_full_reg_offset(s, a->rn), | ||
50 | - vec_full_reg_offset(s, a->rm), | ||
51 | - vsz, vsz, high_ofs, gen_helper_sve2_zip_q); | ||
52 | - } | ||
53 | - return true; | ||
54 | + return gen_gvec_ool_arg_zzz(s, gen_helper_sve2_zip_q, a, high_ofs); | ||
55 | } | ||
56 | |||
57 | static bool trans_ZIP1_q(DisasContext *s, arg_rrr_esz *a) | ||
58 | -- | ||
59 | 2.25.1 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Convert SVE translation functions using do_zip* | ||
4 | to use TRANS_FEAT and gen_gvec_ool_arg_zzz. | ||
5 | |||
6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
7 | Message-id: 20220527181907.189259-60-richard.henderson@linaro.org | ||
8 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
10 | --- | ||
11 | target/arm/translate-sve.c | 54 +++++++++----------------------------- | ||
12 | 1 file changed, 13 insertions(+), 41 deletions(-) | ||
13 | |||
14 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
15 | index XXXXXXX..XXXXXXX 100644 | ||
16 | --- a/target/arm/translate-sve.c | ||
17 | +++ b/target/arm/translate-sve.c | ||
18 | @@ -XXX,XX +XXX,XX @@ TRANS_FEAT(PUNPKHI, aa64_sve, do_perm_pred2, a, 1, gen_helper_sve_punpk_p) | ||
19 | *** SVE Permute - Interleaving Group | ||
20 | */ | ||
21 | |||
22 | -static bool do_zip(DisasContext *s, arg_rrr_esz *a, bool high) | ||
23 | -{ | ||
24 | - static gen_helper_gvec_3 * const fns[4] = { | ||
25 | - gen_helper_sve_zip_b, gen_helper_sve_zip_h, | ||
26 | - gen_helper_sve_zip_s, gen_helper_sve_zip_d, | ||
27 | - }; | ||
28 | - unsigned vsz = vec_full_reg_size(s); | ||
29 | - unsigned high_ofs = high ? vsz / 2 : 0; | ||
30 | +static gen_helper_gvec_3 * const zip_fns[4] = { | ||
31 | + gen_helper_sve_zip_b, gen_helper_sve_zip_h, | ||
32 | + gen_helper_sve_zip_s, gen_helper_sve_zip_d, | ||
33 | +}; | ||
34 | +TRANS_FEAT(ZIP1_z, aa64_sve, gen_gvec_ool_arg_zzz, | ||
35 | + zip_fns[a->esz], a, 0) | ||
36 | +TRANS_FEAT(ZIP2_z, aa64_sve, gen_gvec_ool_arg_zzz, | ||
37 | + zip_fns[a->esz], a, vec_full_reg_size(s) / 2) | ||
38 | |||
39 | - return gen_gvec_ool_arg_zzz(s, fns[a->esz], a, high_ofs); | ||
40 | -} | ||
41 | - | ||
42 | -static bool trans_ZIP1_z(DisasContext *s, arg_rrr_esz *a) | ||
43 | -{ | ||
44 | - return do_zip(s, a, false); | ||
45 | -} | ||
46 | - | ||
47 | -static bool trans_ZIP2_z(DisasContext *s, arg_rrr_esz *a) | ||
48 | -{ | ||
49 | - return do_zip(s, a, true); | ||
50 | -} | ||
51 | - | ||
52 | -static bool do_zip_q(DisasContext *s, arg_rrr_esz *a, bool high) | ||
53 | -{ | ||
54 | - unsigned vsz = vec_full_reg_size(s); | ||
55 | - unsigned high_ofs = high ? QEMU_ALIGN_DOWN(vsz, 32) / 2 : 0; | ||
56 | - | ||
57 | - if (!dc_isar_feature(aa64_sve_f64mm, s)) { | ||
58 | - return false; | ||
59 | - } | ||
60 | - return gen_gvec_ool_arg_zzz(s, gen_helper_sve2_zip_q, a, high_ofs); | ||
61 | -} | ||
62 | - | ||
63 | -static bool trans_ZIP1_q(DisasContext *s, arg_rrr_esz *a) | ||
64 | -{ | ||
65 | - return do_zip_q(s, a, false); | ||
66 | -} | ||
67 | - | ||
68 | -static bool trans_ZIP2_q(DisasContext *s, arg_rrr_esz *a) | ||
69 | -{ | ||
70 | - return do_zip_q(s, a, true); | ||
71 | -} | ||
72 | +TRANS_FEAT(ZIP1_q, aa64_sve_f64mm, gen_gvec_ool_arg_zzz, | ||
73 | + gen_helper_sve2_zip_q, a, 0) | ||
74 | +TRANS_FEAT(ZIP2_q, aa64_sve_f64mm, gen_gvec_ool_arg_zzz, | ||
75 | + gen_helper_sve2_zip_q, a, | ||
76 | + QEMU_ALIGN_DOWN(vec_full_reg_size(s), 32) / 2) | ||
77 | |||
78 | static gen_helper_gvec_3 * const uzp_fns[4] = { | ||
79 | gen_helper_sve_uzp_b, gen_helper_sve_uzp_h, | ||
80 | -- | ||
81 | 2.25.1 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
4 | Message-id: 20220527181907.189259-61-richard.henderson@linaro.org | ||
5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | --- | ||
8 | target/arm/translate-sve.c | 11 ++--------- | ||
9 | 1 file changed, 2 insertions(+), 9 deletions(-) | ||
10 | |||
11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
12 | index XXXXXXX..XXXXXXX 100644 | ||
13 | --- a/target/arm/translate-sve.c | ||
14 | +++ b/target/arm/translate-sve.c | ||
15 | @@ -XXX,XX +XXX,XX @@ static bool do_clast_vector(DisasContext *s, arg_rprr_esz *a, bool before) | ||
16 | return true; | ||
17 | } | ||
18 | |||
19 | -static bool trans_CLASTA_z(DisasContext *s, arg_rprr_esz *a) | ||
20 | -{ | ||
21 | - return do_clast_vector(s, a, false); | ||
22 | -} | ||
23 | - | ||
24 | -static bool trans_CLASTB_z(DisasContext *s, arg_rprr_esz *a) | ||
25 | -{ | ||
26 | - return do_clast_vector(s, a, true); | ||
27 | -} | ||
28 | +TRANS_FEAT(CLASTA_z, aa64_sve, do_clast_vector, a, false) | ||
29 | +TRANS_FEAT(CLASTB_z, aa64_sve, do_clast_vector, a, true) | ||
30 | |||
31 | /* Compute CLAST for a scalar. */ | ||
32 | static void do_clast_scalar(DisasContext *s, int esz, int pg, int rm, | ||
33 | -- | ||
34 | 2.25.1 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
4 | Message-id: 20220527181907.189259-62-richard.henderson@linaro.org | ||
5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | --- | ||
8 | target/arm/translate-sve.c | 11 ++--------- | ||
9 | 1 file changed, 2 insertions(+), 9 deletions(-) | ||
10 | |||
11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
12 | index XXXXXXX..XXXXXXX 100644 | ||
13 | --- a/target/arm/translate-sve.c | ||
14 | +++ b/target/arm/translate-sve.c | ||
15 | @@ -XXX,XX +XXX,XX @@ static bool do_clast_fp(DisasContext *s, arg_rpr_esz *a, bool before) | ||
16 | return true; | ||
17 | } | ||
18 | |||
19 | -static bool trans_CLASTA_v(DisasContext *s, arg_rpr_esz *a) | ||
20 | -{ | ||
21 | - return do_clast_fp(s, a, false); | ||
22 | -} | ||
23 | - | ||
24 | -static bool trans_CLASTB_v(DisasContext *s, arg_rpr_esz *a) | ||
25 | -{ | ||
26 | - return do_clast_fp(s, a, true); | ||
27 | -} | ||
28 | +TRANS_FEAT(CLASTA_v, aa64_sve, do_clast_fp, a, false) | ||
29 | +TRANS_FEAT(CLASTB_v, aa64_sve, do_clast_fp, a, true) | ||
30 | |||
31 | /* Compute CLAST for a Xreg. */ | ||
32 | static bool do_clast_general(DisasContext *s, arg_rpr_esz *a, bool before) | ||
33 | -- | ||
34 | 2.25.1 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
4 | Message-id: 20220527181907.189259-63-richard.henderson@linaro.org | ||
5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | --- | ||
8 | target/arm/translate-sve.c | 11 ++--------- | ||
9 | 1 file changed, 2 insertions(+), 9 deletions(-) | ||
10 | |||
11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
12 | index XXXXXXX..XXXXXXX 100644 | ||
13 | --- a/target/arm/translate-sve.c | ||
14 | +++ b/target/arm/translate-sve.c | ||
15 | @@ -XXX,XX +XXX,XX @@ static bool do_clast_general(DisasContext *s, arg_rpr_esz *a, bool before) | ||
16 | return true; | ||
17 | } | ||
18 | |||
19 | -static bool trans_CLASTA_r(DisasContext *s, arg_rpr_esz *a) | ||
20 | -{ | ||
21 | - return do_clast_general(s, a, false); | ||
22 | -} | ||
23 | - | ||
24 | -static bool trans_CLASTB_r(DisasContext *s, arg_rpr_esz *a) | ||
25 | -{ | ||
26 | - return do_clast_general(s, a, true); | ||
27 | -} | ||
28 | +TRANS_FEAT(CLASTA_r, aa64_sve, do_clast_general, a, false) | ||
29 | +TRANS_FEAT(CLASTB_r, aa64_sve, do_clast_general, a, true) | ||
30 | |||
31 | /* Compute LAST for a scalar. */ | ||
32 | static TCGv_i64 do_last_scalar(DisasContext *s, int esz, | ||
33 | -- | ||
34 | 2.25.1 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
4 | Message-id: 20220527181907.189259-64-richard.henderson@linaro.org | ||
5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | --- | ||
8 | target/arm/translate-sve.c | 11 ++--------- | ||
9 | 1 file changed, 2 insertions(+), 9 deletions(-) | ||
10 | |||
11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
12 | index XXXXXXX..XXXXXXX 100644 | ||
13 | --- a/target/arm/translate-sve.c | ||
14 | +++ b/target/arm/translate-sve.c | ||
15 | @@ -XXX,XX +XXX,XX @@ static bool do_last_fp(DisasContext *s, arg_rpr_esz *a, bool before) | ||
16 | return true; | ||
17 | } | ||
18 | |||
19 | -static bool trans_LASTA_v(DisasContext *s, arg_rpr_esz *a) | ||
20 | -{ | ||
21 | - return do_last_fp(s, a, false); | ||
22 | -} | ||
23 | - | ||
24 | -static bool trans_LASTB_v(DisasContext *s, arg_rpr_esz *a) | ||
25 | -{ | ||
26 | - return do_last_fp(s, a, true); | ||
27 | -} | ||
28 | +TRANS_FEAT(LASTA_v, aa64_sve, do_last_fp, a, false) | ||
29 | +TRANS_FEAT(LASTB_v, aa64_sve, do_last_fp, a, true) | ||
30 | |||
31 | /* Compute LAST for a Xreg. */ | ||
32 | static bool do_last_general(DisasContext *s, arg_rpr_esz *a, bool before) | ||
33 | -- | ||
34 | 2.25.1 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
4 | Message-id: 20220527181907.189259-65-richard.henderson@linaro.org | ||
5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | --- | ||
8 | target/arm/translate-sve.c | 11 ++--------- | ||
9 | 1 file changed, 2 insertions(+), 9 deletions(-) | ||
10 | |||
11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
12 | index XXXXXXX..XXXXXXX 100644 | ||
13 | --- a/target/arm/translate-sve.c | ||
14 | +++ b/target/arm/translate-sve.c | ||
15 | @@ -XXX,XX +XXX,XX @@ static bool do_last_general(DisasContext *s, arg_rpr_esz *a, bool before) | ||
16 | return true; | ||
17 | } | ||
18 | |||
19 | -static bool trans_LASTA_r(DisasContext *s, arg_rpr_esz *a) | ||
20 | -{ | ||
21 | - return do_last_general(s, a, false); | ||
22 | -} | ||
23 | - | ||
24 | -static bool trans_LASTB_r(DisasContext *s, arg_rpr_esz *a) | ||
25 | -{ | ||
26 | - return do_last_general(s, a, true); | ||
27 | -} | ||
28 | +TRANS_FEAT(LASTA_r, aa64_sve, do_last_general, a, false) | ||
29 | +TRANS_FEAT(LASTB_r, aa64_sve, do_last_general, a, true) | ||
30 | |||
31 | static bool trans_CPY_m_r(DisasContext *s, arg_rpr_esz *a) | ||
32 | { | ||
33 | -- | ||
34 | 2.25.1 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
4 | Message-id: 20220527181907.189259-66-richard.henderson@linaro.org | ||
5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | --- | ||
8 | target/arm/translate-sve.c | 17 ++++------------- | ||
9 | 1 file changed, 4 insertions(+), 13 deletions(-) | ||
10 | |||
11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
12 | index XXXXXXX..XXXXXXX 100644 | ||
13 | --- a/target/arm/translate-sve.c | ||
14 | +++ b/target/arm/translate-sve.c | ||
15 | @@ -XXX,XX +XXX,XX @@ TRANS_FEAT(REVH, aa64_sve, gen_gvec_ool_arg_zpz, revh_fns[a->esz], a, 0) | ||
16 | TRANS_FEAT(REVW, aa64_sve, gen_gvec_ool_arg_zpz, | ||
17 | a->esz == 3 ? gen_helper_sve_revw_d : NULL, a, 0) | ||
18 | |||
19 | -static bool trans_SPLICE(DisasContext *s, arg_rprr_esz *a) | ||
20 | -{ | ||
21 | - return gen_gvec_ool_zzzp(s, gen_helper_sve_splice, | ||
22 | - a->rd, a->rn, a->rm, a->pg, a->esz); | ||
23 | -} | ||
24 | +TRANS_FEAT(SPLICE, aa64_sve, gen_gvec_ool_arg_zpzz, | ||
25 | + gen_helper_sve_splice, a, a->esz) | ||
26 | |||
27 | -static bool trans_SPLICE_sve2(DisasContext *s, arg_rpr_esz *a) | ||
28 | -{ | ||
29 | - if (!dc_isar_feature(aa64_sve2, s)) { | ||
30 | - return false; | ||
31 | - } | ||
32 | - return gen_gvec_ool_zzzp(s, gen_helper_sve_splice, | ||
33 | - a->rd, a->rn, (a->rn + 1) % 32, a->pg, a->esz); | ||
34 | -} | ||
35 | +TRANS_FEAT(SPLICE_sve2, aa64_sve2, gen_gvec_ool_zzzp, gen_helper_sve_splice, | ||
36 | + a->rd, a->rn, (a->rn + 1) % 32, a->pg, a->esz) | ||
37 | |||
38 | /* | ||
39 | *** SVE Integer Compare - Vectors Group | ||
40 | -- | ||
41 | 2.25.1 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
4 | Message-id: 20220527181907.189259-67-richard.henderson@linaro.org | ||
5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | --- | ||
8 | target/arm/translate-sve.c | 28 ++++++++++++---------------- | ||
9 | 1 file changed, 12 insertions(+), 16 deletions(-) | ||
10 | |||
11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
12 | index XXXXXXX..XXXXXXX 100644 | ||
13 | --- a/target/arm/translate-sve.c | ||
14 | +++ b/target/arm/translate-sve.c | ||
15 | @@ -XXX,XX +XXX,XX @@ static bool do_ppzz_flags(DisasContext *s, arg_rprr_esz *a, | ||
16 | } | ||
17 | |||
18 | #define DO_PPZZ(NAME, name) \ | ||
19 | -static bool trans_##NAME##_ppzz(DisasContext *s, arg_rprr_esz *a) \ | ||
20 | -{ \ | ||
21 | - static gen_helper_gvec_flags_4 * const fns[4] = { \ | ||
22 | - gen_helper_sve_##name##_ppzz_b, gen_helper_sve_##name##_ppzz_h, \ | ||
23 | - gen_helper_sve_##name##_ppzz_s, gen_helper_sve_##name##_ppzz_d, \ | ||
24 | - }; \ | ||
25 | - return do_ppzz_flags(s, a, fns[a->esz]); \ | ||
26 | -} | ||
27 | + static gen_helper_gvec_flags_4 * const name##_ppzz_fns[4] = { \ | ||
28 | + gen_helper_sve_##name##_ppzz_b, gen_helper_sve_##name##_ppzz_h, \ | ||
29 | + gen_helper_sve_##name##_ppzz_s, gen_helper_sve_##name##_ppzz_d, \ | ||
30 | + }; \ | ||
31 | + TRANS_FEAT(NAME##_ppzz, aa64_sve, do_ppzz_flags, \ | ||
32 | + a, name##_ppzz_fns[a->esz]) | ||
33 | |||
34 | DO_PPZZ(CMPEQ, cmpeq) | ||
35 | DO_PPZZ(CMPNE, cmpne) | ||
36 | @@ -XXX,XX +XXX,XX @@ DO_PPZZ(CMPHS, cmphs) | ||
37 | #undef DO_PPZZ | ||
38 | |||
39 | #define DO_PPZW(NAME, name) \ | ||
40 | -static bool trans_##NAME##_ppzw(DisasContext *s, arg_rprr_esz *a) \ | ||
41 | -{ \ | ||
42 | - static gen_helper_gvec_flags_4 * const fns[4] = { \ | ||
43 | - gen_helper_sve_##name##_ppzw_b, gen_helper_sve_##name##_ppzw_h, \ | ||
44 | - gen_helper_sve_##name##_ppzw_s, NULL \ | ||
45 | - }; \ | ||
46 | - return do_ppzz_flags(s, a, fns[a->esz]); \ | ||
47 | -} | ||
48 | + static gen_helper_gvec_flags_4 * const name##_ppzw_fns[4] = { \ | ||
49 | + gen_helper_sve_##name##_ppzw_b, gen_helper_sve_##name##_ppzw_h, \ | ||
50 | + gen_helper_sve_##name##_ppzw_s, NULL \ | ||
51 | + }; \ | ||
52 | + TRANS_FEAT(NAME##_ppzw, aa64_sve, do_ppzz_flags, \ | ||
53 | + a, name##_ppzw_fns[a->esz]) | ||
54 | |||
55 | DO_PPZW(CMPEQ, cmpeq) | ||
56 | DO_PPZW(CMPNE, cmpne) | ||
57 | -- | ||
58 | 2.25.1 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
4 | Message-id: 20220527181907.189259-68-richard.henderson@linaro.org | ||
5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | --- | ||
8 | target/arm/translate-sve.c | 28 ++++++++-------------------- | ||
9 | 1 file changed, 8 insertions(+), 20 deletions(-) | ||
10 | |||
11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
12 | index XXXXXXX..XXXXXXX 100644 | ||
13 | --- a/target/arm/translate-sve.c | ||
14 | +++ b/target/arm/translate-sve.c | ||
15 | @@ -XXX,XX +XXX,XX @@ DO_SVE2_ZZZ_NARROW(SUBHNT, subhnt) | ||
16 | DO_SVE2_ZZZ_NARROW(RSUBHNB, rsubhnb) | ||
17 | DO_SVE2_ZZZ_NARROW(RSUBHNT, rsubhnt) | ||
18 | |||
19 | -static bool do_sve2_ppzz_flags(DisasContext *s, arg_rprr_esz *a, | ||
20 | - gen_helper_gvec_flags_4 *fn) | ||
21 | -{ | ||
22 | - if (!dc_isar_feature(aa64_sve2, s)) { | ||
23 | - return false; | ||
24 | - } | ||
25 | - return do_ppzz_flags(s, a, fn); | ||
26 | -} | ||
27 | +static gen_helper_gvec_flags_4 * const match_fns[4] = { | ||
28 | + gen_helper_sve2_match_ppzz_b, gen_helper_sve2_match_ppzz_h, NULL, NULL | ||
29 | +}; | ||
30 | +TRANS_FEAT(MATCH, aa64_sve2, do_ppzz_flags, a, match_fns[a->esz]) | ||
31 | |||
32 | -#define DO_SVE2_PPZZ_MATCH(NAME, name) \ | ||
33 | -static bool trans_##NAME(DisasContext *s, arg_rprr_esz *a) \ | ||
34 | -{ \ | ||
35 | - static gen_helper_gvec_flags_4 * const fns[4] = { \ | ||
36 | - gen_helper_sve2_##name##_ppzz_b, gen_helper_sve2_##name##_ppzz_h, \ | ||
37 | - NULL, NULL \ | ||
38 | - }; \ | ||
39 | - return do_sve2_ppzz_flags(s, a, fns[a->esz]); \ | ||
40 | -} | ||
41 | - | ||
42 | -DO_SVE2_PPZZ_MATCH(MATCH, match) | ||
43 | -DO_SVE2_PPZZ_MATCH(NMATCH, nmatch) | ||
44 | +static gen_helper_gvec_flags_4 * const nmatch_fns[4] = { | ||
45 | + gen_helper_sve2_nmatch_ppzz_b, gen_helper_sve2_nmatch_ppzz_h, NULL, NULL | ||
46 | +}; | ||
47 | +TRANS_FEAT(NMATCH, aa64_sve2, do_ppzz_flags, a, nmatch_fns[a->esz]) | ||
48 | |||
49 | static gen_helper_gvec_4 * const histcnt_fns[4] = { | ||
50 | NULL, NULL, gen_helper_sve2_histcnt_s, gen_helper_sve2_histcnt_d | ||
51 | -- | ||
52 | 2.25.1 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
4 | Message-id: 20220527181907.189259-69-richard.henderson@linaro.org | ||
5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | --- | ||
8 | target/arm/translate-sve.c | 8 +++----- | ||
9 | 1 file changed, 3 insertions(+), 5 deletions(-) | ||
10 | |||
11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
12 | index XXXXXXX..XXXXXXX 100644 | ||
13 | --- a/target/arm/translate-sve.c | ||
14 | +++ b/target/arm/translate-sve.c | ||
15 | @@ -XXX,XX +XXX,XX @@ static bool do_ppzi_flags(DisasContext *s, arg_rpri_esz *a, | ||
16 | } | ||
17 | |||
18 | #define DO_PPZI(NAME, name) \ | ||
19 | -static bool trans_##NAME##_ppzi(DisasContext *s, arg_rpri_esz *a) \ | ||
20 | -{ \ | ||
21 | - static gen_helper_gvec_flags_3 * const fns[4] = { \ | ||
22 | + static gen_helper_gvec_flags_3 * const name##_ppzi_fns[4] = { \ | ||
23 | gen_helper_sve_##name##_ppzi_b, gen_helper_sve_##name##_ppzi_h, \ | ||
24 | gen_helper_sve_##name##_ppzi_s, gen_helper_sve_##name##_ppzi_d, \ | ||
25 | }; \ | ||
26 | - return do_ppzi_flags(s, a, fns[a->esz]); \ | ||
27 | -} | ||
28 | + TRANS_FEAT(NAME##_ppzi, aa64_sve, do_ppzi_flags, a, \ | ||
29 | + name##_ppzi_fns[a->esz]) | ||
30 | |||
31 | DO_PPZI(CMPEQ, cmpeq) | ||
32 | DO_PPZI(CMPNE, cmpne) | ||
33 | -- | ||
34 | 2.25.1 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
4 | Message-id: 20220527181907.189259-70-richard.henderson@linaro.org | ||
5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | --- | ||
8 | target/arm/translate-sve.c | 45 ++++++++++++-------------------------- | ||
9 | 1 file changed, 14 insertions(+), 31 deletions(-) | ||
10 | |||
11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
12 | index XXXXXXX..XXXXXXX 100644 | ||
13 | --- a/target/arm/translate-sve.c | ||
14 | +++ b/target/arm/translate-sve.c | ||
15 | @@ -XXX,XX +XXX,XX @@ static bool do_brk2(DisasContext *s, arg_rpr_s *a, | ||
16 | return true; | ||
17 | } | ||
18 | |||
19 | -static bool trans_BRKPA(DisasContext *s, arg_rprr_s *a) | ||
20 | -{ | ||
21 | - return do_brk3(s, a, gen_helper_sve_brkpa, gen_helper_sve_brkpas); | ||
22 | -} | ||
23 | +TRANS_FEAT(BRKPA, aa64_sve, do_brk3, a, | ||
24 | + gen_helper_sve_brkpa, gen_helper_sve_brkpas) | ||
25 | +TRANS_FEAT(BRKPB, aa64_sve, do_brk3, a, | ||
26 | + gen_helper_sve_brkpb, gen_helper_sve_brkpbs) | ||
27 | |||
28 | -static bool trans_BRKPB(DisasContext *s, arg_rprr_s *a) | ||
29 | -{ | ||
30 | - return do_brk3(s, a, gen_helper_sve_brkpb, gen_helper_sve_brkpbs); | ||
31 | -} | ||
32 | +TRANS_FEAT(BRKA_m, aa64_sve, do_brk2, a, | ||
33 | + gen_helper_sve_brka_m, gen_helper_sve_brkas_m) | ||
34 | +TRANS_FEAT(BRKB_m, aa64_sve, do_brk2, a, | ||
35 | + gen_helper_sve_brkb_m, gen_helper_sve_brkbs_m) | ||
36 | |||
37 | -static bool trans_BRKA_m(DisasContext *s, arg_rpr_s *a) | ||
38 | -{ | ||
39 | - return do_brk2(s, a, gen_helper_sve_brka_m, gen_helper_sve_brkas_m); | ||
40 | -} | ||
41 | +TRANS_FEAT(BRKA_z, aa64_sve, do_brk2, a, | ||
42 | + gen_helper_sve_brka_z, gen_helper_sve_brkas_z) | ||
43 | +TRANS_FEAT(BRKB_z, aa64_sve, do_brk2, a, | ||
44 | + gen_helper_sve_brkb_z, gen_helper_sve_brkbs_z) | ||
45 | |||
46 | -static bool trans_BRKB_m(DisasContext *s, arg_rpr_s *a) | ||
47 | -{ | ||
48 | - return do_brk2(s, a, gen_helper_sve_brkb_m, gen_helper_sve_brkbs_m); | ||
49 | -} | ||
50 | - | ||
51 | -static bool trans_BRKA_z(DisasContext *s, arg_rpr_s *a) | ||
52 | -{ | ||
53 | - return do_brk2(s, a, gen_helper_sve_brka_z, gen_helper_sve_brkas_z); | ||
54 | -} | ||
55 | - | ||
56 | -static bool trans_BRKB_z(DisasContext *s, arg_rpr_s *a) | ||
57 | -{ | ||
58 | - return do_brk2(s, a, gen_helper_sve_brkb_z, gen_helper_sve_brkbs_z); | ||
59 | -} | ||
60 | - | ||
61 | -static bool trans_BRKN(DisasContext *s, arg_rpr_s *a) | ||
62 | -{ | ||
63 | - return do_brk2(s, a, gen_helper_sve_brkn, gen_helper_sve_brkns); | ||
64 | -} | ||
65 | +TRANS_FEAT(BRKN, aa64_sve, do_brk2, a, | ||
66 | + gen_helper_sve_brkn, gen_helper_sve_brkns) | ||
67 | |||
68 | /* | ||
69 | *** SVE Predicate Count Group | ||
70 | -- | ||
71 | 2.25.1 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Remove the unparsed extractions in trans_CPY_{m,z}_i which are intended | ||
4 | to reject an 8-bit shift of an 8-bit constant for 8-bit element. | ||
5 | |||
6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
7 | Message-id: 20220527181907.189259-74-richard.henderson@linaro.org | ||
8 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
10 | --- | ||
11 | target/arm/sve.decode | 10 ++++++++-- | ||
12 | target/arm/translate-sve.c | 6 ------ | ||
13 | 2 files changed, 8 insertions(+), 8 deletions(-) | ||
14 | |||
15 | diff --git a/target/arm/sve.decode b/target/arm/sve.decode | ||
16 | index XXXXXXX..XXXXXXX 100644 | ||
17 | --- a/target/arm/sve.decode | ||
18 | +++ b/target/arm/sve.decode | ||
19 | @@ -XXX,XX +XXX,XX @@ DUPM 00000101 11 0000 dbm:13 rd:5 | ||
20 | FCPY 00000101 .. 01 .... 110 imm:8 ..... @rdn_pg4 | ||
21 | |||
22 | # SVE copy integer immediate (predicated) | ||
23 | -CPY_m_i 00000101 .. 01 .... 01 . ........ ..... @rdn_pg4 imm=%sh8_i8s | ||
24 | -CPY_z_i 00000101 .. 01 .... 00 . ........ ..... @rdn_pg4 imm=%sh8_i8s | ||
25 | +{ | ||
26 | + INVALID 00000101 00 01 ---- 01 1 -------- ----- | ||
27 | + CPY_m_i 00000101 .. 01 .... 01 . ........ ..... @rdn_pg4 imm=%sh8_i8s | ||
28 | +} | ||
29 | +{ | ||
30 | + INVALID 00000101 00 01 ---- 00 1 -------- ----- | ||
31 | + CPY_z_i 00000101 .. 01 .... 00 . ........ ..... @rdn_pg4 imm=%sh8_i8s | ||
32 | +} | ||
33 | |||
34 | ### SVE Permute - Extract Group | ||
35 | |||
36 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
37 | index XXXXXXX..XXXXXXX 100644 | ||
38 | --- a/target/arm/translate-sve.c | ||
39 | +++ b/target/arm/translate-sve.c | ||
40 | @@ -XXX,XX +XXX,XX @@ static bool trans_FCPY(DisasContext *s, arg_FCPY *a) | ||
41 | |||
42 | static bool trans_CPY_m_i(DisasContext *s, arg_rpri_esz *a) | ||
43 | { | ||
44 | - if (a->esz == 0 && extract32(s->insn, 13, 1)) { | ||
45 | - return false; | ||
46 | - } | ||
47 | if (sve_access_check(s)) { | ||
48 | do_cpy_m(s, a->esz, a->rd, a->rn, a->pg, tcg_constant_i64(a->imm)); | ||
49 | } | ||
50 | @@ -XXX,XX +XXX,XX @@ static bool trans_CPY_z_i(DisasContext *s, arg_CPY_z_i *a) | ||
51 | gen_helper_sve_cpy_z_s, gen_helper_sve_cpy_z_d, | ||
52 | }; | ||
53 | |||
54 | - if (a->esz == 0 && extract32(s->insn, 13, 1)) { | ||
55 | - return false; | ||
56 | - } | ||
57 | if (sve_access_check(s)) { | ||
58 | unsigned vsz = vec_full_reg_size(s); | ||
59 | tcg_gen_gvec_2i_ool(vec_full_reg_offset(s, a->rd), | ||
60 | -- | ||
61 | 2.25.1 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
4 | Message-id: 20220527181907.189259-75-richard.henderson@linaro.org | ||
5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | --- | ||
8 | target/arm/translate-sve.c | 5 +---- | ||
9 | 1 file changed, 1 insertion(+), 4 deletions(-) | ||
10 | |||
11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
12 | index XXXXXXX..XXXXXXX 100644 | ||
13 | --- a/target/arm/translate-sve.c | ||
14 | +++ b/target/arm/translate-sve.c | ||
15 | @@ -XXX,XX +XXX,XX @@ static bool trans_DUP_i(DisasContext *s, arg_DUP_i *a) | ||
16 | return true; | ||
17 | } | ||
18 | |||
19 | -static bool trans_ADD_zzi(DisasContext *s, arg_rri_esz *a) | ||
20 | -{ | ||
21 | - return gen_gvec_fn_arg_zzi(s, tcg_gen_gvec_addi, a); | ||
22 | -} | ||
23 | +TRANS_FEAT(ADD_zzi, aa64_sve, gen_gvec_fn_arg_zzi, tcg_gen_gvec_addi, a) | ||
24 | |||
25 | static bool trans_SUB_zzi(DisasContext *s, arg_rri_esz *a) | ||
26 | { | ||
27 | -- | ||
28 | 2.25.1 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Evgeny Iakovlev <eiakovlev@linux.microsoft.com> |
---|---|---|---|
2 | 2 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 3 | ARM trusted firmware, when built with FEAT_HCX support, sets SCR_EL3.HXEn bit |
4 | Message-id: 20220527181907.189259-76-richard.henderson@linaro.org | 4 | to allow EL2 to modify HCRX_EL2 register without trapping it in EL3. Qemu |
5 | uses a valid mask to clear unsupported SCR_EL3 bits when emulating SCR_EL3 | ||
6 | write, and that mask doesn't include SCR_EL3.HXEn bit even if FEAT_HCX is | ||
7 | enabled and exposed to the guest. As a result EL3 writes of that bit are | ||
8 | ignored. | ||
9 | |||
10 | Cc: qemu-stable@nongnu.org | ||
11 | Signed-off-by: Evgeny Iakovlev <eiakovlev@linux.microsoft.com> | ||
12 | Message-id: 20230105221251.17896-4-eiakovlev@linux.microsoft.com | ||
5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 13 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> |
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 14 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
7 | --- | 15 | --- |
8 | target/arm/translate-sve.c | 23 ++++------------------- | 16 | target/arm/helper.c | 3 +++ |
9 | 1 file changed, 4 insertions(+), 19 deletions(-) | 17 | 1 file changed, 3 insertions(+) |
10 | 18 | ||
11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | 19 | diff --git a/target/arm/helper.c b/target/arm/helper.c |
12 | index XXXXXXX..XXXXXXX 100644 | 20 | index XXXXXXX..XXXXXXX 100644 |
13 | --- a/target/arm/translate-sve.c | 21 | --- a/target/arm/helper.c |
14 | +++ b/target/arm/translate-sve.c | 22 | +++ b/target/arm/helper.c |
15 | @@ -XXX,XX +XXX,XX @@ static bool do_zzi_sat(DisasContext *s, arg_rri_esz *a, bool u, bool d) | 23 | @@ -XXX,XX +XXX,XX @@ static void scr_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value) |
16 | return true; | 24 | if (cpu_isar_feature(aa64_sme, cpu)) { |
17 | } | 25 | valid_mask |= SCR_ENTP2; |
18 | 26 | } | |
19 | -static bool trans_SQADD_zzi(DisasContext *s, arg_rri_esz *a) | 27 | + if (cpu_isar_feature(aa64_hcx, cpu)) { |
20 | -{ | 28 | + valid_mask |= SCR_HXEN; |
21 | - return do_zzi_sat(s, a, false, false); | 29 | + } |
22 | -} | 30 | } else { |
23 | - | 31 | valid_mask &= ~(SCR_RW | SCR_ST); |
24 | -static bool trans_UQADD_zzi(DisasContext *s, arg_rri_esz *a) | 32 | if (cpu_isar_feature(aa32_ras, cpu)) { |
25 | -{ | ||
26 | - return do_zzi_sat(s, a, true, false); | ||
27 | -} | ||
28 | - | ||
29 | -static bool trans_SQSUB_zzi(DisasContext *s, arg_rri_esz *a) | ||
30 | -{ | ||
31 | - return do_zzi_sat(s, a, false, true); | ||
32 | -} | ||
33 | - | ||
34 | -static bool trans_UQSUB_zzi(DisasContext *s, arg_rri_esz *a) | ||
35 | -{ | ||
36 | - return do_zzi_sat(s, a, true, true); | ||
37 | -} | ||
38 | +TRANS_FEAT(SQADD_zzi, aa64_sve, do_zzi_sat, a, false, false) | ||
39 | +TRANS_FEAT(UQADD_zzi, aa64_sve, do_zzi_sat, a, true, false) | ||
40 | +TRANS_FEAT(SQSUB_zzi, aa64_sve, do_zzi_sat, a, false, true) | ||
41 | +TRANS_FEAT(UQSUB_zzi, aa64_sve, do_zzi_sat, a, true, true) | ||
42 | |||
43 | static bool do_zzi_ool(DisasContext *s, arg_rri_esz *a, gen_helper_gvec_2i *fn) | ||
44 | { | ||
45 | -- | 33 | -- |
46 | 2.25.1 | 34 | 2.34.1 | diff view generated by jsdifflib |