1 | Hi; here's the first target-arm pullreq for the 7.0 cycle. | 1 | Massive pullreq but almost all of that is RTH's SVE |
---|---|---|---|
2 | refactoring patchset. The other interesting thing here is | ||
3 | the fix for compiling on aarch64 macos. | ||
2 | 4 | ||
3 | thanks | 5 | thanks |
4 | -- PMM | 6 | -- PMM |
5 | 7 | ||
6 | The following changes since commit 76b56fdfc9fa43ec6e5986aee33f108c6c6a511e: | 8 | The following changes since commit f7a1ea403e0282a7f57edd4298c4f65f24165da5: |
7 | 9 | ||
8 | Merge tag 'block-pull-request' of https://gitlab.com/stefanha/qemu into staging (2021-12-14 12:46:18 -0800) | 10 | Merge tag 'misc-pull-request' of gitlab.com:marcandre.lureau/qemu into staging (2022-05-29 16:34:56 -0700) |
9 | 11 | ||
10 | are available in the Git repository at: | 12 | are available in the Git repository at: |
11 | 13 | ||
12 | https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20211215 | 14 | https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20220530 |
13 | 15 | ||
14 | for you to fetch changes up to aed176558806674d030a8305d989d4e6a5073359: | 16 | for you to fetch changes up to b1071174d2a2ab371082b7d4b5f19e98edc61ac6: |
15 | 17 | ||
16 | tests/acpi: add expected blob for VIOT test on virt machine (2021-12-15 10:35:26 +0000) | 18 | target/arm: Remove aa64_sve check from before disas_sve (2022-05-30 17:05:12 +0100) |
17 | 19 | ||
18 | ---------------------------------------------------------------- | 20 | ---------------------------------------------------------------- |
19 | target-arm queue: | 21 | target-arm queue: |
20 | * ITS: error reporting cleanup | 22 | * docs/system/arm: Add FEAT_HCX to list of emulated features |
21 | * aspeed: improve documentation | 23 | * target/arm/hvf: Include missing "cpregs.h" |
22 | * Fix STM32F2XX USART data register readout | 24 | * hw/sd/allwinner-sdhost: report FIFO water level as 1 when data ready |
23 | * allow emulated GICv3 to be disabled in non-TCG builds | 25 | * SVE: refactor to use TRANS/TRANS_FEAT macros and push |
24 | * fix exception priority for singlestep, misaligned PC, bp, etc | 26 | SVE feature check down to individual insn level |
25 | * Correct calculation of tlb range invalidate length | ||
26 | * npcm7xx_emc: fix missing queue_flush | ||
27 | * virt: Add VIOT ACPI table for virtio-iommu | ||
28 | * target/i386: Use assert() to sanity-check b1 in SSE decode | ||
29 | * Don't include qemu-common unnecessarily | ||
30 | 27 | ||
31 | ---------------------------------------------------------------- | 28 | ---------------------------------------------------------------- |
32 | Alex Bennée (1): | 29 | Icenowy Zheng (1): |
33 | hw/intc: clean-up error reporting for failed ITS cmd | 30 | hw/sd/allwinner-sdhost: report FIFO water level as 1 when data ready |
34 | 31 | ||
35 | Jean-Philippe Brucker (8): | 32 | Peter Maydell (1): |
36 | hw/arm/virt-acpi-build: Add VIOT table for virtio-iommu | 33 | docs/system/arm: Add FEAT_HCX to list of emulated features |
37 | hw/arm/virt: Remove device tree restriction for virtio-iommu | ||
38 | hw/arm/virt: Reject instantiation of multiple IOMMUs | ||
39 | hw/arm/virt: Use object_property_set instead of qdev_prop_set | ||
40 | tests/acpi: allow updates of VIOT expected data files | ||
41 | tests/acpi: add test case for VIOT | ||
42 | tests/acpi: add expected blobs for VIOT test on q35 machine | ||
43 | tests/acpi: add expected blob for VIOT test on virt machine | ||
44 | 34 | ||
45 | Joel Stanley (4): | 35 | Philippe Mathieu-Daudé (1): |
46 | docs: aspeed: Add new boards | 36 | target/arm/hvf: Include missing "cpregs.h" |
47 | docs: aspeed: Update OpenBMC image URL | ||
48 | docs: aspeed: Give an example of booting a kernel | ||
49 | docs: aspeed: ADC is now modelled | ||
50 | 37 | ||
51 | Olivier Hériveaux (1): | 38 | Richard Henderson (114): |
52 | Fix STM32F2XX USART data register readout | 39 | target/arm: Introduce TRANS, TRANS_FEAT |
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 | ||
53 | 153 | ||
54 | Patrick Venture (1): | 154 | docs/system/arm/emulation.rst | 1 + |
55 | hw/net: npcm7xx_emc fix missing queue_flush | 155 | target/arm/translate.h | 11 + |
156 | target/arm/sve.decode | 57 +- | ||
157 | hw/sd/allwinner-sdhost.c | 7 + | ||
158 | target/arm/hvf/hvf.c | 1 + | ||
159 | target/arm/sve_helper.c | 6 +- | ||
160 | target/arm/translate-a64.c | 2 +- | ||
161 | target/arm/translate-sve.c | 5367 +++++++++++++++-------------------------- | ||
162 | 8 files changed, 2067 insertions(+), 3385 deletions(-) | ||
56 | 163 | ||
57 | Peter Maydell (6): | ||
58 | target/i386: Use assert() to sanity-check b1 in SSE decode | ||
59 | include/hw/i386: Don't include qemu-common.h in .h files | ||
60 | target/hexagon/cpu.h: don't include qemu-common.h | ||
61 | target/rx/cpu.h: Don't include qemu-common.h | ||
62 | hw/arm: Don't include qemu-common.h unnecessarily | ||
63 | target/arm: Correct calculation of tlb range invalidate length | ||
64 | |||
65 | Philippe Mathieu-Daudé (2): | ||
66 | hw/intc/arm_gicv3: Extract gicv3_set_gicv3state from arm_gicv3_cpuif.c | ||
67 | hw/intc/arm_gicv3: Introduce CONFIG_ARM_GIC_TCG Kconfig selector | ||
68 | |||
69 | Richard Henderson (10): | ||
70 | target/arm: Hoist pc_next to a local variable in aarch64_tr_translate_insn | ||
71 | target/arm: Hoist pc_next to a local variable in arm_tr_translate_insn | ||
72 | target/arm: Hoist pc_next to a local variable in thumb_tr_translate_insn | ||
73 | target/arm: Split arm_pre_translate_insn | ||
74 | target/arm: Advance pc for arch single-step exception | ||
75 | target/arm: Split compute_fsr_fsc out of arm_deliver_fault | ||
76 | target/arm: Take an exception if PC is misaligned | ||
77 | target/arm: Assert thumb pc is aligned | ||
78 | target/arm: Suppress bp for exceptions with more priority | ||
79 | tests/tcg: Add arm and aarch64 pc alignment tests | ||
80 | |||
81 | docs/system/arm/aspeed.rst | 26 ++++++++++++---- | ||
82 | include/hw/i386/microvm.h | 1 - | ||
83 | include/hw/i386/x86.h | 1 - | ||
84 | target/arm/helper.h | 1 + | ||
85 | target/arm/syndrome.h | 5 +++ | ||
86 | target/hexagon/cpu.h | 1 - | ||
87 | target/rx/cpu.h | 1 - | ||
88 | hw/arm/boot.c | 1 - | ||
89 | hw/arm/digic_boards.c | 1 - | ||
90 | hw/arm/highbank.c | 1 - | ||
91 | hw/arm/npcm7xx_boards.c | 1 - | ||
92 | hw/arm/sbsa-ref.c | 1 - | ||
93 | hw/arm/stm32f405_soc.c | 1 - | ||
94 | hw/arm/vexpress.c | 1 - | ||
95 | hw/arm/virt-acpi-build.c | 7 +++++ | ||
96 | hw/arm/virt.c | 21 ++++++------- | ||
97 | hw/char/stm32f2xx_usart.c | 3 +- | ||
98 | hw/intc/arm_gicv3.c | 2 +- | ||
99 | hw/intc/arm_gicv3_cpuif.c | 10 +----- | ||
100 | hw/intc/arm_gicv3_cpuif_common.c | 22 +++++++++++++ | ||
101 | hw/intc/arm_gicv3_its.c | 39 +++++++++++++++-------- | ||
102 | hw/net/npcm7xx_emc.c | 18 +++++------ | ||
103 | hw/virtio/virtio-iommu-pci.c | 12 ++------ | ||
104 | linux-user/aarch64/cpu_loop.c | 46 ++++++++++++++++------------ | ||
105 | linux-user/hexagon/cpu_loop.c | 1 + | ||
106 | target/arm/debug_helper.c | 23 ++++++++++++++ | ||
107 | target/arm/gdbstub.c | 9 ++++-- | ||
108 | target/arm/helper.c | 6 ++-- | ||
109 | target/arm/machine.c | 10 ++++++ | ||
110 | target/arm/tlb_helper.c | 63 ++++++++++++++++++++++++++++---------- | ||
111 | target/arm/translate-a64.c | 23 ++++++++++++-- | ||
112 | target/arm/translate.c | 58 ++++++++++++++++++++++++++--------- | ||
113 | target/i386/tcg/translate.c | 12 ++------ | ||
114 | tests/qtest/bios-tables-test.c | 38 +++++++++++++++++++++++ | ||
115 | tests/tcg/aarch64/pcalign-a64.c | 37 ++++++++++++++++++++++ | ||
116 | tests/tcg/arm/pcalign-a32.c | 46 ++++++++++++++++++++++++++++ | ||
117 | hw/arm/Kconfig | 1 + | ||
118 | hw/intc/Kconfig | 5 +++ | ||
119 | hw/intc/meson.build | 11 ++++--- | ||
120 | tests/data/acpi/q35/DSDT.viot | Bin 0 -> 9398 bytes | ||
121 | tests/data/acpi/q35/VIOT.viot | Bin 0 -> 112 bytes | ||
122 | tests/data/acpi/virt/VIOT | Bin 0 -> 88 bytes | ||
123 | tests/tcg/aarch64/Makefile.target | 4 +-- | ||
124 | tests/tcg/arm/Makefile.target | 4 +++ | ||
125 | 44 files changed, 429 insertions(+), 145 deletions(-) | ||
126 | create mode 100644 hw/intc/arm_gicv3_cpuif_common.c | ||
127 | create mode 100644 tests/tcg/aarch64/pcalign-a64.c | ||
128 | create mode 100644 tests/tcg/arm/pcalign-a32.c | ||
129 | create mode 100644 tests/data/acpi/q35/DSDT.viot | ||
130 | create mode 100644 tests/data/acpi/q35/VIOT.viot | ||
131 | create mode 100644 tests/data/acpi/virt/VIOT | ||
132 | diff view generated by jsdifflib |
1 | The calculation of the length of TLB range invalidate operations | 1 | In commit 5814d587fe861fe9 we added support for emulating |
---|---|---|---|
2 | in tlbi_aa64_range_get_length() is incorrect in two ways: | 2 | FEAT_HCX (Support for the HCRX_EL2 register). However we |
3 | * the NUM field is 5 bits, but we read only 4 bits | 3 | forgot to add it to the list in emulated.rst. Correct the |
4 | * we miscalculate the page_shift value, because of an | 4 | omission. |
5 | off-by-one error: | ||
6 | TG 0b00 is invalid | ||
7 | TG 0b01 is 4K granule size == 4096 == 2^12 | ||
8 | TG 0b10 is 16K granule size == 16384 == 2^14 | ||
9 | TG 0b11 is 64K granule size == 65536 == 2^16 | ||
10 | so page_shift should be (TG - 1) * 2 + 12 | ||
11 | 5 | ||
12 | Thanks to the bug report submitter Cha HyunSoo for identifying | 6 | Fixes: 5814d587fe861fe9 ("target/arm: Enable FEAT_HCX for -cpu max") |
13 | both these errors. | ||
14 | |||
15 | Fixes: 84940ed82552d3c ("target/arm: Add support for FEAT_TLBIRANGE") | ||
16 | Resolves: https://gitlab.com/qemu-project/qemu/-/issues/734 | ||
17 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 7 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
18 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | 8 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> |
19 | Reviewed-by: Alex Bennée <alex.bennee@linaro.org> | 9 | Message-id: 20220520084320.424166-1-peter.maydell@linaro.org |
20 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
21 | Message-id: 20211130173257.1274194-1-peter.maydell@linaro.org | ||
22 | --- | 10 | --- |
23 | target/arm/helper.c | 6 +++--- | 11 | docs/system/arm/emulation.rst | 1 + |
24 | 1 file changed, 3 insertions(+), 3 deletions(-) | 12 | 1 file changed, 1 insertion(+) |
25 | 13 | ||
26 | diff --git a/target/arm/helper.c b/target/arm/helper.c | 14 | diff --git a/docs/system/arm/emulation.rst b/docs/system/arm/emulation.rst |
27 | index XXXXXXX..XXXXXXX 100644 | 15 | index XXXXXXX..XXXXXXX 100644 |
28 | --- a/target/arm/helper.c | 16 | --- a/docs/system/arm/emulation.rst |
29 | +++ b/target/arm/helper.c | 17 | +++ b/docs/system/arm/emulation.rst |
30 | @@ -XXX,XX +XXX,XX @@ static uint64_t tlbi_aa64_range_get_length(CPUARMState *env, | 18 | @@ -XXX,XX +XXX,XX @@ the following architecture extensions: |
31 | uint64_t exponent; | 19 | - FEAT_FRINTTS (Floating-point to integer instructions) |
32 | uint64_t length; | 20 | - FEAT_FlagM (Flag manipulation instructions v2) |
33 | 21 | - FEAT_FlagM2 (Enhancements to flag manipulation instructions) | |
34 | - num = extract64(value, 39, 4); | 22 | +- FEAT_HCX (Support for the HCRX_EL2 register) |
35 | + num = extract64(value, 39, 5); | 23 | - FEAT_HPDS (Hierarchical permission disables) |
36 | scale = extract64(value, 44, 2); | 24 | - FEAT_I8MM (AArch64 Int8 matrix multiplication instructions) |
37 | page_size_granule = extract64(value, 46, 2); | 25 | - FEAT_IDST (ID space trap handling) |
38 | |||
39 | - page_shift = page_size_granule * 2 + 12; | ||
40 | - | ||
41 | if (page_size_granule == 0) { | ||
42 | qemu_log_mask(LOG_GUEST_ERROR, "Invalid page size granule %d\n", | ||
43 | page_size_granule); | ||
44 | return 0; | ||
45 | } | ||
46 | |||
47 | + page_shift = (page_size_granule - 1) * 2 + 12; | ||
48 | + | ||
49 | exponent = (5 * scale) + 1; | ||
50 | length = (num + 1) << (exponent + page_shift); | ||
51 | |||
52 | -- | 26 | -- |
53 | 2.25.1 | 27 | 2.25.1 |
54 | |||
55 | diff view generated by jsdifflib |
1 | The qemu-common.h header is not supposed to be included from any | 1 | From: Philippe Mathieu-Daudé <f4bug@amsat.org> |
---|---|---|---|
2 | other header files, only from .c files (as documented in a comment at | ||
3 | the start of it). | ||
4 | 2 | ||
5 | Nothing actually relies on target/rx/cpu.h including it, so we can | 3 | Fix when building HVF on macOS Aarch64: |
6 | just drop the include. | ||
7 | 4 | ||
5 | target/arm/hvf/hvf.c:586:15: error: unknown type name 'ARMCPRegInfo'; did you mean 'ARMCPUInfo'? | ||
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 | |||
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> | ||
32 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
33 | Message-id: 20220525161926.34233-1-philmd@fungible.com | ||
34 | Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1029 | ||
35 | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 36 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
9 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
10 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
11 | Reviewed-by: Taylor Simpson <tsimpson@quicinc.com> | ||
12 | Reviewed-by: Yoshinori Sato <ysato@users.sourceforge.jp> | ||
13 | Message-id: 20211129200510.1233037-4-peter.maydell@linaro.org | ||
14 | --- | 37 | --- |
15 | target/rx/cpu.h | 1 - | 38 | target/arm/hvf/hvf.c | 1 + |
16 | 1 file changed, 1 deletion(-) | 39 | 1 file changed, 1 insertion(+) |
17 | 40 | ||
18 | diff --git a/target/rx/cpu.h b/target/rx/cpu.h | 41 | diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c |
19 | index XXXXXXX..XXXXXXX 100644 | 42 | index XXXXXXX..XXXXXXX 100644 |
20 | --- a/target/rx/cpu.h | 43 | --- a/target/arm/hvf/hvf.c |
21 | +++ b/target/rx/cpu.h | 44 | +++ b/target/arm/hvf/hvf.c |
22 | @@ -XXX,XX +XXX,XX @@ | 45 | @@ -XXX,XX +XXX,XX @@ |
23 | #define RX_CPU_H | 46 | #include "sysemu/hvf_int.h" |
24 | 47 | #include "sysemu/hw_accel.h" | |
25 | #include "qemu/bitops.h" | 48 | #include "hvf_arm.h" |
26 | -#include "qemu-common.h" | 49 | +#include "cpregs.h" |
27 | #include "hw/registerfields.h" | 50 | |
28 | #include "cpu-qom.h" | 51 | #include <mach/mach_time.h> |
29 | 52 | ||
30 | -- | 53 | -- |
31 | 2.25.1 | 54 | 2.25.1 |
32 | 55 | ||
33 | 56 | diff view generated by jsdifflib |
1 | In the SSE decode function gen_sse(), we combine a byte | 1 | From: Icenowy Zheng <uwu@icenowy.me> |
---|---|---|---|
2 | 'b' and a value 'b1' which can be [0..3], and switch on them: | ||
3 | b |= (b1 << 8); | ||
4 | switch (b) { | ||
5 | ... | ||
6 | default: | ||
7 | unknown_op: | ||
8 | gen_unknown_opcode(env, s); | ||
9 | return; | ||
10 | } | ||
11 | 2 | ||
12 | In three cases inside this switch, we were then also checking for | 3 | U-Boot queries the FIFO water level to reduce checking status register |
13 | "if (b1 >= 2) { goto unknown_op; }". | 4 | when doing PIO SD card operation. |
14 | However, this can never happen, because the 'case' values in each place | ||
15 | are 0x0nn or 0x1nn and the switch will have directed the b1 == (2, 3) | ||
16 | cases to the default already. | ||
17 | 5 | ||
18 | This check was added in commit c045af25a52e9 in 2010; the added code | 6 | Report a FIFO water level of 1 when data is ready, to prevent the code |
19 | was unnecessary then as well, and was apparently intended only to | 7 | from trying to read 0 words from the FIFO each time. |
20 | ensure that we never accidentally ended up indexing off the end | ||
21 | of an sse_op_table with only 2 entries as a result of future bugs | ||
22 | in the decode logic. | ||
23 | 8 | ||
24 | Change the checks to assert() instead, and make sure they're always | 9 | Signed-off-by: Icenowy Zheng <uwu@icenowy.me> |
25 | immediately before the array access they are protecting. | 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> | ||
13 | --- | ||
14 | hw/sd/allwinner-sdhost.c | 7 +++++++ | ||
15 | 1 file changed, 7 insertions(+) | ||
26 | 16 | ||
27 | Fixes: Coverity CID 1460207 | 17 | diff --git a/hw/sd/allwinner-sdhost.c b/hw/sd/allwinner-sdhost.c |
28 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
29 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
30 | --- | ||
31 | target/i386/tcg/translate.c | 12 +++--------- | ||
32 | 1 file changed, 3 insertions(+), 9 deletions(-) | ||
33 | |||
34 | diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c | ||
35 | index XXXXXXX..XXXXXXX 100644 | 18 | index XXXXXXX..XXXXXXX 100644 |
36 | --- a/target/i386/tcg/translate.c | 19 | --- a/hw/sd/allwinner-sdhost.c |
37 | +++ b/target/i386/tcg/translate.c | 20 | +++ b/hw/sd/allwinner-sdhost.c |
38 | @@ -XXX,XX +XXX,XX @@ static void gen_sse(CPUX86State *env, DisasContext *s, int b, | 21 | @@ -XXX,XX +XXX,XX @@ enum { |
39 | case 0x171: /* shift xmm, im */ | 22 | }; |
40 | case 0x172: | 23 | |
41 | case 0x173: | 24 | enum { |
42 | - if (b1 >= 2) { | 25 | + SD_STAR_FIFO_EMPTY = (1 << 2), |
43 | - goto unknown_op; | 26 | SD_STAR_CARD_PRESENT = (1 << 8), |
44 | - } | 27 | + SD_STAR_FIFO_LEVEL_1 = (1 << 17), |
45 | val = x86_ldub_code(env, s); | 28 | }; |
46 | if (is_xmm) { | 29 | |
47 | tcg_gen_movi_tl(s->T0, val); | 30 | enum { |
48 | @@ -XXX,XX +XXX,XX @@ static void gen_sse(CPUX86State *env, DisasContext *s, int b, | 31 | @@ -XXX,XX +XXX,XX @@ static uint64_t allwinner_sdhost_read(void *opaque, hwaddr offset, |
49 | offsetof(CPUX86State, mmx_t0.MMX_L(1))); | 32 | break; |
50 | op1_offset = offsetof(CPUX86State,mmx_t0); | 33 | case REG_SD_STAR: /* Status */ |
51 | } | 34 | res = s->status; |
52 | + assert(b1 < 2); | 35 | + if (sdbus_data_ready(&s->sdbus)) { |
53 | sse_fn_epp = sse_op_table2[((b - 1) & 3) * 8 + | 36 | + res |= SD_STAR_FIFO_LEVEL_1; |
54 | (((modrm >> 3)) & 7)][b1]; | 37 | + } else { |
55 | if (!sse_fn_epp) { | 38 | + res |= SD_STAR_FIFO_EMPTY; |
56 | @@ -XXX,XX +XXX,XX @@ static void gen_sse(CPUX86State *env, DisasContext *s, int b, | 39 | + } |
57 | rm = modrm & 7; | 40 | break; |
58 | reg = ((modrm >> 3) & 7) | REX_R(s); | 41 | case REG_SD_FWLR: /* FIFO Water Level */ |
59 | mod = (modrm >> 6) & 3; | 42 | res = s->fifo_wlevel; |
60 | - if (b1 >= 2) { | ||
61 | - goto unknown_op; | ||
62 | - } | ||
63 | |||
64 | + assert(b1 < 2); | ||
65 | sse_fn_epp = sse_op_table6[b].op[b1]; | ||
66 | if (!sse_fn_epp) { | ||
67 | goto unknown_op; | ||
68 | @@ -XXX,XX +XXX,XX @@ static void gen_sse(CPUX86State *env, DisasContext *s, int b, | ||
69 | rm = modrm & 7; | ||
70 | reg = ((modrm >> 3) & 7) | REX_R(s); | ||
71 | mod = (modrm >> 6) & 3; | ||
72 | - if (b1 >= 2) { | ||
73 | - goto unknown_op; | ||
74 | - } | ||
75 | |||
76 | + assert(b1 < 2); | ||
77 | sse_fn_eppi = sse_op_table7[b].op[b1]; | ||
78 | if (!sse_fn_eppi) { | ||
79 | goto unknown_op; | ||
80 | -- | 43 | -- |
81 | 2.25.1 | 44 | 2.25.1 |
82 | |||
83 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
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 |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
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 |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
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 |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
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 |
1 | From: Patrick Venture <venture@google.com> | 1 | From: Richard Henderson <richard.henderson@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | The rx_active boolean change to true should always trigger a try_read | 3 | Use gen_gvec_ool_arg_zzz instead of gen_gvec_ool_zzz |
4 | call that flushes the queue. | 4 | when the arguments come from arg_rrr_esz. |
5 | Replaces do_zzw_ool and do_zzz_data_ool. | ||
5 | 6 | ||
6 | Signed-off-by: Patrick Venture <venture@google.com> | 7 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
7 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | 8 | Message-id: 20220527181907.189259-6-richard.henderson@linaro.org |
8 | Message-id: 20211203221002.1719306-1-venture@google.com | 9 | Reviewed-by: Peter Maydell <peter.maydell@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 | hw/net/npcm7xx_emc.c | 18 ++++++++---------- | 12 | target/arm/translate-sve.c | 48 +++++++++++++++++--------------------- |
12 | 1 file changed, 8 insertions(+), 10 deletions(-) | 13 | 1 file changed, 21 insertions(+), 27 deletions(-) |
13 | 14 | ||
14 | diff --git a/hw/net/npcm7xx_emc.c b/hw/net/npcm7xx_emc.c | 15 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c |
15 | index XXXXXXX..XXXXXXX 100644 | 16 | index XXXXXXX..XXXXXXX 100644 |
16 | --- a/hw/net/npcm7xx_emc.c | 17 | --- a/target/arm/translate-sve.c |
17 | +++ b/hw/net/npcm7xx_emc.c | 18 | +++ b/target/arm/translate-sve.c |
18 | @@ -XXX,XX +XXX,XX @@ static void emc_halt_rx(NPCM7xxEMCState *emc, uint32_t mista_flag) | 19 | @@ -XXX,XX +XXX,XX @@ static bool gen_gvec_ool_zzz(DisasContext *s, gen_helper_gvec_3 *fn, |
19 | emc_set_mista(emc, mista_flag); | 20 | return true; |
20 | } | 21 | } |
21 | 22 | ||
22 | +static void emc_enable_rx_and_flush(NPCM7xxEMCState *emc) | 23 | +static bool gen_gvec_ool_arg_zzz(DisasContext *s, gen_helper_gvec_3 *fn, |
24 | + arg_rrr_esz *a, int data) | ||
23 | +{ | 25 | +{ |
24 | + emc->rx_active = true; | 26 | + return gen_gvec_ool_zzz(s, fn, a->rd, a->rn, a->rm, data); |
25 | + qemu_flush_queued_packets(qemu_get_queue(emc->nic)); | ||
26 | +} | 27 | +} |
27 | + | 28 | + |
28 | static void emc_set_next_tx_descriptor(NPCM7xxEMCState *emc, | 29 | /* Invoke an out-of-line helper on 4 Zregs. */ |
29 | const NPCM7xxEMCTxDesc *tx_desc, | 30 | static void gen_gvec_ool_zzzz(DisasContext *s, gen_helper_gvec_4 *fn, |
30 | uint32_t desc_addr) | 31 | int rd, int rn, int rm, int ra, int data) |
31 | @@ -XXX,XX +XXX,XX @@ static ssize_t emc_receive(NetClientState *nc, const uint8_t *buf, size_t len1) | 32 | @@ -XXX,XX +XXX,XX @@ static bool trans_LSL_zzi(DisasContext *s, arg_rri_esz *a) |
32 | return len; | 33 | return do_shift_imm(s, a, false, tcg_gen_gvec_shli); |
33 | } | 34 | } |
34 | 35 | ||
35 | -static void emc_try_receive_next_packet(NPCM7xxEMCState *emc) | 36 | -static bool do_zzw_ool(DisasContext *s, arg_rrr_esz *a, gen_helper_gvec_3 *fn) |
36 | -{ | 37 | -{ |
37 | - if (emc_can_receive(qemu_get_queue(emc->nic))) { | 38 | - return gen_gvec_ool_zzz(s, fn, a->rd, a->rn, a->rm, 0); |
38 | - qemu_flush_queued_packets(qemu_get_queue(emc->nic)); | ||
39 | - } | ||
40 | -} | 39 | -} |
41 | - | 40 | - |
42 | static uint64_t npcm7xx_emc_read(void *opaque, hwaddr offset, unsigned size) | 41 | #define DO_ZZW(NAME, name) \ |
42 | static bool trans_##NAME##_zzw(DisasContext *s, arg_rrr_esz *a) \ | ||
43 | { \ | ||
44 | @@ -XXX,XX +XXX,XX @@ static bool trans_##NAME##_zzw(DisasContext *s, arg_rrr_esz *a) \ | ||
45 | gen_helper_sve_##name##_zzw_b, gen_helper_sve_##name##_zzw_h, \ | ||
46 | gen_helper_sve_##name##_zzw_s, NULL \ | ||
47 | }; \ | ||
48 | - return do_zzw_ool(s, a, fns[a->esz]); \ | ||
49 | + return gen_gvec_ool_arg_zzz(s, fns[a->esz], a, 0); \ | ||
50 | } | ||
51 | |||
52 | DO_ZZW(ASR, asr) | ||
53 | @@ -XXX,XX +XXX,XX @@ static bool trans_FTSSEL(DisasContext *s, arg_rrr_esz *a) | ||
54 | gen_helper_sve_ftssel_s, | ||
55 | gen_helper_sve_ftssel_d, | ||
56 | }; | ||
57 | - return gen_gvec_ool_zzz(s, fns[a->esz], a->rd, a->rn, a->rm, 0); | ||
58 | + return gen_gvec_ool_arg_zzz(s, fns[a->esz], a, 0); | ||
59 | } | ||
60 | |||
61 | /* | ||
62 | @@ -XXX,XX +XXX,XX @@ static bool trans_TBL(DisasContext *s, arg_rrr_esz *a) | ||
63 | gen_helper_sve_tbl_b, gen_helper_sve_tbl_h, | ||
64 | gen_helper_sve_tbl_s, gen_helper_sve_tbl_d | ||
65 | }; | ||
66 | - return gen_gvec_ool_zzz(s, fns[a->esz], a->rd, a->rn, a->rm, 0); | ||
67 | + return gen_gvec_ool_arg_zzz(s, fns[a->esz], a, 0); | ||
68 | } | ||
69 | |||
70 | static bool trans_TBL_sve2(DisasContext *s, arg_rrr_esz *a) | ||
71 | @@ -XXX,XX +XXX,XX @@ static bool trans_TBX(DisasContext *s, arg_rrr_esz *a) | ||
72 | if (!dc_isar_feature(aa64_sve2, s)) { | ||
73 | return false; | ||
74 | } | ||
75 | - return gen_gvec_ool_zzz(s, fns[a->esz], a->rd, a->rn, a->rm, 0); | ||
76 | + return gen_gvec_ool_arg_zzz(s, fns[a->esz], a, 0); | ||
77 | } | ||
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) | ||
43 | { | 91 | { |
44 | NPCM7xxEMCState *emc = opaque; | 92 | return do_zip(s, a, false); |
45 | @@ -XXX,XX +XXX,XX @@ static void npcm7xx_emc_write(void *opaque, hwaddr offset, | 93 | @@ -XXX,XX +XXX,XX @@ static gen_helper_gvec_3 * const uzp_fns[4] = { |
46 | emc->regs[REG_MGSTA] |= REG_MGSTA_RXHA; | 94 | |
47 | } | 95 | static bool trans_UZP1_z(DisasContext *s, arg_rrr_esz *a) |
48 | if (value & REG_MCMDR_RXON) { | 96 | { |
49 | - emc->rx_active = true; | 97 | - return do_zzz_data_ool(s, a, 0, uzp_fns[a->esz]); |
50 | + emc_enable_rx_and_flush(emc); | 98 | + return gen_gvec_ool_arg_zzz(s, uzp_fns[a->esz], a, 0); |
51 | } else { | 99 | } |
52 | emc_halt_rx(emc, 0); | 100 | |
53 | } | 101 | static bool trans_UZP2_z(DisasContext *s, arg_rrr_esz *a) |
54 | @@ -XXX,XX +XXX,XX @@ static void npcm7xx_emc_write(void *opaque, hwaddr offset, | 102 | { |
55 | break; | 103 | - return do_zzz_data_ool(s, a, 1 << a->esz, uzp_fns[a->esz]); |
56 | case REG_RSDR: | 104 | + return gen_gvec_ool_arg_zzz(s, uzp_fns[a->esz], a, 1 << a->esz); |
57 | if (emc->regs[REG_MCMDR] & REG_MCMDR_RXON) { | 105 | } |
58 | - emc->rx_active = true; | 106 | |
59 | - emc_try_receive_next_packet(emc); | 107 | static bool trans_UZP1_q(DisasContext *s, arg_rrr_esz *a) |
60 | + emc_enable_rx_and_flush(emc); | 108 | @@ -XXX,XX +XXX,XX @@ static bool trans_UZP1_q(DisasContext *s, arg_rrr_esz *a) |
61 | } | 109 | if (!dc_isar_feature(aa64_sve_f64mm, s)) { |
62 | break; | 110 | return false; |
63 | case REG_MIIDA: | 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) | ||
64 | -- | 187 | -- |
65 | 2.25.1 | 188 | 2.25.1 |
66 | |||
67 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | 1 | From: Richard Henderson <richard.henderson@linaro.org> | |
2 | |||
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 |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
3 | Convert SVE translation functions using do_sve2_zzz_ool | ||
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-8-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 | 88 ++++++++++++++------------------------ | ||
12 | 1 file changed, 31 insertions(+), 57 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_MUL_zzz(DisasContext *s, arg_rrr_esz *a) | ||
19 | return true; | ||
20 | } | ||
21 | |||
22 | -static bool do_sve2_zzz_ool(DisasContext *s, arg_rrr_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_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 | } | ||
102 | |||
103 | #define DO_SVE2_ZZZ_NARROW(NAME, name) \ | ||
104 | -static bool trans_##NAME(DisasContext *s, arg_rrr_esz *a) \ | ||
105 | -{ \ | ||
106 | - static gen_helper_gvec_3 * const fns[4] = { \ | ||
107 | + static gen_helper_gvec_3 * const name##_fns[4] = { \ | ||
108 | NULL, gen_helper_sve2_##name##_h, \ | ||
109 | gen_helper_sve2_##name##_s, gen_helper_sve2_##name##_d, \ | ||
110 | }; \ | ||
111 | - return do_sve2_zzz_ool(s, a, fns[a->esz]); \ | ||
112 | -} | ||
113 | + TRANS_FEAT(NAME, aa64_sve2, gen_gvec_ool_arg_zzz, \ | ||
114 | + name##_fns[a->esz], a, 0) | ||
115 | |||
116 | DO_SVE2_ZZZ_NARROW(ADDHNB, addhnb) | ||
117 | DO_SVE2_ZZZ_NARROW(ADDHNT, addhnt) | ||
118 | @@ -XXX,XX +XXX,XX @@ static bool trans_HISTCNT(DisasContext *s, arg_rprr_esz *a) | ||
119 | return do_sve2_zpzz_ool(s, a, fns[a->esz - 2]); | ||
120 | } | ||
121 | |||
122 | -static bool trans_HISTSEG(DisasContext *s, arg_rrr_esz *a) | ||
123 | -{ | ||
124 | - if (a->esz != 0) { | ||
125 | - return false; | ||
126 | - } | ||
127 | - return do_sve2_zzz_ool(s, a, gen_helper_sve2_histseg); | ||
128 | -} | ||
129 | +TRANS_FEAT(HISTSEG, aa64_sve2, gen_gvec_ool_arg_zzz, | ||
130 | + a->esz == 0 ? gen_helper_sve2_histseg : NULL, a, 0) | ||
131 | |||
132 | static bool do_sve2_zpzz_fp(DisasContext *s, arg_rprr_esz *a, | ||
133 | gen_helper_gvec_4_ptr *fn) | ||
134 | -- | ||
135 | 2.25.1 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
4 | Message-id: 20220527181907.189259-9-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 | 102 ++++++++++++++----------------------- | ||
9 | 1 file changed, 38 insertions(+), 64 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_zzz(DisasContext *s, gen_helper_gvec_3 *fn, | ||
16 | } | ||
17 | |||
18 | /* Invoke an out-of-line helper on 4 Zregs. */ | ||
19 | -static void gen_gvec_ool_zzzz(DisasContext *s, gen_helper_gvec_4 *fn, | ||
20 | +static bool gen_gvec_ool_zzzz(DisasContext *s, gen_helper_gvec_4 *fn, | ||
21 | int rd, int rn, int rm, int ra, 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 | - vec_full_reg_offset(s, ra), | ||
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 | + vec_full_reg_offset(s, ra), | ||
38 | + vsz, vsz, data, fn); | ||
39 | + } | ||
40 | + return true; | ||
41 | } | ||
42 | |||
43 | /* Invoke an out-of-line helper on 2 Zregs and a predicate. */ | ||
44 | @@ -XXX,XX +XXX,XX @@ static bool trans_TBL_sve2(DisasContext *s, arg_rrr_esz *a) | ||
45 | if (!dc_isar_feature(aa64_sve2, s)) { | ||
46 | return false; | ||
47 | } | ||
48 | - if (sve_access_check(s)) { | ||
49 | - gen_gvec_ool_zzzz(s, fns[a->esz], a->rd, a->rn, | ||
50 | - (a->rn + 1) % 32, a->rm, 0); | ||
51 | - } | ||
52 | - return true; | ||
53 | + return gen_gvec_ool_zzzz(s, fns[a->esz], a->rd, a->rn, | ||
54 | + (a->rn + 1) % 32, a->rm, 0); | ||
55 | } | ||
56 | |||
57 | static gen_helper_gvec_3 * const tbx_fns[4] = { | ||
58 | @@ -XXX,XX +XXX,XX @@ static bool trans_DOT_zzzz(DisasContext *s, arg_DOT_zzzz *a) | ||
59 | { gen_helper_gvec_sdot_b, gen_helper_gvec_sdot_h }, | ||
60 | { gen_helper_gvec_udot_b, gen_helper_gvec_udot_h } | ||
61 | }; | ||
62 | - | ||
63 | - if (sve_access_check(s)) { | ||
64 | - gen_gvec_ool_zzzz(s, fns[a->u][a->sz], a->rd, a->rn, a->rm, a->ra, 0); | ||
65 | - } | ||
66 | - return true; | ||
67 | + return gen_gvec_ool_zzzz(s, fns[a->u][a->sz], | ||
68 | + a->rd, a->rn, a->rm, a->ra, 0); | ||
69 | } | ||
70 | |||
71 | /* | ||
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 | -- | ||
205 | 2.25.1 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
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 |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
3 | Use gen_gvec_ool_arg_zzzz instead of gen_gvec_ool_zzzz | ||
4 | when the arguments come from arg_rrrr_esz. | ||
5 | |||
6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
7 | Message-id: 20220527181907.189259-11-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 | 16 ++++++++++------ | ||
12 | 1 file changed, 10 insertions(+), 6 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_zzzz(DisasContext *s, gen_helper_gvec_4 *fn, | ||
19 | return true; | ||
20 | } | ||
21 | |||
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 | -- | ||
70 | 2.25.1 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
3 | Convert SVE translation functions using do_sve2_zzzz_ool | ||
4 | to use TRANS_FEAT and gen_gvec_ool_arg_zzzz. | ||
5 | |||
6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
7 | Message-id: 20220527181907.189259-12-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 | 263 +++++++++++-------------------------- | ||
12 | 1 file changed, 79 insertions(+), 184 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_SQCADD_rot270(DisasContext *s, arg_rrr_esz *a) | ||
19 | return do_cadd(s, a, true, true); | ||
20 | } | ||
21 | |||
22 | -static bool do_sve2_zzzz_ool(DisasContext *s, arg_rrrr_esz *a, | ||
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 | { | ||
76 | @@ -XXX,XX +XXX,XX @@ static bool do_adcl(DisasContext *s, arg_rrrr_esz *a, bool sel) | ||
77 | * Note that in this case the ESZ field encodes both size and sign. | ||
78 | * Split out 'subtract' into bit 1 of the data field for the helper. | ||
79 | */ | ||
80 | - return do_sve2_zzzz_ool(s, a, fns[a->esz & 1], (a->esz & 2) | sel); | ||
81 | + return gen_gvec_ool_arg_zzzz(s, fns[a->esz & 1], a, (a->esz & 2) | sel); | ||
82 | } | ||
83 | |||
84 | -static bool trans_ADCLB(DisasContext *s, arg_rrrr_esz *a) | ||
85 | -{ | ||
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 | { | ||
98 | @@ -XXX,XX +XXX,XX @@ static bool trans_FMMLA(DisasContext *s, arg_rrrr_esz *a) | ||
99 | return true; | ||
100 | } | ||
101 | |||
102 | -static bool do_sqdmlal_zzzw(DisasContext *s, arg_rrrr_esz *a, | ||
103 | - bool sel1, bool sel2) | ||
104 | -{ | ||
105 | - static gen_helper_gvec_4 * const fns[] = { | ||
106 | - NULL, gen_helper_sve2_sqdmlal_zzzw_h, | ||
107 | - gen_helper_sve2_sqdmlal_zzzw_s, gen_helper_sve2_sqdmlal_zzzw_d, | ||
108 | - }; | ||
109 | - return do_sve2_zzzz_ool(s, a, fns[a->esz], (sel2 << 1) | sel1); | ||
110 | -} | ||
111 | +static gen_helper_gvec_4 * const sqdmlal_zzzw_fns[] = { | ||
112 | + NULL, gen_helper_sve2_sqdmlal_zzzw_h, | ||
113 | + gen_helper_sve2_sqdmlal_zzzw_s, gen_helper_sve2_sqdmlal_zzzw_d, | ||
114 | +}; | ||
115 | +TRANS_FEAT(SQDMLALB_zzzw, aa64_sve2, gen_gvec_ool_arg_zzzz, | ||
116 | + sqdmlal_zzzw_fns[a->esz], a, 0) | ||
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 | -- | ||
313 | 2.25.1 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
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 |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
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 |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
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 |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Richard Henderson <richard.henderson@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | The size of the code covered by a TranslationBlock cannot be 0; | 3 | Convert SVE translation functions using do_sve2_zzz_data |
4 | this is checked via assert in tb_gen_code. | 4 | to use TRANS_FEAT and gen_gvec_ool_zzz. |
5 | 5 | ||
6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
7 | Message-id: 20220527181907.189259-16-richard.henderson@linaro.org | ||
7 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 8 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> |
8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
9 | --- | 10 | --- |
10 | target/arm/translate-a64.c | 1 + | 11 | target/arm/translate-sve.c | 69 ++++++++++++++------------------------ |
11 | 1 file changed, 1 insertion(+) | 12 | 1 file changed, 25 insertions(+), 44 deletions(-) |
12 | 13 | ||
13 | diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c | 14 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c |
14 | index XXXXXXX..XXXXXXX 100644 | 15 | index XXXXXXX..XXXXXXX 100644 |
15 | --- a/target/arm/translate-a64.c | 16 | --- a/target/arm/translate-sve.c |
16 | +++ b/target/arm/translate-a64.c | 17 | +++ b/target/arm/translate-sve.c |
17 | @@ -XXX,XX +XXX,XX @@ static void aarch64_tr_translate_insn(DisasContextBase *dcbase, CPUState *cpu) | 18 | @@ -XXX,XX +XXX,XX @@ TRANS_FEAT(SUDOT_zzxw_s, aa64_sve_i8mm, gen_gvec_ool_arg_zzxz, |
18 | assert(s->base.num_insns == 1); | 19 | TRANS_FEAT(USDOT_zzxw_s, aa64_sve_i8mm, gen_gvec_ool_arg_zzxz, |
19 | gen_swstep_exception(s, 0, 0); | 20 | gen_helper_gvec_usdot_idx_b, a) |
20 | s->base.is_jmp = DISAS_NORETURN; | 21 | |
21 | + s->base.pc_next = pc + 4; | 22 | -static bool do_sve2_zzz_data(DisasContext *s, int rd, int rn, int rm, int data, |
22 | return; | 23 | - gen_helper_gvec_3 *fn) |
23 | } | 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 | ||
24 | 104 | ||
25 | -- | 105 | -- |
26 | 2.25.1 | 106 | 2.25.1 |
27 | |||
28 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
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 |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
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 |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
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 |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
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 |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
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 |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
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 |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
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 |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
3 | Rename the function to match gen_gvec_ool_arg_zpz, | ||
4 | and move to be adjacent. | ||
5 | |||
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> | ||
10 | --- | ||
11 | target/arm/translate-sve.c | 29 ++++++++++++++--------------- | ||
12 | 1 file changed, 14 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_ool_arg_zpz(DisasContext *s, gen_helper_gvec_3 *fn, | ||
19 | return gen_gvec_ool_zzp(s, fn, a->rd, a->rn, a->pg, data); | ||
20 | } | ||
21 | |||
22 | +static bool gen_gvec_ool_arg_zpzi(DisasContext *s, gen_helper_gvec_3 *fn, | ||
23 | + arg_rpri_esz *a) | ||
24 | +{ | ||
25 | + return gen_gvec_ool_zzp(s, fn, a->rd, a->rn, a->pg, a->imm); | ||
26 | +} | ||
27 | |||
28 | /* Invoke an out-of-line helper on 3 Zregs and a predicate. */ | ||
29 | static void gen_gvec_ool_zzzp(DisasContext *s, gen_helper_gvec_4 *fn, | ||
30 | @@ -XXX,XX +XXX,XX @@ static bool do_movz_zpz(DisasContext *s, int rd, int rn, int pg, | ||
31 | return gen_gvec_ool_zzp(s, fns[esz], rd, rn, pg, invert); | ||
32 | } | ||
33 | |||
34 | -static bool do_zpzi_ool(DisasContext *s, arg_rpri_esz *a, | ||
35 | - gen_helper_gvec_3 *fn) | ||
36 | -{ | ||
37 | - return gen_gvec_ool_zzp(s, fn, a->rd, a->rn, a->pg, a->imm); | ||
38 | -} | ||
39 | - | ||
40 | static bool trans_ASR_zpzi(DisasContext *s, arg_rpri_esz *a) | ||
41 | { | ||
42 | static gen_helper_gvec_3 * const fns[4] = { | ||
43 | @@ -XXX,XX +XXX,XX @@ static bool trans_ASR_zpzi(DisasContext *s, arg_rpri_esz *a) | ||
44 | /* Shift by element size is architecturally valid. For | ||
45 | arithmetic right-shift, it's the same as by one less. */ | ||
46 | a->imm = MIN(a->imm, (8 << a->esz) - 1); | ||
47 | - return do_zpzi_ool(s, a, fns[a->esz]); | ||
48 | + return gen_gvec_ool_arg_zpzi(s, fns[a->esz], a); | ||
49 | } | ||
50 | |||
51 | static bool trans_LSR_zpzi(DisasContext *s, arg_rpri_esz *a) | ||
52 | @@ -XXX,XX +XXX,XX @@ static bool trans_LSR_zpzi(DisasContext *s, arg_rpri_esz *a) | ||
53 | if (a->imm >= (8 << a->esz)) { | ||
54 | return do_movz_zpz(s, a->rd, a->rd, a->pg, a->esz, true); | ||
55 | } else { | ||
56 | - return do_zpzi_ool(s, a, fns[a->esz]); | ||
57 | + return gen_gvec_ool_arg_zpzi(s, fns[a->esz], a); | ||
58 | } | ||
59 | } | ||
60 | |||
61 | @@ -XXX,XX +XXX,XX @@ static bool trans_LSL_zpzi(DisasContext *s, arg_rpri_esz *a) | ||
62 | if (a->imm >= (8 << a->esz)) { | ||
63 | return do_movz_zpz(s, a->rd, a->rd, a->pg, a->esz, true); | ||
64 | } else { | ||
65 | - return do_zpzi_ool(s, a, fns[a->esz]); | ||
66 | + return gen_gvec_ool_arg_zpzi(s, fns[a->esz], a); | ||
67 | } | ||
68 | } | ||
69 | |||
70 | @@ -XXX,XX +XXX,XX @@ static bool trans_ASRD(DisasContext *s, arg_rpri_esz *a) | ||
71 | if (a->imm >= (8 << a->esz)) { | ||
72 | return do_movz_zpz(s, a->rd, a->rd, a->pg, a->esz, true); | ||
73 | } else { | ||
74 | - return do_zpzi_ool(s, a, fns[a->esz]); | ||
75 | + return gen_gvec_ool_arg_zpzi(s, fns[a->esz], a); | ||
76 | } | ||
77 | } | ||
78 | |||
79 | @@ -XXX,XX +XXX,XX @@ static bool trans_SQSHL_zpzi(DisasContext *s, arg_rpri_esz *a) | ||
80 | if (a->esz < 0 || !dc_isar_feature(aa64_sve2, s)) { | ||
81 | return false; | ||
82 | } | ||
83 | - return do_zpzi_ool(s, a, fns[a->esz]); | ||
84 | + return gen_gvec_ool_arg_zpzi(s, fns[a->esz], a); | ||
85 | } | ||
86 | |||
87 | static bool trans_UQSHL_zpzi(DisasContext *s, arg_rpri_esz *a) | ||
88 | @@ -XXX,XX +XXX,XX @@ static bool trans_UQSHL_zpzi(DisasContext *s, arg_rpri_esz *a) | ||
89 | if (a->esz < 0 || !dc_isar_feature(aa64_sve2, s)) { | ||
90 | return false; | ||
91 | } | ||
92 | - return do_zpzi_ool(s, a, fns[a->esz]); | ||
93 | + return gen_gvec_ool_arg_zpzi(s, fns[a->esz], a); | ||
94 | } | ||
95 | |||
96 | static bool trans_SRSHR(DisasContext *s, arg_rpri_esz *a) | ||
97 | @@ -XXX,XX +XXX,XX @@ static bool trans_SRSHR(DisasContext *s, arg_rpri_esz *a) | ||
98 | if (a->esz < 0 || !dc_isar_feature(aa64_sve2, s)) { | ||
99 | return false; | ||
100 | } | ||
101 | - return do_zpzi_ool(s, a, fns[a->esz]); | ||
102 | + return gen_gvec_ool_arg_zpzi(s, fns[a->esz], a); | ||
103 | } | ||
104 | |||
105 | static bool trans_URSHR(DisasContext *s, arg_rpri_esz *a) | ||
106 | @@ -XXX,XX +XXX,XX @@ static bool trans_URSHR(DisasContext *s, arg_rpri_esz *a) | ||
107 | if (a->esz < 0 || !dc_isar_feature(aa64_sve2, s)) { | ||
108 | return false; | ||
109 | } | ||
110 | - return do_zpzi_ool(s, a, fns[a->esz]); | ||
111 | + return gen_gvec_ool_arg_zpzi(s, fns[a->esz], a); | ||
112 | } | ||
113 | |||
114 | static bool trans_SQSHLU(DisasContext *s, arg_rpri_esz *a) | ||
115 | @@ -XXX,XX +XXX,XX @@ static bool trans_SQSHLU(DisasContext *s, arg_rpri_esz *a) | ||
116 | if (a->esz < 0 || !dc_isar_feature(aa64_sve2, s)) { | ||
117 | return false; | ||
118 | } | ||
119 | - return do_zpzi_ool(s, a, fns[a->esz]); | ||
120 | + return gen_gvec_ool_arg_zpzi(s, fns[a->esz], a); | ||
121 | } | ||
122 | |||
123 | /* | ||
124 | -- | ||
125 | 2.25.1 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
3 | Convert some SVE translation functions using | ||
4 | gen_gvec_ool_arg_zpzi to TRANS_FEAT. | ||
5 | |||
6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
7 | Message-id: 20220527181907.189259-25-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, 30 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 @@ static bool trans_ASRD(DisasContext *s, arg_rpri_esz *a) | ||
19 | } | ||
20 | } | ||
21 | |||
22 | -static bool trans_SQSHL_zpzi(DisasContext *s, arg_rpri_esz *a) | ||
23 | -{ | ||
24 | - static gen_helper_gvec_3 * const fns[4] = { | ||
25 | - gen_helper_sve2_sqshl_zpzi_b, gen_helper_sve2_sqshl_zpzi_h, | ||
26 | - gen_helper_sve2_sqshl_zpzi_s, gen_helper_sve2_sqshl_zpzi_d, | ||
27 | - }; | ||
28 | - if (a->esz < 0 || !dc_isar_feature(aa64_sve2, s)) { | ||
29 | - return false; | ||
30 | - } | ||
31 | - return gen_gvec_ool_arg_zpzi(s, fns[a->esz], a); | ||
32 | -} | ||
33 | +static gen_helper_gvec_3 * const sqshl_zpzi_fns[4] = { | ||
34 | + gen_helper_sve2_sqshl_zpzi_b, gen_helper_sve2_sqshl_zpzi_h, | ||
35 | + gen_helper_sve2_sqshl_zpzi_s, gen_helper_sve2_sqshl_zpzi_d, | ||
36 | +}; | ||
37 | +TRANS_FEAT(SQSHL_zpzi, aa64_sve2, gen_gvec_ool_arg_zpzi, | ||
38 | + a->esz < 0 ? NULL : sqshl_zpzi_fns[a->esz], a) | ||
39 | |||
40 | -static bool trans_UQSHL_zpzi(DisasContext *s, arg_rpri_esz *a) | ||
41 | -{ | ||
42 | - static gen_helper_gvec_3 * const fns[4] = { | ||
43 | - gen_helper_sve2_uqshl_zpzi_b, gen_helper_sve2_uqshl_zpzi_h, | ||
44 | - gen_helper_sve2_uqshl_zpzi_s, gen_helper_sve2_uqshl_zpzi_d, | ||
45 | - }; | ||
46 | - if (a->esz < 0 || !dc_isar_feature(aa64_sve2, s)) { | ||
47 | - return false; | ||
48 | - } | ||
49 | - return gen_gvec_ool_arg_zpzi(s, fns[a->esz], a); | ||
50 | -} | ||
51 | +static gen_helper_gvec_3 * const uqshl_zpzi_fns[4] = { | ||
52 | + gen_helper_sve2_uqshl_zpzi_b, gen_helper_sve2_uqshl_zpzi_h, | ||
53 | + gen_helper_sve2_uqshl_zpzi_s, gen_helper_sve2_uqshl_zpzi_d, | ||
54 | +}; | ||
55 | +TRANS_FEAT(UQSHL_zpzi, aa64_sve2, gen_gvec_ool_arg_zpzi, | ||
56 | + a->esz < 0 ? NULL : uqshl_zpzi_fns[a->esz], a) | ||
57 | |||
58 | -static bool trans_SRSHR(DisasContext *s, arg_rpri_esz *a) | ||
59 | -{ | ||
60 | - static gen_helper_gvec_3 * const fns[4] = { | ||
61 | - gen_helper_sve2_srshr_b, gen_helper_sve2_srshr_h, | ||
62 | - gen_helper_sve2_srshr_s, gen_helper_sve2_srshr_d, | ||
63 | - }; | ||
64 | - if (a->esz < 0 || !dc_isar_feature(aa64_sve2, s)) { | ||
65 | - return false; | ||
66 | - } | ||
67 | - return gen_gvec_ool_arg_zpzi(s, fns[a->esz], a); | ||
68 | -} | ||
69 | +static gen_helper_gvec_3 * const srshr_fns[4] = { | ||
70 | + gen_helper_sve2_srshr_b, gen_helper_sve2_srshr_h, | ||
71 | + gen_helper_sve2_srshr_s, gen_helper_sve2_srshr_d, | ||
72 | +}; | ||
73 | +TRANS_FEAT(SRSHR, aa64_sve2, gen_gvec_ool_arg_zpzi, | ||
74 | + a->esz < 0 ? NULL : srshr_fns[a->esz], a) | ||
75 | |||
76 | -static bool trans_URSHR(DisasContext *s, arg_rpri_esz *a) | ||
77 | -{ | ||
78 | - static gen_helper_gvec_3 * const fns[4] = { | ||
79 | - gen_helper_sve2_urshr_b, gen_helper_sve2_urshr_h, | ||
80 | - gen_helper_sve2_urshr_s, gen_helper_sve2_urshr_d, | ||
81 | - }; | ||
82 | - if (a->esz < 0 || !dc_isar_feature(aa64_sve2, s)) { | ||
83 | - return false; | ||
84 | - } | ||
85 | - return gen_gvec_ool_arg_zpzi(s, fns[a->esz], a); | ||
86 | -} | ||
87 | +static gen_helper_gvec_3 * const urshr_fns[4] = { | ||
88 | + gen_helper_sve2_urshr_b, gen_helper_sve2_urshr_h, | ||
89 | + gen_helper_sve2_urshr_s, gen_helper_sve2_urshr_d, | ||
90 | +}; | ||
91 | +TRANS_FEAT(URSHR, aa64_sve2, gen_gvec_ool_arg_zpzi, | ||
92 | + a->esz < 0 ? NULL : urshr_fns[a->esz], a) | ||
93 | |||
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 | -- | ||
115 | 2.25.1 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
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 |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
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 |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
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 |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
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 |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
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 |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
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 |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
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 |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
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 |
1 | A lot of C files in hw/arm include qemu-common.h when they don't | 1 | From: Richard Henderson <richard.henderson@linaro.org> |
---|---|---|---|
2 | need anything from it. Drop the include lines. | ||
3 | 2 | ||
4 | omap1.c, pxa2xx.c and strongarm.c retain the include because they | 3 | Convert SVE translation functions directly using |
5 | use it for the prototype of qemu_get_timedate(). | 4 | gen_gvec_fn_arg_zzz to TRANS_FEAT. |
6 | 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> | ||
7 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
8 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
9 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
10 | Reviewed-by: Taylor Simpson <tsimpson@quicinc.com> | ||
11 | Reviewed-by: Yoshinori Sato <ysato@users.sourceforge.jp> | ||
12 | Message-id: 20211129200510.1233037-5-peter.maydell@linaro.org | ||
13 | --- | 10 | --- |
14 | hw/arm/boot.c | 1 - | 11 | target/arm/translate-sve.c | 66 +++++++------------------------------- |
15 | hw/arm/digic_boards.c | 1 - | 12 | 1 file changed, 11 insertions(+), 55 deletions(-) |
16 | hw/arm/highbank.c | 1 - | ||
17 | hw/arm/npcm7xx_boards.c | 1 - | ||
18 | hw/arm/sbsa-ref.c | 1 - | ||
19 | hw/arm/stm32f405_soc.c | 1 - | ||
20 | hw/arm/vexpress.c | 1 - | ||
21 | hw/arm/virt.c | 1 - | ||
22 | 8 files changed, 8 deletions(-) | ||
23 | 13 | ||
24 | diff --git a/hw/arm/boot.c b/hw/arm/boot.c | 14 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c |
25 | index XXXXXXX..XXXXXXX 100644 | 15 | index XXXXXXX..XXXXXXX 100644 |
26 | --- a/hw/arm/boot.c | 16 | --- a/target/arm/translate-sve.c |
27 | +++ b/hw/arm/boot.c | 17 | +++ b/target/arm/translate-sve.c |
28 | @@ -XXX,XX +XXX,XX @@ | 18 | @@ -XXX,XX +XXX,XX @@ const uint64_t pred_esz_masks[4] = { |
19 | *** SVE Logical - Unpredicated Group | ||
29 | */ | 20 | */ |
30 | 21 | ||
31 | #include "qemu/osdep.h" | 22 | -static bool trans_AND_zzz(DisasContext *s, arg_rrr_esz *a) |
32 | -#include "qemu-common.h" | 23 | -{ |
33 | #include "qemu/datadir.h" | 24 | - return gen_gvec_fn_arg_zzz(s, tcg_gen_gvec_and, a); |
34 | #include "qemu/error-report.h" | 25 | -} |
35 | #include "qapi/error.h" | 26 | - |
36 | diff --git a/hw/arm/digic_boards.c b/hw/arm/digic_boards.c | 27 | -static bool trans_ORR_zzz(DisasContext *s, arg_rrr_esz *a) |
37 | index XXXXXXX..XXXXXXX 100644 | 28 | -{ |
38 | --- a/hw/arm/digic_boards.c | 29 | - return gen_gvec_fn_arg_zzz(s, tcg_gen_gvec_or, a); |
39 | +++ b/hw/arm/digic_boards.c | 30 | -} |
40 | @@ -XXX,XX +XXX,XX @@ | 31 | - |
41 | 32 | -static bool trans_EOR_zzz(DisasContext *s, arg_rrr_esz *a) | |
42 | #include "qemu/osdep.h" | 33 | -{ |
43 | #include "qapi/error.h" | 34 | - return gen_gvec_fn_arg_zzz(s, tcg_gen_gvec_xor, a); |
44 | -#include "qemu-common.h" | 35 | -} |
45 | #include "qemu/datadir.h" | 36 | - |
46 | #include "hw/boards.h" | 37 | -static bool trans_BIC_zzz(DisasContext *s, arg_rrr_esz *a) |
47 | #include "qemu/error-report.h" | 38 | -{ |
48 | diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c | 39 | - return gen_gvec_fn_arg_zzz(s, tcg_gen_gvec_andc, a); |
49 | index XXXXXXX..XXXXXXX 100644 | 40 | -} |
50 | --- a/hw/arm/highbank.c | 41 | +TRANS_FEAT(AND_zzz, aa64_sve, gen_gvec_fn_arg_zzz, tcg_gen_gvec_and, a) |
51 | +++ b/hw/arm/highbank.c | 42 | +TRANS_FEAT(ORR_zzz, aa64_sve, gen_gvec_fn_arg_zzz, tcg_gen_gvec_or, a) |
52 | @@ -XXX,XX +XXX,XX @@ | 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 | ||
53 | */ | 50 | */ |
54 | 51 | ||
55 | #include "qemu/osdep.h" | 52 | -static bool trans_ADD_zzz(DisasContext *s, arg_rrr_esz *a) |
56 | -#include "qemu-common.h" | 53 | -{ |
57 | #include "qemu/datadir.h" | 54 | - return gen_gvec_fn_arg_zzz(s, tcg_gen_gvec_add, a); |
58 | #include "qapi/error.h" | 55 | -} |
59 | #include "hw/sysbus.h" | 56 | - |
60 | diff --git a/hw/arm/npcm7xx_boards.c b/hw/arm/npcm7xx_boards.c | 57 | -static bool trans_SUB_zzz(DisasContext *s, arg_rrr_esz *a) |
61 | index XXXXXXX..XXXXXXX 100644 | 58 | -{ |
62 | --- a/hw/arm/npcm7xx_boards.c | 59 | - return gen_gvec_fn_arg_zzz(s, tcg_gen_gvec_sub, a); |
63 | +++ b/hw/arm/npcm7xx_boards.c | 60 | -} |
64 | @@ -XXX,XX +XXX,XX @@ | 61 | - |
65 | #include "hw/qdev-core.h" | 62 | -static bool trans_SQADD_zzz(DisasContext *s, arg_rrr_esz *a) |
66 | #include "hw/qdev-properties.h" | 63 | -{ |
67 | #include "qapi/error.h" | 64 | - return gen_gvec_fn_arg_zzz(s, tcg_gen_gvec_ssadd, a); |
68 | -#include "qemu-common.h" | 65 | -} |
69 | #include "qemu/datadir.h" | 66 | - |
70 | #include "qemu/units.h" | 67 | -static bool trans_SQSUB_zzz(DisasContext *s, arg_rrr_esz *a) |
71 | #include "sysemu/blockdev.h" | 68 | -{ |
72 | diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c | 69 | - return gen_gvec_fn_arg_zzz(s, tcg_gen_gvec_sssub, a); |
73 | index XXXXXXX..XXXXXXX 100644 | 70 | -} |
74 | --- a/hw/arm/sbsa-ref.c | 71 | - |
75 | +++ b/hw/arm/sbsa-ref.c | 72 | -static bool trans_UQADD_zzz(DisasContext *s, arg_rrr_esz *a) |
76 | @@ -XXX,XX +XXX,XX @@ | 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 | ||
77 | */ | 92 | */ |
78 | 93 | ||
79 | #include "qemu/osdep.h" | 94 | -static bool trans_MUL_zzz(DisasContext *s, arg_rrr_esz *a) |
80 | -#include "qemu-common.h" | 95 | -{ |
81 | #include "qemu/datadir.h" | 96 | - if (!dc_isar_feature(aa64_sve2, s)) { |
82 | #include "qapi/error.h" | 97 | - return false; |
83 | #include "qemu/error-report.h" | 98 | - } |
84 | diff --git a/hw/arm/stm32f405_soc.c b/hw/arm/stm32f405_soc.c | 99 | - return gen_gvec_fn_arg_zzz(s, tcg_gen_gvec_mul, a); |
85 | index XXXXXXX..XXXXXXX 100644 | 100 | -} |
86 | --- a/hw/arm/stm32f405_soc.c | 101 | +TRANS_FEAT(MUL_zzz, aa64_sve2, gen_gvec_fn_arg_zzz, tcg_gen_gvec_mul, a) |
87 | +++ b/hw/arm/stm32f405_soc.c | 102 | |
88 | @@ -XXX,XX +XXX,XX @@ | 103 | static gen_helper_gvec_3 * const smulh_zzz_fns[4] = { |
89 | 104 | gen_helper_gvec_smulh_b, gen_helper_gvec_smulh_h, | |
90 | #include "qemu/osdep.h" | ||
91 | #include "qapi/error.h" | ||
92 | -#include "qemu-common.h" | ||
93 | #include "exec/address-spaces.h" | ||
94 | #include "sysemu/sysemu.h" | ||
95 | #include "hw/arm/stm32f405_soc.h" | ||
96 | diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c | ||
97 | index XXXXXXX..XXXXXXX 100644 | ||
98 | --- a/hw/arm/vexpress.c | ||
99 | +++ b/hw/arm/vexpress.c | ||
100 | @@ -XXX,XX +XXX,XX @@ | ||
101 | |||
102 | #include "qemu/osdep.h" | ||
103 | #include "qapi/error.h" | ||
104 | -#include "qemu-common.h" | ||
105 | #include "qemu/datadir.h" | ||
106 | #include "cpu.h" | ||
107 | #include "hw/sysbus.h" | ||
108 | diff --git a/hw/arm/virt.c b/hw/arm/virt.c | ||
109 | index XXXXXXX..XXXXXXX 100644 | ||
110 | --- a/hw/arm/virt.c | ||
111 | +++ b/hw/arm/virt.c | ||
112 | @@ -XXX,XX +XXX,XX @@ | ||
113 | */ | ||
114 | |||
115 | #include "qemu/osdep.h" | ||
116 | -#include "qemu-common.h" | ||
117 | #include "qemu/datadir.h" | ||
118 | #include "qemu/units.h" | ||
119 | #include "qemu/option.h" | ||
120 | -- | 105 | -- |
121 | 2.25.1 | 106 | 2.25.1 |
122 | |||
123 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
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 |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
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 |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
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 |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
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 |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
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 |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
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 |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
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 |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
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 |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
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 |
1 | The qemu-common.h header is not supposed to be included from any | 1 | From: Richard Henderson <richard.henderson@linaro.org> |
---|---|---|---|
2 | other header files, only from .c files (as documented in a comment at | ||
3 | the start of it). | ||
4 | 2 | ||
5 | include/hw/i386/x86.h and include/hw/i386/microvm.h break this rule. | 3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
6 | In fact, the include is not required at all, so we can just drop it | 4 | Message-id: 20220527181907.189259-44-richard.henderson@linaro.org |
7 | from both files. | 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 | 20 +++++++------------- | ||
9 | 1 file changed, 7 insertions(+), 13 deletions(-) | ||
8 | 10 | ||
9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c |
10 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
11 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
12 | Message-id: 20211129200510.1233037-2-peter.maydell@linaro.org | ||
13 | --- | ||
14 | include/hw/i386/microvm.h | 1 - | ||
15 | include/hw/i386/x86.h | 1 - | ||
16 | 2 files changed, 2 deletions(-) | ||
17 | |||
18 | diff --git a/include/hw/i386/microvm.h b/include/hw/i386/microvm.h | ||
19 | index XXXXXXX..XXXXXXX 100644 | 12 | index XXXXXXX..XXXXXXX 100644 |
20 | --- a/include/hw/i386/microvm.h | 13 | --- a/target/arm/translate-sve.c |
21 | +++ b/include/hw/i386/microvm.h | 14 | +++ b/target/arm/translate-sve.c |
22 | @@ -XXX,XX +XXX,XX @@ | 15 | @@ -XXX,XX +XXX,XX @@ static bool do_vpz_ool(DisasContext *s, arg_rpr_esz *a, |
23 | #ifndef HW_I386_MICROVM_H | 16 | } |
24 | #define HW_I386_MICROVM_H | 17 | |
25 | 18 | #define DO_VPZ(NAME, name) \ | |
26 | -#include "qemu-common.h" | 19 | -static bool trans_##NAME(DisasContext *s, arg_rpr_esz *a) \ |
27 | #include "exec/hwaddr.h" | 20 | -{ \ |
28 | #include "qemu/notify.h" | 21 | - static gen_helper_gvec_reduc * const fns[4] = { \ |
29 | 22 | + static gen_helper_gvec_reduc * const name##_fns[4] = { \ | |
30 | diff --git a/include/hw/i386/x86.h b/include/hw/i386/x86.h | 23 | gen_helper_sve_##name##_b, gen_helper_sve_##name##_h, \ |
31 | index XXXXXXX..XXXXXXX 100644 | 24 | gen_helper_sve_##name##_s, gen_helper_sve_##name##_d, \ |
32 | --- a/include/hw/i386/x86.h | 25 | }; \ |
33 | +++ b/include/hw/i386/x86.h | 26 | - return do_vpz_ool(s, a, fns[a->esz]); \ |
34 | @@ -XXX,XX +XXX,XX @@ | 27 | -} |
35 | #ifndef HW_I386_X86_H | 28 | + TRANS_FEAT(NAME, aa64_sve, do_vpz_ool, a, name##_fns[a->esz]) |
36 | #define HW_I386_X86_H | 29 | |
37 | 30 | DO_VPZ(ORV, orv) | |
38 | -#include "qemu-common.h" | 31 | DO_VPZ(ANDV, andv) |
39 | #include "exec/hwaddr.h" | 32 | @@ -XXX,XX +XXX,XX @@ DO_VPZ(UMAXV, umaxv) |
40 | #include "qemu/notify.h" | 33 | DO_VPZ(SMINV, sminv) |
34 | DO_VPZ(UMINV, uminv) | ||
35 | |||
36 | -static bool trans_SADDV(DisasContext *s, arg_rpr_esz *a) | ||
37 | -{ | ||
38 | - static gen_helper_gvec_reduc * const fns[4] = { | ||
39 | - gen_helper_sve_saddv_b, gen_helper_sve_saddv_h, | ||
40 | - gen_helper_sve_saddv_s, NULL | ||
41 | - }; | ||
42 | - return do_vpz_ool(s, a, fns[a->esz]); | ||
43 | -} | ||
44 | +static gen_helper_gvec_reduc * const saddv_fns[4] = { | ||
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 | ||
41 | 51 | ||
42 | -- | 52 | -- |
43 | 2.25.1 | 53 | 2.25.1 |
44 | |||
45 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
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 |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Richard Henderson <richard.henderson@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | Both single-step and pc alignment faults have priority over | 3 | Share code between the various shifts using arg_rpri_esz. |
4 | breakpoint exceptions. | ||
5 | 4 | ||
5 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
6 | Message-id: 20220527181907.189259-46-richard.henderson@linaro.org | ||
6 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 7 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> |
7 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
9 | --- | 9 | --- |
10 | target/arm/debug_helper.c | 23 +++++++++++++++++++++++ | 10 | target/arm/translate-sve.c | 68 +++++++++++++++++--------------------- |
11 | 1 file changed, 23 insertions(+) | 11 | 1 file changed, 30 insertions(+), 38 deletions(-) |
12 | 12 | ||
13 | diff --git a/target/arm/debug_helper.c b/target/arm/debug_helper.c | 13 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c |
14 | index XXXXXXX..XXXXXXX 100644 | 14 | index XXXXXXX..XXXXXXX 100644 |
15 | --- a/target/arm/debug_helper.c | 15 | --- a/target/arm/translate-sve.c |
16 | +++ b/target/arm/debug_helper.c | 16 | +++ b/target/arm/translate-sve.c |
17 | @@ -XXX,XX +XXX,XX @@ bool arm_debug_check_breakpoint(CPUState *cs) | 17 | @@ -XXX,XX +XXX,XX @@ static bool do_movz_zpz(DisasContext *s, int rd, int rn, int pg, |
18 | { | 18 | return gen_gvec_ool_zzp(s, fns[esz], rd, rn, pg, invert); |
19 | ARMCPU *cpu = ARM_CPU(cs); | 19 | } |
20 | CPUARMState *env = &cpu->env; | 20 | |
21 | + target_ulong pc; | 21 | +static bool do_shift_zpzi(DisasContext *s, arg_rpri_esz *a, bool asr, |
22 | int n; | 22 | + gen_helper_gvec_3 * const fns[4]) |
23 | 23 | +{ | |
24 | /* | 24 | + int max; |
25 | @@ -XXX,XX +XXX,XX @@ bool arm_debug_check_breakpoint(CPUState *cs) | 25 | + |
26 | return false; | 26 | + if (a->esz < 0) { |
27 | } | 27 | + /* Invalid tsz encoding -- see tszimm_esz. */ |
28 | |||
29 | + /* | ||
30 | + * Single-step exceptions have priority over breakpoint exceptions. | ||
31 | + * If single-step state is active-pending, suppress the bp. | ||
32 | + */ | ||
33 | + if (arm_singlestep_active(env) && !(env->pstate & PSTATE_SS)) { | ||
34 | + return false; | 28 | + return false; |
35 | + } | 29 | + } |
36 | + | 30 | + |
37 | + /* | 31 | + /* |
38 | + * PC alignment faults have priority over breakpoint exceptions. | 32 | + * Shift by element size is architecturally valid. |
33 | + * For arithmetic right-shift, it's the same as by one less. | ||
34 | + * For logical shifts and ASRD, it is a zeroing operation. | ||
39 | + */ | 35 | + */ |
40 | + pc = is_a64(env) ? env->pc : env->regs[15]; | 36 | + max = 8 << a->esz; |
41 | + if ((is_a64(env) || !env->thumb) && (pc & 3) != 0) { | 37 | + if (a->imm >= max) { |
42 | + return false; | 38 | + if (asr) { |
39 | + a->imm = max - 1; | ||
40 | + } else { | ||
41 | + return do_movz_zpz(s, a->rd, a->rd, a->pg, a->esz, true); | ||
42 | + } | ||
43 | + } | 43 | + } |
44 | + return gen_gvec_ool_arg_zpzi(s, fns[a->esz], a); | ||
45 | +} | ||
44 | + | 46 | + |
45 | + /* | 47 | static bool trans_ASR_zpzi(DisasContext *s, arg_rpri_esz *a) |
46 | + * Instruction aborts have priority over breakpoint exceptions. | 48 | { |
47 | + * TODO: We would need to look up the page for PC and verify that | 49 | static gen_helper_gvec_3 * const fns[4] = { |
48 | + * it is present and executable. | 50 | gen_helper_sve_asr_zpzi_b, gen_helper_sve_asr_zpzi_h, |
49 | + */ | 51 | gen_helper_sve_asr_zpzi_s, gen_helper_sve_asr_zpzi_d, |
50 | + | 52 | }; |
51 | for (n = 0; n < ARRAY_SIZE(env->cpu_breakpoint); n++) { | 53 | - if (a->esz < 0) { |
52 | if (bp_wp_matches(cpu, n, false)) { | 54 | - /* Invalid tsz encoding -- see tszimm_esz. */ |
53 | return true; | 55 | - return false; |
56 | - } | ||
57 | - /* Shift by element size is architecturally valid. For | ||
58 | - arithmetic right-shift, it's the same as by one less. */ | ||
59 | - a->imm = MIN(a->imm, (8 << a->esz) - 1); | ||
60 | - return gen_gvec_ool_arg_zpzi(s, fns[a->esz], a); | ||
61 | + return do_shift_zpzi(s, a, true, fns); | ||
62 | } | ||
63 | |||
64 | static bool trans_LSR_zpzi(DisasContext *s, arg_rpri_esz *a) | ||
65 | @@ -XXX,XX +XXX,XX @@ static bool trans_LSR_zpzi(DisasContext *s, arg_rpri_esz *a) | ||
66 | gen_helper_sve_lsr_zpzi_b, gen_helper_sve_lsr_zpzi_h, | ||
67 | gen_helper_sve_lsr_zpzi_s, gen_helper_sve_lsr_zpzi_d, | ||
68 | }; | ||
69 | - if (a->esz < 0) { | ||
70 | - return false; | ||
71 | - } | ||
72 | - /* Shift by element size is architecturally valid. | ||
73 | - For logical shifts, it is a zeroing operation. */ | ||
74 | - if (a->imm >= (8 << a->esz)) { | ||
75 | - return do_movz_zpz(s, a->rd, a->rd, a->pg, a->esz, true); | ||
76 | - } else { | ||
77 | - return gen_gvec_ool_arg_zpzi(s, fns[a->esz], a); | ||
78 | - } | ||
79 | + return do_shift_zpzi(s, a, false, fns); | ||
80 | } | ||
81 | |||
82 | static bool trans_LSL_zpzi(DisasContext *s, arg_rpri_esz *a) | ||
83 | @@ -XXX,XX +XXX,XX @@ static bool trans_LSL_zpzi(DisasContext *s, arg_rpri_esz *a) | ||
84 | gen_helper_sve_lsl_zpzi_b, gen_helper_sve_lsl_zpzi_h, | ||
85 | gen_helper_sve_lsl_zpzi_s, gen_helper_sve_lsl_zpzi_d, | ||
86 | }; | ||
87 | - if (a->esz < 0) { | ||
88 | - return false; | ||
89 | - } | ||
90 | - /* Shift by element size is architecturally valid. | ||
91 | - For logical shifts, it is a zeroing operation. */ | ||
92 | - if (a->imm >= (8 << a->esz)) { | ||
93 | - return do_movz_zpz(s, a->rd, a->rd, a->pg, a->esz, true); | ||
94 | - } else { | ||
95 | - return gen_gvec_ool_arg_zpzi(s, fns[a->esz], a); | ||
96 | - } | ||
97 | + return do_shift_zpzi(s, a, false, fns); | ||
98 | } | ||
99 | |||
100 | static bool trans_ASRD(DisasContext *s, arg_rpri_esz *a) | ||
101 | @@ -XXX,XX +XXX,XX @@ static bool trans_ASRD(DisasContext *s, arg_rpri_esz *a) | ||
102 | gen_helper_sve_asrd_b, gen_helper_sve_asrd_h, | ||
103 | gen_helper_sve_asrd_s, gen_helper_sve_asrd_d, | ||
104 | }; | ||
105 | - if (a->esz < 0) { | ||
106 | - return false; | ||
107 | - } | ||
108 | - /* Shift by element size is architecturally valid. For arithmetic | ||
109 | - right shift for division, it is a zeroing operation. */ | ||
110 | - if (a->imm >= (8 << a->esz)) { | ||
111 | - return do_movz_zpz(s, a->rd, a->rd, a->pg, a->esz, true); | ||
112 | - } else { | ||
113 | - return gen_gvec_ool_arg_zpzi(s, fns[a->esz], a); | ||
114 | - } | ||
115 | + return do_shift_zpzi(s, a, false, fns); | ||
116 | } | ||
117 | |||
118 | static gen_helper_gvec_3 * const sqshl_zpzi_fns[4] = { | ||
54 | -- | 119 | -- |
55 | 2.25.1 | 120 | 2.25.1 |
56 | |||
57 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
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 |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
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 |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
4 | Message-id: 20220527181907.189259-49-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 | 53 ++++++++++++++++++-------------------- | ||
9 | 1 file changed, 25 insertions(+), 28 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(MLS, aa64_sve, do_zpzzz_ool, a, mls_fns[a->esz]) | ||
16 | *** SVE Index Generation Group | ||
17 | */ | ||
18 | |||
19 | -static void do_index(DisasContext *s, int esz, int rd, | ||
20 | +static bool do_index(DisasContext *s, int esz, int rd, | ||
21 | TCGv_i64 start, TCGv_i64 incr) | ||
22 | { | ||
23 | - unsigned vsz = vec_full_reg_size(s); | ||
24 | - TCGv_i32 desc = tcg_constant_i32(simd_desc(vsz, vsz, 0)); | ||
25 | - TCGv_ptr t_zd = tcg_temp_new_ptr(); | ||
26 | + unsigned vsz; | ||
27 | + TCGv_i32 desc; | ||
28 | + TCGv_ptr t_zd; | ||
29 | + | ||
30 | + if (!sve_access_check(s)) { | ||
31 | + return true; | ||
32 | + } | ||
33 | + | ||
34 | + vsz = vec_full_reg_size(s); | ||
35 | + desc = tcg_constant_i32(simd_desc(vsz, vsz, 0)); | ||
36 | + t_zd = tcg_temp_new_ptr(); | ||
37 | |||
38 | tcg_gen_addi_ptr(t_zd, cpu_env, vec_full_reg_offset(s, rd)); | ||
39 | if (esz == 3) { | ||
40 | @@ -XXX,XX +XXX,XX @@ static void do_index(DisasContext *s, int esz, int rd, | ||
41 | tcg_temp_free_i32(i32); | ||
42 | } | ||
43 | tcg_temp_free_ptr(t_zd); | ||
44 | + return true; | ||
45 | } | ||
46 | |||
47 | static bool trans_INDEX_ii(DisasContext *s, arg_INDEX_ii *a) | ||
48 | { | ||
49 | - if (sve_access_check(s)) { | ||
50 | - TCGv_i64 start = tcg_constant_i64(a->imm1); | ||
51 | - TCGv_i64 incr = tcg_constant_i64(a->imm2); | ||
52 | - do_index(s, a->esz, a->rd, start, incr); | ||
53 | - } | ||
54 | - return true; | ||
55 | + TCGv_i64 start = tcg_constant_i64(a->imm1); | ||
56 | + TCGv_i64 incr = tcg_constant_i64(a->imm2); | ||
57 | + return do_index(s, a->esz, a->rd, start, incr); | ||
58 | } | ||
59 | |||
60 | static bool trans_INDEX_ir(DisasContext *s, arg_INDEX_ir *a) | ||
61 | { | ||
62 | - if (sve_access_check(s)) { | ||
63 | - TCGv_i64 start = tcg_constant_i64(a->imm); | ||
64 | - TCGv_i64 incr = cpu_reg(s, a->rm); | ||
65 | - do_index(s, a->esz, a->rd, start, incr); | ||
66 | - } | ||
67 | - return true; | ||
68 | + TCGv_i64 start = tcg_constant_i64(a->imm); | ||
69 | + TCGv_i64 incr = cpu_reg(s, a->rm); | ||
70 | + return do_index(s, a->esz, a->rd, start, incr); | ||
71 | } | ||
72 | |||
73 | static bool trans_INDEX_ri(DisasContext *s, arg_INDEX_ri *a) | ||
74 | { | ||
75 | - if (sve_access_check(s)) { | ||
76 | - TCGv_i64 start = cpu_reg(s, a->rn); | ||
77 | - TCGv_i64 incr = tcg_constant_i64(a->imm); | ||
78 | - do_index(s, a->esz, a->rd, start, incr); | ||
79 | - } | ||
80 | - return true; | ||
81 | + TCGv_i64 start = cpu_reg(s, a->rn); | ||
82 | + TCGv_i64 incr = tcg_constant_i64(a->imm); | ||
83 | + return do_index(s, a->esz, a->rd, start, incr); | ||
84 | } | ||
85 | |||
86 | static bool trans_INDEX_rr(DisasContext *s, arg_INDEX_rr *a) | ||
87 | { | ||
88 | - if (sve_access_check(s)) { | ||
89 | - TCGv_i64 start = cpu_reg(s, a->rn); | ||
90 | - TCGv_i64 incr = cpu_reg(s, a->rm); | ||
91 | - do_index(s, a->esz, a->rd, start, incr); | ||
92 | - } | ||
93 | - return true; | ||
94 | + TCGv_i64 start = cpu_reg(s, a->rn); | ||
95 | + TCGv_i64 incr = cpu_reg(s, a->rm); | ||
96 | + return do_index(s, a->esz, a->rd, start, incr); | ||
97 | } | ||
98 | |||
99 | /* | ||
100 | -- | ||
101 | 2.25.1 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
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 |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
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 |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
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 |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
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 |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
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 |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
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 |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
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 |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
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 |
1 | From: Jean-Philippe Brucker <jean-philippe@linaro.org> | 1 | From: Richard Henderson <richard.henderson@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | To propagate errors to the caller of the pre_plug callback, use the | 3 | This is in line with how we treat uzp, and will |
4 | object_poperty_set*() functions directly instead of the qdev_prop_set*() | 4 | eliminate the special case code during translation. |
5 | helpers. | ||
6 | 5 | ||
7 | Suggested-by: Igor Mammedov <imammedo@redhat.com> | 6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
8 | Reviewed-by: Eric Auger <eric.auger@redhat.com> | 7 | Message-id: 20220527181907.189259-58-richard.henderson@linaro.org |
9 | Reviewed-by: Igor Mammedov <imammedo@redhat.com> | 8 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> |
10 | Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org> | ||
11 | Message-id: 20211210170415.583179-5-jean-philippe@linaro.org | ||
12 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
13 | --- | 10 | --- |
14 | hw/arm/virt.c | 5 +++-- | 11 | target/arm/sve_helper.c | 6 ++++-- |
15 | 1 file changed, 3 insertions(+), 2 deletions(-) | 12 | target/arm/translate-sve.c | 12 ++++++------ |
13 | 2 files changed, 10 insertions(+), 8 deletions(-) | ||
16 | 14 | ||
17 | diff --git a/hw/arm/virt.c b/hw/arm/virt.c | 15 | diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c |
18 | index XXXXXXX..XXXXXXX 100644 | 16 | index XXXXXXX..XXXXXXX 100644 |
19 | --- a/hw/arm/virt.c | 17 | --- a/target/arm/sve_helper.c |
20 | +++ b/hw/arm/virt.c | 18 | +++ b/target/arm/sve_helper.c |
21 | @@ -XXX,XX +XXX,XX @@ static void virt_machine_device_pre_plug_cb(HotplugHandler *hotplug_dev, | 19 | @@ -XXX,XX +XXX,XX @@ void HELPER(sve_punpk_p)(void *vd, void *vn, uint32_t pred_desc) |
22 | db_start, db_end, | 20 | void HELPER(NAME)(void *vd, void *vn, void *vm, uint32_t desc) \ |
23 | VIRTIO_IOMMU_RESV_MEM_T_MSI); | 21 | { \ |
24 | 22 | intptr_t oprsz = simd_oprsz(desc); \ | |
25 | - qdev_prop_set_uint32(dev, "len-reserved-regions", 1); | 23 | + intptr_t odd_ofs = simd_data(desc); \ |
26 | - qdev_prop_set_string(dev, "reserved-regions[0]", resv_prop_str); | 24 | intptr_t i, oprsz_2 = oprsz / 2; \ |
27 | + object_property_set_uint(OBJECT(dev), "len-reserved-regions", 1, errp); | 25 | ARMVectorReg tmp_n, tmp_m; \ |
28 | + object_property_set_str(OBJECT(dev), "reserved-regions[0]", | 26 | /* We produce output faster than we consume input. \ |
29 | + resv_prop_str, errp); | 27 | @@ -XXX,XX +XXX,XX @@ void HELPER(NAME)(void *vd, void *vn, void *vm, uint32_t desc) \ |
30 | g_free(resv_prop_str); | 28 | vm = memcpy(&tmp_m, vm, oprsz_2); \ |
29 | } \ | ||
30 | for (i = 0; i < oprsz_2; i += sizeof(TYPE)) { \ | ||
31 | - *(TYPE *)(vd + H(2 * i + 0)) = *(TYPE *)(vn + H(i)); \ | ||
32 | - *(TYPE *)(vd + H(2 * i + sizeof(TYPE))) = *(TYPE *)(vm + H(i)); \ | ||
33 | + *(TYPE *)(vd + H(2 * i + 0)) = *(TYPE *)(vn + odd_ofs + H(i)); \ | ||
34 | + *(TYPE *)(vd + H(2 * i + sizeof(TYPE))) = \ | ||
35 | + *(TYPE *)(vm + odd_ofs + H(i)); \ | ||
36 | } \ | ||
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]); | ||
31 | } | 53 | } |
54 | 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; | ||
32 | } | 68 | } |
33 | -- | 69 | -- |
34 | 2.25.1 | 70 | 2.25.1 |
35 | |||
36 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
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 |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
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 |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
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 |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
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 |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
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 |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
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 |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
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 |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
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 |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
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 |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
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 |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
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 |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
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 |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
4 | Message-id: 20220527181907.189259-71-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 | 10 +--------- | ||
9 | 1 file changed, 1 insertion(+), 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_SUBR_zzi(DisasContext *s, arg_rri_esz *a) | ||
16 | return true; | ||
17 | } | ||
18 | |||
19 | -static bool trans_MUL_zzi(DisasContext *s, arg_rri_esz *a) | ||
20 | -{ | ||
21 | - if (sve_access_check(s)) { | ||
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 | - } | ||
26 | - return true; | ||
27 | -} | ||
28 | +TRANS_FEAT(MUL_zzi, aa64_sve, gen_gvec_fn_arg_zzi, tcg_gen_gvec_muli, a) | ||
29 | |||
30 | static bool do_zzi_sat(DisasContext *s, arg_rri_esz *a, bool u, bool d) | ||
31 | { | ||
32 | -- | ||
33 | 2.25.1 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
3 | Remove the unparsed extraction in trans_DUP_i, | ||
4 | which is intended to reject an 8-bit shift of | ||
5 | an 8-bit constant for 8-bit element. | ||
6 | |||
7 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
8 | Message-id: 20220527181907.189259-72-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/sve.decode | 5 ++++- | ||
13 | target/arm/translate-sve.c | 10 ++++++---- | ||
14 | 2 files changed, 10 insertions(+), 5 deletions(-) | ||
15 | |||
16 | diff --git a/target/arm/sve.decode b/target/arm/sve.decode | ||
17 | index XXXXXXX..XXXXXXX 100644 | ||
18 | --- a/target/arm/sve.decode | ||
19 | +++ b/target/arm/sve.decode | ||
20 | @@ -XXX,XX +XXX,XX @@ WHILE_ptr 00100101 esz:2 1 rm:5 001 100 rn:5 rw:1 rd:4 | ||
21 | FDUP 00100101 esz:2 111 00 1110 imm:8 rd:5 | ||
22 | |||
23 | # SVE broadcast integer immediate (unpredicated) | ||
24 | -DUP_i 00100101 esz:2 111 00 011 . ........ rd:5 imm=%sh8_i8s | ||
25 | +{ | ||
26 | + INVALID 00100101 00 111 00 011 1 -------- ----- | ||
27 | + DUP_i 00100101 esz:2 111 00 011 . ........ rd:5 imm=%sh8_i8s | ||
28 | +} | ||
29 | |||
30 | # SVE integer add/subtract immediate (unpredicated) | ||
31 | ADD_zzi 00100101 .. 100 000 11 . ........ ..... @rdn_sh_i8u | ||
32 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
33 | index XXXXXXX..XXXXXXX 100644 | ||
34 | --- a/target/arm/translate-sve.c | ||
35 | +++ b/target/arm/translate-sve.c | ||
36 | @@ -XXX,XX +XXX,XX @@ const uint64_t pred_esz_masks[4] = { | ||
37 | 0x1111111111111111ull, 0x0101010101010101ull | ||
38 | }; | ||
39 | |||
40 | +static bool trans_INVALID(DisasContext *s, arg_INVALID *a) | ||
41 | +{ | ||
42 | + unallocated_encoding(s); | ||
43 | + return true; | ||
44 | +} | ||
45 | + | ||
46 | /* | ||
47 | *** SVE Logical - Unpredicated Group | ||
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 | { | ||
53 | - if (a->esz == 0 && extract32(s->insn, 13, 1)) { | ||
54 | - return false; | ||
55 | - } | ||
56 | if (sve_access_check(s)) { | ||
57 | unsigned vsz = vec_full_reg_size(s); | ||
58 | int dofs = vec_full_reg_offset(s, a->rd); | ||
59 | - | ||
60 | tcg_gen_gvec_dup_imm(a->esz, dofs, vsz, vsz, a->imm); | ||
61 | } | ||
62 | return true; | ||
63 | -- | ||
64 | 2.25.1 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
1 | 2 | ||
3 | Remove the unparsed extractions in trans_ADD_zzi, trans_SUBR_zzi, | ||
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 | |||
7 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
8 | Message-id: 20220527181907.189259-73-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/sve.decode | 35 ++++++++++++++++++++++++++++------- | ||
13 | target/arm/translate-sve.c | 9 --------- | ||
14 | 2 files changed, 28 insertions(+), 16 deletions(-) | ||
15 | |||
16 | diff --git a/target/arm/sve.decode b/target/arm/sve.decode | ||
17 | index XXXXXXX..XXXXXXX 100644 | ||
18 | --- a/target/arm/sve.decode | ||
19 | +++ b/target/arm/sve.decode | ||
20 | @@ -XXX,XX +XXX,XX @@ FDUP 00100101 esz:2 111 00 1110 imm:8 rd:5 | ||
21 | } | ||
22 | |||
23 | # SVE integer add/subtract immediate (unpredicated) | ||
24 | -ADD_zzi 00100101 .. 100 000 11 . ........ ..... @rdn_sh_i8u | ||
25 | -SUB_zzi 00100101 .. 100 001 11 . ........ ..... @rdn_sh_i8u | ||
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 | { | ||
70 | - if (a->esz == 0 && extract32(s->insn, 13, 1)) { | ||
71 | - return false; | ||
72 | - } | ||
73 | return gen_gvec_fn_arg_zzi(s, tcg_gen_gvec_addi, a); | ||
74 | } | ||
75 | |||
76 | @@ -XXX,XX +XXX,XX @@ static bool trans_SUBR_zzi(DisasContext *s, arg_rri_esz *a) | ||
77 | .scalar_first = true } | ||
78 | }; | ||
79 | |||
80 | - if (a->esz == 0 && extract32(s->insn, 13, 1)) { | ||
81 | - return false; | ||
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 | -- | ||
97 | 2.25.1 | diff view generated by jsdifflib |
1 | From: Jean-Philippe Brucker <jean-philippe@linaro.org> | 1 | From: Richard Henderson <richard.henderson@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | The VIOT blob contains the following: | 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. | ||
4 | 5 | ||
5 | [000h 0000 4] Signature : "VIOT" [Virtual I/O Translation Table] | 6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
6 | [004h 0004 4] Table Length : 00000058 | 7 | Message-id: 20220527181907.189259-74-richard.henderson@linaro.org |
7 | [008h 0008 1] Revision : 00 | 8 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> |
8 | [009h 0009 1] Checksum : 66 | ||
9 | [00Ah 0010 6] Oem ID : "BOCHS " | ||
10 | [010h 0016 8] Oem Table ID : "BXPC " | ||
11 | [018h 0024 4] Oem Revision : 00000001 | ||
12 | [01Ch 0028 4] Asl Compiler ID : "BXPC" | ||
13 | [020h 0032 4] Asl Compiler Revision : 00000001 | ||
14 | |||
15 | [024h 0036 2] Node count : 0002 | ||
16 | [026h 0038 2] Node offset : 0030 | ||
17 | [028h 0040 8] Reserved : 0000000000000000 | ||
18 | |||
19 | [030h 0048 1] Type : 03 [VirtIO-PCI IOMMU] | ||
20 | [031h 0049 1] Reserved : 00 | ||
21 | [032h 0050 2] Length : 0010 | ||
22 | |||
23 | [034h 0052 2] PCI Segment : 0000 | ||
24 | [036h 0054 2] PCI BDF number : 0008 | ||
25 | [038h 0056 8] Reserved : 0000000000000000 | ||
26 | |||
27 | [040h 0064 1] Type : 01 [PCI Range] | ||
28 | [041h 0065 1] Reserved : 00 | ||
29 | [042h 0066 2] Length : 0018 | ||
30 | |||
31 | [044h 0068 4] Endpoint start : 00000000 | ||
32 | [048h 0072 2] PCI Segment start : 0000 | ||
33 | [04Ah 0074 2] PCI Segment end : 0000 | ||
34 | [04Ch 0076 2] PCI BDF start : 0000 | ||
35 | [04Eh 0078 2] PCI BDF end : 00FF | ||
36 | [050h 0080 2] Output node : 0030 | ||
37 | [052h 0082 6] Reserved : 000000000000 | ||
38 | |||
39 | Acked-by: Ani Sinha <ani@anisinha.ca> | ||
40 | Reviewed-by: Eric Auger <eric.auger@redhat.com> | ||
41 | Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org> | ||
42 | Message-id: 20211210170415.583179-9-jean-philippe@linaro.org | ||
43 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
44 | --- | 10 | --- |
45 | tests/qtest/bios-tables-test-allowed-diff.h | 1 - | 11 | target/arm/sve.decode | 10 ++++++++-- |
46 | tests/data/acpi/virt/VIOT | Bin 0 -> 88 bytes | 12 | target/arm/translate-sve.c | 6 ------ |
47 | 2 files changed, 1 deletion(-) | 13 | 2 files changed, 8 insertions(+), 8 deletions(-) |
48 | 14 | ||
49 | diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h | 15 | diff --git a/target/arm/sve.decode b/target/arm/sve.decode |
50 | index XXXXXXX..XXXXXXX 100644 | 16 | index XXXXXXX..XXXXXXX 100644 |
51 | --- a/tests/qtest/bios-tables-test-allowed-diff.h | 17 | --- a/target/arm/sve.decode |
52 | +++ b/tests/qtest/bios-tables-test-allowed-diff.h | 18 | +++ b/target/arm/sve.decode |
53 | @@ -1,2 +1 @@ | 19 | @@ -XXX,XX +XXX,XX @@ DUPM 00000101 11 0000 dbm:13 rd:5 |
54 | /* List of comma-separated changed AML files to ignore */ | 20 | FCPY 00000101 .. 01 .... 110 imm:8 ..... @rdn_pg4 |
55 | -"tests/data/acpi/virt/VIOT", | 21 | |
56 | diff --git a/tests/data/acpi/virt/VIOT b/tests/data/acpi/virt/VIOT | 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 | ||
57 | index XXXXXXX..XXXXXXX 100644 | 37 | index XXXXXXX..XXXXXXX 100644 |
58 | GIT binary patch | 38 | --- a/target/arm/translate-sve.c |
59 | literal 88 | 39 | +++ b/target/arm/translate-sve.c |
60 | zcmWIZ^bd((0D?3pe`k+i1*eDrX9XZ&1PX!JAexE60Hgv8m>C3sGzXN&z`)2L0cSHX | 40 | @@ -XXX,XX +XXX,XX @@ static bool trans_FCPY(DisasContext *s, arg_FCPY *a) |
61 | I{D-Rq0Q5fy0RR91 | 41 | |
62 | 42 | static bool trans_CPY_m_i(DisasContext *s, arg_rpri_esz *a) | |
63 | literal 0 | 43 | { |
64 | HcmV?d00001 | 44 | - if (a->esz == 0 && extract32(s->insn, 13, 1)) { |
65 | 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), | ||
66 | -- | 60 | -- |
67 | 2.25.1 | 61 | 2.25.1 |
68 | |||
69 | diff view generated by jsdifflib |
1 | From: Jean-Philippe Brucker <jean-philippe@linaro.org> | 1 | From: Richard Henderson <richard.henderson@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | Add expected blobs of the VIOT and DSDT table for the VIOT test on the | 3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
4 | q35 machine. | 4 | Message-id: 20220527181907.189259-75-richard.henderson@linaro.org |
5 | 5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | |
6 | Since the test instantiates a virtio device and two PCIe expander | ||
7 | bridges, DSDT.viot has more blocks than the base DSDT. | ||
8 | |||
9 | The VIOT table generated for the q35 test is: | ||
10 | |||
11 | [000h 0000 4] Signature : "VIOT" [Virtual I/O Translation Table] | ||
12 | [004h 0004 4] Table Length : 00000070 | ||
13 | [008h 0008 1] Revision : 00 | ||
14 | [009h 0009 1] Checksum : 3D | ||
15 | [00Ah 0010 6] Oem ID : "BOCHS " | ||
16 | [010h 0016 8] Oem Table ID : "BXPC " | ||
17 | [018h 0024 4] Oem Revision : 00000001 | ||
18 | [01Ch 0028 4] Asl Compiler ID : "BXPC" | ||
19 | [020h 0032 4] Asl Compiler Revision : 00000001 | ||
20 | |||
21 | [024h 0036 2] Node count : 0003 | ||
22 | [026h 0038 2] Node offset : 0030 | ||
23 | [028h 0040 8] Reserved : 0000000000000000 | ||
24 | |||
25 | [030h 0048 1] Type : 03 [VirtIO-PCI IOMMU] | ||
26 | [031h 0049 1] Reserved : 00 | ||
27 | [032h 0050 2] Length : 0010 | ||
28 | |||
29 | [034h 0052 2] PCI Segment : 0000 | ||
30 | [036h 0054 2] PCI BDF number : 0010 | ||
31 | [038h 0056 8] Reserved : 0000000000000000 | ||
32 | |||
33 | [040h 0064 1] Type : 01 [PCI Range] | ||
34 | [041h 0065 1] Reserved : 00 | ||
35 | [042h 0066 2] Length : 0018 | ||
36 | |||
37 | [044h 0068 4] Endpoint start : 00003000 | ||
38 | [048h 0072 2] PCI Segment start : 0000 | ||
39 | [04Ah 0074 2] PCI Segment end : 0000 | ||
40 | [04Ch 0076 2] PCI BDF start : 3000 | ||
41 | [04Eh 0078 2] PCI BDF end : 30FF | ||
42 | [050h 0080 2] Output node : 0030 | ||
43 | [052h 0082 6] Reserved : 000000000000 | ||
44 | |||
45 | [058h 0088 1] Type : 01 [PCI Range] | ||
46 | [059h 0089 1] Reserved : 00 | ||
47 | [05Ah 0090 2] Length : 0018 | ||
48 | |||
49 | [05Ch 0092 4] Endpoint start : 00001000 | ||
50 | [060h 0096 2] PCI Segment start : 0000 | ||
51 | [062h 0098 2] PCI Segment end : 0000 | ||
52 | [064h 0100 2] PCI BDF start : 1000 | ||
53 | [066h 0102 2] PCI BDF end : 10FF | ||
54 | [068h 0104 2] Output node : 0030 | ||
55 | [06Ah 0106 6] Reserved : 000000000000 | ||
56 | |||
57 | And the DSDT diff is: | ||
58 | |||
59 | @@ -XXX,XX +XXX,XX @@ | ||
60 | * | ||
61 | * Disassembling to symbolic ASL+ operators | ||
62 | * | ||
63 | - * Disassembly of tests/data/acpi/q35/DSDT, Fri Dec 10 15:03:08 2021 | ||
64 | + * Disassembly of /tmp/aml-H9Y5D1, Fri Dec 10 15:02:27 2021 | ||
65 | * | ||
66 | * Original Table Header: | ||
67 | * Signature "DSDT" | ||
68 | - * Length 0x00002061 (8289) | ||
69 | + * Length 0x000024B6 (9398) | ||
70 | * Revision 0x01 **** 32-bit table (V1), no 64-bit math support | ||
71 | - * Checksum 0xFA | ||
72 | + * Checksum 0xA7 | ||
73 | * OEM ID "BOCHS " | ||
74 | * OEM Table ID "BXPC " | ||
75 | * OEM Revision 0x00000001 (1) | ||
76 | @@ -XXX,XX +XXX,XX @@ | ||
77 | } | ||
78 | } | ||
79 | |||
80 | + Scope (\_SB) | ||
81 | + { | ||
82 | + Device (PC30) | ||
83 | + { | ||
84 | + Name (_UID, 0x30) // _UID: Unique ID | ||
85 | + Name (_BBN, 0x30) // _BBN: BIOS Bus Number | ||
86 | + Name (_HID, EisaId ("PNP0A08") /* PCI Express Bus */) // _HID: Hardware ID | ||
87 | + Name (_CID, EisaId ("PNP0A03") /* PCI Bus */) // _CID: Compatible ID | ||
88 | + Method (_OSC, 4, NotSerialized) // _OSC: Operating System Capabilities | ||
89 | + { | ||
90 | + CreateDWordField (Arg3, Zero, CDW1) | ||
91 | + If ((Arg0 == ToUUID ("33db4d5b-1ff7-401c-9657-7441c03dd766") /* PCI Host Bridge Device */)) | ||
92 | + { | ||
93 | + CreateDWordField (Arg3, 0x04, CDW2) | ||
94 | + CreateDWordField (Arg3, 0x08, CDW3) | ||
95 | + Local0 = CDW3 /* \_SB_.PC30._OSC.CDW3 */ | ||
96 | + Local0 &= 0x1F | ||
97 | + If ((Arg1 != One)) | ||
98 | + { | ||
99 | + CDW1 |= 0x08 | ||
100 | + } | ||
101 | + | ||
102 | + If ((CDW3 != Local0)) | ||
103 | + { | ||
104 | + CDW1 |= 0x10 | ||
105 | + } | ||
106 | + | ||
107 | + CDW3 = Local0 | ||
108 | + } | ||
109 | + Else | ||
110 | + { | ||
111 | + CDW1 |= 0x04 | ||
112 | + } | ||
113 | + | ||
114 | + Return (Arg3) | ||
115 | + } | ||
116 | + | ||
117 | + Method (_PRT, 0, NotSerialized) // _PRT: PCI Routing Table | ||
118 | + { | ||
119 | + Local0 = Package (0x80){} | ||
120 | + Local1 = Zero | ||
121 | + While ((Local1 < 0x80)) | ||
122 | + { | ||
123 | + Local2 = (Local1 >> 0x02) | ||
124 | + Local3 = ((Local1 + Local2) & 0x03) | ||
125 | + If ((Local3 == Zero)) | ||
126 | + { | ||
127 | + Local4 = Package (0x04) | ||
128 | + { | ||
129 | + Zero, | ||
130 | + Zero, | ||
131 | + LNKD, | ||
132 | + Zero | ||
133 | + } | ||
134 | + } | ||
135 | + | ||
136 | + If ((Local3 == One)) | ||
137 | + { | ||
138 | + Local4 = Package (0x04) | ||
139 | + { | ||
140 | + Zero, | ||
141 | + Zero, | ||
142 | + LNKA, | ||
143 | + Zero | ||
144 | + } | ||
145 | + } | ||
146 | + | ||
147 | + If ((Local3 == 0x02)) | ||
148 | + { | ||
149 | + Local4 = Package (0x04) | ||
150 | + { | ||
151 | + Zero, | ||
152 | + Zero, | ||
153 | + LNKB, | ||
154 | + Zero | ||
155 | + } | ||
156 | + } | ||
157 | + | ||
158 | + If ((Local3 == 0x03)) | ||
159 | + { | ||
160 | + Local4 = Package (0x04) | ||
161 | + { | ||
162 | + Zero, | ||
163 | + Zero, | ||
164 | + LNKC, | ||
165 | + Zero | ||
166 | + } | ||
167 | + } | ||
168 | + | ||
169 | + Local4 [Zero] = ((Local2 << 0x10) | 0xFFFF) | ||
170 | + Local4 [One] = (Local1 & 0x03) | ||
171 | + Local0 [Local1] = Local4 | ||
172 | + Local1++ | ||
173 | + } | ||
174 | + | ||
175 | + Return (Local0) | ||
176 | + } | ||
177 | + | ||
178 | + Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings | ||
179 | + { | ||
180 | + WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode, | ||
181 | + 0x0000, // Granularity | ||
182 | + 0x0030, // Range Minimum | ||
183 | + 0x0030, // Range Maximum | ||
184 | + 0x0000, // Translation Offset | ||
185 | + 0x0001, // Length | ||
186 | + ,, ) | ||
187 | + }) | ||
188 | + } | ||
189 | + } | ||
190 | + | ||
191 | + Scope (\_SB) | ||
192 | + { | ||
193 | + Device (PC20) | ||
194 | + { | ||
195 | + Name (_UID, 0x20) // _UID: Unique ID | ||
196 | + Name (_BBN, 0x20) // _BBN: BIOS Bus Number | ||
197 | + Name (_HID, EisaId ("PNP0A08") /* PCI Express Bus */) // _HID: Hardware ID | ||
198 | + Name (_CID, EisaId ("PNP0A03") /* PCI Bus */) // _CID: Compatible ID | ||
199 | + Method (_OSC, 4, NotSerialized) // _OSC: Operating System Capabilities | ||
200 | + { | ||
201 | + CreateDWordField (Arg3, Zero, CDW1) | ||
202 | + If ((Arg0 == ToUUID ("33db4d5b-1ff7-401c-9657-7441c03dd766") /* PCI Host Bridge Device */)) | ||
203 | + { | ||
204 | + CreateDWordField (Arg3, 0x04, CDW2) | ||
205 | + CreateDWordField (Arg3, 0x08, CDW3) | ||
206 | + Local0 = CDW3 /* \_SB_.PC20._OSC.CDW3 */ | ||
207 | + Local0 &= 0x1F | ||
208 | + If ((Arg1 != One)) | ||
209 | + { | ||
210 | + CDW1 |= 0x08 | ||
211 | + } | ||
212 | + | ||
213 | + If ((CDW3 != Local0)) | ||
214 | + { | ||
215 | + CDW1 |= 0x10 | ||
216 | + } | ||
217 | + | ||
218 | + CDW3 = Local0 | ||
219 | + } | ||
220 | + Else | ||
221 | + { | ||
222 | + CDW1 |= 0x04 | ||
223 | + } | ||
224 | + | ||
225 | + Return (Arg3) | ||
226 | + } | ||
227 | + | ||
228 | + Method (_PRT, 0, NotSerialized) // _PRT: PCI Routing Table | ||
229 | + { | ||
230 | + Local0 = Package (0x80){} | ||
231 | + Local1 = Zero | ||
232 | + While ((Local1 < 0x80)) | ||
233 | + { | ||
234 | + Local2 = (Local1 >> 0x02) | ||
235 | + Local3 = ((Local1 + Local2) & 0x03) | ||
236 | + If ((Local3 == Zero)) | ||
237 | + { | ||
238 | + Local4 = Package (0x04) | ||
239 | + { | ||
240 | + Zero, | ||
241 | + Zero, | ||
242 | + LNKD, | ||
243 | + Zero | ||
244 | + } | ||
245 | + } | ||
246 | + | ||
247 | + If ((Local3 == One)) | ||
248 | + { | ||
249 | + Local4 = Package (0x04) | ||
250 | + { | ||
251 | + Zero, | ||
252 | + Zero, | ||
253 | + LNKA, | ||
254 | + Zero | ||
255 | + } | ||
256 | + } | ||
257 | + | ||
258 | + If ((Local3 == 0x02)) | ||
259 | + { | ||
260 | + Local4 = Package (0x04) | ||
261 | + { | ||
262 | + Zero, | ||
263 | + Zero, | ||
264 | + LNKB, | ||
265 | + Zero | ||
266 | + } | ||
267 | + } | ||
268 | + | ||
269 | + If ((Local3 == 0x03)) | ||
270 | + { | ||
271 | + Local4 = Package (0x04) | ||
272 | + { | ||
273 | + Zero, | ||
274 | + Zero, | ||
275 | + LNKC, | ||
276 | + Zero | ||
277 | + } | ||
278 | + } | ||
279 | + | ||
280 | + Local4 [Zero] = ((Local2 << 0x10) | 0xFFFF) | ||
281 | + Local4 [One] = (Local1 & 0x03) | ||
282 | + Local0 [Local1] = Local4 | ||
283 | + Local1++ | ||
284 | + } | ||
285 | + | ||
286 | + Return (Local0) | ||
287 | + } | ||
288 | + | ||
289 | + Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings | ||
290 | + { | ||
291 | + WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode, | ||
292 | + 0x0000, // Granularity | ||
293 | + 0x0020, // Range Minimum | ||
294 | + 0x0020, // Range Maximum | ||
295 | + 0x0000, // Translation Offset | ||
296 | + 0x0001, // Length | ||
297 | + ,, ) | ||
298 | + }) | ||
299 | + } | ||
300 | + } | ||
301 | + | ||
302 | + Scope (\_SB) | ||
303 | + { | ||
304 | + Device (PC10) | ||
305 | + { | ||
306 | + Name (_UID, 0x10) // _UID: Unique ID | ||
307 | + Name (_BBN, 0x10) // _BBN: BIOS Bus Number | ||
308 | + Name (_HID, EisaId ("PNP0A08") /* PCI Express Bus */) // _HID: Hardware ID | ||
309 | + Name (_CID, EisaId ("PNP0A03") /* PCI Bus */) // _CID: Compatible ID | ||
310 | + Method (_OSC, 4, NotSerialized) // _OSC: Operating System Capabilities | ||
311 | + { | ||
312 | + CreateDWordField (Arg3, Zero, CDW1) | ||
313 | + If ((Arg0 == ToUUID ("33db4d5b-1ff7-401c-9657-7441c03dd766") /* PCI Host Bridge Device */)) | ||
314 | + { | ||
315 | + CreateDWordField (Arg3, 0x04, CDW2) | ||
316 | + CreateDWordField (Arg3, 0x08, CDW3) | ||
317 | + Local0 = CDW3 /* \_SB_.PC10._OSC.CDW3 */ | ||
318 | + Local0 &= 0x1F | ||
319 | + If ((Arg1 != One)) | ||
320 | + { | ||
321 | + CDW1 |= 0x08 | ||
322 | + } | ||
323 | + | ||
324 | + If ((CDW3 != Local0)) | ||
325 | + { | ||
326 | + CDW1 |= 0x10 | ||
327 | + } | ||
328 | + | ||
329 | + CDW3 = Local0 | ||
330 | + } | ||
331 | + Else | ||
332 | + { | ||
333 | + CDW1 |= 0x04 | ||
334 | + } | ||
335 | + | ||
336 | + Return (Arg3) | ||
337 | + } | ||
338 | + | ||
339 | + Method (_PRT, 0, NotSerialized) // _PRT: PCI Routing Table | ||
340 | + { | ||
341 | + Local0 = Package (0x80){} | ||
342 | + Local1 = Zero | ||
343 | + While ((Local1 < 0x80)) | ||
344 | + { | ||
345 | + Local2 = (Local1 >> 0x02) | ||
346 | + Local3 = ((Local1 + Local2) & 0x03) | ||
347 | + If ((Local3 == Zero)) | ||
348 | + { | ||
349 | + Local4 = Package (0x04) | ||
350 | + { | ||
351 | + Zero, | ||
352 | + Zero, | ||
353 | + LNKD, | ||
354 | + Zero | ||
355 | + } | ||
356 | + } | ||
357 | + | ||
358 | + If ((Local3 == One)) | ||
359 | + { | ||
360 | + Local4 = Package (0x04) | ||
361 | + { | ||
362 | + Zero, | ||
363 | + Zero, | ||
364 | + LNKA, | ||
365 | + Zero | ||
366 | + } | ||
367 | + } | ||
368 | + | ||
369 | + If ((Local3 == 0x02)) | ||
370 | + { | ||
371 | + Local4 = Package (0x04) | ||
372 | + { | ||
373 | + Zero, | ||
374 | + Zero, | ||
375 | + LNKB, | ||
376 | + Zero | ||
377 | + } | ||
378 | + } | ||
379 | + | ||
380 | + If ((Local3 == 0x03)) | ||
381 | + { | ||
382 | + Local4 = Package (0x04) | ||
383 | + { | ||
384 | + Zero, | ||
385 | + Zero, | ||
386 | + LNKC, | ||
387 | + Zero | ||
388 | + } | ||
389 | + } | ||
390 | + | ||
391 | + Local4 [Zero] = ((Local2 << 0x10) | 0xFFFF) | ||
392 | + Local4 [One] = (Local1 & 0x03) | ||
393 | + Local0 [Local1] = Local4 | ||
394 | + Local1++ | ||
395 | + } | ||
396 | + | ||
397 | + Return (Local0) | ||
398 | + } | ||
399 | + | ||
400 | + Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings | ||
401 | + { | ||
402 | + WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode, | ||
403 | + 0x0000, // Granularity | ||
404 | + 0x0010, // Range Minimum | ||
405 | + 0x0010, // Range Maximum | ||
406 | + 0x0000, // Translation Offset | ||
407 | + 0x0001, // Length | ||
408 | + ,, ) | ||
409 | + }) | ||
410 | + } | ||
411 | + } | ||
412 | + | ||
413 | Scope (\_SB.PCI0) | ||
414 | { | ||
415 | Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings | ||
416 | @@ -XXX,XX +XXX,XX @@ | ||
417 | WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode, | ||
418 | 0x0000, // Granularity | ||
419 | 0x0000, // Range Minimum | ||
420 | - 0x00FF, // Range Maximum | ||
421 | + 0x000F, // Range Maximum | ||
422 | 0x0000, // Translation Offset | ||
423 | - 0x0100, // Length | ||
424 | + 0x0010, // Length | ||
425 | ,, ) | ||
426 | IO (Decode16, | ||
427 | 0x0CF8, // Range Minimum | ||
428 | @@ -XXX,XX +XXX,XX @@ | ||
429 | } | ||
430 | } | ||
431 | |||
432 | + Device (S10) | ||
433 | + { | ||
434 | + Name (_ADR, 0x00020000) // _ADR: Address | ||
435 | + } | ||
436 | + | ||
437 | + Device (S18) | ||
438 | + { | ||
439 | + Name (_ADR, 0x00030000) // _ADR: Address | ||
440 | + } | ||
441 | + | ||
442 | + Device (S20) | ||
443 | + { | ||
444 | + Name (_ADR, 0x00040000) // _ADR: Address | ||
445 | + } | ||
446 | + | ||
447 | + Device (S28) | ||
448 | + { | ||
449 | + Name (_ADR, 0x00050000) // _ADR: Address | ||
450 | + } | ||
451 | + | ||
452 | Method (PCNT, 0, NotSerialized) | ||
453 | { | ||
454 | } | ||
455 | |||
456 | Reviewed-by: Eric Auger <eric.auger@redhat.com> | ||
457 | Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org> | ||
458 | Message-id: 20211210170415.583179-8-jean-philippe@linaro.org | ||
459 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
460 | --- | 7 | --- |
461 | tests/qtest/bios-tables-test-allowed-diff.h | 2 -- | 8 | target/arm/translate-sve.c | 5 +---- |
462 | tests/data/acpi/q35/DSDT.viot | Bin 0 -> 9398 bytes | 9 | 1 file changed, 1 insertion(+), 4 deletions(-) |
463 | tests/data/acpi/q35/VIOT.viot | Bin 0 -> 112 bytes | ||
464 | 3 files changed, 2 deletions(-) | ||
465 | 10 | ||
466 | diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h | 11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c |
467 | index XXXXXXX..XXXXXXX 100644 | 12 | index XXXXXXX..XXXXXXX 100644 |
468 | --- a/tests/qtest/bios-tables-test-allowed-diff.h | 13 | --- a/target/arm/translate-sve.c |
469 | +++ b/tests/qtest/bios-tables-test-allowed-diff.h | 14 | +++ b/target/arm/translate-sve.c |
470 | @@ -XXX,XX +XXX,XX @@ | 15 | @@ -XXX,XX +XXX,XX @@ static bool trans_DUP_i(DisasContext *s, arg_DUP_i *a) |
471 | /* List of comma-separated changed AML files to ignore */ | 16 | return true; |
472 | "tests/data/acpi/virt/VIOT", | 17 | } |
473 | -"tests/data/acpi/q35/DSDT.viot", | 18 | |
474 | -"tests/data/acpi/q35/VIOT.viot", | 19 | -static bool trans_ADD_zzi(DisasContext *s, arg_rri_esz *a) |
475 | diff --git a/tests/data/acpi/q35/DSDT.viot b/tests/data/acpi/q35/DSDT.viot | 20 | -{ |
476 | index XXXXXXX..XXXXXXX 100644 | 21 | - return gen_gvec_fn_arg_zzi(s, tcg_gen_gvec_addi, a); |
477 | GIT binary patch | 22 | -} |
478 | literal 9398 | 23 | +TRANS_FEAT(ADD_zzi, aa64_sve, gen_gvec_fn_arg_zzi, tcg_gen_gvec_addi, a) |
479 | zcmeHNO>7&-8J*>iv|O&FB}G~Oi$yp||57BBoWHhc5OS9yDTx$CQgH$r;8Idr*-4Q_ | 24 | |
480 | z5(9Az1F`}niVsB-)<KW7p`g9Br(A2Gm-gmc1N78GFS!;)e2V(MnH_0{q<{#yMgn&C | 25 | static bool trans_SUB_zzi(DisasContext *s, arg_rri_esz *a) |
481 | zn|*J-d9yqFhO_H6z19~`FlPL*u<DkZ*}|)JH;X@mF-FI<cPg<fti9tEN*yB^i5czN | 26 | { |
482 | zNq&q?!OZ;BE3B7{KWzJ-`Tn~f`9?Qj8~2^N8{Oc8J%57{==w%rS#;nOCp*nTr@iZ1 | ||
483 | zb+?i;JLQUJ=O0?8*>S~D)a>NF1~WVB6^~_B#yhJ`H+JU@=6aXs`?Yv)J2h=N?drcS | ||
484 | zeLZ*n<<Bm^n}6`jfBx#u8&(W}1?)}iF9o#mZ~E2+zwdn7yK3AbIzKnxpZ>JRPm3~# | ||
485 | z&ICS{+_OayRW-l=Mtk=~uaS3o8z<_udd|(wqg`&JnVPfCe>BUOO`Su3e>pff_^UW% | ||
486 | z&JE^NO`)=Amg~iqRB1pPscP?(>#ZuY8GHCmlEvD$9g3%4Db~Dfz2SATnddvrR-Oe^ | ||
487 | z;s;dJec!hnzi)ri^I6YN9vtkm{^TdUF8h7gX8-<Qe4p)GQ=)AtYx2VcwdLVAEXEjG | ||
488 | z^Mj|UHPqkj-LsWuzQem1>F3atdZn=zv3$#RmZzSHN+6-yyU#8cJb=YDilX&sl}vNm | ||
489 | znkgAR^O<3kj4if>{ly5fwRfMWuC5=lrlvKPX~i#654Cp}R_d*JS$9laZ$ra6)<ns8 | ||
490 | zFZy28G%xP(nit&F>LDi%G<tIc=TY=gl$jSD&Uv!Yat~XR46h%rI$!}a%!|xG7u8Zn | ||
491 | zeY8_|n=K>xz_v_W8VX$W-Fg-qFWcT}7MCyz{%%{ia7hZ>Law-k6NOr}VI&_48U=2l | ||
492 | zwqDKFE8eTwwozDdms#e?x?5a|v>&JF;2_v0L~z5n%BYU^52<*cWuD4|GYUm@1+?)) | ||
493 | zte^45>Rz)t*<T5V#={r>@t@{%?^i#W{i=HAZ*Dc9y59Va-+#P!jrGs;u38a{fLr`N | ||
494 | zvT@rUu>DljxJ?^&Z?-?vyJn3C>3D=qux{Y*bs5|5n)Qmi$TD^Zdn4GU$ocJS2Hh-< | ||
495 | z`xPI^^+v0nUVdjMos8k`WGl7hA`{03ju%<lrgAHSpd^DRf-*}_#Ly0mB!LSfVgWcQ | ||
496 | z&T$@~G9)JI=hz5m0vkrel+Xy{Oh7pkAu-V!j*W7rY(bO}Q$nMH2`FbGB&N)QaV4<4 | ||
497 | zo)~9JXiP9=;}NPl<C@MmXG&;XFlFNrsyfFsonxFSp<}vEgsRSQP3O3#b6nSnP}ON_ | ||
498 | zI!#Tdsp~|j>ckUB>FI=~GokB5sOq#dotCE4(sd$KbtW~PNlj-`*NIToiD#j5J#9^= | ||
499 | zt?NXn>YUJYPG~wObe#xQos*i*NloXZt`niEb4t@WrRki~bs|)CI+{*L)9L6s5vn>< | ||
500 | zn$DD_Go|Z9sOn5>I@6lYw5}7Os&iV?Ij!lO)^#FOb!If38BJ$K*NIToIiu;E(R9w} | ||
501 | zIuWWmPiZ<&X*y5oIuWWmF_XaEC!a&Jn$B5WCqh-{X-(&8P3LJ{Cqh-{8P3dyPr@^t | ||
502 | zSqL9?X9Uwd3W@23*s~h*tj0X6GZCuHa~kuU#yqDp5vt7d8uPryJg+kms?5hU=3^T3 | ||
503 | zF`bD}WnSP+=`t5MQ$FJ_2&Q~+BP6E0f^%BVIW6a$o)e+SX~IDBih-7z6{O~7YTy`& | ||
504 | zLjy&Cv?7QikV#>n0>>@MV8oK`Gmun34-FKdlm-J8SZSaNlnhir4-FI{S|bfqV8e)V | ||
505 | zss<{chX#reE#g=hsKAC%sF6d-Km}BWs!kZFsFpKfpbC@>6rprQGEjt4Ck#|zITHq| | ||
506 | zK*>M_l;<P^MJRQ`Kn0dFVW0|>3{*fllMEE0)CmI>Sk8ojDo`>|0p(0GP=xY&!axO< | ||
507 | zGhv_#lnhirIg<<&q0|Wj6<E%MfhtfkPyyvkGEjt4Ck#|zITHq|K*>M_lrzad5lWpf | ||
508 | zP=V!47^ngz0~JutBm+e#b;3XemNQ|X3X}{~Ksl2P6rt1!0~J`#gn=qhGEf2KOfpb} | ||
509 | zQYQ>lU^x>8szAv=1(Y+%KoLrvFi?TzOc<yFB?A>u&LjgxD0RX>1(q{mpbC@>R6seC | ||
510 | z3>2Z%2?G^a&V+#~P%=;f<xDbAgi<FARA4z12C6{GKn0XD$v_cGoiI>=<xCi;0wn_# | ||
511 | zP|hR+MJRQ`Kn0dFVW0|>3{*fllMEE0)CmI>Sk8ojDo`>|0p(0GP=rz^3{+q_69%e4 | ||
512 | z$v_2^Gs!>^N}VuJf#pmXr~)Me6;RG314Srx!axxz28u{EP=u<1B2)}iVZuNaCK;&0 | ||
513 | zBm-5LFi?dF167!0pbC==RAItE6($T+VUmF=Ofpb~2?JG_Fi?d_2C6X0Kouqo6p_5T | ||
514 | zFi=FeV!SiSKoR0H$dH(_Z(*Q_WZ%L-5y`$K14StNmJAdjmWs}HV4<vU_xO+1efmLq | ||
515 | zZ;W>N_U)fP6Qy6Nw5mbt9Y(#emWSi66=>tq#xoh#Ue=0qyhxi8ZOUe5y0V7VfPUhp | ||
516 | zwX=;ymc+i5%sg9Ja~lZ&8oAV@mHc>&CHP9v4R(jhtT?un;O4e9#pno)Xkh7OWgK&a | ||
517 | zyj=3Iv0OuoK_;5rOr5f(Kb~ZXDBO+V`OWYo#_C08imwChQxnjdd?wZLDou8aj;$SD | ||
518 | zGDYiA3<$Tu<JnHL(KPOChi#zrR32t83}naR$+ym4P_h?z_5#|cW-nw$XD_sOtE62l | ||
519 | zrD3@*)NVyiklt0&yF9%+klsBey&I<Y2E<!f(E8TuJte)z(|ZHyy<^gQVfx}=`q&B5 | ||
520 | z7nSryp1wGczIaUfVwiq$Fn#<4=@*ssi#+|}K>EdF(l3VTOM~ghPLRH&q%ZOGrGfON | ||
521 | zW73zx^yR_y<0nX8R??Sw`tm^f@-gYlNFSp|*<gA{q?Zp5Oe-+l#rmyYmKozi9y=P> | ||
522 | zVReJU*h=ZuVXiS$ohTbw-O#v9>(yZbGE|)?8(H1ZIKvV!jWa0>vy!3eMA^vdhQ>`s | ||
523 | zuMSg{q3T50$m)j1!HixV<}X9liL#N^4c*tL^y)CF8LCc{jjV3yKAqL8!%SzWI#H%q | ||
524 | z=bSrQ&)%JCRttF5g4Zf`6l?y@>PzD7MA^D>wBlcH6r1ucwJ<p0O%rZ?JzIY3-QdmZ | ||
525 | zzs|n>`a5r3e|z)wcUaqS>nqFQ-8x}eCF4u`OWUxqst-@1rSmUs%WmKP5e0dcb?e2N | ||
526 | z;Z|x*!);VwF|Yuhqs^khqOM!@u*jY!WYldISF(V6`BoNd&6Qfk3>X#SuD^7J>p_D= | ||
527 | zBPa51y^_n#=cpOt#Zf$ya$Ae9Mfz56n|<i!a=ELS@)%a{^NIH3SDuN<R~sah1km#P | ||
528 | zU@?*f%<rG=4W1wgfi;C?_n|W@%lm$&8YfvNOJodIg&IcIpIJQRHr<+ej11GQ6)&eF | ||
529 | z2Lam*jIH}#y0>KnY%4JQfOYS$*uU%f#@$U6`N8I3N-lV?5ErFCdv~xDmu2(wexld4 | ||
530 | z4v^;aVAT2k6GJ^m*FD(Wqc(Qg^)6a<?}h$zLoj}4;PP!+(O{@!a1y-hoAhF_7!z+6 | ||
531 | zslpAmNtYbjHrw-~#SPVk_FUf>-Obg6yV`8o$8_`PyJe_;bY5_EMBfBfWU!Q=*9HsG | ||
532 | z%_Cda{@_Krr!oHVhv9+y+T5qR8zZ2aZ>5r!$*|f$^U%yBUYfR&B!+EYy_PwL!BeUi | ||
533 | zJH^}r3r9Q+B)X@Z)fk=P13w&7x#wBtXTZ)g>WITPg5r&pQc!nmyrmk#S(>>b9xnNr | ||
534 | zx_b#v9Xv-Y><Wb%?S^0Xe&<)bbKl_=Z|3C$tf|F<bYzE*mfHB;uC)`q-?buaBe?l? | ||
535 | zcLTpK*k<49Z32`K?|nSBMFqxTK^_IE-li2fEGdK~(ZdoKBl6ab4a;Hler#`xvEXJG | ||
536 | zb?<E%EZExfX>jcOVhS*0rS~RS1dA#xhkv@Nct@#q?LyeKS<$uFec!bw>{@uu$gZ6a | ||
537 | zyVen1i{1BKd%~`D7|m$;U0a<I*3I7%^N%N%lGYdU_GS!gaR8T$NA@GzFi~z`l7hdl | ||
538 | zarZy6590|88pi(1zq;V(>38zM0sT&<zX;R5$1w3;`_JMG`;&I&0Y23DMx1%@(w(R9 | ||
539 | z4M$j;D5J+Gy%fijRQsctzFKf&cv|BAz#YLq3CZJWDdtL4u1u1|mkdcUp7|sxJC+?Y | ||
540 | z_@@s`v3j}Q7*z>6X~cwUxUL8G1KT)_XTp!KAbs;vCp{K3&~_X@+ew=-D}v`2MbFV0 | ||
541 | zQsVsL=rXi-pI*G|iiz;VTCutgUs)hDzV1+4?8KcoP3xROf<M%qC6lgVdpFt4<-|uM | ||
542 | z=#rl_b1#YjSIl6Toj2z_hOZcKupkdE(LozC(fN=FY(x|sk)ym|;Rq2E1xJWD%Z!ol | ||
543 | Gu>S+TT-130 | ||
544 | |||
545 | literal 0 | ||
546 | HcmV?d00001 | ||
547 | |||
548 | diff --git a/tests/data/acpi/q35/VIOT.viot b/tests/data/acpi/q35/VIOT.viot | ||
549 | index XXXXXXX..XXXXXXX 100644 | ||
550 | GIT binary patch | ||
551 | literal 112 | ||
552 | zcmWIZ^baXu00LVle`k+i1*eDrX9XZ&1PX!JAex!M0Hgv8m>C3sGzdcgBZCA3T-xBj | ||
553 | Q0Zb)W9Hva*zW_`e0M!8s0RR91 | ||
554 | |||
555 | literal 0 | ||
556 | HcmV?d00001 | ||
557 | |||
558 | -- | 27 | -- |
559 | 2.25.1 | 28 | 2.25.1 |
560 | |||
561 | diff view generated by jsdifflib |
1 | From: Jean-Philippe Brucker <jean-philippe@linaro.org> | 1 | From: Richard Henderson <richard.henderson@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | Create empty data files and allow updates for the upcoming VIOT tests. | 3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
4 | 4 | Message-id: 20220527181907.189259-76-richard.henderson@linaro.org | |
5 | Acked-by: Igor Mammedov <imammedo@redhat.com> | 5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> |
6 | Reviewed-by: Eric Auger <eric.auger@redhat.com> | ||
7 | Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org> | ||
8 | Message-id: 20211210170415.583179-6-jean-philippe@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 | tests/qtest/bios-tables-test-allowed-diff.h | 3 +++ | 8 | target/arm/translate-sve.c | 23 ++++------------------- |
12 | tests/data/acpi/q35/DSDT.viot | 0 | 9 | 1 file changed, 4 insertions(+), 19 deletions(-) |
13 | tests/data/acpi/q35/VIOT.viot | 0 | ||
14 | tests/data/acpi/virt/VIOT | 0 | ||
15 | 4 files changed, 3 insertions(+) | ||
16 | create mode 100644 tests/data/acpi/q35/DSDT.viot | ||
17 | create mode 100644 tests/data/acpi/q35/VIOT.viot | ||
18 | create mode 100644 tests/data/acpi/virt/VIOT | ||
19 | 10 | ||
20 | diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h | 11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c |
21 | index XXXXXXX..XXXXXXX 100644 | 12 | index XXXXXXX..XXXXXXX 100644 |
22 | --- a/tests/qtest/bios-tables-test-allowed-diff.h | 13 | --- a/target/arm/translate-sve.c |
23 | +++ b/tests/qtest/bios-tables-test-allowed-diff.h | 14 | +++ b/target/arm/translate-sve.c |
24 | @@ -1 +1,4 @@ | 15 | @@ -XXX,XX +XXX,XX @@ static bool do_zzi_sat(DisasContext *s, arg_rri_esz *a, bool u, bool d) |
25 | /* List of comma-separated changed AML files to ignore */ | 16 | return true; |
26 | +"tests/data/acpi/virt/VIOT", | 17 | } |
27 | +"tests/data/acpi/q35/DSDT.viot", | 18 | |
28 | +"tests/data/acpi/q35/VIOT.viot", | 19 | -static bool trans_SQADD_zzi(DisasContext *s, arg_rri_esz *a) |
29 | diff --git a/tests/data/acpi/q35/DSDT.viot b/tests/data/acpi/q35/DSDT.viot | 20 | -{ |
30 | new file mode 100644 | 21 | - return do_zzi_sat(s, a, false, false); |
31 | index XXXXXXX..XXXXXXX | 22 | -} |
32 | diff --git a/tests/data/acpi/q35/VIOT.viot b/tests/data/acpi/q35/VIOT.viot | 23 | - |
33 | new file mode 100644 | 24 | -static bool trans_UQADD_zzi(DisasContext *s, arg_rri_esz *a) |
34 | index XXXXXXX..XXXXXXX | 25 | -{ |
35 | diff --git a/tests/data/acpi/virt/VIOT b/tests/data/acpi/virt/VIOT | 26 | - return do_zzi_sat(s, a, true, false); |
36 | new file mode 100644 | 27 | -} |
37 | index XXXXXXX..XXXXXXX | 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 | { | ||
38 | -- | 45 | -- |
39 | 2.25.1 | 46 | 2.25.1 |
40 | |||
41 | diff view generated by jsdifflib |
1 | From: Jean-Philippe Brucker <jean-philippe@linaro.org> | 1 | From: Richard Henderson <richard.henderson@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | virtio-iommu is now supported with ACPI VIOT as well as device tree. | 3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
4 | Remove the restriction that prevents from instantiating a virtio-iommu | 4 | Message-id: 20220527181907.189259-77-richard.henderson@linaro.org |
5 | device under ACPI. | 5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> |
6 | |||
7 | Acked-by: Igor Mammedov <imammedo@redhat.com> | ||
8 | Reviewed-by: Eric Auger <eric.auger@redhat.com> | ||
9 | Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org> | ||
10 | Message-id: 20211210170415.583179-3-jean-philippe@linaro.org | ||
11 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
12 | --- | 7 | --- |
13 | hw/arm/virt.c | 10 ++-------- | 8 | target/arm/translate-sve.c | 7 ++----- |
14 | hw/virtio/virtio-iommu-pci.c | 12 ++---------- | 9 | 1 file changed, 2 insertions(+), 5 deletions(-) |
15 | 2 files changed, 4 insertions(+), 18 deletions(-) | ||
16 | 10 | ||
17 | diff --git a/hw/arm/virt.c b/hw/arm/virt.c | 11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c |
18 | index XXXXXXX..XXXXXXX 100644 | 12 | index XXXXXXX..XXXXXXX 100644 |
19 | --- a/hw/arm/virt.c | 13 | --- a/target/arm/translate-sve.c |
20 | +++ b/hw/arm/virt.c | 14 | +++ b/target/arm/translate-sve.c |
21 | @@ -XXX,XX +XXX,XX @@ static HotplugHandler *virt_machine_get_hotplug_handler(MachineState *machine, | 15 | @@ -XXX,XX +XXX,XX @@ static bool do_zzi_ool(DisasContext *s, arg_rri_esz *a, gen_helper_gvec_2i *fn) |
22 | MachineClass *mc = MACHINE_GET_CLASS(machine); | ||
23 | |||
24 | if (device_is_dynamic_sysbus(mc, dev) || | ||
25 | - (object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM))) { | ||
26 | + object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM) || | ||
27 | + object_dynamic_cast(OBJECT(dev), TYPE_VIRTIO_IOMMU_PCI)) { | ||
28 | return HOTPLUG_HANDLER(machine); | ||
29 | } | ||
30 | - if (object_dynamic_cast(OBJECT(dev), TYPE_VIRTIO_IOMMU_PCI)) { | ||
31 | - VirtMachineState *vms = VIRT_MACHINE(machine); | ||
32 | - | ||
33 | - if (!vms->bootinfo.firmware_loaded || !virt_is_acpi_enabled(vms)) { | ||
34 | - return HOTPLUG_HANDLER(machine); | ||
35 | - } | ||
36 | - } | ||
37 | return NULL; | ||
38 | } | 16 | } |
39 | 17 | ||
40 | diff --git a/hw/virtio/virtio-iommu-pci.c b/hw/virtio/virtio-iommu-pci.c | 18 | #define DO_ZZI(NAME, name) \ |
41 | index XXXXXXX..XXXXXXX 100644 | 19 | -static bool trans_##NAME##_zzi(DisasContext *s, arg_rri_esz *a) \ |
42 | --- a/hw/virtio/virtio-iommu-pci.c | 20 | -{ \ |
43 | +++ b/hw/virtio/virtio-iommu-pci.c | 21 | - static gen_helper_gvec_2i * const fns[4] = { \ |
44 | @@ -XXX,XX +XXX,XX @@ static void virtio_iommu_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp) | 22 | + static gen_helper_gvec_2i * const name##i_fns[4] = { \ |
45 | VirtIOIOMMU *s = VIRTIO_IOMMU(vdev); | 23 | gen_helper_sve_##name##i_b, gen_helper_sve_##name##i_h, \ |
46 | 24 | gen_helper_sve_##name##i_s, gen_helper_sve_##name##i_d, \ | |
47 | if (!qdev_get_machine_hotplug_handler(DEVICE(vpci_dev))) { | 25 | }; \ |
48 | - MachineClass *mc = MACHINE_GET_CLASS(qdev_get_machine()); | 26 | - return do_zzi_ool(s, a, fns[a->esz]); \ |
49 | - | 27 | -} |
50 | - error_setg(errp, | 28 | + TRANS_FEAT(NAME##_zzi, aa64_sve, do_zzi_ool, a, name##i_fns[a->esz]) |
51 | - "%s machine fails to create iommu-map device tree bindings", | 29 | |
52 | - mc->name); | 30 | DO_ZZI(SMAX, smax) |
53 | - error_append_hint(errp, | 31 | DO_ZZI(UMAX, umax) |
54 | - "Check your machine implements a hotplug handler " | ||
55 | - "for the virtio-iommu-pci device\n"); | ||
56 | - error_append_hint(errp, "Check the guest is booted without FW or with " | ||
57 | - "-no-acpi\n"); | ||
58 | + error_setg(errp, "Check your machine implements a hotplug handler " | ||
59 | + "for the virtio-iommu-pci device"); | ||
60 | return; | ||
61 | } | ||
62 | for (int i = 0; i < s->nb_reserved_regions; i++) { | ||
63 | -- | 32 | -- |
64 | 2.25.1 | 33 | 2.25.1 |
65 | |||
66 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Richard Henderson <richard.henderson@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | Use these for the several varieties of floating-point | ||
4 | multiply-add instructions. | ||
5 | |||
6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
7 | Message-id: 20220527181907.189259-78-richard.henderson@linaro.org | ||
3 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 8 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> |
4 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
5 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
6 | --- | 10 | --- |
7 | tests/tcg/aarch64/pcalign-a64.c | 37 +++++++++++++++++++++++++ | 11 | target/arm/translate-sve.c | 140 ++++++++++++++----------------------- |
8 | tests/tcg/arm/pcalign-a32.c | 46 +++++++++++++++++++++++++++++++ | 12 | 1 file changed, 53 insertions(+), 87 deletions(-) |
9 | tests/tcg/aarch64/Makefile.target | 4 +-- | ||
10 | tests/tcg/arm/Makefile.target | 4 +++ | ||
11 | 4 files changed, 89 insertions(+), 2 deletions(-) | ||
12 | create mode 100644 tests/tcg/aarch64/pcalign-a64.c | ||
13 | create mode 100644 tests/tcg/arm/pcalign-a32.c | ||
14 | 13 | ||
15 | diff --git a/tests/tcg/aarch64/pcalign-a64.c b/tests/tcg/aarch64/pcalign-a64.c | 14 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c |
16 | new file mode 100644 | 15 | index XXXXXXX..XXXXXXX 100644 |
17 | index XXXXXXX..XXXXXXX | 16 | --- a/target/arm/translate-sve.c |
18 | --- /dev/null | 17 | +++ b/target/arm/translate-sve.c |
19 | +++ b/tests/tcg/aarch64/pcalign-a64.c | 18 | @@ -XXX,XX +XXX,XX @@ static bool gen_gvec_ool_arg_zzxz(DisasContext *s, gen_helper_gvec_4 *fn, |
20 | @@ -XXX,XX +XXX,XX @@ | 19 | return gen_gvec_ool_zzzz(s, fn, a->rd, a->rn, a->rm, a->ra, a->index); |
21 | +/* Test PC misalignment exception */ | 20 | } |
22 | + | 21 | |
23 | +#include <assert.h> | 22 | +/* Invoke an out-of-line helper on 4 Zregs, plus a pointer. */ |
24 | +#include <signal.h> | 23 | +static bool gen_gvec_ptr_zzzz(DisasContext *s, gen_helper_gvec_4_ptr *fn, |
25 | +#include <stdlib.h> | 24 | + int rd, int rn, int rm, int ra, |
26 | +#include <stdio.h> | 25 | + int data, TCGv_ptr ptr) |
27 | + | ||
28 | +static void *expected; | ||
29 | + | ||
30 | +static void sigbus(int sig, siginfo_t *info, void *vuc) | ||
31 | +{ | 26 | +{ |
32 | + assert(info->si_code == BUS_ADRALN); | 27 | + if (fn == NULL) { |
33 | + assert(info->si_addr == expected); | 28 | + return false; |
34 | + exit(EXIT_SUCCESS); | 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; | ||
35 | +} | 39 | +} |
36 | + | 40 | + |
37 | +int main() | 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) | ||
38 | +{ | 44 | +{ |
39 | + void *tmp; | 45 | + TCGv_ptr status = fpstatus_ptr(flavour); |
40 | + | 46 | + bool ret = gen_gvec_ptr_zzzz(s, fn, rd, rn, rm, ra, data, status); |
41 | + struct sigaction sa = { | 47 | + tcg_temp_free_ptr(status); |
42 | + .sa_sigaction = sigbus, | 48 | + return ret; |
43 | + .sa_flags = SA_SIGINFO | ||
44 | + }; | ||
45 | + | ||
46 | + if (sigaction(SIGBUS, &sa, NULL) < 0) { | ||
47 | + perror("sigaction"); | ||
48 | + return EXIT_FAILURE; | ||
49 | + } | ||
50 | + | ||
51 | + asm volatile("adr %0, 1f + 1\n\t" | ||
52 | + "str %0, %1\n\t" | ||
53 | + "br %0\n" | ||
54 | + "1:" | ||
55 | + : "=&r"(tmp), "=m"(expected)); | ||
56 | + abort(); | ||
57 | +} | ||
58 | diff --git a/tests/tcg/arm/pcalign-a32.c b/tests/tcg/arm/pcalign-a32.c | ||
59 | new file mode 100644 | ||
60 | index XXXXXXX..XXXXXXX | ||
61 | --- /dev/null | ||
62 | +++ b/tests/tcg/arm/pcalign-a32.c | ||
63 | @@ -XXX,XX +XXX,XX @@ | ||
64 | +/* Test PC misalignment exception */ | ||
65 | + | ||
66 | +#ifdef __thumb__ | ||
67 | +#error "This test must be compiled for ARM" | ||
68 | +#endif | ||
69 | + | ||
70 | +#include <assert.h> | ||
71 | +#include <signal.h> | ||
72 | +#include <stdlib.h> | ||
73 | +#include <stdio.h> | ||
74 | + | ||
75 | +static void *expected; | ||
76 | + | ||
77 | +static void sigbus(int sig, siginfo_t *info, void *vuc) | ||
78 | +{ | ||
79 | + assert(info->si_code == BUS_ADRALN); | ||
80 | + assert(info->si_addr == expected); | ||
81 | + exit(EXIT_SUCCESS); | ||
82 | +} | 49 | +} |
83 | + | 50 | + |
84 | +int main() | 51 | /* Invoke an out-of-line helper on 2 Zregs and a predicate. */ |
85 | +{ | 52 | static bool gen_gvec_ool_zzp(DisasContext *s, gen_helper_gvec_3 *fn, |
86 | + void *tmp; | 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 | - } | ||
77 | - return true; | ||
78 | + return gen_gvec_fpst_zzzz(s, fns[a->esz], a->rd, a->rn, a->rm, a->ra, | ||
79 | + (a->index << 1) | sub, | ||
80 | + a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); | ||
81 | } | ||
82 | |||
83 | static bool trans_FMLA_zzxz(DisasContext *s, arg_FMLA_zzxz *a) | ||
84 | @@ -XXX,XX +XXX,XX @@ static bool trans_FCMLA_zpzzz(DisasContext *s, arg_FCMLA_zpzzz *a) | ||
85 | |||
86 | static bool trans_FCMLA_zzxz(DisasContext *s, arg_FCMLA_zzxz *a) | ||
87 | { | ||
88 | - static gen_helper_gvec_4_ptr * const fns[2] = { | ||
89 | + static gen_helper_gvec_4_ptr * const fns[4] = { | ||
90 | + NULL, | ||
91 | gen_helper_gvec_fcmlah_idx, | ||
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 | - } | ||
110 | - return true; | ||
87 | + | 111 | + |
88 | + struct sigaction sa = { | 112 | + return gen_gvec_fpst_zzzz(s, fns[a->esz], a->rd, a->rn, a->rm, a->ra, |
89 | + .sa_sigaction = sigbus, | 113 | + a->index * 4 + a->rot, |
90 | + .sa_flags = SA_SIGINFO | 114 | + a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); |
91 | + }; | 115 | } |
92 | + | 116 | |
93 | + if (sigaction(SIGBUS, &sa, NULL) < 0) { | 117 | /* |
94 | + perror("sigaction"); | 118 | @@ -XXX,XX +XXX,XX @@ static bool trans_FMMLA(DisasContext *s, arg_rrrr_esz *a) |
95 | + return EXIT_FAILURE; | 119 | return false; |
96 | + } | 120 | } |
97 | + | 121 | |
98 | + asm volatile("adr %0, 1f + 2\n\t" | 122 | - if (sve_access_check(s)) { |
99 | + "str %0, %1\n\t" | 123 | - unsigned vsz = vec_full_reg_size(s); |
100 | + "bx %0\n" | 124 | - TCGv_ptr status = fpstatus_ptr(FPST_FPCR); |
101 | + "1:" | 125 | - tcg_gen_gvec_4_ptr(vec_full_reg_offset(s, a->rd), |
102 | + : "=&r"(tmp), "=m"(expected)); | 126 | - vec_full_reg_offset(s, a->rn), |
103 | + | 127 | - vec_full_reg_offset(s, a->rm), |
104 | + /* | 128 | - vec_full_reg_offset(s, a->ra), |
105 | + * From v8, it is CONSTRAINED UNPREDICTABLE whether BXWritePC aligns | 129 | - status, vsz, vsz, 0, fn); |
106 | + * the address or not. If so, we can legitimately fall through. | 130 | - tcg_temp_free_ptr(status); |
107 | + */ | 131 | - } |
108 | + return EXIT_SUCCESS; | 132 | - return true; |
109 | +} | 133 | + return gen_gvec_fpst_zzzz(s, fn, a->rd, a->rn, a->rm, a->ra, 0, FPST_FPCR); |
110 | diff --git a/tests/tcg/aarch64/Makefile.target b/tests/tcg/aarch64/Makefile.target | 134 | } |
111 | index XXXXXXX..XXXXXXX 100644 | 135 | |
112 | --- a/tests/tcg/aarch64/Makefile.target | 136 | static gen_helper_gvec_4 * const sqdmlal_zzzw_fns[] = { |
113 | +++ b/tests/tcg/aarch64/Makefile.target | 137 | @@ -XXX,XX +XXX,XX @@ static bool do_FMLAL_zzzw(DisasContext *s, arg_rrrr_esz *a, bool sub, bool sel) |
114 | @@ -XXX,XX +XXX,XX @@ VPATH += $(ARM_SRC) | 138 | if (!dc_isar_feature(aa64_sve2, s)) { |
115 | AARCH64_SRC=$(SRC_PATH)/tests/tcg/aarch64 | 139 | return false; |
116 | VPATH += $(AARCH64_SRC) | 140 | } |
117 | 141 | - if (sve_access_check(s)) { | |
118 | -# Float-convert Tests | 142 | - unsigned vsz = vec_full_reg_size(s); |
119 | -AARCH64_TESTS=fcvt | 143 | - tcg_gen_gvec_4_ptr(vec_full_reg_offset(s, a->rd), |
120 | +# Base architecture tests | 144 | - vec_full_reg_offset(s, a->rn), |
121 | +AARCH64_TESTS=fcvt pcalign-a64 | 145 | - vec_full_reg_offset(s, a->rm), |
122 | 146 | - vec_full_reg_offset(s, a->ra), | |
123 | fcvt: LDFLAGS+=-lm | 147 | - cpu_env, vsz, vsz, (sel << 1) | sub, |
124 | 148 | - gen_helper_sve2_fmlal_zzzw_s); | |
125 | diff --git a/tests/tcg/arm/Makefile.target b/tests/tcg/arm/Makefile.target | 149 | - } |
126 | index XXXXXXX..XXXXXXX 100644 | 150 | - return true; |
127 | --- a/tests/tcg/arm/Makefile.target | 151 | + return gen_gvec_ptr_zzzz(s, gen_helper_sve2_fmlal_zzzw_s, |
128 | +++ b/tests/tcg/arm/Makefile.target | 152 | + a->rd, a->rn, a->rm, a->ra, |
129 | @@ -XXX,XX +XXX,XX @@ run-fcvt: fcvt | 153 | + (sel << 1) | sub, cpu_env); |
130 | $(call run-test,fcvt,$(QEMU) $<,"$< on $(TARGET_NAME)") | 154 | } |
131 | $(call diff-out,fcvt,$(ARM_SRC)/fcvt.ref) | 155 | |
132 | 156 | static bool trans_FMLALB_zzzw(DisasContext *s, arg_rrrr_esz *a) | |
133 | +# PC alignment test | 157 | @@ -XXX,XX +XXX,XX @@ static bool do_FMLAL_zzxw(DisasContext *s, arg_rrxr_esz *a, bool sub, bool sel) |
134 | +ARM_TESTS += pcalign-a32 | 158 | if (!dc_isar_feature(aa64_sve2, s)) { |
135 | +pcalign-a32: CFLAGS+=-marm | 159 | return false; |
136 | + | 160 | } |
137 | ifeq ($(CONFIG_ARM_COMPATIBLE_SEMIHOSTING),y) | 161 | - if (sve_access_check(s)) { |
138 | 162 | - unsigned vsz = vec_full_reg_size(s); | |
139 | # Semihosting smoke test for linux-user | 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) | ||
140 | -- | 223 | -- |
141 | 2.25.1 | 224 | 2.25.1 |
142 | |||
143 | diff view generated by jsdifflib |
1 | From: Philippe Mathieu-Daudé <philmd@redhat.com> | 1 | From: Richard Henderson <richard.henderson@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | The TYPE_ARM_GICV3 device is an emulated one. When using | 3 | Being able to specify the feature predicate in TRANS_FEAT |
4 | KVM, it is recommended to use the TYPE_KVM_ARM_GICV3 device | 4 | makes it easier to split trans_FMMLA by element size, |
5 | (which uses in-kernel support). | 5 | which also happens to simplify the decode. |
6 | 6 | ||
7 | When using --with-devices-FOO, it is possible to build a | 7 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
8 | binary with a specific set of devices. When this binary is | 8 | Message-id: 20220527181907.189259-79-richard.henderson@linaro.org |
9 | restricted to KVM accelerator, the TYPE_ARM_GICV3 device is | ||
10 | irrelevant, and it is desirable to remove it from the binary. | ||
11 | |||
12 | Therefore introduce the CONFIG_ARM_GIC_TCG Kconfig selector | ||
13 | which select the files required to have the TYPE_ARM_GICV3 | ||
14 | device, but also allowing to de-select this device. | ||
15 | |||
16 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
17 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 9 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> |
18 | Message-id: 20211115223619.2599282-3-philmd@redhat.com | ||
19 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
20 | --- | 11 | --- |
21 | hw/intc/arm_gicv3.c | 2 +- | 12 | target/arm/sve.decode | 7 +++---- |
22 | hw/intc/Kconfig | 5 +++++ | 13 | target/arm/translate-sve.c | 27 ++++----------------------- |
23 | hw/intc/meson.build | 10 ++++++---- | 14 | 2 files changed, 7 insertions(+), 27 deletions(-) |
24 | 3 files changed, 12 insertions(+), 5 deletions(-) | ||
25 | 15 | ||
26 | diff --git a/hw/intc/arm_gicv3.c b/hw/intc/arm_gicv3.c | 16 | diff --git a/target/arm/sve.decode b/target/arm/sve.decode |
27 | index XXXXXXX..XXXXXXX 100644 | 17 | index XXXXXXX..XXXXXXX 100644 |
28 | --- a/hw/intc/arm_gicv3.c | 18 | --- a/target/arm/sve.decode |
29 | +++ b/hw/intc/arm_gicv3.c | 19 | +++ b/target/arm/sve.decode |
30 | @@ -XXX,XX +XXX,XX @@ | 20 | @@ -XXX,XX +XXX,XX @@ SQRDCMLAH_zzzz 01000100 esz:2 0 rm:5 0011 rot:2 rn:5 rd:5 ra=%reg_movprfx |
31 | /* | 21 | USDOT_zzzz 01000100 .. 0 ..... 011 110 ..... ..... @rda_rn_rm |
32 | - * ARM Generic Interrupt Controller v3 | 22 | |
33 | + * ARM Generic Interrupt Controller v3 (emulation) | 23 | ### SVE2 floating point matrix multiply accumulate |
34 | * | 24 | -{ |
35 | * Copyright (c) 2015 Huawei. | 25 | - BFMMLA 01100100 01 1 ..... 111 001 ..... ..... @rda_rn_rm_e0 |
36 | * Copyright (c) 2016 Linaro Limited | 26 | - FMMLA 01100100 .. 1 ..... 111 001 ..... ..... @rda_rn_rm |
37 | diff --git a/hw/intc/Kconfig b/hw/intc/Kconfig | 27 | -} |
28 | +BFMMLA 01100100 01 1 ..... 111 001 ..... ..... @rda_rn_rm_e0 | ||
29 | +FMMLA_s 01100100 10 1 ..... 111 001 ..... ..... @rda_rn_rm_e0 | ||
30 | +FMMLA_d 01100100 11 1 ..... 111 001 ..... ..... @rda_rn_rm_e0 | ||
31 | |||
32 | ### SVE2 Memory Gather Load Group | ||
33 | |||
34 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
38 | index XXXXXXX..XXXXXXX 100644 | 35 | index XXXXXXX..XXXXXXX 100644 |
39 | --- a/hw/intc/Kconfig | 36 | --- a/target/arm/translate-sve.c |
40 | +++ b/hw/intc/Kconfig | 37 | +++ b/target/arm/translate-sve.c |
41 | @@ -XXX,XX +XXX,XX @@ config APIC | 38 | @@ -XXX,XX +XXX,XX @@ DO_SVE2_ZPZZ_FP(FMINP, fminp) |
42 | select MSI_NONBROKEN | 39 | * SVE Integer Multiply-Add (unpredicated) |
43 | select I8259 | 40 | */ |
44 | 41 | ||
45 | +config ARM_GIC_TCG | 42 | -static bool trans_FMMLA(DisasContext *s, arg_rrrr_esz *a) |
46 | + bool | 43 | -{ |
47 | + default y | 44 | - gen_helper_gvec_4_ptr *fn; |
48 | + depends on ARM_GIC && TCG | 45 | - |
49 | + | 46 | - switch (a->esz) { |
50 | config ARM_GIC_KVM | 47 | - case MO_32: |
51 | bool | 48 | - if (!dc_isar_feature(aa64_sve_f32mm, s)) { |
52 | default y | 49 | - return false; |
53 | diff --git a/hw/intc/meson.build b/hw/intc/meson.build | 50 | - } |
54 | index XXXXXXX..XXXXXXX 100644 | 51 | - fn = gen_helper_fmmla_s; |
55 | --- a/hw/intc/meson.build | 52 | - break; |
56 | +++ b/hw/intc/meson.build | 53 | - case MO_64: |
57 | @@ -XXX,XX +XXX,XX @@ softmmu_ss.add(when: 'CONFIG_ARM_GIC', if_true: files( | 54 | - if (!dc_isar_feature(aa64_sve_f64mm, s)) { |
58 | 'arm_gic.c', | 55 | - return false; |
59 | 'arm_gic_common.c', | 56 | - } |
60 | 'arm_gicv2m.c', | 57 | - fn = gen_helper_fmmla_d; |
61 | - 'arm_gicv3.c', | 58 | - break; |
62 | 'arm_gicv3_common.c', | 59 | - default: |
63 | - 'arm_gicv3_dist.c', | 60 | - return false; |
64 | 'arm_gicv3_its_common.c', | 61 | - } |
65 | - 'arm_gicv3_redist.c', | 62 | - |
66 | +)) | 63 | - return gen_gvec_fpst_zzzz(s, fn, a->rd, a->rn, a->rm, a->ra, 0, FPST_FPCR); |
67 | +softmmu_ss.add(when: 'CONFIG_ARM_GIC_TCG', if_true: files( | 64 | -} |
68 | + 'arm_gicv3.c', | 65 | +TRANS_FEAT(FMMLA_s, aa64_sve_f32mm, gen_gvec_fpst_zzzz, gen_helper_fmmla_s, |
69 | + 'arm_gicv3_dist.c', | 66 | + a->rd, a->rn, a->rm, a->ra, 0, FPST_FPCR) |
70 | 'arm_gicv3_its.c', | 67 | +TRANS_FEAT(FMMLA_d, aa64_sve_f64mm, gen_gvec_fpst_zzzz, gen_helper_fmmla_d, |
71 | + 'arm_gicv3_redist.c', | 68 | + a->rd, a->rn, a->rm, a->ra, 0, FPST_FPCR) |
72 | )) | 69 | |
73 | softmmu_ss.add(when: 'CONFIG_ETRAXFS', if_true: files('etraxfs_pic.c')) | 70 | static gen_helper_gvec_4 * const sqdmlal_zzzw_fns[] = { |
74 | softmmu_ss.add(when: 'CONFIG_HEATHROW_PIC', if_true: files('heathrow_pic.c')) | 71 | NULL, gen_helper_sve2_sqdmlal_zzzw_h, |
75 | @@ -XXX,XX +XXX,XX @@ softmmu_ss.add(when: 'CONFIG_XLNX_ZYNQMP_PMU', if_true: files('xlnx-pmu-iomod-in | ||
76 | specific_ss.add(when: 'CONFIG_ALLWINNER_A10_PIC', if_true: files('allwinner-a10-pic.c')) | ||
77 | specific_ss.add(when: 'CONFIG_APIC', if_true: files('apic.c', 'apic_common.c')) | ||
78 | specific_ss.add(when: 'CONFIG_ARM_GIC', if_true: files('arm_gicv3_cpuif_common.c')) | ||
79 | -specific_ss.add(when: 'CONFIG_ARM_GIC', if_true: files('arm_gicv3_cpuif.c')) | ||
80 | +specific_ss.add(when: 'CONFIG_ARM_GIC_TCG', if_true: files('arm_gicv3_cpuif.c')) | ||
81 | specific_ss.add(when: 'CONFIG_ARM_GIC_KVM', if_true: files('arm_gic_kvm.c')) | ||
82 | specific_ss.add(when: ['CONFIG_ARM_GIC_KVM', 'TARGET_AARCH64'], if_true: files('arm_gicv3_kvm.c', 'arm_gicv3_its_kvm.c')) | ||
83 | specific_ss.add(when: 'CONFIG_ARM_V7M', if_true: files('armv7m_nvic.c')) | ||
84 | -- | 72 | -- |
85 | 2.25.1 | 73 | 2.25.1 |
86 | |||
87 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Richard Henderson <richard.henderson@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | Misaligned thumb PC is architecturally impossible. | 3 | Combined with the check already present in gen_mov_p, |
4 | Assert is better than proceeding, in case we've missed | 4 | we can simplify some special cases in trans_AND_pppp |
5 | something somewhere. | 5 | and trans_BIC_pppp. |
6 | 6 | ||
7 | Expand a comment about aligning the pc in gdbstub. | 7 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
8 | Fail an incoming migrate if a thumb pc is misaligned. | 8 | Message-id: 20220527181907.189259-80-richard.henderson@linaro.org |
9 | |||
10 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 9 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> |
11 | Signed-off-by: Richard Henderson <richard.henderson@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 | target/arm/gdbstub.c | 9 +++++++-- | 12 | target/arm/translate-sve.c | 30 ++++++++++++------------------ |
15 | target/arm/machine.c | 10 ++++++++++ | 13 | 1 file changed, 12 insertions(+), 18 deletions(-) |
16 | target/arm/translate.c | 3 +++ | ||
17 | 3 files changed, 20 insertions(+), 2 deletions(-) | ||
18 | 14 | ||
19 | diff --git a/target/arm/gdbstub.c b/target/arm/gdbstub.c | 15 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c |
20 | index XXXXXXX..XXXXXXX 100644 | 16 | index XXXXXXX..XXXXXXX 100644 |
21 | --- a/target/arm/gdbstub.c | 17 | --- a/target/arm/translate-sve.c |
22 | +++ b/target/arm/gdbstub.c | 18 | +++ b/target/arm/translate-sve.c |
23 | @@ -XXX,XX +XXX,XX @@ int arm_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n) | 19 | @@ -XXX,XX +XXX,XX @@ static void do_dupi_z(DisasContext *s, int rd, uint64_t word) |
24 | 20 | } | |
25 | tmp = ldl_p(mem_buf); | 21 | |
26 | 22 | /* Invoke a vector expander on three Pregs. */ | |
27 | - /* Mask out low bit of PC to workaround gdb bugs. This will probably | 23 | -static void gen_gvec_fn_ppp(DisasContext *s, GVecGen3Fn *gvec_fn, |
28 | - cause problems if we ever implement the Jazelle DBX extensions. */ | 24 | +static bool gen_gvec_fn_ppp(DisasContext *s, GVecGen3Fn *gvec_fn, |
29 | + /* | 25 | int rd, int rn, int rm) |
30 | + * Mask out low bits of PC to workaround gdb bugs. | 26 | { |
31 | + * This avoids an assert in thumb_tr_translate_insn, because it is | 27 | - unsigned psz = pred_gvec_reg_size(s); |
32 | + * architecturally impossible to misalign the pc. | 28 | - gvec_fn(MO_64, pred_full_reg_offset(s, rd), |
33 | + * This will probably cause problems if we ever implement the | 29 | - pred_full_reg_offset(s, rn), |
34 | + * Jazelle DBX extensions. | 30 | - pred_full_reg_offset(s, rm), psz, psz); |
35 | + */ | 31 | + if (sve_access_check(s)) { |
36 | if (n == 15) { | 32 | + unsigned psz = pred_gvec_reg_size(s); |
37 | tmp &= ~1; | 33 | + gvec_fn(MO_64, pred_full_reg_offset(s, rd), |
38 | } | 34 | + pred_full_reg_offset(s, rn), |
39 | diff --git a/target/arm/machine.c b/target/arm/machine.c | 35 | + pred_full_reg_offset(s, rm), psz, psz); |
40 | index XXXXXXX..XXXXXXX 100644 | 36 | + } |
41 | --- a/target/arm/machine.c | 37 | + return true; |
42 | +++ b/target/arm/machine.c | 38 | } |
43 | @@ -XXX,XX +XXX,XX @@ static int cpu_post_load(void *opaque, int version_id) | 39 | |
44 | return -1; | 40 | /* Invoke a vector move on two Pregs. */ |
41 | @@ -XXX,XX +XXX,XX @@ static bool trans_AND_pppp(DisasContext *s, arg_rprr_s *a) | ||
42 | }; | ||
43 | |||
44 | if (!a->s) { | ||
45 | - if (!sve_access_check(s)) { | ||
46 | - return true; | ||
47 | - } | ||
48 | if (a->rn == a->rm) { | ||
49 | if (a->pg == a->rn) { | ||
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); | ||
45 | } | 61 | } |
46 | } | 62 | } |
47 | + | 63 | return do_pppp_flags(s, a, &op); |
48 | + /* | 64 | @@ -XXX,XX +XXX,XX @@ static bool trans_BIC_pppp(DisasContext *s, arg_rprr_s *a) |
49 | + * Misaligned thumb pc is architecturally impossible. | 65 | }; |
50 | + * We have an assert in thumb_tr_translate_insn to verify this. | 66 | |
51 | + * Fail an incoming migrate to avoid this assert. | 67 | if (!a->s && a->pg == a->rn) { |
52 | + */ | 68 | - if (sve_access_check(s)) { |
53 | + if (!is_a64(env) && env->thumb && (env->regs[15] & 1)) { | 69 | - gen_gvec_fn_ppp(s, tcg_gen_gvec_andc, a->rd, a->rn, a->rm); |
54 | + return -1; | 70 | - } |
55 | + } | 71 | - return true; |
56 | + | 72 | + return gen_gvec_fn_ppp(s, tcg_gen_gvec_andc, a->rd, a->rn, a->rm); |
57 | if (!kvm_enabled()) { | ||
58 | pmu_op_finish(&cpu->env); | ||
59 | } | 73 | } |
60 | diff --git a/target/arm/translate.c b/target/arm/translate.c | 74 | return do_pppp_flags(s, a, &op); |
61 | index XXXXXXX..XXXXXXX 100644 | 75 | } |
62 | --- a/target/arm/translate.c | ||
63 | +++ b/target/arm/translate.c | ||
64 | @@ -XXX,XX +XXX,XX @@ static void thumb_tr_translate_insn(DisasContextBase *dcbase, CPUState *cpu) | ||
65 | uint32_t insn; | ||
66 | bool is_16bit; | ||
67 | |||
68 | + /* Misaligned thumb PC is architecturally impossible. */ | ||
69 | + assert((dc->base.pc_next & 1) == 0); | ||
70 | + | ||
71 | if (arm_check_ss_active(dc) || arm_check_kernelpage(dc)) { | ||
72 | dc->base.pc_next = pc + 2; | ||
73 | return; | ||
74 | -- | 76 | -- |
75 | 2.25.1 | 77 | 2.25.1 |
76 | |||
77 | diff view generated by jsdifflib |
1 | From: Jean-Philippe Brucker <jean-philippe@linaro.org> | 1 | From: Richard Henderson <richard.henderson@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | We do not support instantiating multiple IOMMUs. Before adding a | 3 | This alias is defined on EOR (prediates). While the |
4 | virtio-iommu, check that no other IOMMU is present. This will detect | 4 | same operation could be performed with NAND or NOR, |
5 | both "iommu=smmuv3" machine parameter and another virtio-iommu instance. | 5 | only bother with the official alias. |
6 | 6 | ||
7 | Fixes: 70e89132c9 ("hw/arm/virt: Add the virtio-iommu device tree mappings") | 7 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
8 | Reviewed-by: Eric Auger <eric.auger@redhat.com> | 8 | Message-id: 20220527181907.189259-81-richard.henderson@linaro.org |
9 | Reviewed-by: Igor Mammedov <imammedo@redhat.com> | 9 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> |
10 | Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org> | ||
11 | Message-id: 20211210170415.583179-4-jean-philippe@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/arm/virt.c | 5 +++++ | 12 | target/arm/translate-sve.c | 5 +++++ |
15 | 1 file changed, 5 insertions(+) | 13 | 1 file changed, 5 insertions(+) |
16 | 14 | ||
17 | diff --git a/hw/arm/virt.c b/hw/arm/virt.c | 15 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c |
18 | index XXXXXXX..XXXXXXX 100644 | 16 | index XXXXXXX..XXXXXXX 100644 |
19 | --- a/hw/arm/virt.c | 17 | --- a/target/arm/translate-sve.c |
20 | +++ b/hw/arm/virt.c | 18 | +++ b/target/arm/translate-sve.c |
21 | @@ -XXX,XX +XXX,XX @@ static void virt_machine_device_pre_plug_cb(HotplugHandler *hotplug_dev, | 19 | @@ -XXX,XX +XXX,XX @@ static bool trans_EOR_pppp(DisasContext *s, arg_rprr_s *a) |
22 | hwaddr db_start = 0, db_end = 0; | 20 | .fno = gen_helper_sve_eor_pppp, |
23 | char *resv_prop_str; | 21 | .prefer_i64 = TCG_TARGET_REG_BITS == 64, |
24 | 22 | }; | |
25 | + if (vms->iommu != VIRT_IOMMU_NONE) { | ||
26 | + error_setg(errp, "virt machine does not support multiple IOMMUs"); | ||
27 | + return; | ||
28 | + } | ||
29 | + | 23 | + |
30 | switch (vms->msi_controller) { | 24 | + /* Alias NOT (predicate) is EOR Pd.B, Pg/Z, Pn.B, Pg.B */ |
31 | case VIRT_MSI_CTRL_NONE: | 25 | + if (!a->s && a->pg == a->rm) { |
32 | return; | 26 | + return gen_gvec_fn_ppp(s, tcg_gen_gvec_andc, a->rd, a->pg, a->rn); |
27 | + } | ||
28 | return do_pppp_flags(s, a, &op); | ||
29 | } | ||
30 | |||
33 | -- | 31 | -- |
34 | 2.25.1 | 32 | 2.25.1 |
35 | |||
36 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Richard Henderson <richard.henderson@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
4 | Message-id: 20220527181907.189259-82-richard.henderson@linaro.org | ||
4 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> |
5 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
6 | --- | 7 | --- |
7 | target/arm/translate.c | 16 ++++++++-------- | 8 | target/arm/translate-sve.c | 5 +---- |
8 | 1 file changed, 8 insertions(+), 8 deletions(-) | 9 | 1 file changed, 1 insertion(+), 4 deletions(-) |
9 | 10 | ||
10 | diff --git a/target/arm/translate.c b/target/arm/translate.c | 11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c |
11 | index XXXXXXX..XXXXXXX 100644 | 12 | index XXXXXXX..XXXXXXX 100644 |
12 | --- a/target/arm/translate.c | 13 | --- a/target/arm/translate-sve.c |
13 | +++ b/target/arm/translate.c | 14 | +++ b/target/arm/translate-sve.c |
14 | @@ -XXX,XX +XXX,XX @@ static void thumb_tr_translate_insn(DisasContextBase *dcbase, CPUState *cpu) | 15 | @@ -XXX,XX +XXX,XX @@ static gen_helper_gvec_4 * const udiv_fns[4] = { |
15 | { | 16 | }; |
16 | DisasContext *dc = container_of(dcbase, DisasContext, base); | 17 | TRANS_FEAT(UDIV_zpzz, aa64_sve, gen_gvec_ool_arg_zpzz, udiv_fns[a->esz], a, 0) |
17 | CPUARMState *env = cpu->env_ptr; | 18 | |
18 | + uint32_t pc = dc->base.pc_next; | 19 | -static bool trans_SEL_zpzz(DisasContext *s, arg_rprr_esz *a) |
19 | uint32_t insn; | 20 | -{ |
20 | bool is_16bit; | 21 | - return do_sel_z(s, a->rd, a->rn, a->rm, a->pg, a->esz); |
21 | 22 | -} | |
22 | if (arm_pre_translate_insn(dc)) { | 23 | +TRANS_FEAT(SEL_zpzz, aa64_sve, do_sel_z, a->rd, a->rn, a->rm, a->pg, a->esz) |
23 | - dc->base.pc_next += 2; | 24 | |
24 | + dc->base.pc_next = pc + 2; | 25 | /* |
25 | return; | 26 | *** SVE Integer Arithmetic - Unary Predicated Group |
26 | } | ||
27 | |||
28 | - dc->pc_curr = dc->base.pc_next; | ||
29 | - insn = arm_lduw_code(env, &dc->base, dc->base.pc_next, dc->sctlr_b); | ||
30 | + dc->pc_curr = pc; | ||
31 | + insn = arm_lduw_code(env, &dc->base, pc, dc->sctlr_b); | ||
32 | is_16bit = thumb_insn_is_16bit(dc, dc->base.pc_next, insn); | ||
33 | - dc->base.pc_next += 2; | ||
34 | + pc += 2; | ||
35 | if (!is_16bit) { | ||
36 | - uint32_t insn2 = arm_lduw_code(env, &dc->base, dc->base.pc_next, | ||
37 | - dc->sctlr_b); | ||
38 | - | ||
39 | + uint32_t insn2 = arm_lduw_code(env, &dc->base, pc, dc->sctlr_b); | ||
40 | insn = insn << 16 | insn2; | ||
41 | - dc->base.pc_next += 2; | ||
42 | + pc += 2; | ||
43 | } | ||
44 | + dc->base.pc_next = pc; | ||
45 | dc->insn = insn; | ||
46 | |||
47 | if (dc->pstate_il) { | ||
48 | -- | 27 | -- |
49 | 2.25.1 | 28 | 2.25.1 |
50 | |||
51 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Richard Henderson <richard.henderson@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
4 | Message-id: 20220527181907.189259-83-richard.henderson@linaro.org | ||
4 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> |
5 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
6 | --- | 7 | --- |
7 | target/arm/translate.c | 9 +++++---- | 8 | target/arm/translate-sve.c | 17 +++-------------- |
8 | 1 file changed, 5 insertions(+), 4 deletions(-) | 9 | 1 file changed, 3 insertions(+), 14 deletions(-) |
9 | 10 | ||
10 | diff --git a/target/arm/translate.c b/target/arm/translate.c | 11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c |
11 | index XXXXXXX..XXXXXXX 100644 | 12 | index XXXXXXX..XXXXXXX 100644 |
12 | --- a/target/arm/translate.c | 13 | --- a/target/arm/translate-sve.c |
13 | +++ b/target/arm/translate.c | 14 | +++ b/target/arm/translate-sve.c |
14 | @@ -XXX,XX +XXX,XX @@ static void arm_tr_translate_insn(DisasContextBase *dcbase, CPUState *cpu) | 15 | @@ -XXX,XX +XXX,XX @@ static bool trans_PRF_rr(DisasContext *s, arg_PRF_rr *a) |
15 | { | 16 | * In the meantime, just emit the moves. |
16 | DisasContext *dc = container_of(dcbase, DisasContext, base); | 17 | */ |
17 | CPUARMState *env = cpu->env_ptr; | 18 | |
18 | + uint32_t pc = dc->base.pc_next; | 19 | -static bool trans_MOVPRFX(DisasContext *s, arg_MOVPRFX *a) |
19 | unsigned int insn; | 20 | -{ |
20 | 21 | - return do_mov_z(s, a->rd, a->rn); | |
21 | if (arm_pre_translate_insn(dc)) { | 22 | -} |
22 | - dc->base.pc_next += 4; | 23 | - |
23 | + dc->base.pc_next = pc + 4; | 24 | -static bool trans_MOVPRFX_m(DisasContext *s, arg_rpr_esz *a) |
24 | return; | 25 | -{ |
25 | } | 26 | - return do_sel_z(s, a->rd, a->rn, a->rd, a->pg, a->esz); |
26 | 27 | -} | |
27 | - dc->pc_curr = dc->base.pc_next; | 28 | - |
28 | - insn = arm_ldl_code(env, &dc->base, dc->base.pc_next, dc->sctlr_b); | 29 | -static bool trans_MOVPRFX_z(DisasContext *s, arg_rpr_esz *a) |
29 | + dc->pc_curr = pc; | 30 | -{ |
30 | + insn = arm_ldl_code(env, &dc->base, pc, dc->sctlr_b); | 31 | - return do_movz_zpz(s, a->rd, a->rn, a->pg, a->esz, false); |
31 | dc->insn = insn; | 32 | -} |
32 | - dc->base.pc_next += 4; | 33 | +TRANS_FEAT(MOVPRFX, aa64_sve, do_mov_z, a->rd, a->rn) |
33 | + dc->base.pc_next = pc + 4; | 34 | +TRANS_FEAT(MOVPRFX_m, aa64_sve, do_sel_z, a->rd, a->rn, a->rd, a->pg, a->esz) |
34 | disas_arm_insn(dc, insn); | 35 | +TRANS_FEAT(MOVPRFX_z, aa64_sve, do_movz_zpz, a->rd, a->rn, a->pg, a->esz, false) |
35 | 36 | ||
36 | arm_post_translate_insn(dc); | 37 | /* |
38 | * SVE2 Integer Multiply - Unpredicated | ||
37 | -- | 39 | -- |
38 | 2.25.1 | 40 | 2.25.1 |
39 | |||
40 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Richard Henderson <richard.henderson@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
4 | Message-id: 20220527181907.189259-84-richard.henderson@linaro.org | ||
4 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> |
5 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
6 | --- | 7 | --- |
7 | target/arm/translate-a64.c | 7 ++++--- | 8 | target/arm/translate-sve.c | 11 ++--------- |
8 | 1 file changed, 4 insertions(+), 3 deletions(-) | 9 | 1 file changed, 2 insertions(+), 9 deletions(-) |
9 | 10 | ||
10 | diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c | 11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c |
11 | index XXXXXXX..XXXXXXX 100644 | 12 | index XXXXXXX..XXXXXXX 100644 |
12 | --- a/target/arm/translate-a64.c | 13 | --- a/target/arm/translate-sve.c |
13 | +++ b/target/arm/translate-a64.c | 14 | +++ b/target/arm/translate-sve.c |
14 | @@ -XXX,XX +XXX,XX @@ static void aarch64_tr_translate_insn(DisasContextBase *dcbase, CPUState *cpu) | 15 | @@ -XXX,XX +XXX,XX @@ static bool do_FMLA_zzxz(DisasContext *s, arg_rrxr_esz *a, bool sub) |
15 | { | 16 | a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); |
16 | DisasContext *s = container_of(dcbase, DisasContext, base); | 17 | } |
17 | CPUARMState *env = cpu->env_ptr; | 18 | |
18 | + uint64_t pc = s->base.pc_next; | 19 | -static bool trans_FMLA_zzxz(DisasContext *s, arg_FMLA_zzxz *a) |
19 | uint32_t insn; | 20 | -{ |
20 | 21 | - return do_FMLA_zzxz(s, a, false); | |
21 | if (s->ss_active && !s->pstate_ss) { | 22 | -} |
22 | @@ -XXX,XX +XXX,XX @@ static void aarch64_tr_translate_insn(DisasContextBase *dcbase, CPUState *cpu) | 23 | - |
23 | return; | 24 | -static bool trans_FMLS_zzxz(DisasContext *s, arg_FMLA_zzxz *a) |
24 | } | 25 | -{ |
25 | 26 | - return do_FMLA_zzxz(s, a, true); | |
26 | - s->pc_curr = s->base.pc_next; | 27 | -} |
27 | - insn = arm_ldl_code(env, &s->base, s->base.pc_next, s->sctlr_b); | 28 | +TRANS_FEAT(FMLA_zzxz, aa64_sve, do_FMLA_zzxz, a, false) |
28 | + s->pc_curr = pc; | 29 | +TRANS_FEAT(FMLS_zzxz, aa64_sve, do_FMLA_zzxz, a, true) |
29 | + insn = arm_ldl_code(env, &s->base, pc, s->sctlr_b); | 30 | |
30 | s->insn = insn; | 31 | /* |
31 | - s->base.pc_next += 4; | 32 | *** SVE Floating Point Multiply Indexed Group |
32 | + s->base.pc_next = pc + 4; | ||
33 | |||
34 | s->fp_access_checked = false; | ||
35 | s->sve_access_checked = false; | ||
36 | -- | 33 | -- |
37 | 2.25.1 | 34 | 2.25.1 |
38 | |||
39 | diff view generated by jsdifflib |
1 | From: Philippe Mathieu-Daudé <philmd@redhat.com> | 1 | From: Richard Henderson <richard.henderson@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | gicv3_set_gicv3state() is used by arm_gicv3_common.c in | 3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
4 | arm_gicv3_common_realize(). Since we want to restrict | 4 | Message-id: 20220527181907.189259-85-richard.henderson@linaro.org |
5 | arm_gicv3_cpuif.c to TCG, extract gicv3_set_gicv3state() | ||
6 | to a new file. Add this file to the meson 'specific' | ||
7 | source set, since it needs access to "cpu.h". | ||
8 | |||
9 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
10 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> |
11 | Message-id: 20211115223619.2599282-2-philmd@redhat.com | ||
12 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
13 | --- | 7 | --- |
14 | hw/intc/arm_gicv3_cpuif.c | 10 +--------- | 8 | target/arm/translate-sve.c | 28 ++++------------------------ |
15 | hw/intc/arm_gicv3_cpuif_common.c | 22 ++++++++++++++++++++++ | 9 | 1 file changed, 4 insertions(+), 24 deletions(-) |
16 | hw/intc/meson.build | 1 + | ||
17 | 3 files changed, 24 insertions(+), 9 deletions(-) | ||
18 | create mode 100644 hw/intc/arm_gicv3_cpuif_common.c | ||
19 | 10 | ||
20 | diff --git a/hw/intc/arm_gicv3_cpuif.c b/hw/intc/arm_gicv3_cpuif.c | 11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c |
21 | index XXXXXXX..XXXXXXX 100644 | 12 | index XXXXXXX..XXXXXXX 100644 |
22 | --- a/hw/intc/arm_gicv3_cpuif.c | 13 | --- a/target/arm/translate-sve.c |
23 | +++ b/hw/intc/arm_gicv3_cpuif.c | 14 | +++ b/target/arm/translate-sve.c |
24 | @@ -XXX,XX +XXX,XX @@ | 15 | @@ -XXX,XX +XXX,XX @@ TRANS_FEAT(BFMMLA, aa64_sve_bf16, gen_gvec_ool_arg_zzzz, |
25 | /* | 16 | |
26 | - * ARM Generic Interrupt Controller v3 | 17 | static bool do_BFMLAL_zzzw(DisasContext *s, arg_rrrr_esz *a, bool sel) |
27 | + * ARM Generic Interrupt Controller v3 (emulation) | 18 | { |
28 | * | 19 | - if (!dc_isar_feature(aa64_sve_bf16, s)) { |
29 | * Copyright (c) 2016 Linaro Limited | 20 | - return false; |
30 | * Written by Peter Maydell | 21 | - } |
31 | @@ -XXX,XX +XXX,XX @@ | 22 | return gen_gvec_fpst_zzzz(s, gen_helper_gvec_bfmlal, |
32 | #include "hw/irq.h" | 23 | a->rd, a->rn, a->rm, a->ra, sel, FPST_FPCR); |
33 | #include "cpu.h" | 24 | } |
34 | 25 | ||
35 | -void gicv3_set_gicv3state(CPUState *cpu, GICv3CPUState *s) | 26 | -static bool trans_BFMLALB_zzzw(DisasContext *s, arg_rrrr_esz *a) |
36 | -{ | 27 | -{ |
37 | - ARMCPU *arm_cpu = ARM_CPU(cpu); | 28 | - return do_BFMLAL_zzzw(s, a, false); |
38 | - CPUARMState *env = &arm_cpu->env; | 29 | -} |
39 | - | 30 | - |
40 | - env->gicv3state = (void *)s; | 31 | -static bool trans_BFMLALT_zzzw(DisasContext *s, arg_rrrr_esz *a) |
41 | -}; | 32 | -{ |
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 | } | ||
47 | |||
48 | -static bool trans_BFMLALB_zzxw(DisasContext *s, arg_rrxr_esz *a) | ||
49 | -{ | ||
50 | - return do_BFMLAL_zzxw(s, a, false); | ||
51 | -} | ||
42 | - | 52 | - |
43 | static GICv3CPUState *icc_cs_from_env(CPUARMState *env) | 53 | -static bool trans_BFMLALT_zzxw(DisasContext *s, arg_rrxr_esz *a) |
44 | { | 54 | -{ |
45 | return env->gicv3state; | 55 | - return do_BFMLAL_zzxw(s, a, true); |
46 | diff --git a/hw/intc/arm_gicv3_cpuif_common.c b/hw/intc/arm_gicv3_cpuif_common.c | 56 | -} |
47 | new file mode 100644 | 57 | +TRANS_FEAT(BFMLALB_zzxw, aa64_sve_bf16, do_BFMLAL_zzxw, a, false) |
48 | index XXXXXXX..XXXXXXX | 58 | +TRANS_FEAT(BFMLALT_zzxw, aa64_sve_bf16, do_BFMLAL_zzxw, a, true) |
49 | --- /dev/null | ||
50 | +++ b/hw/intc/arm_gicv3_cpuif_common.c | ||
51 | @@ -XXX,XX +XXX,XX @@ | ||
52 | +/* SPDX-License-Identifier: GPL-2.0-or-later */ | ||
53 | +/* | ||
54 | + * ARM Generic Interrupt Controller v3 | ||
55 | + * | ||
56 | + * Copyright (c) 2016 Linaro Limited | ||
57 | + * Written by Peter Maydell | ||
58 | + * | ||
59 | + * This code is licensed under the GPL, version 2 or (at your option) | ||
60 | + * any later version. | ||
61 | + */ | ||
62 | + | ||
63 | +#include "qemu/osdep.h" | ||
64 | +#include "gicv3_internal.h" | ||
65 | +#include "cpu.h" | ||
66 | + | ||
67 | +void gicv3_set_gicv3state(CPUState *cpu, GICv3CPUState *s) | ||
68 | +{ | ||
69 | + ARMCPU *arm_cpu = ARM_CPU(cpu); | ||
70 | + CPUARMState *env = &arm_cpu->env; | ||
71 | + | ||
72 | + env->gicv3state = (void *)s; | ||
73 | +}; | ||
74 | diff --git a/hw/intc/meson.build b/hw/intc/meson.build | ||
75 | index XXXXXXX..XXXXXXX 100644 | ||
76 | --- a/hw/intc/meson.build | ||
77 | +++ b/hw/intc/meson.build | ||
78 | @@ -XXX,XX +XXX,XX @@ softmmu_ss.add(when: 'CONFIG_XLNX_ZYNQMP_PMU', if_true: files('xlnx-pmu-iomod-in | ||
79 | |||
80 | specific_ss.add(when: 'CONFIG_ALLWINNER_A10_PIC', if_true: files('allwinner-a10-pic.c')) | ||
81 | specific_ss.add(when: 'CONFIG_APIC', if_true: files('apic.c', 'apic_common.c')) | ||
82 | +specific_ss.add(when: 'CONFIG_ARM_GIC', if_true: files('arm_gicv3_cpuif_common.c')) | ||
83 | specific_ss.add(when: 'CONFIG_ARM_GIC', if_true: files('arm_gicv3_cpuif.c')) | ||
84 | specific_ss.add(when: 'CONFIG_ARM_GIC_KVM', if_true: files('arm_gic_kvm.c')) | ||
85 | specific_ss.add(when: ['CONFIG_ARM_GIC_KVM', 'TARGET_AARCH64'], if_true: files('arm_gicv3_kvm.c', 'arm_gicv3_its_kvm.c')) | ||
86 | -- | 59 | -- |
87 | 2.25.1 | 60 | 2.25.1 |
88 | |||
89 | diff view generated by jsdifflib |
1 | From: Jean-Philippe Brucker <jean-philippe@linaro.org> | 1 | From: Richard Henderson <richard.henderson@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | Add two test cases for VIOT, one on the q35 machine and the other on | 3 | Rename the function to match gen_gvec_ool_arg_zzz, |
4 | virt. To test complex topologies the q35 test has two PCIe buses that | 4 | and move to be adjacent. Split out gen_gvec_fpst_zzz |
5 | bypass the IOMMU (and are therefore not described by VIOT), and two | 5 | as a helper while we're at it. |
6 | buses that are translated by virtio-iommu. | ||
7 | 6 | ||
8 | Reviewed-by: Eric Auger <eric.auger@redhat.com> | 7 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
9 | Reviewed-by: Igor Mammedov <imammedo@redhat.com> | 8 | Message-id: 20220527181907.189259-86-richard.henderson@linaro.org |
10 | Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org> | 9 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> |
11 | Message-id: 20211210170415.583179-7-jean-philippe@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 | tests/qtest/bios-tables-test.c | 38 ++++++++++++++++++++++++++++++++++ | 12 | target/arm/translate-sve.c | 50 +++++++++++++++++++++++--------------- |
15 | 1 file changed, 38 insertions(+) | 13 | 1 file changed, 30 insertions(+), 20 deletions(-) |
16 | 14 | ||
17 | diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c | 15 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c |
18 | index XXXXXXX..XXXXXXX 100644 | 16 | index XXXXXXX..XXXXXXX 100644 |
19 | --- a/tests/qtest/bios-tables-test.c | 17 | --- a/target/arm/translate-sve.c |
20 | +++ b/tests/qtest/bios-tables-test.c | 18 | +++ b/target/arm/translate-sve.c |
21 | @@ -XXX,XX +XXX,XX @@ static void test_acpi_virt_tcg(void) | 19 | @@ -XXX,XX +XXX,XX @@ static bool gen_gvec_ool_arg_zzz(DisasContext *s, gen_helper_gvec_3 *fn, |
22 | free_test_data(&data); | 20 | return gen_gvec_ool_zzz(s, fn, a->rd, a->rn, a->rm, data); |
23 | } | 21 | } |
24 | 22 | ||
25 | +static void test_acpi_q35_viot(void) | 23 | +/* Invoke an out-of-line helper on 3 Zregs, plus float_status. */ |
24 | +static bool gen_gvec_fpst_zzz(DisasContext *s, gen_helper_gvec_3_ptr *fn, | ||
25 | + int rd, int rn, int rm, | ||
26 | + int data, ARMFPStatusFlavour flavour) | ||
26 | +{ | 27 | +{ |
27 | + test_data data = { | 28 | + if (fn == NULL) { |
28 | + .machine = MACHINE_Q35, | 29 | + return false; |
29 | + .variant = ".viot", | 30 | + } |
30 | + }; | 31 | + if (sve_access_check(s)) { |
32 | + unsigned vsz = vec_full_reg_size(s); | ||
33 | + TCGv_ptr status = fpstatus_ptr(flavour); | ||
31 | + | 34 | + |
32 | + /* | 35 | + tcg_gen_gvec_3_ptr(vec_full_reg_offset(s, rd), |
33 | + * To keep things interesting, two buses bypass the IOMMU. | 36 | + vec_full_reg_offset(s, rn), |
34 | + * VIOT should only describes the other two buses. | 37 | + vec_full_reg_offset(s, rm), |
35 | + */ | 38 | + status, vsz, vsz, data, fn); |
36 | + test_acpi_one("-machine default_bus_bypass_iommu=on " | 39 | + |
37 | + "-device virtio-iommu-pci " | 40 | + tcg_temp_free_ptr(status); |
38 | + "-device pxb-pcie,bus_nr=0x10,id=pcie.100,bus=pcie.0 " | 41 | + } |
39 | + "-device pxb-pcie,bus_nr=0x20,id=pcie.200,bus=pcie.0,bypass_iommu=on " | 42 | + return true; |
40 | + "-device pxb-pcie,bus_nr=0x30,id=pcie.300,bus=pcie.0", | ||
41 | + &data); | ||
42 | + free_test_data(&data); | ||
43 | +} | 43 | +} |
44 | + | 44 | + |
45 | +static void test_acpi_virt_viot(void) | 45 | +static bool gen_gvec_fpst_arg_zzz(DisasContext *s, gen_helper_gvec_3_ptr *fn, |
46 | + arg_rrr_esz *a, int data) | ||
46 | +{ | 47 | +{ |
47 | + test_data data = { | 48 | + return gen_gvec_fpst_zzz(s, fn, a->rd, a->rn, a->rm, data, |
48 | + .machine = "virt", | 49 | + a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); |
49 | + .uefi_fl1 = "pc-bios/edk2-aarch64-code.fd", | ||
50 | + .uefi_fl2 = "pc-bios/edk2-arm-vars.fd", | ||
51 | + .cd = "tests/data/uefi-boot-images/bios-tables-test.aarch64.iso.qcow2", | ||
52 | + .ram_start = 0x40000000ULL, | ||
53 | + .scan_len = 128ULL * 1024 * 1024, | ||
54 | + }; | ||
55 | + | ||
56 | + test_acpi_one("-cpu cortex-a57 " | ||
57 | + "-device virtio-iommu-pci", &data); | ||
58 | + free_test_data(&data); | ||
59 | +} | 50 | +} |
60 | + | 51 | + |
61 | static void test_oem_fields(test_data *data) | 52 | /* Invoke an out-of-line helper on 4 Zregs. */ |
62 | { | 53 | static bool gen_gvec_ool_zzzz(DisasContext *s, gen_helper_gvec_4 *fn, |
63 | int i; | 54 | int rd, int rn, int rm, int ra, int data) |
64 | @@ -XXX,XX +XXX,XX @@ int main(int argc, char *argv[]) | 55 | @@ -XXX,XX +XXX,XX @@ static bool trans_FADDA(DisasContext *s, arg_rprr_esz *a) |
65 | qtest_add_func("acpi/q35/kvm/xapic", test_acpi_q35_kvm_xapic); | 56 | *** SVE Floating Point Arithmetic - Unpredicated Group |
66 | qtest_add_func("acpi/q35/kvm/dmar", test_acpi_q35_kvm_dmar); | 57 | */ |
67 | } | 58 | |
68 | + qtest_add_func("acpi/q35/viot", test_acpi_q35_viot); | 59 | -static bool do_zzz_fp(DisasContext *s, arg_rrr_esz *a, |
69 | } else if (strcmp(arch, "aarch64") == 0) { | 60 | - gen_helper_gvec_3_ptr *fn) |
70 | if (has_tcg) { | 61 | -{ |
71 | qtest_add_func("acpi/virt", test_acpi_virt_tcg); | 62 | - if (fn == NULL) { |
72 | @@ -XXX,XX +XXX,XX @@ int main(int argc, char *argv[]) | 63 | - return false; |
73 | qtest_add_func("acpi/virt/memhp", test_acpi_virt_tcg_memhp); | 64 | - } |
74 | qtest_add_func("acpi/virt/pxb", test_acpi_virt_tcg_pxb); | 65 | - if (sve_access_check(s)) { |
75 | qtest_add_func("acpi/virt/oem-fields", test_acpi_oem_fields_virt); | 66 | - unsigned vsz = vec_full_reg_size(s); |
76 | + qtest_add_func("acpi/virt/viot", test_acpi_virt_viot); | 67 | - TCGv_ptr status = fpstatus_ptr(a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); |
77 | } | 68 | - tcg_gen_gvec_3_ptr(vec_full_reg_offset(s, a->rd), |
78 | } | 69 | - vec_full_reg_offset(s, a->rn), |
79 | ret = g_test_run(); | 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 | } | ||
88 | |||
89 | DO_FP3(FADD_zzz, fadd) | ||
80 | -- | 90 | -- |
81 | 2.25.1 | 91 | 2.25.1 |
82 | |||
83 | diff view generated by jsdifflib |
1 | The qemu-common.h header is not supposed to be included from any | 1 | From: Richard Henderson <richard.henderson@linaro.org> |
---|---|---|---|
2 | other header files, only from .c files (as documented in a comment at | ||
3 | the start of it). | ||
4 | 2 | ||
5 | Move the include to linux-user/hexagon/cpu_loop.c, which needs it for | 3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
6 | the declaration of cpu_exec_step_atomic(). | 4 | Message-id: 20220527181907.189259-87-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 | 7 ++----- | ||
9 | 1 file changed, 2 insertions(+), 5 deletions(-) | ||
7 | 10 | ||
8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c |
9 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
10 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
11 | Reviewed-by: Taylor Simpson <tsimpson@quicinc.com> | ||
12 | Message-id: 20211129200510.1233037-3-peter.maydell@linaro.org | ||
13 | --- | ||
14 | target/hexagon/cpu.h | 1 - | ||
15 | linux-user/hexagon/cpu_loop.c | 1 + | ||
16 | 2 files changed, 1 insertion(+), 1 deletion(-) | ||
17 | |||
18 | diff --git a/target/hexagon/cpu.h b/target/hexagon/cpu.h | ||
19 | index XXXXXXX..XXXXXXX 100644 | 12 | index XXXXXXX..XXXXXXX 100644 |
20 | --- a/target/hexagon/cpu.h | 13 | --- a/target/arm/translate-sve.c |
21 | +++ b/target/hexagon/cpu.h | 14 | +++ b/target/arm/translate-sve.c |
22 | @@ -XXX,XX +XXX,XX @@ typedef struct CPUHexagonState CPUHexagonState; | 15 | @@ -XXX,XX +XXX,XX @@ static bool trans_FADDA(DisasContext *s, arg_rprr_esz *a) |
23 | |||
24 | #include "fpu/softfloat-types.h" | ||
25 | |||
26 | -#include "qemu-common.h" | ||
27 | #include "exec/cpu-defs.h" | ||
28 | #include "hex_regs.h" | ||
29 | #include "mmvec/mmvec.h" | ||
30 | diff --git a/linux-user/hexagon/cpu_loop.c b/linux-user/hexagon/cpu_loop.c | ||
31 | index XXXXXXX..XXXXXXX 100644 | ||
32 | --- a/linux-user/hexagon/cpu_loop.c | ||
33 | +++ b/linux-user/hexagon/cpu_loop.c | ||
34 | @@ -XXX,XX +XXX,XX @@ | ||
35 | */ | 16 | */ |
36 | 17 | ||
37 | #include "qemu/osdep.h" | 18 | #define DO_FP3(NAME, name) \ |
38 | +#include "qemu-common.h" | 19 | -static bool trans_##NAME(DisasContext *s, arg_rrr_esz *a) \ |
39 | #include "qemu.h" | 20 | -{ \ |
40 | #include "user-internals.h" | 21 | - static gen_helper_gvec_3_ptr * const fns[4] = { \ |
41 | #include "cpu_loop-common.h" | 22 | + static gen_helper_gvec_3_ptr * const name##_fns[4] = { \ |
23 | NULL, gen_helper_gvec_##name##_h, \ | ||
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) | ||
42 | -- | 32 | -- |
43 | 2.25.1 | 33 | 2.25.1 |
44 | |||
45 | diff view generated by jsdifflib |
1 | From: Olivier Hériveaux <olivier.heriveaux@ledger.fr> | 1 | From: Richard Henderson <richard.henderson@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | Fix issue where the data register may be overwritten by next character | 3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
4 | reception before being read and returned. | 4 | Message-id: 20220527181907.189259-88-richard.henderson@linaro.org |
5 | |||
6 | Signed-off-by: Olivier Hériveaux <olivier.heriveaux@ledger.fr> | ||
7 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> |
8 | Reviewed-by: Alistair Francis <alistair.francis@wdc.com> | ||
9 | Message-id: 20211128120723.4053-1-olivier.heriveaux@ledger.fr | ||
10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
11 | --- | 7 | --- |
12 | hw/char/stm32f2xx_usart.c | 3 ++- | 8 | target/arm/translate-sve.c | 26 +++++++------------------- |
13 | 1 file changed, 2 insertions(+), 1 deletion(-) | 9 | 1 file changed, 7 insertions(+), 19 deletions(-) |
14 | 10 | ||
15 | diff --git a/hw/char/stm32f2xx_usart.c b/hw/char/stm32f2xx_usart.c | 11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c |
16 | index XXXXXXX..XXXXXXX 100644 | 12 | index XXXXXXX..XXXXXXX 100644 |
17 | --- a/hw/char/stm32f2xx_usart.c | 13 | --- a/target/arm/translate-sve.c |
18 | +++ b/hw/char/stm32f2xx_usart.c | 14 | +++ b/target/arm/translate-sve.c |
19 | @@ -XXX,XX +XXX,XX @@ static uint64_t stm32f2xx_usart_read(void *opaque, hwaddr addr, | 15 | @@ -XXX,XX +XXX,XX @@ TRANS_FEAT(FMLS_zzxz, aa64_sve, do_FMLA_zzxz, a, true) |
20 | return retvalue; | 16 | *** SVE Floating Point Multiply Indexed Group |
21 | case USART_DR: | 17 | */ |
22 | DB_PRINT("Value: 0x%" PRIx32 ", %c\n", s->usart_dr, (char) s->usart_dr); | 18 | |
23 | + retvalue = s->usart_dr & 0x3FF; | 19 | -static bool trans_FMUL_zzx(DisasContext *s, arg_FMUL_zzx *a) |
24 | s->usart_sr &= ~USART_SR_RXNE; | 20 | -{ |
25 | qemu_chr_fe_accept_input(&s->chr); | 21 | - static gen_helper_gvec_3_ptr * const fns[3] = { |
26 | qemu_set_irq(s->irq, 0); | 22 | - gen_helper_gvec_fmul_idx_h, |
27 | - return s->usart_dr & 0x3FF; | 23 | - gen_helper_gvec_fmul_idx_s, |
28 | + return retvalue; | 24 | - gen_helper_gvec_fmul_idx_d, |
29 | case USART_BRR: | 25 | - }; |
30 | return s->usart_brr; | 26 | - |
31 | case USART_CR1: | 27 | - if (sve_access_check(s)) { |
28 | - unsigned vsz = vec_full_reg_size(s); | ||
29 | - TCGv_ptr status = fpstatus_ptr(a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); | ||
30 | - tcg_gen_gvec_3_ptr(vec_full_reg_offset(s, a->rd), | ||
31 | - vec_full_reg_offset(s, a->rn), | ||
32 | - vec_full_reg_offset(s, a->rm), | ||
33 | - status, vsz, vsz, a->index, fns[a->esz - 1]); | ||
34 | - tcg_temp_free_ptr(status); | ||
35 | - } | ||
36 | - return true; | ||
37 | -} | ||
38 | +static gen_helper_gvec_3_ptr * const fmul_idx_fns[4] = { | ||
39 | + NULL, gen_helper_gvec_fmul_idx_h, | ||
40 | + gen_helper_gvec_fmul_idx_s, gen_helper_gvec_fmul_idx_d, | ||
41 | +}; | ||
42 | +TRANS_FEAT(FMUL_zzx, aa64_sve, gen_gvec_fpst_zzz, | ||
43 | + fmul_idx_fns[a->esz], a->rd, a->rn, a->rm, a->index, | ||
44 | + a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR) | ||
45 | |||
46 | /* | ||
47 | *** SVE Floating Point Fast Reduction Group | ||
32 | -- | 48 | -- |
33 | 2.25.1 | 49 | 2.25.1 |
34 | |||
35 | diff view generated by jsdifflib |
1 | From: Joel Stanley <joel@jms.id.au> | 1 | From: Richard Henderson <richard.henderson@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | Move it to the supported list. | 3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
4 | 4 | Message-id: 20220527181907.189259-89-richard.henderson@linaro.org | |
5 | Signed-off-by: Joel Stanley <joel@jms.id.au> | 5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> |
6 | Message-id: 20211117065752.330632-5-joel@jms.id.au | ||
7 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
8 | --- | 7 | --- |
9 | docs/system/arm/aspeed.rst | 2 +- | 8 | target/arm/translate-sve.c | 29 +++++++---------------------- |
10 | 1 file changed, 1 insertion(+), 1 deletion(-) | 9 | 1 file changed, 7 insertions(+), 22 deletions(-) |
11 | 10 | ||
12 | diff --git a/docs/system/arm/aspeed.rst b/docs/system/arm/aspeed.rst | 11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c |
13 | index XXXXXXX..XXXXXXX 100644 | 12 | index XXXXXXX..XXXXXXX 100644 |
14 | --- a/docs/system/arm/aspeed.rst | 13 | --- a/target/arm/translate-sve.c |
15 | +++ b/docs/system/arm/aspeed.rst | 14 | +++ b/target/arm/translate-sve.c |
16 | @@ -XXX,XX +XXX,XX @@ Supported devices | 15 | @@ -XXX,XX +XXX,XX @@ DO_PPZ(FCMNE_ppz0, fcmne0) |
17 | * Front LEDs (PCA9552 on I2C bus) | 16 | *** SVE floating-point trig multiply-add coefficient |
18 | * LPC Peripheral Controller (a subset of subdevices are supported) | 17 | */ |
19 | * Hash/Crypto Engine (HACE) - Hash support only. TODO: HMAC and RSA | 18 | |
20 | + * ADC | 19 | -static bool trans_FTMAD(DisasContext *s, arg_FTMAD *a) |
21 | 20 | -{ | |
22 | 21 | - static gen_helper_gvec_3_ptr * const fns[3] = { | |
23 | Missing devices | 22 | - gen_helper_sve_ftmad_h, |
24 | --------------- | 23 | - gen_helper_sve_ftmad_s, |
25 | 24 | - gen_helper_sve_ftmad_d, | |
26 | * Coprocessor support | 25 | - }; |
27 | - * ADC (out of tree implementation) | 26 | - |
28 | * PWM and Fan Controller | 27 | - if (a->esz == 0) { |
29 | * Slave GPIO Controller | 28 | - return false; |
30 | * Super I/O Controller | 29 | - } |
30 | - if (sve_access_check(s)) { | ||
31 | - unsigned vsz = vec_full_reg_size(s); | ||
32 | - TCGv_ptr status = fpstatus_ptr(a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); | ||
33 | - tcg_gen_gvec_3_ptr(vec_full_reg_offset(s, a->rd), | ||
34 | - vec_full_reg_offset(s, a->rn), | ||
35 | - vec_full_reg_offset(s, a->rm), | ||
36 | - status, vsz, vsz, a->imm, fns[a->esz - 1]); | ||
37 | - tcg_temp_free_ptr(status); | ||
38 | - } | ||
39 | - return true; | ||
40 | -} | ||
41 | +static gen_helper_gvec_3_ptr * const ftmad_fns[4] = { | ||
42 | + NULL, gen_helper_sve_ftmad_h, | ||
43 | + gen_helper_sve_ftmad_s, gen_helper_sve_ftmad_d, | ||
44 | +}; | ||
45 | +TRANS_FEAT(FTMAD, aa64_sve, gen_gvec_fpst_zzz, | ||
46 | + ftmad_fns[a->esz], a->rd, a->rn, a->rm, a->imm, | ||
47 | + a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR) | ||
48 | |||
49 | /* | ||
50 | *** SVE Floating Point Accumulating Reduction Group | ||
31 | -- | 51 | -- |
32 | 2.25.1 | 52 | 2.25.1 |
33 | |||
34 | diff view generated by jsdifflib |
1 | From: Jean-Philippe Brucker <jean-philippe@linaro.org> | 1 | From: Richard Henderson <richard.henderson@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | When a virtio-iommu is instantiated, describe it using the ACPI VIOT | 3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
4 | table. | 4 | Message-id: 20220527181907.189259-90-richard.henderson@linaro.org |
5 | 5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | |
6 | Acked-by: Igor Mammedov <imammedo@redhat.com> | ||
7 | Reviewed-by: Eric Auger <eric.auger@redhat.com> | ||
8 | Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org> | ||
9 | Message-id: 20211210170415.583179-2-jean-philippe@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 | hw/arm/virt-acpi-build.c | 7 +++++++ | 8 | target/arm/translate-sve.c | 30 +++++++++++++++++------------- |
13 | hw/arm/Kconfig | 1 + | 9 | 1 file changed, 17 insertions(+), 13 deletions(-) |
14 | 2 files changed, 8 insertions(+) | ||
15 | 10 | ||
16 | diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c | 11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c |
17 | index XXXXXXX..XXXXXXX 100644 | 12 | index XXXXXXX..XXXXXXX 100644 |
18 | --- a/hw/arm/virt-acpi-build.c | 13 | --- a/target/arm/translate-sve.c |
19 | +++ b/hw/arm/virt-acpi-build.c | 14 | +++ b/target/arm/translate-sve.c |
20 | @@ -XXX,XX +XXX,XX @@ | 15 | @@ -XXX,XX +XXX,XX @@ TRANS_FEAT(FMUL_zzx, aa64_sve, gen_gvec_fpst_zzz, |
21 | #include "kvm_arm.h" | 16 | typedef void gen_helper_fp_reduce(TCGv_i64, TCGv_ptr, TCGv_ptr, |
22 | #include "migration/vmstate.h" | 17 | TCGv_ptr, TCGv_i32); |
23 | #include "hw/acpi/ghes.h" | 18 | |
24 | +#include "hw/acpi/viot.h" | 19 | -static void do_reduce(DisasContext *s, arg_rpr_esz *a, |
25 | 20 | +static bool do_reduce(DisasContext *s, arg_rpr_esz *a, | |
26 | #define ARM_SPI_BASE 32 | 21 | gen_helper_fp_reduce *fn) |
27 | 22 | { | |
28 | @@ -XXX,XX +XXX,XX @@ void virt_acpi_build(VirtMachineState *vms, AcpiBuildTables *tables) | 23 | - unsigned vsz = vec_full_reg_size(s); |
29 | } | 24 | - unsigned p2vsz = pow2ceil(vsz); |
30 | #endif | 25 | - TCGv_i32 t_desc = tcg_constant_i32(simd_desc(vsz, vsz, p2vsz)); |
31 | 26 | + unsigned vsz, p2vsz; | |
32 | + if (vms->iommu == VIRT_IOMMU_VIRTIO) { | 27 | + TCGv_i32 t_desc; |
33 | + acpi_add_table(table_offsets, tables_blob); | 28 | TCGv_ptr t_zn, t_pg, status; |
34 | + build_viot(ms, tables_blob, tables->linker, vms->virtio_iommu_bdf, | 29 | TCGv_i64 temp; |
35 | + vms->oem_id, vms->oem_table_id); | 30 | |
31 | + if (fn == NULL) { | ||
32 | + return false; | ||
33 | + } | ||
34 | + if (!sve_access_check(s)) { | ||
35 | + return true; | ||
36 | + } | 36 | + } |
37 | + | 37 | + |
38 | /* XSDT is pointed to by RSDP */ | 38 | + vsz = vec_full_reg_size(s); |
39 | xsdt = tables_blob->len; | 39 | + p2vsz = pow2ceil(vsz); |
40 | build_xsdt(tables_blob, tables->linker, table_offsets, vms->oem_id, | 40 | + t_desc = tcg_constant_i32(simd_desc(vsz, vsz, p2vsz)); |
41 | diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig | 41 | temp = tcg_temp_new_i64(); |
42 | index XXXXXXX..XXXXXXX 100644 | 42 | t_zn = tcg_temp_new_ptr(); |
43 | --- a/hw/arm/Kconfig | 43 | t_pg = tcg_temp_new_ptr(); |
44 | +++ b/hw/arm/Kconfig | 44 | @@ -XXX,XX +XXX,XX @@ static void do_reduce(DisasContext *s, arg_rpr_esz *a, |
45 | @@ -XXX,XX +XXX,XX @@ config ARM_VIRT | 45 | |
46 | select DIMM | 46 | write_fp_dreg(s, a->rd, temp); |
47 | select ACPI_HW_REDUCED | 47 | tcg_temp_free_i64(temp); |
48 | select ACPI_APEI | 48 | + return true; |
49 | + select ACPI_VIOT | 49 | } |
50 | 50 | ||
51 | config CHEETAH | 51 | #define DO_VPZ(NAME, name) \ |
52 | bool | 52 | static bool trans_##NAME(DisasContext *s, arg_rpr_esz *a) \ |
53 | { \ | ||
54 | - static gen_helper_fp_reduce * const fns[3] = { \ | ||
55 | - gen_helper_sve_##name##_h, \ | ||
56 | + static gen_helper_fp_reduce * const fns[4] = { \ | ||
57 | + NULL, gen_helper_sve_##name##_h, \ | ||
58 | gen_helper_sve_##name##_s, \ | ||
59 | gen_helper_sve_##name##_d, \ | ||
60 | }; \ | ||
61 | - if (a->esz == 0) { \ | ||
62 | - return false; \ | ||
63 | - } \ | ||
64 | - if (sve_access_check(s)) { \ | ||
65 | - do_reduce(s, a, fns[a->esz - 1]); \ | ||
66 | - } \ | ||
67 | - return true; \ | ||
68 | + return do_reduce(s, a, fns[a->esz]); \ | ||
69 | } | ||
70 | |||
71 | DO_VPZ(FADDV, faddv) | ||
53 | -- | 72 | -- |
54 | 2.25.1 | 73 | 2.25.1 |
55 | |||
56 | diff view generated by jsdifflib |
1 | From: Joel Stanley <joel@jms.id.au> | 1 | From: Richard Henderson <richard.henderson@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | A common use case for the ASPEED machine is to boot a Linux kernel. | 3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
4 | Provide a full example command line. | 4 | Message-id: 20220527181907.189259-91-richard.henderson@linaro.org |
5 | 5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | |
6 | Reviewed-by: Cédric Le Goater <clg@kaod.org> | ||
7 | Signed-off-by: Joel Stanley <joel@jms.id.au> | ||
8 | Message-id: 20211117065752.330632-4-joel@jms.id.au | ||
9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
10 | --- | 7 | --- |
11 | docs/system/arm/aspeed.rst | 15 ++++++++++++--- | 8 | target/arm/translate-sve.c | 14 ++++++-------- |
12 | 1 file changed, 12 insertions(+), 3 deletions(-) | 9 | 1 file changed, 6 insertions(+), 8 deletions(-) |
13 | 10 | ||
14 | diff --git a/docs/system/arm/aspeed.rst b/docs/system/arm/aspeed.rst | 11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c |
15 | index XXXXXXX..XXXXXXX 100644 | 12 | index XXXXXXX..XXXXXXX 100644 |
16 | --- a/docs/system/arm/aspeed.rst | 13 | --- a/target/arm/translate-sve.c |
17 | +++ b/docs/system/arm/aspeed.rst | 14 | +++ b/target/arm/translate-sve.c |
18 | @@ -XXX,XX +XXX,XX @@ Missing devices | 15 | @@ -XXX,XX +XXX,XX @@ static bool do_reduce(DisasContext *s, arg_rpr_esz *a, |
19 | Boot options | 16 | } |
20 | ------------ | 17 | |
21 | 18 | #define DO_VPZ(NAME, name) \ | |
22 | -The Aspeed machines can be started using the ``-kernel`` option to | 19 | -static bool trans_##NAME(DisasContext *s, arg_rpr_esz *a) \ |
23 | -load a Linux kernel or from a firmware. Images can be downloaded from | 20 | -{ \ |
24 | -the OpenBMC jenkins : | 21 | - static gen_helper_fp_reduce * const fns[4] = { \ |
25 | +The Aspeed machines can be started using the ``-kernel`` and ``-dtb`` options | 22 | - NULL, gen_helper_sve_##name##_h, \ |
26 | +to load a Linux kernel or from a firmware. Images can be downloaded from the | 23 | - gen_helper_sve_##name##_s, \ |
27 | +OpenBMC jenkins : | 24 | - gen_helper_sve_##name##_d, \ |
28 | 25 | + static gen_helper_fp_reduce * const name##_fns[4] = { \ | |
29 | https://jenkins.openbmc.org/job/ci-openbmc/lastSuccessfulBuild/ | 26 | + NULL, gen_helper_sve_##name##_h, \ |
30 | 27 | + gen_helper_sve_##name##_s, gen_helper_sve_##name##_d, \ | |
31 | @@ -XXX,XX +XXX,XX @@ or directly from the OpenBMC GitHub release repository : | 28 | }; \ |
32 | 29 | - return do_reduce(s, a, fns[a->esz]); \ | |
33 | https://github.com/openbmc/openbmc/releases | 30 | -} |
34 | 31 | + TRANS_FEAT(NAME, aa64_sve, do_reduce, a, name##_fns[a->esz]) | |
35 | +To boot a kernel directly from a Linux build tree: | 32 | |
33 | DO_VPZ(FADDV, faddv) | ||
34 | DO_VPZ(FMINNMV, fminnmv) | ||
35 | @@ -XXX,XX +XXX,XX @@ DO_VPZ(FMAXNMV, fmaxnmv) | ||
36 | DO_VPZ(FMINV, fminv) | ||
37 | DO_VPZ(FMAXV, fmaxv) | ||
38 | |||
39 | +#undef DO_VPZ | ||
36 | + | 40 | + |
37 | +.. code-block:: bash | 41 | /* |
38 | + | 42 | *** SVE Floating Point Unary Operations - Unpredicated Group |
39 | + $ qemu-system-arm -M ast2600-evb -nographic \ | 43 | */ |
40 | + -kernel arch/arm/boot/zImage \ | ||
41 | + -dtb arch/arm/boot/dts/aspeed-ast2600-evb.dtb \ | ||
42 | + -initrd rootfs.cpio | ||
43 | + | ||
44 | The image should be attached as an MTD drive. Run : | ||
45 | |||
46 | .. code-block:: bash | ||
47 | -- | 44 | -- |
48 | 2.25.1 | 45 | 2.25.1 |
49 | |||
50 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Richard Henderson <richard.henderson@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | For A64, any input to an indirect branch can cause this. | 3 | Rename do_zz_fp to gen_gvec_fpst_arg_zz, and move up. |
4 | 4 | Split out gen_gvec_fpst_zz as a helper while we're at it. | |
5 | For A32, many indirect branch paths force the branch to be aligned, | ||
6 | but BXWritePC does not. This includes the BX instruction but also | ||
7 | other interworking changes to PC. Prior to v8, this case is UNDEFINED. | ||
8 | With v8, this is CONSTRAINED UNPREDICTABLE and may either raise an | ||
9 | exception or force align the PC. | ||
10 | |||
11 | We choose to raise an exception because we have the infrastructure, | ||
12 | it makes the generated code for gen_bx simpler, and it has the | ||
13 | possibility of catching more guest bugs. | ||
14 | 5 | ||
15 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
7 | Message-id: 20220527181907.189259-92-richard.henderson@linaro.org | ||
16 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 8 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> |
17 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
18 | --- | 10 | --- |
19 | target/arm/helper.h | 1 + | 11 | target/arm/translate-sve.c | 77 ++++++++++++++++++-------------------- |
20 | target/arm/syndrome.h | 5 ++++ | 12 | 1 file changed, 36 insertions(+), 41 deletions(-) |
21 | linux-user/aarch64/cpu_loop.c | 46 ++++++++++++++++++++--------------- | ||
22 | target/arm/tlb_helper.c | 18 ++++++++++++++ | ||
23 | target/arm/translate-a64.c | 15 ++++++++++++ | ||
24 | target/arm/translate.c | 22 ++++++++++++++++- | ||
25 | 6 files changed, 87 insertions(+), 20 deletions(-) | ||
26 | 13 | ||
27 | diff --git a/target/arm/helper.h b/target/arm/helper.h | 14 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c |
28 | index XXXXXXX..XXXXXXX 100644 | 15 | index XXXXXXX..XXXXXXX 100644 |
29 | --- a/target/arm/helper.h | 16 | --- a/target/arm/translate-sve.c |
30 | +++ b/target/arm/helper.h | 17 | +++ b/target/arm/translate-sve.c |
31 | @@ -XXX,XX +XXX,XX @@ DEF_HELPER_FLAGS_3(sel_flags, TCG_CALL_NO_RWG_SE, | 18 | @@ -XXX,XX +XXX,XX @@ static bool gen_gvec_ool_zz(DisasContext *s, gen_helper_gvec_2 *fn, |
32 | DEF_HELPER_2(exception_internal, void, env, i32) | 19 | return true; |
33 | DEF_HELPER_4(exception_with_syndrome, void, env, i32, i32, i32) | ||
34 | DEF_HELPER_2(exception_bkpt_insn, void, env, i32) | ||
35 | +DEF_HELPER_2(exception_pc_alignment, noreturn, env, tl) | ||
36 | DEF_HELPER_1(setend, void, env) | ||
37 | DEF_HELPER_2(wfi, void, env, i32) | ||
38 | DEF_HELPER_1(wfe, void, env) | ||
39 | diff --git a/target/arm/syndrome.h b/target/arm/syndrome.h | ||
40 | index XXXXXXX..XXXXXXX 100644 | ||
41 | --- a/target/arm/syndrome.h | ||
42 | +++ b/target/arm/syndrome.h | ||
43 | @@ -XXX,XX +XXX,XX @@ static inline uint32_t syn_illegalstate(void) | ||
44 | return (EC_ILLEGALSTATE << ARM_EL_EC_SHIFT) | ARM_EL_IL; | ||
45 | } | 20 | } |
46 | 21 | ||
47 | +static inline uint32_t syn_pcalignment(void) | 22 | +static bool gen_gvec_fpst_zz(DisasContext *s, gen_helper_gvec_2_ptr *fn, |
23 | + int rd, int rn, int data, | ||
24 | + ARMFPStatusFlavour flavour) | ||
48 | +{ | 25 | +{ |
49 | + return (EC_PCALIGNMENT << ARM_EL_EC_SHIFT) | ARM_EL_IL; | 26 | + if (fn == NULL) { |
27 | + return false; | ||
28 | + } | ||
29 | + if (sve_access_check(s)) { | ||
30 | + unsigned vsz = vec_full_reg_size(s); | ||
31 | + TCGv_ptr status = fpstatus_ptr(flavour); | ||
32 | + | ||
33 | + tcg_gen_gvec_2_ptr(vec_full_reg_offset(s, rd), | ||
34 | + vec_full_reg_offset(s, rn), | ||
35 | + status, vsz, vsz, data, fn); | ||
36 | + tcg_temp_free_ptr(status); | ||
37 | + } | ||
38 | + return true; | ||
50 | +} | 39 | +} |
51 | + | 40 | + |
52 | #endif /* TARGET_ARM_SYNDROME_H */ | 41 | +static bool gen_gvec_fpst_arg_zz(DisasContext *s, gen_helper_gvec_2_ptr *fn, |
53 | diff --git a/linux-user/aarch64/cpu_loop.c b/linux-user/aarch64/cpu_loop.c | 42 | + arg_rr_esz *a, int data) |
54 | index XXXXXXX..XXXXXXX 100644 | ||
55 | --- a/linux-user/aarch64/cpu_loop.c | ||
56 | +++ b/linux-user/aarch64/cpu_loop.c | ||
57 | @@ -XXX,XX +XXX,XX @@ void cpu_loop(CPUARMState *env) | ||
58 | break; | ||
59 | case EXCP_PREFETCH_ABORT: | ||
60 | case EXCP_DATA_ABORT: | ||
61 | - /* We should only arrive here with EC in {DATAABORT, INSNABORT}. */ | ||
62 | ec = syn_get_ec(env->exception.syndrome); | ||
63 | - assert(ec == EC_DATAABORT || ec == EC_INSNABORT); | ||
64 | - | ||
65 | - /* Both EC have the same format for FSC, or close enough. */ | ||
66 | - fsc = extract32(env->exception.syndrome, 0, 6); | ||
67 | - switch (fsc) { | ||
68 | - case 0x04 ... 0x07: /* Translation fault, level {0-3} */ | ||
69 | - si_signo = TARGET_SIGSEGV; | ||
70 | - si_code = TARGET_SEGV_MAPERR; | ||
71 | + switch (ec) { | ||
72 | + case EC_DATAABORT: | ||
73 | + case EC_INSNABORT: | ||
74 | + /* Both EC have the same format for FSC, or close enough. */ | ||
75 | + fsc = extract32(env->exception.syndrome, 0, 6); | ||
76 | + switch (fsc) { | ||
77 | + case 0x04 ... 0x07: /* Translation fault, level {0-3} */ | ||
78 | + si_signo = TARGET_SIGSEGV; | ||
79 | + si_code = TARGET_SEGV_MAPERR; | ||
80 | + break; | ||
81 | + case 0x09 ... 0x0b: /* Access flag fault, level {1-3} */ | ||
82 | + case 0x0d ... 0x0f: /* Permission fault, level {1-3} */ | ||
83 | + si_signo = TARGET_SIGSEGV; | ||
84 | + si_code = TARGET_SEGV_ACCERR; | ||
85 | + break; | ||
86 | + case 0x11: /* Synchronous Tag Check Fault */ | ||
87 | + si_signo = TARGET_SIGSEGV; | ||
88 | + si_code = TARGET_SEGV_MTESERR; | ||
89 | + break; | ||
90 | + case 0x21: /* Alignment fault */ | ||
91 | + si_signo = TARGET_SIGBUS; | ||
92 | + si_code = TARGET_BUS_ADRALN; | ||
93 | + break; | ||
94 | + default: | ||
95 | + g_assert_not_reached(); | ||
96 | + } | ||
97 | break; | ||
98 | - case 0x09 ... 0x0b: /* Access flag fault, level {1-3} */ | ||
99 | - case 0x0d ... 0x0f: /* Permission fault, level {1-3} */ | ||
100 | - si_signo = TARGET_SIGSEGV; | ||
101 | - si_code = TARGET_SEGV_ACCERR; | ||
102 | - break; | ||
103 | - case 0x11: /* Synchronous Tag Check Fault */ | ||
104 | - si_signo = TARGET_SIGSEGV; | ||
105 | - si_code = TARGET_SEGV_MTESERR; | ||
106 | - break; | ||
107 | - case 0x21: /* Alignment fault */ | ||
108 | + case EC_PCALIGNMENT: | ||
109 | si_signo = TARGET_SIGBUS; | ||
110 | si_code = TARGET_BUS_ADRALN; | ||
111 | break; | ||
112 | diff --git a/target/arm/tlb_helper.c b/target/arm/tlb_helper.c | ||
113 | index XXXXXXX..XXXXXXX 100644 | ||
114 | --- a/target/arm/tlb_helper.c | ||
115 | +++ b/target/arm/tlb_helper.c | ||
116 | @@ -XXX,XX +XXX,XX @@ | ||
117 | #include "cpu.h" | ||
118 | #include "internals.h" | ||
119 | #include "exec/exec-all.h" | ||
120 | +#include "exec/helper-proto.h" | ||
121 | |||
122 | static inline uint32_t merge_syn_data_abort(uint32_t template_syn, | ||
123 | unsigned int target_el, | ||
124 | @@ -XXX,XX +XXX,XX @@ void arm_cpu_do_unaligned_access(CPUState *cs, vaddr vaddr, | ||
125 | arm_deliver_fault(cpu, vaddr, access_type, mmu_idx, &fi); | ||
126 | } | ||
127 | |||
128 | +void helper_exception_pc_alignment(CPUARMState *env, target_ulong pc) | ||
129 | +{ | 43 | +{ |
130 | + ARMMMUFaultInfo fi = { .type = ARMFault_Alignment }; | 44 | + return gen_gvec_fpst_zz(s, fn, a->rd, a->rn, data, |
131 | + int target_el = exception_target_el(env); | 45 | + a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); |
132 | + int mmu_idx = cpu_mmu_index(env, true); | ||
133 | + uint32_t fsc; | ||
134 | + | ||
135 | + env->exception.vaddress = pc; | ||
136 | + | ||
137 | + /* | ||
138 | + * Note that the fsc is not applicable to this exception, | ||
139 | + * since any syndrome is pcalignment not insn_abort. | ||
140 | + */ | ||
141 | + env->exception.fsr = compute_fsr_fsc(env, &fi, target_el, mmu_idx, &fsc); | ||
142 | + raise_exception(env, EXCP_PREFETCH_ABORT, syn_pcalignment(), target_el); | ||
143 | +} | 46 | +} |
144 | + | 47 | + |
145 | #if !defined(CONFIG_USER_ONLY) | 48 | /* Invoke an out-of-line helper on 3 Zregs. */ |
49 | static bool gen_gvec_ool_zzz(DisasContext *s, gen_helper_gvec_3 *fn, | ||
50 | int rd, int rn, int rm, int data) | ||
51 | @@ -XXX,XX +XXX,XX @@ DO_VPZ(FMAXV, fmaxv) | ||
52 | *** SVE Floating Point Unary Operations - Unpredicated Group | ||
53 | */ | ||
54 | |||
55 | -static void do_zz_fp(DisasContext *s, arg_rr_esz *a, gen_helper_gvec_2_ptr *fn) | ||
56 | -{ | ||
57 | - unsigned vsz = vec_full_reg_size(s); | ||
58 | - TCGv_ptr status = fpstatus_ptr(a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); | ||
59 | +static gen_helper_gvec_2_ptr * const frecpe_fns[] = { | ||
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) | ||
146 | 107 | ||
147 | /* | 108 | /* |
148 | diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c | 109 | *** SVE Floating Point Compare with Zero Group |
149 | index XXXXXXX..XXXXXXX 100644 | ||
150 | --- a/target/arm/translate-a64.c | ||
151 | +++ b/target/arm/translate-a64.c | ||
152 | @@ -XXX,XX +XXX,XX @@ static void aarch64_tr_translate_insn(DisasContextBase *dcbase, CPUState *cpu) | ||
153 | uint64_t pc = s->base.pc_next; | ||
154 | uint32_t insn; | ||
155 | |||
156 | + /* Singlestep exceptions have the highest priority. */ | ||
157 | if (s->ss_active && !s->pstate_ss) { | ||
158 | /* Singlestep state is Active-pending. | ||
159 | * If we're in this state at the start of a TB then either | ||
160 | @@ -XXX,XX +XXX,XX @@ static void aarch64_tr_translate_insn(DisasContextBase *dcbase, CPUState *cpu) | ||
161 | return; | ||
162 | } | ||
163 | |||
164 | + if (pc & 3) { | ||
165 | + /* | ||
166 | + * PC alignment fault. This has priority over the instruction abort | ||
167 | + * that we would receive from a translation fault via arm_ldl_code. | ||
168 | + * This should only be possible after an indirect branch, at the | ||
169 | + * start of the TB. | ||
170 | + */ | ||
171 | + assert(s->base.num_insns == 1); | ||
172 | + gen_helper_exception_pc_alignment(cpu_env, tcg_constant_tl(pc)); | ||
173 | + s->base.is_jmp = DISAS_NORETURN; | ||
174 | + s->base.pc_next = QEMU_ALIGN_UP(pc, 4); | ||
175 | + return; | ||
176 | + } | ||
177 | + | ||
178 | s->pc_curr = pc; | ||
179 | insn = arm_ldl_code(env, &s->base, pc, s->sctlr_b); | ||
180 | s->insn = insn; | ||
181 | diff --git a/target/arm/translate.c b/target/arm/translate.c | ||
182 | index XXXXXXX..XXXXXXX 100644 | ||
183 | --- a/target/arm/translate.c | ||
184 | +++ b/target/arm/translate.c | ||
185 | @@ -XXX,XX +XXX,XX @@ static void arm_tr_translate_insn(DisasContextBase *dcbase, CPUState *cpu) | ||
186 | uint32_t pc = dc->base.pc_next; | ||
187 | unsigned int insn; | ||
188 | |||
189 | - if (arm_check_ss_active(dc) || arm_check_kernelpage(dc)) { | ||
190 | + /* Singlestep exceptions have the highest priority. */ | ||
191 | + if (arm_check_ss_active(dc)) { | ||
192 | + dc->base.pc_next = pc + 4; | ||
193 | + return; | ||
194 | + } | ||
195 | + | ||
196 | + if (pc & 3) { | ||
197 | + /* | ||
198 | + * PC alignment fault. This has priority over the instruction abort | ||
199 | + * that we would receive from a translation fault via arm_ldl_code | ||
200 | + * (or the execution of the kernelpage entrypoint). This should only | ||
201 | + * be possible after an indirect branch, at the start of the TB. | ||
202 | + */ | ||
203 | + assert(dc->base.num_insns == 1); | ||
204 | + gen_helper_exception_pc_alignment(cpu_env, tcg_constant_tl(pc)); | ||
205 | + dc->base.is_jmp = DISAS_NORETURN; | ||
206 | + dc->base.pc_next = QEMU_ALIGN_UP(pc, 4); | ||
207 | + return; | ||
208 | + } | ||
209 | + | ||
210 | + if (arm_check_kernelpage(dc)) { | ||
211 | dc->base.pc_next = pc + 4; | ||
212 | return; | ||
213 | } | ||
214 | -- | 110 | -- |
215 | 2.25.1 | 111 | 2.25.1 |
216 | |||
217 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Richard Henderson <richard.henderson@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | Create arm_check_ss_active and arm_check_kernelpage. | 3 | Simplify indexing of this array. This will allow folding |
4 | 4 | of the illegal esz == 0 into the normal fn == NULL check. | |
5 | Reverse the order of the tests. While it doesn't matter in practice, | ||
6 | because only user-only has a kernel page and user-only never sets | ||
7 | ss_active, ss_active has priority over execution exceptions and it | ||
8 | is best to keep them in the proper order. | ||
9 | 5 | ||
10 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
7 | Message-id: 20220527181907.189259-93-richard.henderson@linaro.org | ||
11 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 8 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> |
12 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
13 | --- | 10 | --- |
14 | target/arm/translate.c | 10 +++++++--- | 11 | target/arm/translate-sve.c | 15 ++++++++------- |
15 | 1 file changed, 7 insertions(+), 3 deletions(-) | 12 | 1 file changed, 8 insertions(+), 7 deletions(-) |
16 | 13 | ||
17 | diff --git a/target/arm/translate.c b/target/arm/translate.c | 14 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c |
18 | index XXXXXXX..XXXXXXX 100644 | 15 | index XXXXXXX..XXXXXXX 100644 |
19 | --- a/target/arm/translate.c | 16 | --- a/target/arm/translate-sve.c |
20 | +++ b/target/arm/translate.c | 17 | +++ b/target/arm/translate-sve.c |
21 | @@ -XXX,XX +XXX,XX @@ static void arm_tr_insn_start(DisasContextBase *dcbase, CPUState *cpu) | 18 | @@ -XXX,XX +XXX,XX @@ static bool trans_FCVTZU_dd(DisasContext *s, arg_rpr_esz *a) |
22 | dc->insn_start = tcg_last_op(); | 19 | return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve_fcvtzu_dd); |
23 | } | 20 | } |
24 | 21 | ||
25 | -static bool arm_pre_translate_insn(DisasContext *dc) | 22 | -static gen_helper_gvec_3_ptr * const frint_fns[3] = { |
26 | +static bool arm_check_kernelpage(DisasContext *dc) | 23 | +static gen_helper_gvec_3_ptr * const frint_fns[] = { |
27 | { | 24 | + NULL, |
28 | #ifdef CONFIG_USER_ONLY | 25 | gen_helper_sve_frint_h, |
29 | /* Intercept jump to the magic kernel page. */ | 26 | gen_helper_sve_frint_s, |
30 | @@ -XXX,XX +XXX,XX @@ static bool arm_pre_translate_insn(DisasContext *dc) | 27 | gen_helper_sve_frint_d |
31 | return true; | 28 | @@ -XXX,XX +XXX,XX @@ static bool trans_FRINTI(DisasContext *s, arg_rpr_esz *a) |
29 | return false; | ||
32 | } | 30 | } |
33 | #endif | 31 | return do_zpz_ptr(s, a->rd, a->rn, a->pg, a->esz == MO_16, |
34 | + return false; | 32 | - frint_fns[a->esz - 1]); |
35 | +} | 33 | + frint_fns[a->esz]); |
36 | 34 | } | |
37 | +static bool arm_check_ss_active(DisasContext *dc) | 35 | |
38 | +{ | 36 | static bool trans_FRINTX(DisasContext *s, arg_rpr_esz *a) |
39 | if (dc->ss_active && !dc->pstate_ss) { | 37 | @@ -XXX,XX +XXX,XX @@ static bool trans_FRINTN(DisasContext *s, arg_rpr_esz *a) |
40 | /* Singlestep state is Active-pending. | 38 | if (a->esz == 0) { |
41 | * If we're in this state at the start of a TB then either | 39 | return false; |
42 | @@ -XXX,XX +XXX,XX @@ static void arm_tr_translate_insn(DisasContextBase *dcbase, CPUState *cpu) | ||
43 | uint32_t pc = dc->base.pc_next; | ||
44 | unsigned int insn; | ||
45 | |||
46 | - if (arm_pre_translate_insn(dc)) { | ||
47 | + if (arm_check_ss_active(dc) || arm_check_kernelpage(dc)) { | ||
48 | dc->base.pc_next = pc + 4; | ||
49 | return; | ||
50 | } | 40 | } |
51 | @@ -XXX,XX +XXX,XX @@ static void thumb_tr_translate_insn(DisasContextBase *dcbase, CPUState *cpu) | 41 | - return do_frint_mode(s, a, float_round_nearest_even, frint_fns[a->esz - 1]); |
52 | uint32_t insn; | 42 | + return do_frint_mode(s, a, float_round_nearest_even, frint_fns[a->esz]); |
53 | bool is_16bit; | 43 | } |
54 | 44 | ||
55 | - if (arm_pre_translate_insn(dc)) { | 45 | static bool trans_FRINTP(DisasContext *s, arg_rpr_esz *a) |
56 | + if (arm_check_ss_active(dc) || arm_check_kernelpage(dc)) { | 46 | @@ -XXX,XX +XXX,XX @@ static bool trans_FRINTP(DisasContext *s, arg_rpr_esz *a) |
57 | dc->base.pc_next = pc + 2; | 47 | if (a->esz == 0) { |
58 | return; | 48 | return false; |
59 | } | 49 | } |
50 | - return do_frint_mode(s, a, float_round_up, frint_fns[a->esz - 1]); | ||
51 | + return do_frint_mode(s, a, float_round_up, frint_fns[a->esz]); | ||
52 | } | ||
53 | |||
54 | static bool trans_FRINTM(DisasContext *s, arg_rpr_esz *a) | ||
55 | @@ -XXX,XX +XXX,XX @@ static bool trans_FRINTM(DisasContext *s, arg_rpr_esz *a) | ||
56 | if (a->esz == 0) { | ||
57 | return false; | ||
58 | } | ||
59 | - return do_frint_mode(s, a, float_round_down, frint_fns[a->esz - 1]); | ||
60 | + return do_frint_mode(s, a, float_round_down, frint_fns[a->esz]); | ||
61 | } | ||
62 | |||
63 | static bool trans_FRINTZ(DisasContext *s, arg_rpr_esz *a) | ||
64 | @@ -XXX,XX +XXX,XX @@ static bool trans_FRINTZ(DisasContext *s, arg_rpr_esz *a) | ||
65 | if (a->esz == 0) { | ||
66 | return false; | ||
67 | } | ||
68 | - return do_frint_mode(s, a, float_round_to_zero, frint_fns[a->esz - 1]); | ||
69 | + return do_frint_mode(s, a, float_round_to_zero, frint_fns[a->esz]); | ||
70 | } | ||
71 | |||
72 | static bool trans_FRINTA(DisasContext *s, arg_rpr_esz *a) | ||
73 | @@ -XXX,XX +XXX,XX @@ static bool trans_FRINTA(DisasContext *s, arg_rpr_esz *a) | ||
74 | if (a->esz == 0) { | ||
75 | return false; | ||
76 | } | ||
77 | - return do_frint_mode(s, a, float_round_ties_away, frint_fns[a->esz - 1]); | ||
78 | + return do_frint_mode(s, a, float_round_ties_away, frint_fns[a->esz]); | ||
79 | } | ||
80 | |||
81 | static bool trans_FRECPX(DisasContext *s, arg_rpr_esz *a) | ||
60 | -- | 82 | -- |
61 | 2.25.1 | 83 | 2.25.1 |
62 | |||
63 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Richard Henderson <richard.henderson@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | We will reuse this section of arm_deliver_fault for | 3 | Rename the function to match other expansion function and |
4 | raising pc alignment faults. | 4 | move to be adjacent. Split out gen_gvec_fpst_zzp as a |
5 | helper while we're at it. | ||
5 | 6 | ||
6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 7 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
8 | Message-id: 20220527181907.189259-94-richard.henderson@linaro.org | ||
7 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 9 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> |
8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
9 | --- | 11 | --- |
10 | target/arm/tlb_helper.c | 45 +++++++++++++++++++++++++---------------- | 12 | target/arm/translate-sve.c | 392 ++++++++++++------------------------- |
11 | 1 file changed, 28 insertions(+), 17 deletions(-) | 13 | 1 file changed, 129 insertions(+), 263 deletions(-) |
12 | 14 | ||
13 | diff --git a/target/arm/tlb_helper.c b/target/arm/tlb_helper.c | 15 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c |
14 | index XXXXXXX..XXXXXXX 100644 | 16 | index XXXXXXX..XXXXXXX 100644 |
15 | --- a/target/arm/tlb_helper.c | 17 | --- a/target/arm/translate-sve.c |
16 | +++ b/target/arm/tlb_helper.c | 18 | +++ b/target/arm/translate-sve.c |
17 | @@ -XXX,XX +XXX,XX @@ static inline uint32_t merge_syn_data_abort(uint32_t template_syn, | 19 | @@ -XXX,XX +XXX,XX @@ static bool gen_gvec_ool_arg_zpzi(DisasContext *s, gen_helper_gvec_3 *fn, |
18 | return syn; | 20 | return gen_gvec_ool_zzp(s, fn, a->rd, a->rn, a->pg, a->imm); |
19 | } | 21 | } |
20 | 22 | ||
21 | -static void QEMU_NORETURN arm_deliver_fault(ARMCPU *cpu, vaddr addr, | 23 | +static bool gen_gvec_fpst_zzp(DisasContext *s, gen_helper_gvec_3_ptr *fn, |
22 | - MMUAccessType access_type, | 24 | + int rd, int rn, int pg, int data, |
23 | - int mmu_idx, ARMMMUFaultInfo *fi) | 25 | + ARMFPStatusFlavour flavour) |
24 | +static uint32_t compute_fsr_fsc(CPUARMState *env, ARMMMUFaultInfo *fi, | 26 | +{ |
25 | + int target_el, int mmu_idx, uint32_t *ret_fsc) | 27 | + if (fn == NULL) { |
26 | { | 28 | + return false; |
27 | - CPUARMState *env = &cpu->env; | 29 | + } |
28 | - int target_el; | 30 | + if (sve_access_check(s)) { |
29 | - bool same_el; | 31 | + unsigned vsz = vec_full_reg_size(s); |
30 | - uint32_t syn, exc, fsr, fsc; | 32 | + TCGv_ptr status = fpstatus_ptr(flavour); |
31 | ARMMMUIdx arm_mmu_idx = core_to_arm_mmu_idx(env, mmu_idx); | 33 | + |
32 | - | 34 | + tcg_gen_gvec_3_ptr(vec_full_reg_offset(s, rd), |
33 | - target_el = exception_target_el(env); | 35 | + vec_full_reg_offset(s, rn), |
34 | - if (fi->stage2) { | 36 | + pred_full_reg_offset(s, pg), |
35 | - target_el = 2; | 37 | + status, vsz, vsz, data, fn); |
36 | - env->cp15.hpfar_el2 = extract64(fi->s2addr, 12, 47) << 4; | 38 | + tcg_temp_free_ptr(status); |
37 | - if (arm_is_secure_below_el3(env) && fi->s1ns) { | 39 | + } |
38 | - env->cp15.hpfar_el2 |= HPFAR_NS; | 40 | + return true; |
39 | - } | ||
40 | - } | ||
41 | - same_el = (arm_current_el(env) == target_el); | ||
42 | + uint32_t fsr, fsc; | ||
43 | |||
44 | if (target_el == 2 || arm_el_is_aa64(env, target_el) || | ||
45 | arm_s1_regime_using_lpae_format(env, arm_mmu_idx)) { | ||
46 | @@ -XXX,XX +XXX,XX @@ static void QEMU_NORETURN arm_deliver_fault(ARMCPU *cpu, vaddr addr, | ||
47 | fsc = 0x3f; | ||
48 | } | ||
49 | |||
50 | + *ret_fsc = fsc; | ||
51 | + return fsr; | ||
52 | +} | 41 | +} |
53 | + | 42 | + |
54 | +static void QEMU_NORETURN arm_deliver_fault(ARMCPU *cpu, vaddr addr, | 43 | +static bool gen_gvec_fpst_arg_zpz(DisasContext *s, gen_helper_gvec_3_ptr *fn, |
55 | + MMUAccessType access_type, | 44 | + arg_rpr_esz *a, int data, |
56 | + int mmu_idx, ARMMMUFaultInfo *fi) | 45 | + ARMFPStatusFlavour flavour) |
57 | +{ | 46 | +{ |
58 | + CPUARMState *env = &cpu->env; | 47 | + return gen_gvec_fpst_zzp(s, fn, a->rd, a->rn, a->pg, data, flavour); |
59 | + int target_el; | 48 | +} |
60 | + bool same_el; | ||
61 | + uint32_t syn, exc, fsr, fsc; | ||
62 | + | 49 | + |
63 | + target_el = exception_target_el(env); | 50 | /* Invoke an out-of-line helper on 3 Zregs and a predicate. */ |
64 | + if (fi->stage2) { | 51 | static bool gen_gvec_ool_zzzp(DisasContext *s, gen_helper_gvec_4 *fn, |
65 | + target_el = 2; | 52 | int rd, int rn, int rm, int pg, int data) |
66 | + env->cp15.hpfar_el2 = extract64(fi->s2addr, 12, 47) << 4; | 53 | @@ -XXX,XX +XXX,XX @@ static bool trans_FCMLA_zzxz(DisasContext *s, arg_FCMLA_zzxz *a) |
67 | + if (arm_is_secure_below_el3(env) && fi->s1ns) { | 54 | *** SVE Floating Point Unary Operations Predicated Group |
68 | + env->cp15.hpfar_el2 |= HPFAR_NS; | 55 | */ |
69 | + } | 56 | |
70 | + } | 57 | -static bool do_zpz_ptr(DisasContext *s, int rd, int rn, int pg, |
71 | + same_el = (arm_current_el(env) == target_el); | 58 | - bool is_fp16, gen_helper_gvec_3_ptr *fn) |
72 | + | 59 | -{ |
73 | + fsr = compute_fsr_fsc(env, fi, target_el, mmu_idx, &fsc); | 60 | - if (sve_access_check(s)) { |
74 | + | 61 | - unsigned vsz = vec_full_reg_size(s); |
75 | if (access_type == MMU_INST_FETCH) { | 62 | - TCGv_ptr status = fpstatus_ptr(is_fp16 ? FPST_FPCR_F16 : FPST_FPCR); |
76 | syn = syn_insn_abort(same_el, fi->ea, fi->s1ptw, fsc); | 63 | - tcg_gen_gvec_3_ptr(vec_full_reg_offset(s, rd), |
77 | exc = EXCP_PREFETCH_ABORT; | 64 | - vec_full_reg_offset(s, rn), |
65 | - pred_full_reg_offset(s, pg), | ||
66 | - status, vsz, vsz, 0, fn); | ||
67 | - tcg_temp_free_ptr(status); | ||
68 | - } | ||
69 | - return true; | ||
70 | -} | ||
71 | +TRANS_FEAT(FCVT_sh, aa64_sve, gen_gvec_fpst_arg_zpz, | ||
72 | + gen_helper_sve_fcvt_sh, a, 0, FPST_FPCR) | ||
73 | +TRANS_FEAT(FCVT_hs, aa64_sve, gen_gvec_fpst_arg_zpz, | ||
74 | + gen_helper_sve_fcvt_hs, a, 0, FPST_FPCR) | ||
75 | |||
76 | -static bool trans_FCVT_sh(DisasContext *s, arg_rpr_esz *a) | ||
77 | -{ | ||
78 | - return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve_fcvt_sh); | ||
79 | -} | ||
80 | +TRANS_FEAT(BFCVT, aa64_sve_bf16, gen_gvec_fpst_arg_zpz, | ||
81 | + gen_helper_sve_bfcvt, a, 0, FPST_FPCR) | ||
82 | |||
83 | -static bool trans_FCVT_hs(DisasContext *s, arg_rpr_esz *a) | ||
84 | -{ | ||
85 | - return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve_fcvt_hs); | ||
86 | -} | ||
87 | +TRANS_FEAT(FCVT_dh, aa64_sve, gen_gvec_fpst_arg_zpz, | ||
88 | + gen_helper_sve_fcvt_dh, a, 0, FPST_FPCR) | ||
89 | +TRANS_FEAT(FCVT_hd, aa64_sve, gen_gvec_fpst_arg_zpz, | ||
90 | + gen_helper_sve_fcvt_hd, a, 0, FPST_FPCR) | ||
91 | +TRANS_FEAT(FCVT_ds, aa64_sve, gen_gvec_fpst_arg_zpz, | ||
92 | + gen_helper_sve_fcvt_ds, a, 0, FPST_FPCR) | ||
93 | +TRANS_FEAT(FCVT_sd, aa64_sve, gen_gvec_fpst_arg_zpz, | ||
94 | + gen_helper_sve_fcvt_sd, a, 0, FPST_FPCR) | ||
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 | { | ||
78 | -- | 461 | -- |
79 | 2.25.1 | 462 | 2.25.1 |
80 | |||
81 | diff view generated by jsdifflib |
1 | From: Joel Stanley <joel@jms.id.au> | 1 | From: Richard Henderson <richard.henderson@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | This is the latest URL for the OpenBMC CI. The old URL still works, but | 3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
4 | redirects. | 4 | Message-id: 20220527181907.189259-95-richard.henderson@linaro.org |
5 | 5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | |
6 | Reviewed-by: Cédric Le Goater <clg@kaod.org> | ||
7 | Signed-off-by: Joel Stanley <joel@jms.id.au> | ||
8 | Message-id: 20211117065752.330632-3-joel@jms.id.au | ||
9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
10 | --- | 7 | --- |
11 | docs/system/arm/aspeed.rst | 2 +- | 8 | target/arm/translate-sve.c | 52 +++++++++++++++++--------------------- |
12 | 1 file changed, 1 insertion(+), 1 deletion(-) | 9 | 1 file changed, 23 insertions(+), 29 deletions(-) |
13 | 10 | ||
14 | diff --git a/docs/system/arm/aspeed.rst b/docs/system/arm/aspeed.rst | 11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c |
15 | index XXXXXXX..XXXXXXX 100644 | 12 | index XXXXXXX..XXXXXXX 100644 |
16 | --- a/docs/system/arm/aspeed.rst | 13 | --- a/target/arm/translate-sve.c |
17 | +++ b/docs/system/arm/aspeed.rst | 14 | +++ b/target/arm/translate-sve.c |
18 | @@ -XXX,XX +XXX,XX @@ The Aspeed machines can be started using the ``-kernel`` option to | 15 | @@ -XXX,XX +XXX,XX @@ TRANS_FEAT(FRINTX, aa64_sve, gen_gvec_fpst_arg_zpz, frintx_fns[a->esz], |
19 | load a Linux kernel or from a firmware. Images can be downloaded from | 16 | static bool do_frint_mode(DisasContext *s, arg_rpr_esz *a, |
20 | the OpenBMC jenkins : | 17 | int mode, gen_helper_gvec_3_ptr *fn) |
21 | 18 | { | |
22 | - https://jenkins.openbmc.org/job/ci-openbmc/lastSuccessfulBuild/distro=ubuntu,label=docker-builder | 19 | - if (sve_access_check(s)) { |
23 | + https://jenkins.openbmc.org/job/ci-openbmc/lastSuccessfulBuild/ | 20 | - unsigned vsz = vec_full_reg_size(s); |
24 | 21 | - TCGv_i32 tmode = tcg_const_i32(mode); | |
25 | or directly from the OpenBMC GitHub release repository : | 22 | - TCGv_ptr status = fpstatus_ptr(a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); |
23 | + unsigned vsz; | ||
24 | + TCGv_i32 tmode; | ||
25 | + TCGv_ptr status; | ||
26 | |||
27 | - gen_helper_set_rmode(tmode, tmode, status); | ||
28 | - | ||
29 | - tcg_gen_gvec_3_ptr(vec_full_reg_offset(s, a->rd), | ||
30 | - vec_full_reg_offset(s, a->rn), | ||
31 | - pred_full_reg_offset(s, a->pg), | ||
32 | - status, vsz, vsz, 0, fn); | ||
33 | - | ||
34 | - gen_helper_set_rmode(tmode, tmode, status); | ||
35 | - tcg_temp_free_i32(tmode); | ||
36 | - tcg_temp_free_ptr(status); | ||
37 | + if (fn == NULL) { | ||
38 | + return false; | ||
39 | } | ||
40 | + if (!sve_access_check(s)) { | ||
41 | + return true; | ||
42 | + } | ||
43 | + | ||
44 | + vsz = vec_full_reg_size(s); | ||
45 | + tmode = tcg_const_i32(mode); | ||
46 | + status = fpstatus_ptr(a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); | ||
47 | + | ||
48 | + gen_helper_set_rmode(tmode, tmode, status); | ||
49 | + | ||
50 | + tcg_gen_gvec_3_ptr(vec_full_reg_offset(s, a->rd), | ||
51 | + vec_full_reg_offset(s, a->rn), | ||
52 | + pred_full_reg_offset(s, a->pg), | ||
53 | + status, vsz, vsz, 0, fn); | ||
54 | + | ||
55 | + gen_helper_set_rmode(tmode, tmode, status); | ||
56 | + tcg_temp_free_i32(tmode); | ||
57 | + tcg_temp_free_ptr(status); | ||
58 | return true; | ||
59 | } | ||
60 | |||
61 | static bool trans_FRINTN(DisasContext *s, arg_rpr_esz *a) | ||
62 | { | ||
63 | - if (a->esz == 0) { | ||
64 | - return false; | ||
65 | - } | ||
66 | return do_frint_mode(s, a, float_round_nearest_even, frint_fns[a->esz]); | ||
67 | } | ||
68 | |||
69 | static bool trans_FRINTP(DisasContext *s, arg_rpr_esz *a) | ||
70 | { | ||
71 | - if (a->esz == 0) { | ||
72 | - return false; | ||
73 | - } | ||
74 | return do_frint_mode(s, a, float_round_up, frint_fns[a->esz]); | ||
75 | } | ||
76 | |||
77 | static bool trans_FRINTM(DisasContext *s, arg_rpr_esz *a) | ||
78 | { | ||
79 | - if (a->esz == 0) { | ||
80 | - return false; | ||
81 | - } | ||
82 | return do_frint_mode(s, a, float_round_down, frint_fns[a->esz]); | ||
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 | } | ||
26 | 100 | ||
27 | -- | 101 | -- |
28 | 2.25.1 | 102 | 2.25.1 |
29 | |||
30 | diff view generated by jsdifflib |
1 | From: Joel Stanley <joel@jms.id.au> | 1 | From: Richard Henderson <richard.henderson@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | Add X11, FP5280G2, G220A, Rainier and Fuji. Mention that Swift will be | 3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
4 | removed in v7.0. | 4 | Message-id: 20220527181907.189259-96-richard.henderson@linaro.org |
5 | 5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | |
6 | Signed-off-by: Joel Stanley <joel@jms.id.au> | ||
7 | Reviewed-by: Cédric Le Goater <clg@kaod.org> | ||
8 | Message-id: 20211117065752.330632-2-joel@jms.id.au | ||
9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
10 | --- | 7 | --- |
11 | docs/system/arm/aspeed.rst | 7 ++++++- | 8 | target/arm/translate-sve.c | 53 ++++++++++---------------------------- |
12 | 1 file changed, 6 insertions(+), 1 deletion(-) | 9 | 1 file changed, 14 insertions(+), 39 deletions(-) |
13 | 10 | ||
14 | diff --git a/docs/system/arm/aspeed.rst b/docs/system/arm/aspeed.rst | 11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c |
15 | index XXXXXXX..XXXXXXX 100644 | 12 | index XXXXXXX..XXXXXXX 100644 |
16 | --- a/docs/system/arm/aspeed.rst | 13 | --- a/target/arm/translate-sve.c |
17 | +++ b/docs/system/arm/aspeed.rst | 14 | +++ b/target/arm/translate-sve.c |
18 | @@ -XXX,XX +XXX,XX @@ AST2400 SoC based machines : | 15 | @@ -XXX,XX +XXX,XX @@ static bool do_frint_mode(DisasContext *s, arg_rpr_esz *a, |
19 | 16 | return true; | |
20 | - ``palmetto-bmc`` OpenPOWER Palmetto POWER8 BMC | 17 | } |
21 | - ``quanta-q71l-bmc`` OpenBMC Quanta BMC | 18 | |
22 | +- ``supermicrox11-bmc`` Supermicro X11 BMC | 19 | -static bool trans_FRINTN(DisasContext *s, arg_rpr_esz *a) |
23 | 20 | -{ | |
24 | AST2500 SoC based machines : | 21 | - return do_frint_mode(s, a, float_round_nearest_even, frint_fns[a->esz]); |
25 | 22 | -} | |
26 | @@ -XXX,XX +XXX,XX @@ AST2500 SoC based machines : | 23 | - |
27 | - ``romulus-bmc`` OpenPOWER Romulus POWER9 BMC | 24 | -static bool trans_FRINTP(DisasContext *s, arg_rpr_esz *a) |
28 | - ``witherspoon-bmc`` OpenPOWER Witherspoon POWER9 BMC | 25 | -{ |
29 | - ``sonorapass-bmc`` OCP SonoraPass BMC | 26 | - return do_frint_mode(s, a, float_round_up, frint_fns[a->esz]); |
30 | -- ``swift-bmc`` OpenPOWER Swift BMC POWER9 | 27 | -} |
31 | +- ``swift-bmc`` OpenPOWER Swift BMC POWER9 (to be removed in v7.0) | 28 | - |
32 | +- ``fp5280g2-bmc`` Inspur FP5280G2 BMC | 29 | -static bool trans_FRINTM(DisasContext *s, arg_rpr_esz *a) |
33 | +- ``g220a-bmc`` Bytedance G220A BMC | 30 | -{ |
34 | 31 | - return do_frint_mode(s, a, float_round_down, frint_fns[a->esz]); | |
35 | AST2600 SoC based machines : | 32 | -} |
36 | 33 | - | |
37 | - ``ast2600-evb`` Aspeed AST2600 Evaluation board (Cortex-A7) | 34 | -static bool trans_FRINTZ(DisasContext *s, arg_rpr_esz *a) |
38 | - ``tacoma-bmc`` OpenPOWER Witherspoon POWER9 AST2600 BMC | 35 | -{ |
39 | +- ``rainier-bmc`` IBM Rainier POWER10 BMC | 36 | - return do_frint_mode(s, a, float_round_to_zero, frint_fns[a->esz]); |
40 | +- ``fuji-bmc`` Facebook Fuji BMC | 37 | -} |
41 | 38 | - | |
42 | Supported devices | 39 | -static bool trans_FRINTA(DisasContext *s, arg_rpr_esz *a) |
43 | ----------------- | 40 | -{ |
41 | - return do_frint_mode(s, a, float_round_ties_away, frint_fns[a->esz]); | ||
42 | -} | ||
43 | +TRANS_FEAT(FRINTN, aa64_sve, do_frint_mode, a, | ||
44 | + float_round_nearest_even, frint_fns[a->esz]) | ||
45 | +TRANS_FEAT(FRINTP, aa64_sve, do_frint_mode, a, | ||
46 | + float_round_up, frint_fns[a->esz]) | ||
47 | +TRANS_FEAT(FRINTM, aa64_sve, do_frint_mode, a, | ||
48 | + float_round_down, frint_fns[a->esz]) | ||
49 | +TRANS_FEAT(FRINTZ, aa64_sve, do_frint_mode, a, | ||
50 | + float_round_to_zero, frint_fns[a->esz]) | ||
51 | +TRANS_FEAT(FRINTA, aa64_sve, do_frint_mode, a, | ||
52 | + float_round_ties_away, frint_fns[a->esz]) | ||
53 | |||
54 | static gen_helper_gvec_3_ptr * const frecpx_fns[] = { | ||
55 | NULL, gen_helper_sve_frecpx_h, | ||
56 | @@ -XXX,XX +XXX,XX @@ TRANS_FEAT(FCVTLT_hs, aa64_sve2, gen_gvec_fpst_arg_zpz, | ||
57 | TRANS_FEAT(FCVTLT_sd, aa64_sve2, gen_gvec_fpst_arg_zpz, | ||
58 | gen_helper_sve2_fcvtlt_sd, a, 0, FPST_FPCR) | ||
59 | |||
60 | -static bool trans_FCVTX_ds(DisasContext *s, arg_rpr_esz *a) | ||
61 | -{ | ||
62 | - if (!dc_isar_feature(aa64_sve2, s)) { | ||
63 | - return false; | ||
64 | - } | ||
65 | - return do_frint_mode(s, a, float_round_to_odd, gen_helper_sve_fcvt_ds); | ||
66 | -} | ||
67 | - | ||
68 | -static bool trans_FCVTXNT_ds(DisasContext *s, arg_rpr_esz *a) | ||
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 | { | ||
44 | -- | 82 | -- |
45 | 2.25.1 | 83 | 2.25.1 |
46 | |||
47 | diff view generated by jsdifflib |
1 | From: Alex Bennée <alex.bennee@linaro.org> | 1 | From: Richard Henderson <richard.henderson@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | While trying to debug a GIC ITS failure I saw some guest errors that | 3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
4 | had poor formatting as well as leaving me confused as to what failed. | 4 | Message-id: 20220527181907.189259-97-richard.henderson@linaro.org |
5 | As most of the checks aren't possible without a valid dte split that | ||
6 | check apart and then check the other conditions in steps. This avoids | ||
7 | us relying on undefined data. | ||
8 | |||
9 | I still get a failure with the current kvm-unit-tests but at least I | ||
10 | know (partially) why now: | ||
11 | |||
12 | Exception return from AArch64 EL1 to AArch64 EL1 PC 0x40080588 | ||
13 | PASS: gicv3: its-trigger: inv/invall: dev2/eventid=20 now triggers an LPI | ||
14 | ITS: MAPD devid=2 size = 0x8 itt=0x40430000 valid=0 | ||
15 | INT dev_id=2 event_id=20 | ||
16 | process_its_cmd: invalid command attributes: invalid dte: 0 for 2 (MEM_TX: 0) | ||
17 | PASS: gicv3: its-trigger: mapd valid=false: no LPI after device unmap | ||
18 | SUMMARY: 6 tests, 1 unexpected failures | ||
19 | |||
20 | Signed-off-by: Alex Bennée <alex.bennee@linaro.org> | ||
21 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> |
22 | Message-id: 20211112170454.3158925-1-alex.bennee@linaro.org | ||
23 | Cc: Shashi Mallela <shashi.mallela@linaro.org> | ||
24 | Cc: Peter Maydell <peter.maydell@linaro.org> | ||
25 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
26 | --- | 7 | --- |
27 | hw/intc/arm_gicv3_its.c | 39 +++++++++++++++++++++++++++------------ | 8 | target/arm/translate-sve.c | 29 ++++++----------------------- |
28 | 1 file changed, 27 insertions(+), 12 deletions(-) | 9 | 1 file changed, 6 insertions(+), 23 deletions(-) |
29 | 10 | ||
30 | diff --git a/hw/intc/arm_gicv3_its.c b/hw/intc/arm_gicv3_its.c | 11 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c |
31 | index XXXXXXX..XXXXXXX 100644 | 12 | index XXXXXXX..XXXXXXX 100644 |
32 | --- a/hw/intc/arm_gicv3_its.c | 13 | --- a/target/arm/translate-sve.c |
33 | +++ b/hw/intc/arm_gicv3_its.c | 14 | +++ b/target/arm/translate-sve.c |
34 | @@ -XXX,XX +XXX,XX @@ static bool process_its_cmd(GICv3ITSState *s, uint64_t value, uint32_t offset, | 15 | @@ -XXX,XX +XXX,XX @@ TRANS_FEAT(FCVTX_ds, aa64_sve2, do_frint_mode, a, |
35 | if (res != MEMTX_OK) { | 16 | TRANS_FEAT(FCVTXNT_ds, aa64_sve2, do_frint_mode, a, |
36 | return result; | 17 | float_round_to_odd, gen_helper_sve2_fcvtnt_ds) |
37 | } | 18 | |
38 | + } else { | 19 | -static bool trans_FLOGB(DisasContext *s, arg_rpr_esz *a) |
39 | + qemu_log_mask(LOG_GUEST_ERROR, | 20 | -{ |
40 | + "%s: invalid command attributes: " | 21 | - static gen_helper_gvec_3_ptr * const fns[] = { |
41 | + "invalid dte: %"PRIx64" for %d (MEM_TX: %d)\n", | 22 | - NULL, gen_helper_flogb_h, |
42 | + __func__, dte, devid, res); | 23 | - gen_helper_flogb_s, gen_helper_flogb_d |
43 | + return result; | 24 | - }; |
44 | } | 25 | - |
45 | 26 | - if (!dc_isar_feature(aa64_sve2, s) || fns[a->esz] == NULL) { | |
46 | - if ((devid > s->dt.maxids.max_devids) || !dte_valid || !ite_valid || | 27 | - return false; |
47 | - !cte_valid || (eventid > max_eventid)) { | 28 | - } |
48 | + | 29 | - if (sve_access_check(s)) { |
49 | + /* | 30 | - TCGv_ptr status = |
50 | + * In this implementation, in case of guest errors we ignore the | 31 | - fpstatus_ptr(a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); |
51 | + * command and move onto the next command in the queue. | 32 | - unsigned vsz = vec_full_reg_size(s); |
52 | + */ | 33 | - |
53 | + if (devid > s->dt.maxids.max_devids) { | 34 | - tcg_gen_gvec_3_ptr(vec_full_reg_offset(s, a->rd), |
54 | qemu_log_mask(LOG_GUEST_ERROR, | 35 | - vec_full_reg_offset(s, a->rn), |
55 | - "%s: invalid command attributes " | 36 | - pred_full_reg_offset(s, a->pg), |
56 | - "devid %d or eventid %d or invalid dte %d or" | 37 | - status, vsz, vsz, 0, fns[a->esz]); |
57 | - "invalid cte %d or invalid ite %d\n", | 38 | - tcg_temp_free_ptr(status); |
58 | - __func__, devid, eventid, dte_valid, cte_valid, | 39 | - } |
59 | - ite_valid); | 40 | - return true; |
60 | - /* | 41 | -} |
61 | - * in this implementation, in case of error | 42 | +static gen_helper_gvec_3_ptr * const flogb_fns[] = { |
62 | - * we ignore this command and move onto the next | 43 | + NULL, gen_helper_flogb_h, |
63 | - * command in the queue | 44 | + gen_helper_flogb_s, gen_helper_flogb_d |
64 | - */ | 45 | +}; |
65 | + "%s: invalid command attributes: devid %d>%d", | 46 | +TRANS_FEAT(FLOGB, aa64_sve2, gen_gvec_fpst_arg_zpz, flogb_fns[a->esz], |
66 | + __func__, devid, s->dt.maxids.max_devids); | 47 | + a, 0, a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR) |
67 | + | 48 | |
68 | + } else if (!dte_valid || !ite_valid || !cte_valid) { | 49 | static bool do_FMLAL_zzzw(DisasContext *s, arg_rrrr_esz *a, bool sub, bool sel) |
69 | + qemu_log_mask(LOG_GUEST_ERROR, | 50 | { |
70 | + "%s: invalid command attributes: " | ||
71 | + "dte: %s, ite: %s, cte: %s\n", | ||
72 | + __func__, | ||
73 | + dte_valid ? "valid" : "invalid", | ||
74 | + ite_valid ? "valid" : "invalid", | ||
75 | + cte_valid ? "valid" : "invalid"); | ||
76 | + } else if (eventid > max_eventid) { | ||
77 | + qemu_log_mask(LOG_GUEST_ERROR, | ||
78 | + "%s: invalid command attributes: eventid %d > %d\n", | ||
79 | + __func__, eventid, max_eventid); | ||
80 | } else { | ||
81 | /* | ||
82 | * Current implementation only supports rdbase == procnum | ||
83 | -- | 51 | -- |
84 | 2.25.1 | 52 | 2.25.1 |
85 | |||
86 | diff view generated by jsdifflib |