target-arm queue
Most of this is the Neon decodetree patches, followed by Edgar's versal cleanups.
thanks
-- PMM
The following changes since commit 2ef486e76d64436be90f7359a3071fb2a56ce835:
Merge remote-tracking branch 'remotes/marcel/tags/rdma-pull-request' into staging (2020-05-03 14:12:56 +0100)
are available in the Git repository at:
https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20200504
for you to fetch changes up to 9aefc6cf9b73f66062d2f914a0136756e7a28211:
target/arm: Move gen_ function typedefs to translate.h (2020-05-04 12:59:26 +0100)
----------------------------------------------------------------
target-arm queue:
* Start of conversion of Neon insns to decodetree
* versal board: support SD and RTC
* Implement ARMv8.2-TTS2UXN
* Make VQDMULL undefined when U=1
* Some minor code cleanups
----------------------------------------------------------------
Edgar E. Iglesias (11):
hw/arm: versal: Remove inclusion of arm_gicv3_common.h hw/arm: versal: Move misplaced comment hw/arm: versal-virt: Fix typo xlnx-ve -> xlnx-versal hw/arm: versal: Embed the UARTs into the SoC type hw/arm: versal: Embed the GEMs into the SoC type hw/arm: versal: Embed the ADMAs into the SoC type hw/arm: versal: Embed the APUs into the SoC type hw/arm: versal: Add support for SD
hw/arm: versal: Add support for the RTC hw/arm: versal-virt: Add support for SD hw/arm: versal-virt: Add support for the RTC
Fredrik Strupe (1):
target/arm: Make VQDMULL undefined when U=1
Peter Maydell (25):
target/arm: Don't use a TLB for ARMMMUIdx_Stage2
target/arm: Use enum constant in get_phys_addr_lpae() call target/arm: Add new 's1_is_el0' argument to get_phys_addr_lpae() target/arm: Implement ARMv8.2-TTS2UXN
target/arm: Use correct variable for setting 'max' cpu's ID_AA64DFR0 target/arm/translate-vfp.inc.c: Remove duplicate simd_r32 check target/arm: Don't allow Thumb Neon insns without FEATURE_NEON target/arm: Add stubs for AArch32 Neon decodetree
target/arm: Convert VCMLA (vector) to decodetree
target/arm: Convert VCADD (vector) to decodetree
target/arm: Convert V[US]DOT (vector) to decodetree target/arm: Convert VFM[AS]L (vector) to decodetree target/arm: Convert VCMLA (scalar) to decodetree
target/arm: Convert V[US]DOT (scalar) to decodetree target/arm: Convert VFM[AS]L (scalar) to decodetree target/arm: Convert Neon load/store multiple structures to decodetree target/arm: Convert Neon 'load single structure to all lanes' to decodetree target/arm: Convert Neon 'load/store single structure' to decodetree target/arm: Convert Neon 3-reg-same VADD/VSUB to decodetree target/arm: Convert Neon 3-reg-same logic ops to decodetree target/arm: Convert Neon 3-reg-same VMAX/VMIN to decodetree target/arm: Convert Neon 3-reg-same comparisons to decodetree target/arm: Convert Neon 3-reg-same VQADD/VQSUB to decodetree target/arm: Convert Neon 3-reg-same VMUL, VMLA, VMLS, VSHL to decodetree target/arm: Move gen_ function typedefs to translate.h
Philippe Mathieu-Daudé (2):
hw/arm/mps2-tz: Use TYPE_IOTKIT instead of hardcoded string target/arm: Use uint64_t for midr field in CPU state struct
include/hw/arm/xlnx-versal.h | 31 +- target/arm/cpu-param.h | 2 +- target/arm/cpu.h | 38 ++- target/arm/translate-a64.h | 9 - target/arm/translate.h | 26 ++ target/arm/neon-dp.decode | 86 +++++ target/arm/neon-ls.decode | 52 +++ target/arm/neon-shared.decode | 66 ++++ hw/arm/mps2-tz.c | 2 +- hw/arm/xlnx-versal-virt.c | 74 ++++- hw/arm/xlnx-versal.c | 115 +++++-- target/arm/cpu.c | 3 +- target/arm/cpu64.c | 8 +- target/arm/helper.c | 183 ++++------ target/arm/translate-a64.c | 17 - target/arm/translate-neon.inc.c | 714 +++++++++++++++++++++++++++++++++++++++ target/arm/translate-vfp.inc.c | 6 - target/arm/translate.c | 716 +++------------------------------------- target/arm/Makefile.objs | 18 + 19 files changed, 1302 insertions(+), 864 deletions(-) create mode 100644 target/arm/neon-dp.decode create mode 100644 target/arm/neon-ls.decode create mode 100644 target/arm/neon-shared.decode create mode 100644 target/arm/translate-neon.inc.c
[PULL 01/39] target/arm: Make VQDMULL undefined when U=1
From: Fredrik Strupe <[email protected]>
According to Arm ARM, VQDMULL is only valid when U=0, while having U=1 is unallocated.
--- target/arm/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
target/arm/translate.c +1 -1
@@ -6016,7 +6016,7 @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn) {0, 0, 0, 0}, /* VMLSL */ {0, 0, 0, 9}, /* VQDMLSL */ {0, 0, 0, 0}, /* Integer VMULL */ - {0, 0, 0, 1}, /* VQDMULL */ + {0, 0, 0, 9}, /* VQDMULL */ {0, 0, 0, 0xa}, /* Polynomial VMULL */ {0, 0, 0, 7}, /* Reserved: always UNDEF */ };
Signature · 1 line
2.20.1
[PULL 02/39] hw/arm/mps2-tz: Use TYPE_IOTKIT instead of hardcoded string
In reply to Peter MaydellFrom: Philippe Mathieu-Daudé <[email protected]>
By using the TYPE_* definitions for devices, we can:
- quickly find where devices are used with 'git-grep'
- easily rename a device (one-line change).
Message-id: [email protected]
--- hw/arm/mps2-tz.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/arm/mps2-tz.c +1 -1
@@ -395,7 +395,7 @@ static void mps2tz_common_init(MachineState *machine)exit (EXIT_FAILURE ); } -sysbus_init_child_obj (OBJECT (machine),"iotkit" , &mms->iotkit, +sysbus_init_child_obj (OBJECT (machine),TYPE_IOTKIT , &mms->iotkit,sizeof (mms->iotkit), mmc->armsse_type); iotkitdev =DEVICE (&mms->iotkit); object_property_set_link(OBJECT(&mms->iotkit), OBJECT(system_memory),
Signature · 1 line
2.20.1
[PULL 03/39] target/arm: Don't use a TLB for ARMMMUIdx_Stage2
In reply to Peter MaydellWe define ARMMMUIdx_Stage2 as being an MMU index which uses a QEMU TLB. However we never actually use the TLB -- all stage 2 lookups are done by direct calls to get_phys_addr_lpae() followed by a physical address load via address_space_ld*().
Remove Stage2 from the list of ARM MMU indexes which correspond to real core MMU indexes, and instead put it in the set of "NOTLB" ARM MMU indexes.
This allows us to drop NB_MMU_MODES to 11. It also means we can safely add support for the ARMv8.3-TTS2UXN extension, which adds permission bits to the stage 2 descriptors which define execute permission separatel for EL0 and EL1; supporting that while keeping Stage2 in a QEMU TLB would require us to use separate TLBs for "Stage2 for an EL0 access" and "Stage2 for an EL1 access", which is a lot of extra complication given we aren't even using the QEMU TLB.
In the process of updating the comment on our MMU index use, fix a couple of other minor errors:
* NS EL2 EL2&0 was missing from the list in the comment
* some text hadn't been updated from when we bumped NB_MMU_MODES above 8
Message-id: [email protected]
--- target/arm/cpu-param.h | 2 +- target/arm/cpu.h | 21 +++++--- target/arm/helper.c | 112 ++++------------------------------------- 3 files changed, 27 insertions(+), 108 deletions(-)
target/arm/cpu-param.h +1 -1
@@ -29,6 +29,6 @@# define TARGET_PAGE_BITS_MIN 10#endif -#define NB_MMU_MODES 12 +#define NB_MMU_MODES 11#endif
target/arm/cpu.h +15 -6
@@ -2801,6 +2801,9 @@ bool write_cpustate_to_list(ARMCPU *cpu, bool kvm_sync);* handling via the TLB. The only way to do a stage 1 translation without * the immediate stage 2 translation is via the ATS or AT system insns, * which can be slow-pathed and always do a page table walk. +* The only use of stage 2 translations is either as part of an s1+2 +* lookup or when loading the descriptors during a stage 1 page table walk, +* and in both those cases we don't use the TLB. * 4. we can also safely fold together the "32 bit EL3" and "64 bit EL3" * translation regimes, because they map reasonably well to each other * and they can't both be active at the same time.
@@ -2816,15 +2819,15 @@ bool write_cpustate_to_list(ARMCPU *cpu, bool kvm_sync);* NS EL1 EL1&0 stage 1+2 (aka NS PL1) * NS EL1 EL1&0 stage 1+2 +PAN * NS EL0 EL2&0 +* NS EL2 EL2&0 * NS EL2 EL2&0 +PAN * NS EL2 (aka NS PL2) * S EL0 EL1&0 (aka S PL0) * S EL1 EL1&0 (not used if EL3 is 32 bit) * S EL1 EL1&0 +PAN * S EL3 (aka S PL1) -* NS EL1&0 stage 2 * -* for a total of 12 different mmu_idx. +* for a total of 11 different mmu_idx. * * R profile CPUs have an MPU, but can use the same set of MMU indexes * as A profile. They only need to distinguish NS EL0 and NS EL1 (and
@@ -2846,7 +2849,8 @@ bool write_cpustate_to_list(ARMCPU *cpu, bool kvm_sync);* are not quite the same -- different CPU types (most notably M profile * vs A/R profile) would like to use MMU indexes with different semantics, * but since we don't ever need to use all of those in a single CPU we -* can avoid setting NB_MMU_MODES to more than 8. The lower bits of +* can avoid having to set NB_MMU_MODES to "total number of A profile MMU +* modes + total number of M profile MMU modes". The lower bits of * ARMMMUIdx are the core TLB mmu index, and the higher bits are always * the same for any particular CPU. * Variables of type ARMMUIdx are always full values, and the core
@@ -2894,8 +2898,6 @@ typedef enum ARMMMUIdx { ARMMMUIdx_SE10_1_PAN =9 |ARM_MMU_IDX_A , ARMMMUIdx_SE3 = 10 | ARM_MMU_IDX_A, - ARMMMUIdx_Stage2 =11 |ARM_MMU_IDX_A , -/* * These are not allocated TLBs and are used only for AT system * instructions or for the first stage of an S12 page table walk.
@@ -2903,6 +2905,14 @@ typedef enum ARMMMUIdx { ARMMMUIdx_Stage1_E0 =0 |ARM_MMU_IDX_NOTLB , ARMMMUIdx_Stage1_E1 =1 |ARM_MMU_IDX_NOTLB , ARMMMUIdx_Stage1_E1_PAN =2 |ARM_MMU_IDX_NOTLB , +/* +* Not allocated a TLB: used only for second stage of an S12 page +* table walk, or for descriptor loads during first stage of an S1 +* page table walk. Note that if we ever want to have a TLB for this +* then various TLB flush insns which currently are no-ops or flush +* only stage 1 MMU indexes will need to change to flush stage 2. +*/ + ARMMMUIdx_Stage2 = 3 | ARM_MMU_IDX_NOTLB,/* * M-profile.
@@ -2936,7 +2946,6 @@ typedef enum ARMMMUIdxBit {TO_CORE_BIT (SE10_1 ),TO_CORE_BIT (SE10_1_PAN ),TO_CORE_BIT (SE3 ), -TO_CORE_BIT (Stage2),TO_CORE_BIT (MUser), TO_CORE_BIT(MPriv),
target/arm/helper.c +11 -101
172 lines not on this page · raw message
Signature · 1 line
2.20.1
[PULL 04/39] target/arm: Use enum constant in get_phys_addr_lpae() call
In reply to Peter MaydellThe access_type argument to get_phys_addr_lpae() is an MMUAccessType; use the enum constant MMU_DATA_LOAD rather than a literal 0 when we call it in S1_ptw_translate().
Message-id: [email protected]
--- target/arm/helper.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
target/arm/helper.c +3 -2
@@ -10052,8 +10052,9 @@ static hwaddr S1_ptw_translate(CPUARMState *env, ARMMMUIdx mmu_idx, pcacheattrs = &cacheattrs; } - ret =get_phys_addr_lpae (env, addr,0 , ARMMMUIdx_Stage2, &s2pa, - &txattrs, &s2prot, &s2size, fi, pcacheattrs); + ret =get_phys_addr_lpae (env, addr,MMU_DATA_LOAD , ARMMMUIdx_Stage2, + &s2pa, &txattrs, &s2prot, &s2size, fi, + pcacheattrs);if (ret) {assert (fi->type != ARMFault_None); fi->s2addr = addr;
Signature · 1 line
2.20.1
[PULL 09/39] hw/arm: versal: Remove inclusion of arm_gicv3_common.h
In reply to Peter MaydellFrom: "Edgar E. Iglesias" <[email protected]>
Remove inclusion of arm_gicv3_common.h, this already gets included via xlnx-versal.h.
Message-id: [email protected]
--- hw/arm/xlnx-versal.c | 1 - 1 file changed, 1 deletion(-)
hw/arm/xlnx-versal.c +0 -1
@@ -20,7 +20,6 @@#include "hw/arm/boot.h" #include "kvm_arm.h" #include "hw/misc/unimp.h" -#include "hw/intc/arm_gicv3_common.h" #include "hw/arm/xlnx-versal.h" #include "hw/char/pl011.h"
Signature · 1 line
2.20.1
[PULL 10/39] hw/arm: versal: Move misplaced comment
In reply to Peter MaydellFrom: "Edgar E. Iglesias" <[email protected]>
Move misplaced comment.
Message-id: [email protected]
--- hw/arm/xlnx-versal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/arm/xlnx-versal.c +1 -1
@@ -36,7 +36,6 @@ static void versal_create_apu_cpus(Versal *s) obj =object_new (XLNX_VERSAL_ACPU_TYPE );if (!obj) { -/* Secondary CPUs start in PSCI powered-down state */ error_report ("Unable to create apu.cpu[%d] of type %s" , i,XLNX_VERSAL_ACPU_TYPE );exit (EXIT_FAILURE );
@@ -49,6 +48,7 @@ static void versal_create_apu_cpus(Versal *s)object_property_set_int (obj, s->cfg.psci_conduit,"psci-conduit" , &error_abort);if (i) { +/* Secondary CPUs start in PSCI powered-down state */ object_property_set_bool (obj, true,"start-powered-off" , &error_abort); }
Signature · 1 line
2.20.1
[PULL 06/39] target/arm: Implement ARMv8.2-TTS2UXN
In reply to Peter MaydellThe ARMv8.2-TTS2UXN feature extends the XN field in stage 2 translation table descriptors from just bit [54] to bits [54:53], allowing stage 2 to control execution permissions separately for EL0 and EL1. Implement the new semantics of the XN field and enable the feature for our 'max' CPU.
Message-id: [email protected]
--- target/arm/cpu.h | 15 +++++++++++++++ target/arm/cpu.c | 1 + target/arm/cpu64.c | 2 ++ target/arm/helper.c | 37 +++++++++++++++++++++++++++++++------ 4 files changed, 49 insertions(+), 6 deletions(-)
target/arm/cpu.h +15 -0
@@ -3610,6 +3610,11 @@ static inline bool isar_feature_aa32_ccidx(const ARMISARegisters *id)return FIELD_EX32 (id->id_mmfr4,ID_MMFR4 ,CCIDX ) !=0 ; } +static inline bool isar_feature_aa32_tts2uxn (const ARMISARegisters *id) +{ +return FIELD_EX32 (id->id_mmfr4,ID_MMFR4 ,XNX ) !=0 ; +} +/* * 64-bit feature tests via id registers. */
@@ -3822,6 +3827,11 @@ static inline bool isar_feature_aa64_ccidx(const ARMISARegisters *id)return FIELD_EX64 (id->id_aa64mmfr2,ID_AA64MMFR2 ,CCIDX ) !=0 ; } +static inline bool isar_feature_aa64_tts2uxn (const ARMISARegisters *id) +{ +return FIELD_EX64 (id->id_aa64mmfr1,ID_AA64MMFR1 ,XNX ) !=0 ; +} +/* * Feature tests for "does this exist in either 32-bit or 64-bit?" */
@@ -3850,6 +3860,11 @@ static inline bool isar_feature_any_ccidx(const ARMISARegisters *id)return isar_feature_aa64_ccidx (id) ||isar_feature_aa32_ccidx (id); } +static inline bool isar_feature_any_tts2uxn (const ARMISARegisters *id) +{ +return isar_feature_aa64_tts2uxn (id) ||isar_feature_aa32_tts2uxn (id); +} +/* * Forward to the above feature tests given an ARMCPU pointer. */
target/arm/cpu.c +1 -0
@@ -2686,6 +2686,7 @@ static void arm_max_initfn(Object *obj) t =FIELD_DP32 (t,ID_MMFR4 ,HPDS ,1 );/* AA32HPD */ t =FIELD_DP32 (t,ID_MMFR4 ,AC2 ,1 );/* ACTLR2, HACTLR2 */ t =FIELD_DP32 (t,ID_MMFR4 ,CNP ,1 );/* TTCNP */ + t =FIELD_DP32 (t,ID_MMFR4 ,XNX ,1 );/* TTS2UXN */ cpu->isar.id_mmfr4 = t; }#endif
target/arm/cpu64.c +2 -0
@@ -673,6 +673,7 @@ static void aarch64_max_initfn(Object *obj) t =FIELD_DP64 (t,ID_AA64MMFR1 ,VH ,1 ); t =FIELD_DP64 (t,ID_AA64MMFR1 ,PAN ,2 );/* ATS1E1 */ t =FIELD_DP64 (t,ID_AA64MMFR1 ,VMIDBITS ,2 );/* VMID16 */ + t =FIELD_DP64 (t,ID_AA64MMFR1 ,XNX ,1 );/* TTS2UXN */ cpu->isar.id_aa64mmfr1 = t; t = cpu->isar.id_aa64mmfr2;
@@ -706,6 +707,7 @@ static void aarch64_max_initfn(Object *obj) u =FIELD_DP32 (u,ID_MMFR4 ,HPDS ,1 );/* AA32HPD */ u =FIELD_DP32 (u,ID_MMFR4 ,AC2 ,1 );/* ACTLR2, HACTLR2 */ u =FIELD_DP32 (u,ID_MMFR4 ,CNP ,1 );/* TTCNP */ + u =FIELD_DP32 (u,ID_MMFR4 ,XNX ,1 );/* TTS2UXN */ cpu->isar.id_mmfr4 = u; u = cpu->isar.id_aa64dfr0;
target/arm/helper.c +31 -6
@@ -9908,9 +9908,10 @@ simple_ap_to_rw_prot(CPUARMState *env, ARMMMUIdx mmu_idx, int ap)* * @env: CPUARMState * @s2ap: The 2-bit stage2 access permissions (S2AP) -* @xn: XN (execute-never) bit +* @xn: XN (execute-never) bits +* @s1_is_el0: true if this is S2 of an S1+2 walk for EL0 */ -static int get_S2prot (CPUARMState *env,int s2ap,int xn) +static int get_S2prot (CPUARMState *env,int s2ap,int xn,bool s1_is_el0) {int prot =0 ;
@@ -9920,9 +9921,32 @@ static int get_S2prot(CPUARMState *env, int s2ap, int xn)if (s2ap &2 ) { prot |=PAGE_WRITE ; } -if (!xn) { -if (arm_el_is_aa64 (env,2 ) || prot &PAGE_READ ) { + +if (cpu_isar_feature (any_tts2uxn,env_archcpu (env))) { +switch (xn) { +case 0 : prot |=PAGE_EXEC ; +break ; +case 1 : +if (s1_is_el0) { + prot |=PAGE_EXEC ; + } +break ; +case 2 : +break ; +case 3 : +if (!s1_is_el0) { + prot |=PAGE_EXEC ; + } +break ; +default : +g_assert_not_reached (); + } + }else { +if (!extract32 (xn,1 ,1 )) { +if (arm_el_is_aa64 (env,2 ) || prot &PAGE_READ ) { + prot |=PAGE_EXEC ; + } } }return prot;
@@ -10901,13 +10925,14 @@ static bool get_phys_addr_lpae(CPUARMState *env, target_ulong address, } ap =extract32 (attrs,4 ,2 ); - xn =extract32 (attrs,12 ,1 );if (mmu_idx == ARMMMUIdx_Stage2) { ns = true; - *prot =get_S2prot (env, ap, xn); + xn =extract32 (attrs,11 ,2 ); + *prot =get_S2prot (env, ap, xn, s1_is_el0); }else { ns =extract32 (attrs,3 ,1 ); + xn =extract32 (attrs,12 ,1 ); pxn =extract32 (attrs,11 ,1 ); *prot =get_S1prot (env, mmu_idx, aarch64, ap, ns, xn, pxn); }
Signature · 1 line
2.20.1
[PULL 05/39] target/arm: Add new 's1_is_el0' argument to get_phys_addr_lpae()
In reply to Peter MaydellFor ARMv8.2-TTS2UXN, the stage 2 page table walk wants to know whether the stage 1 access is for EL0 or not, because whether exec permission is given can depend on whether this is an EL0 or EL1 access. Add a new argument to get_phys_addr_lpae() so the call sites can pass this information in.
Since get_phys_addr_lpae() doesn't already have a doc comment, add one so we have a place to put the documentation of the semantics of the new s1_is_el0 argument.
Message-id: [email protected]
--- target/arm/helper.c | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-)
target/arm/helper.c +28 -1
@@ -41,6 +41,7 @@static bool get_phys_addr_lpae (CPUARMState *env,target_ulong address,MMUAccessType access_type,ARMMMUIdx mmu_idx, +bool s1_is_el0,hwaddr *phys_ptr,MemTxAttrs *txattrs,int *prot,target_ulong *page_size_ptr,ARMMMUFaultInfo *fi,ARMCacheAttrs *cacheattrs);
@@ -10053,6 +10054,7 @@ static hwaddr S1_ptw_translate(CPUARMState *env, ARMMMUIdx mmu_idx, } ret =get_phys_addr_lpae (env, addr,MMU_DATA_LOAD , ARMMMUIdx_Stage2, + false, &s2pa, &txattrs, &s2prot, &s2size, fi, pcacheattrs);if (ret) {
@@ -10655,8 +10657,32 @@ static ARMVAParameters aa32_va_parameters(CPUARMState *env, uint32_t va, }; } +/** +* get_phys_addr_lpae: perform one stage of page table walk, LPAE format +* +* Returns false if the translation was successful. Otherwise, phys_ptr, attrs, +* prot and page_size may not be filled in, and the populated fsr value provides +* information on why the translation aborted, in the format of a long-format +* DFSR/IFSR fault register, with the following caveats: +* * the WnR bit is never set (the caller must do this). +* +* @env: CPUARMState +* @address: virtual address to get physical address for +* @access_type: MMU_DATA_LOAD, MMU_DATA_STORE or MMU_INST_FETCH +* @mmu_idx: MMU index indicating required translation regime +* @s1_is_el0: if @mmu_idx is ARMMMUIdx_Stage2 (so this is a stage 2 page table +* walk), must be true if this is stage 2 of a stage 1+2 walk for an +* EL0 access). If @mmu_idx is anything else, @s1_is_el0 is ignored. +* @phys_ptr: set to the physical address corresponding to the virtual address +* @attrs: set to the memory transaction attributes to use +* @prot: set to the permissions for the page containing phys_ptr +* @page_size_ptr: set to the size of the page containing phys_ptr +* @fi: set to fault info if the translation fails +* @cacheattrs: (if non-NULL) set to the cacheability/shareability attributes +*/ static bool get_phys_addr_lpae (CPUARMState *env,target_ulong address,MMUAccessType access_type,ARMMMUIdx mmu_idx, +bool s1_is_el0,hwaddr *phys_ptr,MemTxAttrs *txattrs,int *prot,target_ulong *page_size_ptr,ARMMMUFaultInfo *fi,ARMCacheAttrs *cacheattrs)
@@ -11748,6 +11774,7 @@ bool get_phys_addr(CPUARMState *env, target_ulong address,/* S1 is done. Now do S2 translation. */ ret =get_phys_addr_lpae (env, ipa, access_type, ARMMMUIdx_Stage2, + mmu_idx == ARMMMUIdx_E10_0, phys_ptr, attrs, &s2_prot, page_size, fi, cacheattrs !=NULL ? &cacheattrs2 :NULL );
@@ -11872,7 +11899,7 @@ bool get_phys_addr(CPUARMState *env, target_ulong address, }if (regime_using_lpae_format (env, mmu_idx)) { -return get_phys_addr_lpae (env, address, access_type, mmu_idx, +return get_phys_addr_lpae (env, address, access_type, mmu_idx, false, phys_ptr, attrs, prot, page_size, fi, cacheattrs); }else if (regime_sctlr (env, mmu_idx) &SCTLR_XP ) {
Signature · 1 line
2.20.1
[PULL 14/39] hw/arm: versal: Embed the ADMAs into the SoC type
In reply to Peter MaydellFrom: "Edgar E. Iglesias" <[email protected]>
Embed the ADMAs into the SoC type.
Message-id: [email protected]
--- include/hw/arm/xlnx-versal.h | 3 ++- hw/arm/xlnx-versal.c | 14 +++++++------- 2 files changed, 9 insertions(+), 8 deletions(-)
include/hw/arm/xlnx-versal.h +2 -1
@@ -16,6 +16,7 @@#include "hw/arm/boot.h" #include "hw/intc/arm_gicv3.h" #include "hw/char/pl011.h" +#include "hw/dma/xlnx-zdma.h" #include "hw/net/cadence_gem.h" #define TYPE_XLNX_VERSAL "xlnx-versal"
@@ -53,7 +54,7 @@ typedef struct Versal {struct {PL011State uart[XLNX_VERSAL_NR_UARTS ];CadenceGEMState gem[XLNX_VERSAL_NR_GEMS ]; -SysBusDevice *adma[XLNX_VERSAL_NR_ADMAS ]; +XlnxZDMA adma[XLNX_VERSAL_NR_ADMAS ]; } iou; } lpd;
hw/arm/xlnx-versal.c +7 -7
@@ -203,18 +203,18 @@ static void versal_create_admas(Versal *s, qemu_irq *pic)DeviceState *dev;MemoryRegion *mr; - dev =qdev_create (NULL ,"xlnx.zdma" ); - s->lpd.iou.adma[i] =SYS_BUS_DEVICE (dev); -object_property_set_int (OBJECT (s->lpd.iou.adma[i]),128 ,"bus-width" , - &error_abort); -object_property_add_child (OBJECT (s), name,OBJECT (dev), &error_fatal); +sysbus_init_child_obj (OBJECT (s), name, + &s->lpd.iou.adma[i],sizeof (s->lpd.iou.adma[i]), +TYPE_XLNX_ZDMA ); + dev =DEVICE (&s->lpd.iou.adma[i]); +object_property_set_int (OBJECT (dev),128 ,"bus-width" , &error_abort);qdev_init_nofail (dev); - mr =sysbus_mmio_get_region (s->lpd.iou.adma[i],0 ); + mr =sysbus_mmio_get_region (SYS_BUS_DEVICE (dev),0 );memory_region_add_subregion (&s->mr_ps,MM_ADMA_CH0 + i *MM_ADMA_CH0_SIZE , mr); -sysbus_connect_irq (s->lpd.iou.adma[i],0 , pic[VERSAL_ADMA_IRQ_0 + i]); +sysbus_connect_irq (SYS_BUS_DEVICE (dev),0 , pic[VERSAL_ADMA_IRQ_0 + i]);g_free (name); } }
Signature · 1 line
2.20.1
[PULL 16/39] hw/arm: versal: Add support for SD
In reply to Peter MaydellFrom: "Edgar E. Iglesias" <[email protected]>
Add support for SD.
Message-id: [email protected]
--- include/hw/arm/xlnx-versal.h | 12 ++++++++++++ hw/arm/xlnx-versal.c | 31 +++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+)
include/hw/arm/xlnx-versal.h +12 -0
@@ -14,6 +14,7 @@#include "hw/sysbus.h" #include "hw/arm/boot.h" +#include "hw/sd/sdhci.h" #include "hw/intc/arm_gicv3.h" #include "hw/char/pl011.h" #include "hw/dma/xlnx-zdma.h"
@@ -26,6 +27,7 @@#define XLNX_VERSAL_NR_UARTS 2#define XLNX_VERSAL_NR_GEMS 2#define XLNX_VERSAL_NR_ADMAS 8 +#define XLNX_VERSAL_NR_SDS 2#define XLNX_VERSAL_NR_IRQS 192 typedef struct Versal {
@@ -58,6 +60,13 @@ typedef struct Versal { } iou; } lpd; +/* The Platform Management Controller subsystem. */ +struct { +struct { +SDHCIState sd[XLNX_VERSAL_NR_SDS ]; + } iou; + } pmc; +struct {MemoryRegion *mr_ddr;uint32_t psci_conduit;
@@ -80,6 +89,7 @@ typedef struct Versal {#define VERSAL_GEM1_IRQ_0 58#define VERSAL_GEM1_WAKE_IRQ_0 59#define VERSAL_ADMA_IRQ_0 60 +#define VERSAL_SD0_IRQ_0 126/* Architecturally reserved IRQs suitable for virtualization. */ #define VERSAL_RSVD_IRQ_FIRST 111
@@ -129,6 +139,8 @@ typedef struct Versal {#define MM_FPD_CRF 0xfd1a0000U#define MM_FPD_CRF_SIZE 0x140000 +#define MM_PMC_SD0 0xf1040000U +#define MM_PMC_SD0_SIZE 0x10000#define MM_PMC_CRP 0xf1260000U#define MM_PMC_CRP_SIZE 0x10000#endif
hw/arm/xlnx-versal.c +31 -0
@@ -210,6 +210,36 @@ static void versal_create_admas(Versal *s, qemu_irq *pic) } } +#define SDHCI_CAPABILITIES 0x280737ec6481/* Same as on ZynqMP. */ +static void versal_create_sds (Versal *s,qemu_irq *pic) +{ +int i; + +for (i =0 ; i <ARRAY_SIZE (s->pmc.iou.sd); i++) { +DeviceState *dev; +MemoryRegion *mr; + +sysbus_init_child_obj (OBJECT (s),"sd[*]" , + &s->pmc.iou.sd[i],sizeof (s->pmc.iou.sd[i]), +TYPE_SYSBUS_SDHCI ); + dev =DEVICE (&s->pmc.iou.sd[i]); + +object_property_set_uint (OBJECT (dev), +3 ,"sd-spec-version" , &error_fatal); +object_property_set_uint (OBJECT (dev),SDHCI_CAPABILITIES ,"capareg" , + &error_fatal); +object_property_set_uint (OBJECT (dev),UHS_I ,"uhs" , &error_fatal); +qdev_init_nofail (dev); + + mr =sysbus_mmio_get_region (SYS_BUS_DEVICE (dev),0 ); +memory_region_add_subregion (&s->mr_ps, +MM_PMC_SD0 + i *MM_PMC_SD0_SIZE , mr); + +sysbus_connect_irq (SYS_BUS_DEVICE (dev),0 , + pic[VERSAL_SD0_IRQ_0 + i *2 ]); + } +} +/* This takes the board allocated linear DDR memory and creates aliases * for each split DDR range/aperture on the Versal address map. */
@@ -292,6 +322,7 @@ static void versal_realize(DeviceState *dev, Error **errp)versal_create_uarts (s, pic);versal_create_gems (s, pic);versal_create_admas (s, pic); +versal_create_sds (s, pic);versal_map_ddr (s);versal_unimp (s);
Signature · 1 line
2.20.1
[PULL 08/39] target/arm: Use uint64_t for midr field in CPU state struct
In reply to Peter MaydellFrom: Philippe Mathieu-Daudé <[email protected]>
MIDR_EL1 is a 64-bit system register with the top 32-bit being RES0. Represent it in QEMU's ARMCPU struct with a uint64_t, not a uint32_t.
This fixes an error when compiling with -Werror=conversion because we were manipulating the register value using a local uint64_t variable:
target/arm/cpu64.c: In function ‘aarch64_max_initfn’:
target/arm/cpu64.c:628:21: error: conversion from ‘uint64_t’ {aka ‘long unsigned int’} to ‘uint32_t’ {aka ‘unsigned int’} may change value [-Werror=conversion]
628 | cpu->midr = t;
| ^and future-proofs us against a possible future architecture change using some of the top 32 bits.
Message-id: [email protected]
--- target/arm/cpu.h | 2 +- target/arm/cpu.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
target/arm/cpu.h +1 -1
@@ -894,7 +894,7 @@ struct ARMCPU {uint64_t id_aa64dfr0;uint64_t id_aa64dfr1; } isar; -uint32_t midr; +uint64_t midr;uint32_t revidr;uint32_t reset_fpsid;uint32_t ctr;
target/arm/cpu.c +1 -1
@@ -2755,7 +2755,7 @@ static const ARMCPUInfo arm_cpus[] = {static Property arm_cpu_properties[] = {DEFINE_PROP_BOOL ("start-powered-off" ,ARMCPU , start_powered_off, false),DEFINE_PROP_UINT32 ("psci-conduit" ,ARMCPU , psci_conduit,0 ), -DEFINE_PROP_UINT32 ("midr" ,ARMCPU , midr,0 ), +DEFINE_PROP_UINT64 ("midr" ,ARMCPU , midr,0 ),DEFINE_PROP_UINT64 ("mp-affinity" ,ARMCPU , mp_affinity,ARM64_AFFINITY_INVALID ),DEFINE_PROP_INT32 ("node-id" ,ARMCPU , node_id,CPU_UNSET_NUMA_NODE_ID ),
Signature · 1 line
2.20.1
[PULL 07/39] target/arm: Use correct variable for setting 'max' cpu's ID_AA64DFR0
In reply to Peter MaydellIn aarch64_max_initfn() we update both 32-bit and 64-bit ID registers. The intended pattern is that for 64-bit ID registers we use FIELD_DP64 and the uint64_t 't' register, while 32-bit ID registers use FIELD_DP32 and the uint32_t 'u' register. For ID_AA64DFR0 we accidentally used 'u', meaning that the top 32 bits of this 64-bit ID register would end up always zero. Luckily at the moment that's what they should be anyway, so this bug has no visible effects.
Use the right-sized variable.
Message-id: [email protected]
--- target/arm/cpu64.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
target/arm/cpu64.c +3 -3
@@ -710,9 +710,9 @@ static void aarch64_max_initfn(Object *obj) u =FIELD_DP32 (u,ID_MMFR4 ,XNX ,1 );/* TTS2UXN */ cpu->isar.id_mmfr4 = u; - u = cpu->isar.id_aa64dfr0; - u =FIELD_DP64 (u,ID_AA64DFR0 ,PMUVER ,5 );/* v8.4-PMU */ - cpu->isar.id_aa64dfr0 = u; + t = cpu->isar.id_aa64dfr0; + t =FIELD_DP64 (t,ID_AA64DFR0 ,PMUVER ,5 );/* v8.4-PMU */ + cpu->isar.id_aa64dfr0 = t; u = cpu->isar.id_dfr0; u =FIELD_DP32 (u,ID_DFR0 ,PERFMON ,5 );/* v8.4-PMU */
Signature · 1 line
2.20.1
[PULL 11/39] hw/arm: versal-virt: Fix typo xlnx-ve -> xlnx-versal
In reply to Peter MaydellFrom: "Edgar E. Iglesias" <[email protected]>
Fix typo xlnx-ve -> xlnx-versal.
Message-id: [email protected]
--- hw/arm/xlnx-versal-virt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/arm/xlnx-versal-virt.c +1 -1
@@ -440,7 +440,7 @@ static void versal_virt_init(MachineState *machine) psci_conduit =QEMU_PSCI_CONDUIT_SMC ; } -sysbus_init_child_obj (OBJECT (machine),"xlnx-ve" , &s->soc, +sysbus_init_child_obj (OBJECT (machine),"xlnx-versal" , &s->soc,sizeof (s->soc),TYPE_XLNX_VERSAL );object_property_set_link (OBJECT (&s->soc),OBJECT (machine->ram),"ddr" , &error_abort);
Signature · 1 line
2.20.1
[PULL 24/39] target/arm: Convert VCADD (vector) to decodetree
In reply to Peter MaydellConvert the VCADD (vector) insns to decodetree.
Message-id: [email protected]
--- target/arm/neon-shared.decode | 3 +++ target/arm/translate-neon.inc.c | 37 +++++++++++++++++++++++++++++++++ target/arm/translate.c | 11 +--------- 3 files changed, 41 insertions(+), 10 deletions(-)
target/arm/neon-shared.decode +3 -0
@@ -36,3 +36,6 @@ VCMLA 1111 110 rot:2 . 1 size:1 .... .... 1000 . q:1 . 0 .... \ vm=%vm_dp vn=%vn_dp vd=%vd_dp + +VCADD 1111 110 rot:1 1 . 0 size:1 .... .... 1000 . q:1 . 0 .... \ + vm=%vm_dp vn=%vn_dp vd=%vd_dp
target/arm/translate-neon.inc.c +37 -0
@@ -67,3 +67,40 @@ static bool trans_VCMLA(DisasContext *s, arg_VCMLA *a)tcg_temp_free_ptr (fpst);return true; } + +static bool trans_VCADD (DisasContext *s,arg_VCADD *a) +{ +int opr_sz; +TCGv_ptr fpst; +gen_helper_gvec_3_ptr *fn_gvec_ptr; + +if (!dc_isar_feature (aa32_vcma, s) + || (!a->size && !dc_isar_feature (aa32_fp16_arith, s))) { +return false; + } + +/* UNDEF accesses to D16-D31 if they don't exist. */ +if (!dc_isar_feature (aa32_simd_r32, s) && + ((a->vd | a->vn | a->vm) &0x10 )) { +return false; + } + +if ((a->vn | a->vm | a->vd) & a->q) { +return false; + } + +if (!vfp_access_check (s)) { +return true; + } + + opr_sz = (1 + a->q) *8 ; + fpst =get_fpstatus_ptr (1 ); + fn_gvec_ptr = a->size ? gen_helper_gvec_fcadds : gen_helper_gvec_fcaddh; +tcg_gen_gvec_3_ptr (vfp_reg_offset (1 , a->vd), +vfp_reg_offset (1 , a->vn), +vfp_reg_offset (1 , a->vm), + fpst, opr_sz, opr_sz, a->rot, + fn_gvec_ptr); +tcg_temp_free_ptr (fpst); +return true; +}
target/arm/translate.c +1 -10
@@ -7048,16 +7048,7 @@ static int disas_neon_insn_3same_ext(DisasContext *s, uint32_t insn)bool is_long = false, q =extract32 (insn,6 ,1 );bool ptr_is_env = false; -if ((insn &0xfea00f10 ) ==0xfc800800 ) { -/* VCADD -- 1111 110R 1.0S .... .... 1000 ...0 .... */ -int size =extract32 (insn,20 ,1 ); - data =extract32 (insn,24 ,1 );/* rot */ -if (!dc_isar_feature (aa32_vcma, s) - || (!size && !dc_isar_feature (aa32_fp16_arith, s))) { -return 1 ; - } - fn_gvec_ptr = size ? gen_helper_gvec_fcadds : gen_helper_gvec_fcaddh; - }else if ((insn &0xfeb00f00 ) ==0xfc200d00 ) { +if ((insn &0xfeb00f00 ) ==0xfc200d00 ) {/* V[US]DOT -- 1111 1100 0.10 .... .... 1101 .Q.U .... */ bool u =extract32 (insn,4 ,1 );if (!dc_isar_feature (aa32_dp, s)) {
Signature · 1 line
2.20.1
[PULL 18/39] hw/arm: versal-virt: Add support for SD
In reply to Peter MaydellFrom: "Edgar E. Iglesias" <[email protected]>
Add support for SD.
Message-id: [email protected]
--- hw/arm/xlnx-versal-virt.c | 46 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+)
hw/arm/xlnx-versal-virt.c +46 -0
@@ -20,6 +20,7 @@#include "hw/arm/sysbus-fdt.h" #include "hw/arm/fdt.h" #include "cpu.h" +#include "hw/qdev-properties.h" #include "hw/arm/xlnx-versal.h" #define TYPE_XLNX_VERSAL_VIRT_MACHINE MACHINE_TYPE_NAME("xlnx-versal-virt")
@@ -256,6 +257,32 @@ static void fdt_add_zdma_nodes(VersalVirt *s) } } +static void fdt_add_sd_nodes (VersalVirt *s) +{ +const char clocknames[] ="clk_xin\0clk_ahb" ; +const char compat[] ="arasan,sdhci-8.9a" ; +int i; + +for (i =ARRAY_SIZE (s->soc.pmc.iou.sd) -1 ; i >=0 ; i--) { +uint64_t addr =MM_PMC_SD0 +MM_PMC_SD0_SIZE * i; +char *name =g_strdup_printf ("/sdhci@%" PRIx64, addr); + +qemu_fdt_add_subnode (s->fdt, name); + +qemu_fdt_setprop_cells (s->fdt, name,"clocks" , + s->phandle.clk_25Mhz, s->phandle.clk_25Mhz); +qemu_fdt_setprop (s->fdt, name,"clock-names" , + clocknames,sizeof (clocknames)); +qemu_fdt_setprop_cells (s->fdt, name,"interrupts" , +GIC_FDT_IRQ_TYPE_SPI ,VERSAL_SD0_IRQ_0 + i *2 , +GIC_FDT_IRQ_FLAGS_LEVEL_HI ); +qemu_fdt_setprop_sized_cells (s->fdt, name,"reg" , +2 , addr,2 ,MM_PMC_SD0_SIZE ); +qemu_fdt_setprop (s->fdt, name,"compatible" , compat,sizeof (compat)); +g_free (name); + } +} +static void fdt_nop_memory_nodes (void *fdt,Error **errp) {Error *err =NULL ;
@@ -411,10 +438,23 @@ static void create_virtio_regions(VersalVirt *s) } } +static void sd_plugin_card (SDHCIState *sd,DriveInfo *di) +{ +BlockBackend *blk = di ?blk_by_legacy_dinfo (di) :NULL ; +DeviceState *card; + + card =qdev_create (qdev_get_child_bus (DEVICE (sd),"sd-bus" ),TYPE_SD_CARD ); +object_property_add_child (OBJECT (sd),"card[*]" ,OBJECT (card), + &error_fatal); +qdev_prop_set_drive (card,"drive" , blk, &error_fatal); +object_property_set_bool (OBJECT (card), true,"realized" , &error_fatal); +} +static void versal_virt_init (MachineState *machine) {VersalVirt *s =XLNX_VERSAL_VIRT_MACHINE (machine);int psci_conduit =QEMU_PSCI_CONDUIT_DISABLED ; +int i;/* * If the user provides an Operating System to be loaded, we expect them
@@ -455,6 +495,7 @@ static void versal_virt_init(MachineState *machine)fdt_add_gic_nodes (s);fdt_add_timer_nodes (s);fdt_add_zdma_nodes (s); +fdt_add_sd_nodes (s);fdt_add_cpu_nodes (s, psci_conduit);fdt_add_clk_node (s,"/clk125" ,125000000 , s->phandle.clk_125Mhz);fdt_add_clk_node (s,"/clk25" ,25000000 , s->phandle.clk_25Mhz);
@@ -464,6 +505,11 @@ static void versal_virt_init(MachineState *machine)memory_region_add_subregion_overlap (get_system_memory (),0 , &s->soc.fpd.apu.mr,0 ); +/* Plugin SD cards. */ +for (i =0 ; i <ARRAY_SIZE (s->soc.pmc.iou.sd); i++) { +sd_plugin_card (&s->soc.pmc.iou.sd[i],drive_get_next (IF_SD )); + } + s->binfo.ram_size = machine->ram_size; s->binfo.loader_start =0x0 ; s->binfo.get_dtb = versal_virt_get_dtb;
Signature · 1 line
2.20.1
[PULL 17/39] hw/arm: versal: Add support for the RTC
In reply to Peter MaydellFrom: "Edgar E. Iglesias" <[email protected]>
hw/arm: versal: Add support for the RTC.
Message-id: [email protected]
--- include/hw/arm/xlnx-versal.h | 8 ++++++++ hw/arm/xlnx-versal.c | 21 +++++++++++++++++++++ 2 files changed, 29 insertions(+)
include/hw/arm/xlnx-versal.h +8 -0
@@ -19,6 +19,7 @@#include "hw/char/pl011.h" #include "hw/dma/xlnx-zdma.h" #include "hw/net/cadence_gem.h" +#include "hw/rtc/xlnx-zynqmp-rtc.h" #define TYPE_XLNX_VERSAL "xlnx-versal"#define XLNX_VERSAL (obj) OBJECT_CHECK(Versal, (obj), TYPE_XLNX_VERSAL)
@@ -65,6 +66,8 @@ typedef struct Versal {struct {SDHCIState sd[XLNX_VERSAL_NR_SDS ]; } iou; + +XlnxZynqMPRTC rtc; } pmc;struct {
@@ -89,7 +92,10 @@ typedef struct Versal {#define VERSAL_GEM1_IRQ_0 58#define VERSAL_GEM1_WAKE_IRQ_0 59#define VERSAL_ADMA_IRQ_0 60 +#define VERSAL_RTC_APB_ERR_IRQ 121#define VERSAL_SD0_IRQ_0 126 +#define VERSAL_RTC_ALARM_IRQ 142 +#define VERSAL_RTC_SECONDS_IRQ 143/* Architecturally reserved IRQs suitable for virtualization. */ #define VERSAL_RSVD_IRQ_FIRST 111
@@ -143,4 +149,6 @@ typedef struct Versal {#define MM_PMC_SD0_SIZE 0x10000#define MM_PMC_CRP 0xf1260000U#define MM_PMC_CRP_SIZE 0x10000 +#define MM_PMC_RTC 0xf12a0000 +#define MM_PMC_RTC_SIZE 0x10000#endif
hw/arm/xlnx-versal.c +21 -0
@@ -240,6 +240,26 @@ static void versal_create_sds(Versal *s, qemu_irq *pic) } } +static void versal_create_rtc (Versal *s,qemu_irq *pic) +{ +SysBusDevice *sbd; +MemoryRegion *mr; + +sysbus_init_child_obj (OBJECT (s),"rtc" , &s->pmc.rtc,sizeof (s->pmc.rtc), +TYPE_XLNX_ZYNQMP_RTC ); + sbd =SYS_BUS_DEVICE (&s->pmc.rtc); +qdev_init_nofail (DEVICE (sbd)); + + mr =sysbus_mmio_get_region (sbd,0 ); +memory_region_add_subregion (&s->mr_ps,MM_PMC_RTC , mr); + +/* +* TODO: Connect the ALARM and SECONDS interrupts once our RTC model +* supports them. +*/ +sysbus_connect_irq (sbd,1 , pic[VERSAL_RTC_APB_ERR_IRQ ]); +} +/* This takes the board allocated linear DDR memory and creates aliases * for each split DDR range/aperture on the Versal address map. */
@@ -323,6 +343,7 @@ static void versal_realize(DeviceState *dev, Error **errp)versal_create_gems (s, pic);versal_create_admas (s, pic);versal_create_sds (s, pic); +versal_create_rtc (s, pic);versal_map_ddr (s);versal_unimp (s);
Signature · 1 line
2.20.1
[PULL 12/39] hw/arm: versal: Embed the UARTs into the SoC type
In reply to Peter MaydellFrom: "Edgar E. Iglesias" <[email protected]>
Embed the UARTs into the SoC type.
Message-id: [email protected]
--- include/hw/arm/xlnx-versal.h | 3 ++- hw/arm/xlnx-versal.c | 12 ++++++------ 2 files changed, 8 insertions(+), 7 deletions(-)
include/hw/arm/xlnx-versal.h +2 -1
@@ -15,6 +15,7 @@#include "hw/sysbus.h" #include "hw/arm/boot.h" #include "hw/intc/arm_gicv3.h" +#include "hw/char/pl011.h" #define TYPE_XLNX_VERSAL "xlnx-versal"#define XLNX_VERSAL (obj) OBJECT_CHECK(Versal, (obj), TYPE_XLNX_VERSAL)
@@ -49,7 +50,7 @@ typedef struct Versal {MemoryRegion mr_ocm;struct { -SysBusDevice *uart[XLNX_VERSAL_NR_UARTS ]; +PL011State uart[XLNX_VERSAL_NR_UARTS ];SysBusDevice *gem[XLNX_VERSAL_NR_GEMS ];SysBusDevice *adma[XLNX_VERSAL_NR_ADMAS ]; } iou;
hw/arm/xlnx-versal.c +6 -6
@@ -21,7 +21,6 @@#include "kvm_arm.h" #include "hw/misc/unimp.h" #include "hw/arm/xlnx-versal.h" -#include "hw/char/pl011.h" #define XLNX_VERSAL_ACPU_TYPE ARM_CPU_TYPE_NAME("cortex-a72")#define GEM_REVISION 0x40070106
@@ -144,16 +143,17 @@ static void versal_create_uarts(Versal *s, qemu_irq *pic)DeviceState *dev;MemoryRegion *mr; - dev =qdev_create (NULL ,TYPE_PL011 ); - s->lpd.iou.uart[i] =SYS_BUS_DEVICE (dev); +sysbus_init_child_obj (OBJECT (s), name, + &s->lpd.iou.uart[i],sizeof (s->lpd.iou.uart[i]), +TYPE_PL011 ); + dev =DEVICE (&s->lpd.iou.uart[i]);qdev_prop_set_chr (dev,"chardev" ,serial_hd (i)); -object_property_add_child (OBJECT (s), name,OBJECT (dev), &error_fatal);qdev_init_nofail (dev); - mr =sysbus_mmio_get_region (s->lpd.iou.uart[i],0 ); + mr =sysbus_mmio_get_region (SYS_BUS_DEVICE (dev),0 );memory_region_add_subregion (&s->mr_ps, addrs[i], mr); -sysbus_connect_irq (s->lpd.iou.uart[i],0 , pic[irqs[i]]); +sysbus_connect_irq (SYS_BUS_DEVICE (dev),0 , pic[irqs[i]]);g_free (name); } }
Signature · 1 line
2.20.1
[PULL 25/39] target/arm: Convert V[US]DOT (vector) to decodetree
In reply to Peter MaydellConvert the V[US]DOT (vector) insns to decodetree.
Message-id: [email protected]
--- target/arm/neon-shared.decode | 4 ++++ target/arm/translate-neon.inc.c | 32 ++++++++++++++++++++++++++++++++ target/arm/translate.c | 9 +-------- 3 files changed, 37 insertions(+), 8 deletions(-)
target/arm/neon-shared.decode +4 -0
@@ -39,3 +39,7 @@ VCMLA 1111 110 rot:2 . 1 size:1 .... .... 1000 . q:1 . 0 .... \ VCADD 1111 110 rot:1 1 . 0 size:1 .... .... 1000 . q:1 . 0 .... \ vm=%vm_dp vn=%vn_dp vd=%vd_dp + +# VUDOT and VSDOT +VDOT 1111 110 00 . 10 .... .... 1101 . q:1 . u:1 .... \ + vm=%vm_dp vn=%vn_dp vd=%vd_dp
target/arm/translate-neon.inc.c +32 -0
@@ -104,3 +104,35 @@ static bool trans_VCADD(DisasContext *s, arg_VCADD *a)tcg_temp_free_ptr (fpst);return true; } + +static bool trans_VDOT (DisasContext *s,arg_VDOT *a) +{ +int opr_sz; +gen_helper_gvec_3 *fn_gvec; + +if (!dc_isar_feature (aa32_dp, s)) { +return false; + } + +/* UNDEF accesses to D16-D31 if they don't exist. */ +if (!dc_isar_feature (aa32_simd_r32, s) && + ((a->vd | a->vn | a->vm) &0x10 )) { +return false; + } + +if ((a->vn | a->vm | a->vd) & a->q) { +return false; + } + +if (!vfp_access_check (s)) { +return true; + } + + opr_sz = (1 + a->q) *8 ; + fn_gvec = a->u ? gen_helper_gvec_udot_b : gen_helper_gvec_sdot_b; +tcg_gen_gvec_3_ool (vfp_reg_offset (1 , a->vd), +vfp_reg_offset (1 , a->vn), +vfp_reg_offset (1 , a->vm), + opr_sz, opr_sz,0 , fn_gvec); +return true; +}
target/arm/translate.c +1 -8
@@ -7048,14 +7048,7 @@ static int disas_neon_insn_3same_ext(DisasContext *s, uint32_t insn)bool is_long = false, q =extract32 (insn,6 ,1 );bool ptr_is_env = false; -if ((insn &0xfeb00f00 ) ==0xfc200d00 ) { -/* V[US]DOT -- 1111 1100 0.10 .... .... 1101 .Q.U .... */ -bool u =extract32 (insn,4 ,1 ); -if (!dc_isar_feature (aa32_dp, s)) { -return 1 ; - } - fn_gvec = u ? gen_helper_gvec_udot_b : gen_helper_gvec_sdot_b; - }else if ((insn &0xff300f10 ) ==0xfc200810 ) { +if ((insn &0xff300f10 ) ==0xfc200810 ) {/* VFM[AS]L -- 1111 1100 S.10 .... .... 1000 .Q.1 .... */ int is_s =extract32 (insn,23 ,1 );if (!dc_isar_feature (aa32_fhm, s)) {
Signature · 1 line
2.20.1
[PULL 21/39] target/arm: Don't allow Thumb Neon insns without FEATURE_NEON
In reply to Peter MaydellWe were accidentally permitting decode of Thumb Neon insns even if the CPU didn't have the FEATURE_NEON bit set, because the feature check was being done before the call to disas_neon_data_insn() and disas_neon_ls_insn() in the Arm decoder but was omitted from the Thumb decoder. Push the feature bit check down into the called functions so it is done for both Arm and Thumb encodings.
Message-id: [email protected]
--- target/arm/translate.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
target/arm/translate.c +8 -8
@@ -3258,6 +3258,10 @@ static int disas_neon_ls_insn(DisasContext *s, uint32_t insn)TCGv_i32 tmp2;TCGv_i64 tmp64; +if (!arm_dc_feature (s,ARM_FEATURE_NEON )) { +return 1 ; + } +/* FIXME: this access check should not take precedence over UNDEF * for invalid encodings; we will generate incorrect syndrome information * for attempts to execute invalid vfp/neon encodings with FP disabled.
@@ -5002,6 +5006,10 @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn)TCGv_ptr ptr1, ptr2, ptr3;TCGv_i64 tmp64; +if (!arm_dc_feature (s,ARM_FEATURE_NEON )) { +return 1 ; + } +/* FIXME: this access check should not take precedence over UNDEF * for invalid encodings; we will generate incorrect syndrome information * for attempts to execute invalid vfp/neon encodings with FP disabled.
@@ -10948,10 +10956,6 @@ static void disas_arm_insn(DisasContext *s, unsigned int insn)if (((insn >>25 ) &7 ) ==1 ) {/* NEON Data processing. */ -if (!arm_dc_feature (s,ARM_FEATURE_NEON )) { - goto illegal_op; - } -if (disas_neon_data_insn (s, insn)) { goto illegal_op; }
@@ -10959,10 +10963,6 @@ static void disas_arm_insn(DisasContext *s, unsigned int insn) }if ((insn &0x0f100000 ) ==0x04000000 ) {/* NEON load/store. */ -if (!arm_dc_feature (s,ARM_FEATURE_NEON )) { - goto illegal_op; - } -if (disas_neon_ls_insn (s, insn)) { goto illegal_op; }
Signature · 1 line
2.20.1
[PULL 22/39] target/arm: Add stubs for AArch32 Neon decodetree
In reply to Peter MaydellAdd the infrastructure for building and invoking a decodetree decoder for the AArch32 Neon encodings. At the moment the new decoder covers nothing, so we always fall back to the existing hand-written decode.
We follow the same pattern we did for the VFP decodetree conversion (commit 78e138bc1f672c145ef6ace74617d and following): code that deals with Neon will be moving gradually out to translate-neon.vfp.inc, which we #include into translate.c.
In order to share the decode files between A32 and T32, we split Neon into 3 parts:
* data-processing
* load-store
* 'shared' encodings
The first two groups of instructions have similar but not identical A32 and T32 encodings, so we need to manually transform the T32 encoding into the A32 one before calling the decoder; the third group covers the Neon instructions which are identical in A32 and T32.
Message-id: [email protected]
--- target/arm/neon-dp.decode | 29 ++++++++++++++++++++++++++ target/arm/neon-ls.decode | 29 ++++++++++++++++++++++++++ target/arm/neon-shared.decode | 27 +++++++++++++++++++++++++ target/arm/translate-neon.inc.c | 32 +++++++++++++++++++++++++++++ target/arm/translate.c | 36 +++++++++++++++++++++++++++++++-- target/arm/Makefile.objs | 18 +++++++++++++++++ 6 files changed, 169 insertions(+), 2 deletions(-) create mode 100644 target/arm/neon-dp.decode create mode 100644 target/arm/neon-ls.decode create mode 100644 target/arm/neon-shared.decode create mode 100644 target/arm/translate-neon.inc.c
target/arm/neon-dp.decode new file +29 -0
@@ -0,0 +1,29 @@ +# AArch32 Neon data-processing instruction descriptions +# +# Copyright (c) 2020 Linaro, Ltd +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, see <http://www.gnu.org/licenses/>. + +# +# This file is processed by scripts/decodetree.py +# + +# Encodings for Neon data processing instructions where the T32 encoding +# is a simple transformation of the A32 encoding. +# More specifically, this file covers instructions where the A32 encoding is +# 0b1111_001p_qqqq_qqqq_qqqq_qqqq_qqqq_qqqq +# and the T32 encoding is +# 0b111p_1111_qqqq_qqqq_qqqq_qqqq_qqqq_qqqq +# This file works on the A32 encoding only; calling code for T32 has to +# transform the insn into the A32 version first.
target/arm/neon-ls.decode new file +29 -0
@@ -0,0 +1,29 @@ +# AArch32 Neon load/store instruction descriptions +# +# Copyright (c) 2020 Linaro, Ltd +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, see <http://www.gnu.org/licenses/>. + +# +# This file is processed by scripts/decodetree.py +# + +# Encodings for Neon load/store instructions where the T32 encoding +# is a simple transformation of the A32 encoding. +# More specifically, this file covers instructions where the A32 encoding is +# 0b1111_0100_xxx0_xxxx_xxxx_xxxx_xxxx_xxxx +# and the T32 encoding is +# 0b1111_1001_xxx0_xxxx_xxxx_xxxx_xxxx_xxxx +# This file works on the A32 encoding only; calling code for T32 has to +# transform the insn into the A32 version first.
target/arm/neon-shared.decode new file +27 -0
@@ -0,0 +1,27 @@ +# AArch32 Neon instruction descriptions +# +# Copyright (c) 2020 Linaro, Ltd +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, see <http://www.gnu.org/licenses/>. + +# +# This file is processed by scripts/decodetree.py +# + +# Encodings for Neon instructions whose encoding is the same for +# both A32 and T32. + +# More specifically, this covers: +# 2reg scalar ext: 0b1111_1110_xxxx_xxxx_xxxx_1x0x_xxxx_xxxx +# 3same ext: 0b1111_110x_xxxx_xxxx_xxxx_1x0x_xxxx_xxxx
target/arm/translate-neon.inc.c new file +32 -0
@@ -0,0 +1,32 @@ +/* +* ARM translation: AArch32 Neon instructions +* +* Copyright (c) 2003 Fabrice Bellard +* Copyright (c) 2005-2007 CodeSourcery +* Copyright (c) 2007 OpenedHand, Ltd. +* Copyright (c) 2020 Linaro, Ltd. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; either +* version 2 of the License, or (at your option) any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, see <http://www.gnu.org/licenses/>. +*/ + +/* +* This file is intended to be included from translate.c; it uses +* some macros and definitions provided by that file. +* It might be possible to convert it to a standalone .c file eventually. +*/ + +/* Include the generated Neon decoder */ +#include "decode-neon-dp.inc.c" +#include "decode-neon-ls.inc.c" +#include "decode-neon-shared.inc.c"
target/arm/translate.c +34 -2
@@ -1313,8 +1313,9 @@ static TCGv_ptr vfp_reg_ptr(bool dp, int reg)#define ARM_CP_RW_BIT (1 << 20) -/* Include the VFP decoder */ +/* Include the VFP and Neon decoders */ #include "translate-vfp.inc.c" +#include "translate-neon.inc.c" static inline void iwmmxt_load_reg (TCGv_i64 var,int reg) {
@@ -10949,7 +10950,10 @@ static void disas_arm_insn(DisasContext *s, unsigned int insn)/* Unconditional instructions. */ /* TODO: Perhaps merge these into one decodetree output file. */ if (disas_a32_uncond (s, insn) || -disas_vfp_uncond (s, insn)) { +disas_vfp_uncond (s, insn) || +disas_neon_dp (s, insn) || +disas_neon_ls (s, insn) || +disas_neon_shared (s, insn)) {return ; }/* fall back to legacy decoder */
@@ -11102,6 +11106,33 @@ static void disas_thumb2_insn(DisasContext *s, uint32_t insn) ARCH(6T2); } +if ((insn &0xef000000 ) ==0xef000000 ) { +/* +* T32 encodings 0b111p_1111_qqqq_qqqq_qqqq_qqqq_qqqq_qqqq +* transform into +* A32 encodings 0b1111_001p_qqqq_qqqq_qqqq_qqqq_qqqq_qqqq +*/ +uint32_t a32_insn = (insn &0xe2ffffff ) | + ((insn & (1 <<28 )) >>4 ) | (1 <<28 ); + +if (disas_neon_dp (s, a32_insn)) { +return ; + } + } + +if ((insn &0xff100000 ) ==0xf9000000 ) { +/* +* T32 encodings 0b1111_1001_ppp0_qqqq_qqqq_qqqq_qqqq_qqqq +* transform into +* A32 encodings 0b1111_0100_ppp0_qqqq_qqqq_qqqq_qqqq_qqqq +*/ +uint32_t a32_insn = (insn &0x00ffffff ) |0xf4000000 ; + +if (disas_neon_ls (s, a32_insn)) { +return ; + } + } +/* * TODO: Perhaps merge these into one decodetree output file. * Note disas_vfp is written for a32 with cond field in the
@@ -11109,6 +11140,7 @@ static void disas_thumb2_insn(DisasContext *s, uint32_t insn)*/ if (disas_t32 (s, insn) ||disas_vfp_uncond (s, insn) || +disas_neon_shared (s, insn) || ((insn >>28 ) ==0xe &&disas_vfp (s, insn))) {return ; }
target/arm/Makefile.objs +18 -0
@@ -18,6 +18,21 @@ target/arm/decode-sve.inc.c: $(SRC_PATH)/target/arm/sve.decode $(DECODETREE) $(PYTHON) $(DECODETREE) --decode disas_sve -o $@ $<,\ "GEN", $(TARGET_DIR)$@) +target/arm/decode-neon-shared.inc.c: $(SRC_PATH)/target/arm/neon-shared.decode $(DECODETREE) + $(call quiet-command,\ + $(PYTHON) $(DECODETREE) --static-decode disas_neon_shared -o $@ $<,\ + "GEN", $(TARGET_DIR)$@) + +target/arm/decode-neon-dp.inc.c: $(SRC_PATH)/target/arm/neon-dp.decode $(DECODETREE) + $(call quiet-command,\ + $(PYTHON) $(DECODETREE) --static-decode disas_neon_dp -o $@ $<,\ + "GEN", $(TARGET_DIR)$@) + +target/arm/decode-neon-ls.inc.c: $(SRC_PATH)/target/arm/neon-ls.decode $(DECODETREE) + $(call quiet-command,\ + $(PYTHON) $(DECODETREE) --static-decode disas_neon_ls -o $@ $<,\ + "GEN", $(TARGET_DIR)$@) + target/arm/decode-vfp.inc.c: $(SRC_PATH)/target/arm/vfp.decode $(DECODETREE) $(call quiet-command,\ $(PYTHON) $(DECODETREE) --static-decode disas_vfp -o $@ $<,\
@@ -49,6 +64,9 @@ target/arm/decode-t16.inc.c: $(SRC_PATH)/target/arm/t16.decode $(DECODETREE) "GEN", $(TARGET_DIR)$@) target/arm/translate-sve.o: target/arm/decode-sve.inc.c +target/arm/translate.o: target/arm/decode-neon-shared.inc.c +target/arm/translate.o: target/arm/decode-neon-dp.inc.c +target/arm/translate.o: target/arm/decode-neon-ls.inc.c target/arm/translate.o: target/arm/decode-vfp.inc.c target/arm/translate.o: target/arm/decode-vfp-uncond.inc.c target/arm/translate.o: target/arm/decode-a32.inc.c
Signature · 1 line
2.20.1
[PULL 13/39] hw/arm: versal: Embed the GEMs into the SoC type
In reply to Peter MaydellFrom: "Edgar E. Iglesias" <[email protected]>
Embed the GEMs into the SoC type.
Message-id: [email protected]
--- include/hw/arm/xlnx-versal.h | 3 ++- hw/arm/xlnx-versal.c | 15 ++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-)
include/hw/arm/xlnx-versal.h +2 -1
@@ -16,6 +16,7 @@#include "hw/arm/boot.h" #include "hw/intc/arm_gicv3.h" #include "hw/char/pl011.h" +#include "hw/net/cadence_gem.h" #define TYPE_XLNX_VERSAL "xlnx-versal"#define XLNX_VERSAL (obj) OBJECT_CHECK(Versal, (obj), TYPE_XLNX_VERSAL)
@@ -51,7 +52,7 @@ typedef struct Versal {struct {PL011State uart[XLNX_VERSAL_NR_UARTS ]; -SysBusDevice *gem[XLNX_VERSAL_NR_GEMS ]; +CadenceGEMState gem[XLNX_VERSAL_NR_GEMS ];SysBusDevice *adma[XLNX_VERSAL_NR_ADMAS ]; } iou; } lpd;
hw/arm/xlnx-versal.c +8 -7
@@ -170,25 +170,26 @@ static void versal_create_gems(Versal *s, qemu_irq *pic)DeviceState *dev;MemoryRegion *mr; - dev =qdev_create (NULL ,"cadence_gem" ); - s->lpd.iou.gem[i] =SYS_BUS_DEVICE (dev); -object_property_add_child (OBJECT (s), name,OBJECT (dev), &error_fatal); +sysbus_init_child_obj (OBJECT (s), name, + &s->lpd.iou.gem[i],sizeof (s->lpd.iou.gem[i]), +TYPE_CADENCE_GEM ); + dev =DEVICE (&s->lpd.iou.gem[i]);if (nd->used) {qemu_check_nic_model (nd,"cadence_gem" );qdev_set_nic_properties (dev, nd); } -object_property_set_int (OBJECT (s->lpd.iou.gem[i]), +object_property_set_int (OBJECT (dev),2 ,"num-priority-queues" , &error_abort); -object_property_set_link (OBJECT (s->lpd.iou.gem[i]), +object_property_set_link (OBJECT (dev),OBJECT (&s->mr_ps),"dma" , &error_abort);qdev_init_nofail (dev); - mr =sysbus_mmio_get_region (s->lpd.iou.gem[i],0 ); + mr =sysbus_mmio_get_region (SYS_BUS_DEVICE (dev),0 );memory_region_add_subregion (&s->mr_ps, addrs[i], mr); -sysbus_connect_irq (s->lpd.iou.gem[i],0 , pic[irqs[i]]); +sysbus_connect_irq (SYS_BUS_DEVICE (dev),0 , pic[irqs[i]]);g_free (name); } }
Signature · 1 line
2.20.1
[PULL 29/39] target/arm: Convert VFM[AS]L (scalar) to decodetree
In reply to Peter MaydellConvert the VFM[AS]L (scalar) insns in the 2reg-scalar-ext group to decodetree. These are the last ones in the group so we can remove all the legacy decode for the group.
Note that in disas_thumb2_insn() the parts of this encoding space where the decodetree decoder returns false will correctly be directed to illegal_op by the "(insn & (1 << 28))" check so they won't fall into disas_coproc_insn() by mistake.
Message-id: [email protected]
--- target/arm/neon-shared.decode | 7 +++ target/arm/translate-neon.inc.c | 32 ++++++++++ target/arm/translate.c | 107 +------------------------------- 3 files changed, 40 insertions(+), 106 deletions(-)
target/arm/neon-shared.decode +7 -0
@@ -57,3 +57,10 @@ VCMLA_scalar 1111 1110 1 . rot:2 .... .... 1000 . q:1 . 0 .... \ VDOT_scalar 1111 1110 0 . 10 .... .... 1101 . q:1 index:1 u:1 rm:4 \ vm=%vm_dp vn=%vn_dp vd=%vd_dp + +%vfml_scalar_q0_rm 0:3 5:1 +%vfml_scalar_q1_index 5:1 3:1 +VFML_scalar 1111 1110 0 . 0 s:1 .... .... 1000 . 0 . 1 index:1 ... \ + rm=%vfml_scalar_q0_rm vn=%vn_sp vd=%vd_dp q=0 +VFML_scalar 1111 1110 0 . 0 s:1 .... .... 1000 . 1 . 1 . rm:3 \ + index=%vfml_scalar_q1_index vn=%vn_dp vd=%vd_dp q=1
target/arm/translate-neon.inc.c +32 -0
@@ -242,3 +242,35 @@ static bool trans_VDOT_scalar(DisasContext *s, arg_VDOT_scalar *a)tcg_temp_free_ptr (fpst);return true; } + +static bool trans_VFML_scalar (DisasContext *s,arg_VFML_scalar *a) +{ +int opr_sz; + +if (!dc_isar_feature (aa32_fhm, s)) { +return false; + } + +/* UNDEF accesses to D16-D31 if they don't exist. */ +if (!dc_isar_feature (aa32_simd_r32, s) && + ((a->vd &0x10 ) || (a->q && (a->vn &0x10 )))) { +return false; + } + +if (a->vd & a->q) { +return false; + } + +if (!vfp_access_check (s)) { +return true; + } + + opr_sz = (1 + a->q) *8 ; +tcg_gen_gvec_3_ptr (vfp_reg_offset (1 , a->vd), +vfp_reg_offset (a->q, a->vn), +vfp_reg_offset (a->q, a->rm), + cpu_env, opr_sz, opr_sz, + (a->index <<2 ) | a->s,/* is_2 == 0 */ + gen_helper_gvec_fmlal_idx_a32); +return true; +}
target/arm/translate.c +1 -106
139 lines not on this page · raw message
Signature · 1 line
2.20.1
[PULL 32/39] target/arm: Convert Neon 'load/store single structure' to decodetree
In reply to Peter MaydellConvert the Neon "load/store single structure to one lane" insns to decodetree.
As this is the last set of insns in the neon load/store group, we can remove the whole disas_neon_ls_insn() function.
Message-id: [email protected]
--- target/arm/neon-ls.decode | 11 +++ target/arm/translate-neon.inc.c | 89 +++++++++++++++++++ target/arm/translate.c | 147 -------------------------------- 3 files changed, 100 insertions(+), 147 deletions(-)
target/arm/neon-ls.decode +11 -0
@@ -39,3 +39,14 @@ VLDST_multiple 1111 0100 0 . l:1 0 rn:4 .... itype:4 size:2 align:2 rm:4 \ VLD_all_lanes 1111 0100 1 . 1 0 rn:4 .... 11 n:2 size:2 t:1 a:1 rm:4 \ vd=%vd_dp + +# Neon load/store single structure to one lane +%imm1_5_p1 5:1 !function=plus1 +%imm1_6_p1 6:1 !function=plus1 + +VLDST_single 1111 0100 1 . l:1 0 rn:4 .... 00 n:2 reg_idx:3 align:1 rm:4 \ + vd=%vd_dp size=0 stride=1 +VLDST_single 1111 0100 1 . l:1 0 rn:4 .... 01 n:2 reg_idx:2 align:2 rm:4 \ + vd=%vd_dp size=1 stride=%imm1_5_p1 +VLDST_single 1111 0100 1 . l:1 0 rn:4 .... 10 n:2 reg_idx:1 align:3 rm:4 \ + vd=%vd_dp size=2 stride=%imm1_6_p1
target/arm/translate-neon.inc.c +89 -0
98 lines not on this page · raw message
target/arm/translate.c +0 -147
165 lines not on this page · raw message
Signature · 1 line
2.20.1
[PULL 23/39] target/arm: Convert VCMLA (vector) to decodetree
In reply to Peter MaydellConvert the VCMLA (vector) insns in the 3same extension group to decodetree.
Message-id: [email protected]
--- target/arm/neon-shared.decode | 11 ++++++++++ target/arm/translate-neon.inc.c | 37 +++++++++++++++++++++++++++++++++ target/arm/translate.c | 11 +--------- 3 files changed, 49 insertions(+), 10 deletions(-)
target/arm/neon-shared.decode +11 -0
@@ -25,3 +25,14 @@ # More specifically, this covers: # 2reg scalar ext: 0b1111_1110_xxxx_xxxx_xxxx_1x0x_xxxx_xxxx # 3same ext: 0b1111_110x_xxxx_xxxx_xxxx_1x0x_xxxx_xxxx + +# VFP/Neon register fields; same as vfp.decode +%vm_dp 5:1 0:4 +%vm_sp 0:4 5:1 +%vn_dp 7:1 16:4 +%vn_sp 16:4 7:1 +%vd_dp 22:1 12:4 +%vd_sp 12:4 22:1 + +VCMLA 1111 110 rot:2 . 1 size:1 .... .... 1000 . q:1 . 0 .... \ + vm=%vm_dp vn=%vn_dp vd=%vd_dp
target/arm/translate-neon.inc.c +37 -0
@@ -30,3 +30,40 @@#include "decode-neon-dp.inc.c" #include "decode-neon-ls.inc.c" #include "decode-neon-shared.inc.c" + +static bool trans_VCMLA (DisasContext *s,arg_VCMLA *a) +{ +int opr_sz; +TCGv_ptr fpst; +gen_helper_gvec_3_ptr *fn_gvec_ptr; + +if (!dc_isar_feature (aa32_vcma, s) + || (!a->size && !dc_isar_feature (aa32_fp16_arith, s))) { +return false; + } + +/* UNDEF accesses to D16-D31 if they don't exist. */ +if (!dc_isar_feature (aa32_simd_r32, s) && + ((a->vd | a->vn | a->vm) &0x10 )) { +return false; + } + +if ((a->vn | a->vm | a->vd) & a->q) { +return false; + } + +if (!vfp_access_check (s)) { +return true; + } + + opr_sz = (1 + a->q) *8 ; + fpst =get_fpstatus_ptr (1 ); + fn_gvec_ptr = a->size ? gen_helper_gvec_fcmlas : gen_helper_gvec_fcmlah; +tcg_gen_gvec_3_ptr (vfp_reg_offset (1 , a->vd), +vfp_reg_offset (1 , a->vn), +vfp_reg_offset (1 , a->vm), + fpst, opr_sz, opr_sz, a->rot, + fn_gvec_ptr); +tcg_temp_free_ptr (fpst); +return true; +}
target/arm/translate.c +1 -10
@@ -7048,16 +7048,7 @@ static int disas_neon_insn_3same_ext(DisasContext *s, uint32_t insn)bool is_long = false, q =extract32 (insn,6 ,1 );bool ptr_is_env = false; -if ((insn &0xfe200f10 ) ==0xfc200800 ) { -/* VCMLA -- 1111 110R R.1S .... .... 1000 ...0 .... */ -int size =extract32 (insn,20 ,1 ); - data =extract32 (insn,23 ,2 );/* rot */ -if (!dc_isar_feature (aa32_vcma, s) - || (!size && !dc_isar_feature (aa32_fp16_arith, s))) { -return 1 ; - } - fn_gvec_ptr = size ? gen_helper_gvec_fcmlas : gen_helper_gvec_fcmlah; - }else if ((insn &0xfea00f10 ) ==0xfc800800 ) { +if ((insn &0xfea00f10 ) ==0xfc800800 ) {/* VCADD -- 1111 110R 1.0S .... .... 1000 ...0 .... */ int size =extract32 (insn,20 ,1 ); data =extract32 (insn,24 ,1 );/* rot */
Signature · 1 line
2.20.1
[PULL 15/39] hw/arm: versal: Embed the APUs into the SoC type
In reply to Peter MaydellFrom: "Edgar E. Iglesias" <[email protected]>
Embed the APUs into the SoC type.
Message-id: [email protected]
--- include/hw/arm/xlnx-versal.h | 2 +- hw/arm/xlnx-versal-virt.c | 4 ++-- hw/arm/xlnx-versal.c | 19 +++++-------------- 3 files changed, 8 insertions(+), 17 deletions(-)
include/hw/arm/xlnx-versal.h +1 -1
@@ -36,7 +36,7 @@ typedef struct Versal {struct {struct {MemoryRegion mr; -ARMCPU *cpu[XLNX_VERSAL_NR_ACPUS ]; +ARMCPU cpu[XLNX_VERSAL_NR_ACPUS ];GICv3State gic; } apu; } fpd;
hw/arm/xlnx-versal-virt.c +2 -2
@@ -469,9 +469,9 @@ static void versal_virt_init(MachineState *machine) s->binfo.get_dtb = versal_virt_get_dtb; s->binfo.modify_dtb = versal_virt_modify_dtb;if (machine->kernel_filename) { -arm_load_kernel (s->soc.fpd.apu.cpu[0 ], machine, &s->binfo); +arm_load_kernel (&s->soc.fpd.apu.cpu[0 ], machine, &s->binfo); }else { -AddressSpace *as =arm_boot_address_space (s->soc.fpd.apu.cpu[0 ], +AddressSpace *as =arm_boot_address_space (&s->soc.fpd.apu.cpu[0 ], &s->binfo);/* Some boot-loaders (e.g u-boot) don't like blobs at address 0 (NULL). * Offset things by 4K. */
hw/arm/xlnx-versal.c +5 -14
@@ -31,19 +31,11 @@ static void versal_create_apu_cpus(Versal *s)for (i =0 ; i <ARRAY_SIZE (s->fpd.apu.cpu); i++) {Object *obj; -char *name; - - obj =object_new (XLNX_VERSAL_ACPU_TYPE ); -if (!obj) { -error_report ("Unable to create apu.cpu[%d] of type %s" , - i,XLNX_VERSAL_ACPU_TYPE ); -exit (EXIT_FAILURE ); - } - - name =g_strdup_printf ("apu-cpu[%d]" , i); -object_property_add_child (OBJECT (s), name, obj, &error_fatal); -g_free (name); +object_initialize_child (OBJECT (s),"apu-cpu[*]" , + &s->fpd.apu.cpu[i],sizeof (s->fpd.apu.cpu[i]), +XLNX_VERSAL_ACPU_TYPE , &error_abort,NULL ); + obj =OBJECT (&s->fpd.apu.cpu[i]);object_property_set_int (obj, s->cfg.psci_conduit,"psci-conduit" , &error_abort);if (i) {
@@ -57,7 +49,6 @@ static void versal_create_apu_cpus(Versal *s)object_property_set_link (obj,OBJECT (&s->fpd.apu.mr),"memory" , &error_abort);object_property_set_bool (obj, true,"realized" , &error_fatal); - s->fpd.apu.cpu[i] =ARM_CPU (obj); } }
@@ -95,7 +86,7 @@ static void versal_create_apu_gic(Versal *s, qemu_irq *pic) }for (i =0 ; i < nr_apu_cpus; i++) { -DeviceState *cpudev =DEVICE (s->fpd.apu.cpu[i]); +DeviceState *cpudev =DEVICE (&s->fpd.apu.cpu[i]);int ppibase =XLNX_VERSAL_NR_IRQS + i *GIC_INTERNAL +GIC_NR_SGIS ;qemu_irq maint_irq;int ti;
Signature · 1 line
2.20.1
[PULL 38/39] target/arm: Convert Neon 3-reg-same VMUL, VMLA, VMLS, VSHL to decodetree
In reply to Peter MaydellConvert the Neon VMUL, VMLA, VMLS and VSHL insns in the 3-reg-same grouping to decodetree.
Message-id: [email protected]
--- target/arm/neon-dp.decode | 9 +++++++ target/arm/translate-neon.inc.c | 44 +++++++++++++++++++++++++++++++++ target/arm/translate.c | 28 +++------------------ 3 files changed, 56 insertions(+), 25 deletions(-)
target/arm/neon-dp.decode +9 -0
@@ -65,6 +65,9 @@ VCGT_U_3s 1111 001 1 0 . .. .... .... 0011 . . . 0 .... @3same VCGE_S_3s 1111 001 0 0 . .. .... .... 0011 . . . 1 .... @3same VCGE_U_3s 1111 001 1 0 . .. .... .... 0011 . . . 1 .... @3same +VSHL_S_3s 1111 001 0 0 . .. .... .... 0100 . . . 0 .... @3same +VSHL_U_3s 1111 001 1 0 . .. .... .... 0100 . . . 0 .... @3same + VMAX_S_3s 1111 001 0 0 . .. .... .... 0110 . . . 0 .... @3same VMAX_U_3s 1111 001 1 0 . .. .... .... 0110 . . . 0 .... @3same VMIN_S_3s 1111 001 0 0 . .. .... .... 0110 . . . 1 .... @3same
@@ -75,3 +78,9 @@ VSUB_3s 1111 001 1 0 . .. .... .... 1000 . . . 0 .... @3same VTST_3s 1111 001 0 0 . .. .... .... 1000 . . . 1 .... @3same VCEQ_3s 1111 001 1 0 . .. .... .... 1000 . . . 1 .... @3same + +VMLA_3s 1111 001 0 0 . .. .... .... 1001 . . . 0 .... @3same +VMLS_3s 1111 001 1 0 . .. .... .... 1001 . . . 0 .... @3same + +VMUL_3s 1111 001 0 0 . .. .... .... 1001 . . . 1 .... @3same +VMUL_p_3s 1111 001 1 0 . .. .... .... 1001 . . . 1 .... @3same
target/arm/translate-neon.inc.c +44 -0
53 lines not on this page · raw message
target/arm/translate.c +3 -25
@@ -4848,31 +4848,6 @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn) }return 1 ; -case NEON_3R_VMUL :/* VMUL */ -if (u) { -/* Polynomial case allows only P8. */ -if (size !=0 ) { -return 1 ; - } -tcg_gen_gvec_3_ool (rd_ofs, rn_ofs, rm_ofs, vec_size, vec_size, -0 , gen_helper_gvec_pmul_b); - }else { -tcg_gen_gvec_mul (size, rd_ofs, rn_ofs, rm_ofs, - vec_size, vec_size); - } -return 0 ; - -case NEON_3R_VML :/* VMLA, VMLS */ -tcg_gen_gvec_3 (rd_ofs, rn_ofs, rm_ofs, vec_size, vec_size, - u ? &mls_op[size] : &mla_op[size]); -return 0 ; - -case NEON_3R_VSHL : -/* Note the operation is vshl vd,vm,vn */ -tcg_gen_gvec_3 (rd_ofs, rm_ofs, rn_ofs, vec_size, vec_size, - u ? &ushl_op[size] : &sshl_op[size]); -return 0 ; -case NEON_3R_VADD_VSUB :case NEON_3R_LOGIC :case NEON_3R_VMAX :
@@ -4882,6 +4857,9 @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn)case NEON_3R_VCGE :case NEON_3R_VQADD :case NEON_3R_VQSUB : +case NEON_3R_VMUL : +case NEON_3R_VML : +case NEON_3R_VSHL :/* Already handled by decodetree */ return 1 ; }
Signature · 1 line
2.20.1
[PULL 27/39] target/arm: Convert VCMLA (scalar) to decodetree
In reply to Peter MaydellConvert VCMLA (scalar) in the 2reg-scalar-ext group to decodetree.
Message-id: [email protected]
--- target/arm/neon-shared.decode | 5 +++++ target/arm/translate-neon.inc.c | 40 +++++++++++++++++++++++++++++++++ target/arm/translate.c | 26 +-------------------- 3 files changed, 46 insertions(+), 25 deletions(-)
target/arm/neon-shared.decode +5 -0
@@ -49,3 +49,8 @@ VFML 1111 110 0 s:1 . 10 .... .... 1000 . 0 . 1 .... \ vm=%vm_sp vn=%vn_sp vd=%vd_dp q=0 VFML 1111 110 0 s:1 . 10 .... .... 1000 . 1 . 1 .... \ vm=%vm_dp vn=%vn_dp vd=%vd_dp q=1 + +VCMLA_scalar 1111 1110 0 . rot:2 .... .... 1000 . q:1 index:1 0 vm:4 \ + vn=%vn_dp vd=%vd_dp size=0 +VCMLA_scalar 1111 1110 1 . rot:2 .... .... 1000 . q:1 . 0 .... \ + vm=%vm_dp vn=%vn_dp vd=%vd_dp size=1 index=0
target/arm/translate-neon.inc.c +40 -0
@@ -167,3 +167,43 @@ static bool trans_VFML(DisasContext *s, arg_VFML *a) gen_helper_gvec_fmlal_a32);return true; } + +static bool trans_VCMLA_scalar (DisasContext *s,arg_VCMLA_scalar *a) +{ +gen_helper_gvec_3_ptr *fn_gvec_ptr; +int opr_sz; +TCGv_ptr fpst; + +if (!dc_isar_feature (aa32_vcma, s)) { +return false; + } +if (a->size ==0 && !dc_isar_feature (aa32_fp16_arith, s)) { +return false; + } + +/* UNDEF accesses to D16-D31 if they don't exist. */ +if (!dc_isar_feature (aa32_simd_r32, s) && + ((a->vd | a->vn | a->vm) &0x10 )) { +return false; + } + +if ((a->vd | a->vn) & a->q) { +return false; + } + +if (!vfp_access_check (s)) { +return true; + } + + fn_gvec_ptr = (a->size ? gen_helper_gvec_fcmlas_idx + : gen_helper_gvec_fcmlah_idx); + opr_sz = (1 + a->q) *8 ; + fpst =get_fpstatus_ptr (1 ); +tcg_gen_gvec_3_ptr (vfp_reg_offset (1 , a->vd), +vfp_reg_offset (1 , a->vn), +vfp_reg_offset (1 , a->vm), + fpst, opr_sz, opr_sz, + (a->index <<2 ) | a->rot, fn_gvec_ptr); +tcg_temp_free_ptr (fpst); +return true; +}
target/arm/translate.c +1 -25
@@ -7049,31 +7049,7 @@ static int disas_neon_insn_2reg_scalar_ext(DisasContext *s, uint32_t insn)bool is_long = false, q =extract32 (insn,6 ,1 );bool ptr_is_env = false; -if ((insn &0xff000f10 ) ==0xfe000800 ) { -/* VCMLA (indexed) -- 1111 1110 S.RR .... .... 1000 ...0 .... */ -int rot =extract32 (insn,20 ,2 ); -int size =extract32 (insn,23 ,1 ); -int index; - -if (!dc_isar_feature (aa32_vcma, s)) { -return 1 ; - } -if (size ==0 ) { -if (!dc_isar_feature (aa32_fp16_arith, s)) { -return 1 ; - } -/* For fp16, rm is just Vm, and index is M. */ - rm =extract32 (insn,0 ,4 ); - index =extract32 (insn,5 ,1 ); - }else { -/* For fp32, rm is the usual M:Vm, and index is 0. */ -VFP_DREG_M (rm, insn); - index =0 ; - } - data = (index <<2 ) | rot; - fn_gvec_ptr = (size ? gen_helper_gvec_fcmlas_idx - : gen_helper_gvec_fcmlah_idx); - }else if ((insn &0xffb00f00 ) ==0xfe200d00 ) { +if ((insn &0xffb00f00 ) ==0xfe200d00 ) {/* V[US]DOT -- 1111 1110 0.10 .... .... 1101 .Q.U .... */ int u =extract32 (insn,4 ,1 );
Signature · 1 line
2.20.1
[PULL 19/39] hw/arm: versal-virt: Add support for the RTC
In reply to Peter MaydellFrom: "Edgar E. Iglesias" <[email protected]>
Add support for the RTC.
Message-id: [email protected]
--- hw/arm/xlnx-versal-virt.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
hw/arm/xlnx-versal-virt.c +22 -0
@@ -283,6 +283,27 @@ static void fdt_add_sd_nodes(VersalVirt *s) } } +static void fdt_add_rtc_node (VersalVirt *s) +{ +const char compat[] ="xlnx,zynqmp-rtc" ; +const char interrupt_names[] ="alarm\0sec" ; +char *name =g_strdup_printf ("/rtc@%x" ,MM_PMC_RTC ); + +qemu_fdt_add_subnode (s->fdt, name); + +qemu_fdt_setprop_cells (s->fdt, name,"interrupts" , +GIC_FDT_IRQ_TYPE_SPI ,VERSAL_RTC_ALARM_IRQ , +GIC_FDT_IRQ_FLAGS_LEVEL_HI , +GIC_FDT_IRQ_TYPE_SPI ,VERSAL_RTC_SECONDS_IRQ , +GIC_FDT_IRQ_FLAGS_LEVEL_HI ); +qemu_fdt_setprop (s->fdt, name,"interrupt-names" , + interrupt_names,sizeof (interrupt_names)); +qemu_fdt_setprop_sized_cells (s->fdt, name,"reg" , +2 ,MM_PMC_RTC ,2 ,MM_PMC_RTC_SIZE ); +qemu_fdt_setprop (s->fdt, name,"compatible" , compat,sizeof (compat)); +g_free (name); +} +static void fdt_nop_memory_nodes (void *fdt,Error **errp) {Error *err =NULL ;
@@ -496,6 +517,7 @@ static void versal_virt_init(MachineState *machine)fdt_add_timer_nodes (s);fdt_add_zdma_nodes (s);fdt_add_sd_nodes (s); +fdt_add_rtc_node (s);fdt_add_cpu_nodes (s, psci_conduit);fdt_add_clk_node (s,"/clk125" ,125000000 , s->phandle.clk_125Mhz);fdt_add_clk_node (s,"/clk25" ,25000000 , s->phandle.clk_25Mhz);
Signature · 1 line
2.20.1
[PULL 30/39] target/arm: Convert Neon load/store multiple structures to decodetree
In reply to Peter MaydellConvert the Neon "load/store multiple structures" insns to decodetree.
Message-id: [email protected]
--- target/arm/neon-ls.decode | 7 ++ target/arm/translate-neon.inc.c | 124 ++++++++++++++++++++++++++++++++ target/arm/translate.c | 91 +---------------------- 3 files changed, 133 insertions(+), 89 deletions(-)
target/arm/neon-ls.decode +7 -0
@@ -27,3 +27,10 @@ # 0b1111_1001_xxx0_xxxx_xxxx_xxxx_xxxx_xxxx # This file works on the A32 encoding only; calling code for T32 has to # transform the insn into the A32 version first. + +%vd_dp 22:1 12:4 + +# Neon load/store multiple structures + +VLDST_multiple 1111 0100 0 . l:1 0 rn:4 .... itype:4 size:2 align:2 rm:4 \ + vd=%vd_dp
target/arm/translate-neon.inc.c +124 -0
127 lines not on this page · raw message
target/arm/translate.c +2 -89
117 lines not on this page · raw message
Signature · 1 line
2.20.1
[PULL 20/39] target/arm/translate-vfp.inc.c: Remove duplicate simd_r32 check
In reply to Peter MaydellSomewhere along theline we accidentally added a duplicate "using D16-D31 when they don't exist" check to do_vfm_dp() (probably an artifact of a patchseries rebase). Remove it.
Message-id: [email protected]
--- target/arm/translate-vfp.inc.c | 6 ------ 1 file changed, 6 deletions(-)
target/arm/translate-vfp.inc.c +0 -6
@@ -1872,12 +1872,6 @@ static bool do_vfm_dp(DisasContext *s, arg_VFMA_dp *a, bool neg_n, bool neg_d)return false; } -/* UNDEF accesses to D16-D31 if they don't exist. */ -if (!dc_isar_feature (aa32_simd_r32, s) && - ((a->vd | a->vn | a->vm) &0x10 )) { -return false; - } -if (!vfp_access_check (s)) {return true; }
Signature · 1 line
2.20.1
[PULL 31/39] target/arm: Convert Neon 'load single structure to all lanes' to decodetree
In reply to Peter MaydellConvert the Neon "load single structure to all lanes" insns to decodetree.
Message-id: [email protected]
--- target/arm/neon-ls.decode | 5 +++ target/arm/translate-neon.inc.c | 73 +++++++++++++++++++++++++++++++++ target/arm/translate.c | 55 +------------------------ 3 files changed, 80 insertions(+), 53 deletions(-)
target/arm/neon-ls.decode +5 -0
@@ -34,3 +34,8 @@ VLDST_multiple 1111 0100 0 . l:1 0 rn:4 .... itype:4 size:2 align:2 rm:4 \ vd=%vd_dp + +# Neon load single element to all lanes + +VLD_all_lanes 1111 0100 1 . 1 0 rn:4 .... 11 n:2 size:2 t:1 a:1 rm:4 \ + vd=%vd_dp
target/arm/translate-neon.inc.c +73 -0
76 lines not on this page · raw message
target/arm/translate.c +2 -53
67 lines not on this page · raw message
Signature · 1 line
2.20.1
[PULL 26/39] target/arm: Convert VFM[AS]L (vector) to decodetree
In reply to Peter MaydellConvert the VFM[AS]L (vector) insns to decodetree. This is the last insn in the legacy decoder for the 3same_ext group, so we can delete the legacy decoder function for the group entirely.
Note that in disas_thumb2_insn() the parts of this encoding space where the decodetree decoder returns false will correctly be directed to illegal_op by the "(insn & (1 << 28))" check so they won't fall into disas_coproc_insn() by mistake.
Message-id: [email protected]
--- target/arm/neon-shared.decode | 6 +++ target/arm/translate-neon.inc.c | 31 +++++++++++ target/arm/translate.c | 92 +-------------------------------- 3 files changed, 38 insertions(+), 91 deletions(-)
target/arm/neon-shared.decode +6 -0
@@ -43,3 +43,9 @@ VCADD 1111 110 rot:1 1 . 0 size:1 .... .... 1000 . q:1 . 0 .... \ # VUDOT and VSDOT VDOT 1111 110 00 . 10 .... .... 1101 . q:1 . u:1 .... \ vm=%vm_dp vn=%vn_dp vd=%vd_dp + +# VFM[AS]L +VFML 1111 110 0 s:1 . 10 .... .... 1000 . 0 . 1 .... \ + vm=%vm_sp vn=%vn_sp vd=%vd_dp q=0 +VFML 1111 110 0 s:1 . 10 .... .... 1000 . 1 . 1 .... \ + vm=%vm_dp vn=%vn_dp vd=%vd_dp q=1
target/arm/translate-neon.inc.c +31 -0
@@ -136,3 +136,34 @@ static bool trans_VDOT(DisasContext *s, arg_VDOT *a) opr_sz, opr_sz, 0, fn_gvec);return true; } + +static bool trans_VFML (DisasContext *s,arg_VFML *a) +{ +int opr_sz; + +if (!dc_isar_feature (aa32_fhm, s)) { +return false; + } + +/* UNDEF accesses to D16-D31 if they don't exist. */ +if (!dc_isar_feature (aa32_simd_r32, s) && + (a->vd &0x10 )) { +return false; + } + +if (a->vd & a->q) { +return false; + } + +if (!vfp_access_check (s)) { +return true; + } + + opr_sz = (1 + a->q) *8 ; +tcg_gen_gvec_3_ptr (vfp_reg_offset (1 , a->vd), +vfp_reg_offset (a->q, a->vn), +vfp_reg_offset (a->q, a->vm), + cpu_env, opr_sz, opr_sz, a->s,/* is_2 == 0 */ + gen_helper_gvec_fmlal_a32); +return true; +}
target/arm/translate.c +1 -91
112 lines not on this page · raw message
Signature · 1 line
2.20.1
[PULL 28/39] target/arm: Convert V[US]DOT (scalar) to decodetree
In reply to Peter MaydellConvert the V[US]DOT (scalar) insns in the 2reg-scalar-ext group to decodetree.
Message-id: [email protected]
--- target/arm/neon-shared.decode | 3 +++ target/arm/translate-neon.inc.c | 35 +++++++++++++++++++++++++++++++++ target/arm/translate.c | 13 +----------- 3 files changed, 39 insertions(+), 12 deletions(-)
target/arm/neon-shared.decode +3 -0
@@ -54,3 +54,6 @@ VCMLA_scalar 1111 1110 0 . rot:2 .... .... 1000 . q:1 index:1 0 vm:4 \ vn=%vn_dp vd=%vd_dp size=0 VCMLA_scalar 1111 1110 1 . rot:2 .... .... 1000 . q:1 . 0 .... \ vm=%vm_dp vn=%vn_dp vd=%vd_dp size=1 index=0 + +VDOT_scalar 1111 1110 0 . 10 .... .... 1101 . q:1 index:1 u:1 rm:4 \ + vm=%vm_dp vn=%vn_dp vd=%vd_dp
target/arm/translate-neon.inc.c +35 -0
@@ -207,3 +207,38 @@ static bool trans_VCMLA_scalar(DisasContext *s, arg_VCMLA_scalar *a)tcg_temp_free_ptr (fpst);return true; } + +static bool trans_VDOT_scalar (DisasContext *s,arg_VDOT_scalar *a) +{ +gen_helper_gvec_3 *fn_gvec; +int opr_sz; +TCGv_ptr fpst; + +if (!dc_isar_feature (aa32_dp, s)) { +return false; + } + +/* UNDEF accesses to D16-D31 if they don't exist. */ +if (!dc_isar_feature (aa32_simd_r32, s) && + ((a->vd | a->vn) &0x10 )) { +return false; + } + +if ((a->vd | a->vn) & a->q) { +return false; + } + +if (!vfp_access_check (s)) { +return true; + } + + fn_gvec = a->u ? gen_helper_gvec_udot_idx_b : gen_helper_gvec_sdot_idx_b; + opr_sz = (1 + a->q) *8 ; + fpst =get_fpstatus_ptr (1 ); +tcg_gen_gvec_3_ool (vfp_reg_offset (1 , a->vd), +vfp_reg_offset (1 , a->vn), +vfp_reg_offset (1 , a->rm), + opr_sz, opr_sz, a->index, fn_gvec); +tcg_temp_free_ptr (fpst); +return true; +}
target/arm/translate.c +1 -12
@@ -7049,18 +7049,7 @@ static int disas_neon_insn_2reg_scalar_ext(DisasContext *s, uint32_t insn)bool is_long = false, q =extract32 (insn,6 ,1 );bool ptr_is_env = false; -if ((insn &0xffb00f00 ) ==0xfe200d00 ) { -/* V[US]DOT -- 1111 1110 0.10 .... .... 1101 .Q.U .... */ -int u =extract32 (insn,4 ,1 ); - -if (!dc_isar_feature (aa32_dp, s)) { -return 1 ; - } - fn_gvec = u ? gen_helper_gvec_udot_idx_b : gen_helper_gvec_sdot_idx_b; -/* rm is just Vm, and index is M. */ - data =extract32 (insn,5 ,1 );/* index */ - rm =extract32 (insn,0 ,4 ); - }else if ((insn &0xffa00f10 ) ==0xfe000810 ) { +if ((insn &0xffa00f10 ) ==0xfe000810 ) {/* VFM[AS]L -- 1111 1110 0.0S .... .... 1000 .Q.1 .... */ int is_s =extract32 (insn,20 ,1 );int vm20 =extract32 (insn,0 ,3 );
Signature · 1 line
2.20.1
[PULL 33/39] target/arm: Convert Neon 3-reg-same VADD/VSUB to decodetree
In reply to Peter MaydellConvert the Neon 3-reg-same VADD and VSUB insns to decodetree.
Note that we don't need the neon_3r_sizes[op] check here because all size values are OK for VADD and VSUB; we'll add this when we convert the first insn that has size restrictions.
For this we need one of the GVecGen*Fn typedefs currently in translate-a64.h; move them all to translate.h as a block so they are visible to the 32-bit decoder.
Message-id: [email protected]
--- target/arm/translate-a64.h | 9 -------- target/arm/translate.h | 9 ++++++++ target/arm/neon-dp.decode | 17 +++++++++++++++ target/arm/translate-neon.inc.c | 38 +++++++++++++++++++++++++++++++++ target/arm/translate.c | 14 ++++-------- 5 files changed, 68 insertions(+), 19 deletions(-)
target/arm/translate-a64.h +0 -9
@@ -115,13 +115,4 @@ static inline int vec_full_reg_size(DisasContext *s)bool disas_sve (DisasContext *,uint32_t ); -/* Note that the gvec expanders operate on offsets + sizes. */ -typedef void GVecGen2Fn (unsigned ,uint32_t ,uint32_t ,uint32_t ,uint32_t ); -typedef void GVecGen2iFn (unsigned ,uint32_t ,uint32_t ,int64_t , -uint32_t ,uint32_t ); -typedef void GVecGen3Fn (unsigned ,uint32_t ,uint32_t , -uint32_t ,uint32_t ,uint32_t ); -typedef void GVecGen4Fn (unsigned ,uint32_t ,uint32_t ,uint32_t , -uint32_t ,uint32_t ,uint32_t ); -#endif /* TARGET_ARM_TRANSLATE_A64_H */
target/arm/translate.h +9 -0
@@ -305,4 +305,13 @@ void gen_sshl_i64(TCGv_i64 d, TCGv_i64 a, TCGv_i64 b);#define dc_isar_feature (name, ctx) \ ({ DisasContext *ctx_ = (ctx); isar_feature_##name(ctx_->isar); }) +/* Note that the gvec expanders operate on offsets + sizes. */ +typedef void GVecGen2Fn (unsigned ,uint32_t ,uint32_t ,uint32_t ,uint32_t ); +typedef void GVecGen2iFn (unsigned ,uint32_t ,uint32_t ,int64_t , +uint32_t ,uint32_t ); +typedef void GVecGen3Fn (unsigned ,uint32_t ,uint32_t , +uint32_t ,uint32_t ,uint32_t ); +typedef void GVecGen4Fn (unsigned ,uint32_t ,uint32_t ,uint32_t , +uint32_t ,uint32_t ,uint32_t ); +#endif /* TARGET_ARM_TRANSLATE_H */
target/arm/neon-dp.decode +17 -0
@@ -18,6 +18,10 @@ # # This file is processed by scripts/decodetree.py # +# VFP/Neon register fields; same as vfp.decode +%vm_dp 5:1 0:4 +%vn_dp 7:1 16:4 +%vd_dp 22:1 12:4 # Encodings for Neon data processing instructions where the T32 encoding # is a simple transformation of the A32 encoding.
@@ -27,3 +31,16 @@ # 0b111p_1111_qqqq_qqqq_qqqq_qqqq_qqqq_qqqq # This file works on the A32 encoding only; calling code for T32 has to # transform the insn into the A32 version first. + +###################################################################### +# 3-reg-same grouping: +# 1111 001 U 0 D sz:2 Vn:4 Vd:4 opc:4 N Q M op Vm:4 +###################################################################### + +&3same vm vn vd q size + +@3same .... ... . . . size:2 .... .... .... . q:1 . . .... \ + &3same vm=%vm_dp vn=%vn_dp vd=%vd_dp + +VADD_3s 1111 001 0 0 . .. .... .... 1000 . . . 0 .... @3same +VSUB_3s 1111 001 1 0 . .. .... .... 1000 . . . 0 .... @3same
target/arm/translate-neon.inc.c +38 -0
@@ -560,3 +560,41 @@ static bool trans_VLDST_single(DisasContext *s, arg_VLDST_single *a)return true; } + +static bool do_3same (DisasContext *s,arg_3same *a,GVecGen3Fn fn) +{ +int vec_size = a->q ?16 :8 ; +int rd_ofs =neon_reg_offset (a->vd,0 ); +int rn_ofs =neon_reg_offset (a->vn,0 ); +int rm_ofs =neon_reg_offset (a->vm,0 ); + +if (!arm_dc_feature (s,ARM_FEATURE_NEON )) { +return false; + } + +/* UNDEF accesses to D16-D31 if they don't exist. */ +if (!dc_isar_feature (aa32_simd_r32, s) && + ((a->vd | a->vn | a->vm) &0x10 )) { +return false; + } + +if ((a->vn | a->vm | a->vd) & a->q) { +return false; + } + +if (!vfp_access_check (s)) { +return true; + } + +fn (a->size, rd_ofs, rn_ofs, rm_ofs, vec_size, vec_size); +return true; +} + +#define DO_3SAME (INSN ,FUNC ) \ + static bool trans_##INSN##_3s(DisasContext *s, arg_3same *a) \ + { \ + return do_3same(s, a, FUNC); \ + } + +DO_3SAME(VADD, tcg_gen_gvec_add) +DO_3SAME (VSUB , tcg_gen_gvec_sub)
target/arm/translate.c +4 -10
@@ -4885,16 +4885,6 @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn) }return 0 ; -case NEON_3R_VADD_VSUB : -if (u) { -tcg_gen_gvec_sub (size, rd_ofs, rn_ofs, rm_ofs, - vec_size, vec_size); - }else { -tcg_gen_gvec_add (size, rd_ofs, rn_ofs, rm_ofs, - vec_size, vec_size); - } -return 0 ; -case NEON_3R_VQADD : tcg_gen_gvec_4(rd_ofs, offsetof(CPUARMState, vfp.qc), rn_ofs, rm_ofs, vec_size, vec_size,
@@ -4970,6 +4960,10 @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn)tcg_gen_gvec_3 (rd_ofs, rm_ofs, rn_ofs, vec_size, vec_size, u ? &ushl_op[size] : &sshl_op[size]);return 0 ; + +case NEON_3R_VADD_VSUB : +/* Already handled by decodetree */ +return 1 ; }if (size ==3 ) {
Signature · 1 line
2.20.1
[PULL 35/39] target/arm: Convert Neon 3-reg-same VMAX/VMIN to decodetree
In reply to Peter MaydellConvert the Neon 3-reg-same VMAX and VMIN insns to decodetree.
Message-id: [email protected]
--- target/arm/neon-dp.decode | 5 +++++ target/arm/translate-neon.inc.c | 14 ++++++++++++++ target/arm/translate.c | 21 ++------------------- 3 files changed, 21 insertions(+), 19 deletions(-)
target/arm/neon-dp.decode +5 -0
@@ -54,5 +54,10 @@ VBSL_3s 1111 001 1 0 . 01 .... .... 0001 ... 1 .... @3same_logic VBIT_3s 1111 001 1 0 . 10 .... .... 0001 ... 1 .... @3same_logic VBIF_3s 1111 001 1 0 . 11 .... .... 0001 ... 1 .... @3same_logic +VMAX_S_3s 1111 001 0 0 . .. .... .... 0110 . . . 0 .... @3same +VMAX_U_3s 1111 001 1 0 . .. .... .... 0110 . . . 0 .... @3same +VMIN_S_3s 1111 001 0 0 . .. .... .... 0110 . . . 1 .... @3same +VMIN_U_3s 1111 001 1 0 . .. .... .... 0110 . . . 1 .... @3same + VADD_3s 1111 001 0 0 . .. .... .... 1000 . . . 0 .... @3same VSUB_3s 1111 001 1 0 . .. .... .... 1000 . . . 0 .... @3same
target/arm/translate-neon.inc.c +14 -0
@@ -617,3 +617,17 @@ DO_3SAME(VEOR, tcg_gen_gvec_xor) DO_3SAME_BITSEL(VBSL, rd_ofs, rn_ofs, rm_ofs) DO_3SAME_BITSEL(VBIT, rm_ofs, rn_ofs, rd_ofs) DO_3SAME_BITSEL(VBIF, rm_ofs, rd_ofs, rn_ofs) + +#define DO_3SAME_NO_SZ_3 (INSN ,FUNC ) \ + static bool trans_##INSN##_3s(DisasContext *s, arg_3same *a) \ + { \ + if (a->size == 3) { \ + return false; \ + } \ + return do_3same(s, a, FUNC); \ + } + +DO_3SAME_NO_SZ_3(VMAX_S, tcg_gen_gvec_smax) +DO_3SAME_NO_SZ_3(VMAX_U, tcg_gen_gvec_umax) +DO_3SAME_NO_SZ_3(VMIN_S, tcg_gen_gvec_smin) +DO_3SAME_NO_SZ_3 (VMIN_U , tcg_gen_gvec_umin)
target/arm/translate.c +2 -19
@@ -4899,25 +4899,6 @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn) rd_ofs, rn_ofs, rm_ofs, vec_size, vec_size);return 0 ; -case NEON_3R_VMAX : -if (u) { -tcg_gen_gvec_umax (size, rd_ofs, rn_ofs, rm_ofs, - vec_size, vec_size); - }else { -tcg_gen_gvec_smax (size, rd_ofs, rn_ofs, rm_ofs, - vec_size, vec_size); - } -return 0 ; -case NEON_3R_VMIN : -if (u) { -tcg_gen_gvec_umin (size, rd_ofs, rn_ofs, rm_ofs, - vec_size, vec_size); - }else { -tcg_gen_gvec_smin (size, rd_ofs, rn_ofs, rm_ofs, - vec_size, vec_size); - } -return 0 ; -case NEON_3R_VSHL :/* Note the operation is vshl vd,vm,vn */ tcg_gen_gvec_3(rd_ofs, rm_ofs, rn_ofs, vec_size, vec_size,
@@ -4926,6 +4907,8 @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn)case NEON_3R_VADD_VSUB :case NEON_3R_LOGIC : +case NEON_3R_VMAX : +case NEON_3R_VMIN :/* Already handled by decodetree */ return 1 ; }
Signature · 1 line
2.20.1
[PULL 34/39] target/arm: Convert Neon 3-reg-same logic ops to decodetree
In reply to Peter MaydellConvert the Neon logic ops in the 3-reg-same grouping to decodetree. Note that for the logic ops the 'size' field forms part of their decode and the actual operations are always bitwise.
Message-id: [email protected]
--- target/arm/neon-dp.decode | 12 +++++++++++ target/arm/translate-neon.inc.c | 19 +++++++++++++++++ target/arm/translate.c | 38 +-------------------------------- 3 files changed, 32 insertions(+), 37 deletions(-)
target/arm/neon-dp.decode +12 -0
@@ -42,5 +42,17 @@ @3same .... ... . . . size:2 .... .... .... . q:1 . . .... \ &3same vm=%vm_dp vn=%vn_dp vd=%vd_dp +@3same_logic .... ... . . . .. .... .... .... . q:1 .. .... \ + &3same vm=%vm_dp vn=%vn_dp vd=%vd_dp size=0 + +VAND_3s 1111 001 0 0 . 00 .... .... 0001 ... 1 .... @3same_logic +VBIC_3s 1111 001 0 0 . 01 .... .... 0001 ... 1 .... @3same_logic +VORR_3s 1111 001 0 0 . 10 .... .... 0001 ... 1 .... @3same_logic +VORN_3s 1111 001 0 0 . 11 .... .... 0001 ... 1 .... @3same_logic +VEOR_3s 1111 001 1 0 . 00 .... .... 0001 ... 1 .... @3same_logic +VBSL_3s 1111 001 1 0 . 01 .... .... 0001 ... 1 .... @3same_logic +VBIT_3s 1111 001 1 0 . 10 .... .... 0001 ... 1 .... @3same_logic +VBIF_3s 1111 001 1 0 . 11 .... .... 0001 ... 1 .... @3same_logic + VADD_3s 1111 001 0 0 . .. .... .... 1000 . . . 0 .... @3same VSUB_3s 1111 001 1 0 . .. .... .... 1000 . . . 0 .... @3same
target/arm/translate-neon.inc.c +19 -0
@@ -598,3 +598,22 @@ static bool do_3same(DisasContext *s, arg_3same *a, GVecGen3Fn fn) DO_3SAME(VADD, tcg_gen_gvec_add) DO_3SAME(VSUB, tcg_gen_gvec_sub) +DO_3SAME(VAND, tcg_gen_gvec_and) +DO_3SAME(VBIC, tcg_gen_gvec_andc) +DO_3SAME(VORR, tcg_gen_gvec_or) +DO_3SAME(VORN, tcg_gen_gvec_orc) +DO_3SAME (VEOR , tcg_gen_gvec_xor) + +/* These insns are all gvec_bitsel but with the inputs in various orders. */ +#define DO_3SAME_BITSEL (INSN ,O1 ,O2 ,O3 ) \ + static void gen_##INSN##_3s(unsigned vece, uint32_t rd_ofs, \ + uint32_t rn_ofs, uint32_t rm_ofs, \ + uint32_t oprsz, uint32_t maxsz) \ + { \ + tcg_gen_gvec_bitsel(vece, rd_ofs, O1, O2, O3, oprsz, maxsz); \ + } \ + DO_3SAME(INSN, gen_##INSN##_3s) + +DO_3SAME_BITSEL(VBSL, rd_ofs, rn_ofs, rm_ofs) +DO_3SAME_BITSEL(VBIT, rm_ofs, rn_ofs, rd_ofs) +DO_3SAME_BITSEL (VBIF , rm_ofs, rd_ofs, rn_ofs)
target/arm/translate.c +1 -37
@@ -4848,43 +4848,6 @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn) }return 1 ; -case NEON_3R_LOGIC :/* Logic ops. */ -switch ((u <<2 ) | size) { -case 0 :/* VAND */ -tcg_gen_gvec_and (0 , rd_ofs, rn_ofs, rm_ofs, - vec_size, vec_size); -break ; -case 1 :/* VBIC */ -tcg_gen_gvec_andc (0 , rd_ofs, rn_ofs, rm_ofs, - vec_size, vec_size); -break ; -case 2 :/* VORR */ -tcg_gen_gvec_or (0 , rd_ofs, rn_ofs, rm_ofs, - vec_size, vec_size); -break ; -case 3 :/* VORN */ -tcg_gen_gvec_orc (0 , rd_ofs, rn_ofs, rm_ofs, - vec_size, vec_size); -break ; -case 4 :/* VEOR */ -tcg_gen_gvec_xor (0 , rd_ofs, rn_ofs, rm_ofs, - vec_size, vec_size); -break ; -case 5 :/* VBSL */ -tcg_gen_gvec_bitsel (MO_8 , rd_ofs, rd_ofs, rn_ofs, rm_ofs, - vec_size, vec_size); -break ; -case 6 :/* VBIT */ -tcg_gen_gvec_bitsel (MO_8 , rd_ofs, rm_ofs, rn_ofs, rd_ofs, - vec_size, vec_size); -break ; -case 7 :/* VBIF */ -tcg_gen_gvec_bitsel (MO_8 , rd_ofs, rm_ofs, rd_ofs, rn_ofs, - vec_size, vec_size); -break ; - } -return 0 ; -case NEON_3R_VQADD : tcg_gen_gvec_4(rd_ofs, offsetof(CPUARMState, vfp.qc), rn_ofs, rm_ofs, vec_size, vec_size,
@@ -4962,6 +4925,7 @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn)return 0 ;case NEON_3R_VADD_VSUB : +case NEON_3R_LOGIC :/* Already handled by decodetree */ return 1 ; }
Signature · 1 line
2.20.1
[PULL 36/39] target/arm: Convert Neon 3-reg-same comparisons to decodetree
In reply to Peter MaydellConvert the Neon comparison ops in the 3-reg-same grouping to decodetree.
Message-id: [email protected]
--- target/arm/neon-dp.decode | 8 ++++++++ target/arm/translate-neon.inc.c | 22 ++++++++++++++++++++++ target/arm/translate.c | 23 +++-------------------- 3 files changed, 33 insertions(+), 20 deletions(-)
target/arm/neon-dp.decode +8 -0
@@ -54,6 +54,11 @@ VBSL_3s 1111 001 1 0 . 01 .... .... 0001 ... 1 .... @3same_logic VBIT_3s 1111 001 1 0 . 10 .... .... 0001 ... 1 .... @3same_logic VBIF_3s 1111 001 1 0 . 11 .... .... 0001 ... 1 .... @3same_logic +VCGT_S_3s 1111 001 0 0 . .. .... .... 0011 . . . 0 .... @3same +VCGT_U_3s 1111 001 1 0 . .. .... .... 0011 . . . 0 .... @3same +VCGE_S_3s 1111 001 0 0 . .. .... .... 0011 . . . 1 .... @3same +VCGE_U_3s 1111 001 1 0 . .. .... .... 0011 . . . 1 .... @3same + VMAX_S_3s 1111 001 0 0 . .. .... .... 0110 . . . 0 .... @3same VMAX_U_3s 1111 001 1 0 . .. .... .... 0110 . . . 0 .... @3same VMIN_S_3s 1111 001 0 0 . .. .... .... 0110 . . . 1 .... @3same
@@ -61,3 +66,6 @@ VMIN_U_3s 1111 001 1 0 . .. .... .... 0110 . . . 1 .... @3same VADD_3s 1111 001 0 0 . .. .... .... 1000 . . . 0 .... @3same VSUB_3s 1111 001 1 0 . .. .... .... 1000 . . . 0 .... @3same + +VTST_3s 1111 001 0 0 . .. .... .... 1000 . . . 1 .... @3same +VCEQ_3s 1111 001 1 0 . .. .... .... 1000 . . . 1 .... @3same
target/arm/translate-neon.inc.c +22 -0
@@ -631,3 +631,25 @@ DO_3SAME_NO_SZ_3(VMAX_S, tcg_gen_gvec_smax) DO_3SAME_NO_SZ_3(VMAX_U, tcg_gen_gvec_umax) DO_3SAME_NO_SZ_3(VMIN_S, tcg_gen_gvec_smin) DO_3SAME_NO_SZ_3(VMIN_U, tcg_gen_gvec_umin) + +#define DO_3SAME_CMP (INSN ,COND ) \ + static void gen_##INSN##_3s(unsigned vece, uint32_t rd_ofs, \ + uint32_t rn_ofs, uint32_t rm_ofs, \ + uint32_t oprsz, uint32_t maxsz) \ + { \ + tcg_gen_gvec_cmp(COND, vece, rd_ofs, rn_ofs, rm_ofs, oprsz, maxsz); \ + } \ + DO_3SAME_NO_SZ_3(INSN, gen_##INSN##_3s) + +DO_3SAME_CMP(VCGT_S, TCG_COND_GT) +DO_3SAME_CMP(VCGT_U, TCG_COND_GTU) +DO_3SAME_CMP(VCGE_S, TCG_COND_GE) +DO_3SAME_CMP(VCGE_U, TCG_COND_GEU) +DO_3SAME_CMP(VCEQ, TCG_COND_EQ) + +static void gen_VTST_3s (unsigned vece,uint32_t rd_ofs,uint32_t rn_ofs, +uint32_t rm_ofs,uint32_t oprsz,uint32_t maxsz) +{ +tcg_gen_gvec_3 (rd_ofs, rn_ofs, rm_ofs, oprsz, maxsz, &cmtst_op[vece]); +} +DO_3SAME_NO_SZ_3 (VTST , gen_VTST_3s)
target/arm/translate.c +3 -20
@@ -4879,26 +4879,6 @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn) u ? &mls_op[size] : &mla_op[size]);return 0 ; -case NEON_3R_VTST_VCEQ : -if (u) {/* VCEQ */ -tcg_gen_gvec_cmp (TCG_COND_EQ , size, rd_ofs, rn_ofs, rm_ofs, - vec_size, vec_size); - }else {/* VTST */ -tcg_gen_gvec_3 (rd_ofs, rn_ofs, rm_ofs, - vec_size, vec_size, &cmtst_op[size]); - } -return 0 ; - -case NEON_3R_VCGT : -tcg_gen_gvec_cmp (u ?TCG_COND_GTU :TCG_COND_GT , size, - rd_ofs, rn_ofs, rm_ofs, vec_size, vec_size); -return 0 ; - -case NEON_3R_VCGE : -tcg_gen_gvec_cmp (u ?TCG_COND_GEU :TCG_COND_GE , size, - rd_ofs, rn_ofs, rm_ofs, vec_size, vec_size); -return 0 ; -case NEON_3R_VSHL :/* Note the operation is vshl vd,vm,vn */ tcg_gen_gvec_3(rd_ofs, rm_ofs, rn_ofs, vec_size, vec_size,
@@ -4909,6 +4889,9 @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn)case NEON_3R_LOGIC :case NEON_3R_VMAX :case NEON_3R_VMIN : +case NEON_3R_VTST_VCEQ : +case NEON_3R_VCGT : +case NEON_3R_VCGE :/* Already handled by decodetree */ return 1 ; }
Signature · 1 line
2.20.1
[PULL 37/39] target/arm: Convert Neon 3-reg-same VQADD/VQSUB to decodetree
In reply to Peter MaydellConvert the Neon VQADD/VQSUB insns in the 3-reg-same grouping to decodetree.
Message-id: [email protected]
--- target/arm/neon-dp.decode | 6 ++++++ target/arm/translate-neon.inc.c | 15 +++++++++++++++ target/arm/translate.c | 14 ++------------ 3 files changed, 23 insertions(+), 12 deletions(-)
target/arm/neon-dp.decode +6 -0
@@ -42,6 +42,9 @@ @3same .... ... . . . size:2 .... .... .... . q:1 . . .... \ &3same vm=%vm_dp vn=%vn_dp vd=%vd_dp +VQADD_S_3s 1111 001 0 0 . .. .... .... 0000 . . . 1 .... @3same +VQADD_U_3s 1111 001 1 0 . .. .... .... 0000 . . . 1 .... @3same + @3same_logic .... ... . . . .. .... .... .... . q:1 .. .... \ &3same vm=%vm_dp vn=%vn_dp vd=%vd_dp size=0
@@ -54,6 +57,9 @@ VBSL_3s 1111 001 1 0 . 01 .... .... 0001 ... 1 .... @3same_logic VBIT_3s 1111 001 1 0 . 10 .... .... 0001 ... 1 .... @3same_logic VBIF_3s 1111 001 1 0 . 11 .... .... 0001 ... 1 .... @3same_logic +VQSUB_S_3s 1111 001 0 0 . .. .... .... 0010 . . . 1 .... @3same +VQSUB_U_3s 1111 001 1 0 . .. .... .... 0010 . . . 1 .... @3same + VCGT_S_3s 1111 001 0 0 . .. .... .... 0011 . . . 0 .... @3same VCGT_U_3s 1111 001 1 0 . .. .... .... 0011 . . . 0 .... @3same VCGE_S_3s 1111 001 0 0 . .. .... .... 0011 . . . 1 .... @3same
target/arm/translate-neon.inc.c +15 -0
@@ -653,3 +653,18 @@ static void gen_VTST_3s(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs,tcg_gen_gvec_3 (rd_ofs, rn_ofs, rm_ofs, oprsz, maxsz, &cmtst_op[vece]); } DO_3SAME_NO_SZ_3(VTST, gen_VTST_3s) + +#define DO_3SAME_GVEC4 (INSN ,OPARRAY ) \ + static void gen_##INSN##_3s(unsigned vece, uint32_t rd_ofs, \ + uint32_t rn_ofs, uint32_t rm_ofs, \ + uint32_t oprsz, uint32_t maxsz) \ + { \ + tcg_gen_gvec_4(rd_ofs, offsetof(CPUARMState, vfp.qc), \ + rn_ofs, rm_ofs, oprsz, maxsz, &OPARRAY[vece]); \ + } \ + DO_3SAME(INSN, gen_##INSN##_3s) + +DO_3SAME_GVEC4(VQADD_S, sqadd_op) +DO_3SAME_GVEC4(VQADD_U, uqadd_op) +DO_3SAME_GVEC4(VQSUB_S, sqsub_op) +DO_3SAME_GVEC4 (VQSUB_U , uqsub_op)
target/arm/translate.c +2 -12
@@ -4848,18 +4848,6 @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn) }return 1 ; -case NEON_3R_VQADD : - tcg_gen_gvec_4(rd_ofs, offsetof(CPUARMState, vfp.qc), - rn_ofs, rm_ofs, vec_size, vec_size, - (u ? uqadd_op : sqadd_op) + size); -return 0 ; - -case NEON_3R_VQSUB : - tcg_gen_gvec_4(rd_ofs, offsetof(CPUARMState, vfp.qc), - rn_ofs, rm_ofs, vec_size, vec_size, - (u ? uqsub_op : sqsub_op) + size); -return 0 ; -case NEON_3R_VMUL :/* VMUL */ if (u) {/* Polynomial case allows only P8. */
@@ -4892,6 +4880,8 @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn)case NEON_3R_VTST_VCEQ :case NEON_3R_VCGT :case NEON_3R_VCGE : +case NEON_3R_VQADD : +case NEON_3R_VQSUB :/* Already handled by decodetree */ return 1 ; }
Signature · 1 line
2.20.1
[PULL 39/39] target/arm: Move gen_ function typedefs to translate.h
In reply to Peter MaydellWe're going to want at least some of the NeonGen* typedefs for the refactored 32-bit Neon decoder, so move them all to translate.h since it makes more sense to keep them in one group.
Message-id: [email protected]
--- target/arm/translate.h | 17 +++++++++++++++++ target/arm/translate-a64.c | 17 ----------------- 2 files changed, 17 insertions(+), 17 deletions(-)
target/arm/translate.h +17 -0
@@ -314,4 +314,21 @@ typedef void GVecGen3Fn(unsigned, uint32_t, uint32_t,typedef void GVecGen4Fn (unsigned ,uint32_t ,uint32_t ,uint32_t ,uint32_t ,uint32_t ,uint32_t ); +/* Function prototype for gen_ functions for calling Neon helpers */ +typedef void NeonGenOneOpEnvFn (TCGv_i32 ,TCGv_ptr ,TCGv_i32 ); +typedef void NeonGenTwoOpFn (TCGv_i32 ,TCGv_i32 ,TCGv_i32 ); +typedef void NeonGenTwoOpEnvFn (TCGv_i32 ,TCGv_ptr ,TCGv_i32 ,TCGv_i32 ); +typedef void NeonGenTwo64OpFn (TCGv_i64 ,TCGv_i64 ,TCGv_i64 ); +typedef void NeonGenTwo64OpEnvFn (TCGv_i64 ,TCGv_ptr ,TCGv_i64 ,TCGv_i64 ); +typedef void NeonGenNarrowFn (TCGv_i32 ,TCGv_i64 ); +typedef void NeonGenNarrowEnvFn (TCGv_i32 ,TCGv_ptr ,TCGv_i64 ); +typedef void NeonGenWidenFn (TCGv_i64 ,TCGv_i32 ); +typedef void NeonGenTwoSingleOPFn (TCGv_i32 ,TCGv_i32 ,TCGv_i32 ,TCGv_ptr ); +typedef void NeonGenTwoDoubleOPFn (TCGv_i64 ,TCGv_i64 ,TCGv_i64 ,TCGv_ptr ); +typedef void NeonGenOneOpFn (TCGv_i64 ,TCGv_i64 ); +typedef void CryptoTwoOpFn (TCGv_ptr ,TCGv_ptr ); +typedef void CryptoThreeOpIntFn (TCGv_ptr ,TCGv_ptr ,TCGv_i32 ); +typedef void CryptoThreeOpFn (TCGv_ptr ,TCGv_ptr ,TCGv_ptr ); +typedef void AtomicThreeOpFn (TCGv_i64 ,TCGv_i64 ,TCGv_i64 ,TCGArg ,MemOp ); +#endif /* TARGET_ARM_TRANSLATE_H */
target/arm/translate-a64.c +0 -17
@@ -70,23 +70,6 @@ typedef struct AArch64DecodeTable {AArch64DecodeFn *disas_fn; } AArch64DecodeTable; -/* Function prototype for gen_ functions for calling Neon helpers */ -typedef void NeonGenOneOpEnvFn (TCGv_i32 ,TCGv_ptr ,TCGv_i32 ); -typedef void NeonGenTwoOpFn (TCGv_i32 ,TCGv_i32 ,TCGv_i32 ); -typedef void NeonGenTwoOpEnvFn (TCGv_i32 ,TCGv_ptr ,TCGv_i32 ,TCGv_i32 ); -typedef void NeonGenTwo64OpFn (TCGv_i64 ,TCGv_i64 ,TCGv_i64 ); -typedef void NeonGenTwo64OpEnvFn (TCGv_i64 ,TCGv_ptr ,TCGv_i64 ,TCGv_i64 ); -typedef void NeonGenNarrowFn (TCGv_i32 ,TCGv_i64 ); -typedef void NeonGenNarrowEnvFn (TCGv_i32 ,TCGv_ptr ,TCGv_i64 ); -typedef void NeonGenWidenFn (TCGv_i64 ,TCGv_i32 ); -typedef void NeonGenTwoSingleOPFn (TCGv_i32 ,TCGv_i32 ,TCGv_i32 ,TCGv_ptr ); -typedef void NeonGenTwoDoubleOPFn (TCGv_i64 ,TCGv_i64 ,TCGv_i64 ,TCGv_ptr ); -typedef void NeonGenOneOpFn (TCGv_i64 ,TCGv_i64 ); -typedef void CryptoTwoOpFn (TCGv_ptr ,TCGv_ptr ); -typedef void CryptoThreeOpIntFn (TCGv_ptr ,TCGv_ptr ,TCGv_i32 ); -typedef void CryptoThreeOpFn (TCGv_ptr ,TCGv_ptr ,TCGv_ptr ); -typedef void AtomicThreeOpFn (TCGv_i64 ,TCGv_i64 ,TCGv_i64 ,TCGArg ,MemOp ); -/* initialize TCG globals. */ void a64_translate_init (void ) {
Signature · 1 line
2.20.1
Peter Maydell
AppliedQuoted 19 lines · Peter Maydell
Most of this is the Neon decodetree patches, followed by Edgar's versal cleanups.
thanks
-- PMMThe following changes since commit
2ef486e76d64436be90f7359a3071fb2a56ce835:Merge remote-tracking branch 'remotes/marcel/tags/rdma-pull-request' into staging (2020-05-03 14:12:56 +0100)
are available in the Git repository at:
https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20200504
for you to fetch changes up to
9aefc6cf9b73f66062d2f914a0136756e7a28211:target/arm: Move
gen_function typedefs totranslate.h(2020-05-04 12:59:26 +0100)
Quoted 7 lines
----------------------------------------------------------------
target-arm queue:
* Start of conversion of Neon insns to decodetree
* versal board: support SD and RTC
* Implement ARMv8.2-TTS2UXN
* Make VQDMULL undefined when U=1
* Some minor code cleanups
Applied, thanks.
Please update the changelog at https://wiki.qemu.org/ChangeLog/5.1
for any user-visible changes.
-- PMM
Patchew URL: https://patchew.org/QEMU/[email protected]/
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series failed build test on FreeBSD host. Please find the details below.
=== TEST SCRIPT BEGIN ===
#!/bin/bash
# Testing script will be invoked under the git checkout with # HEAD pointing to a commit that has the patches applied on top of "base"
# branch if qemu-system-x86_64 --help >/dev/null 2>&1; then QEMU=qemu-system-x86_64 elif /usr/libexec/qemu-kvm --help >/dev/null 2>&1; then QEMU=/usr/libexec/qemu-kvm else exit 1 fi make vm-build-freebsd J=21 QEMU=$QEMU exit 0 === TEST SCRIPT END ===
The full log is available at
http://patchew.org/logs/[email protected]/testing.FreeBSD/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]
Patchew URL: https://patchew.org/QEMU/[email protected]/
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series failed the docker-mingw@fedora build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally.
=== TEST SCRIPT BEGIN ===
#! /bin/bash
export ARCH=x86_64
make docker-image-fedora V=1 NETWORK=1
time make docker-test-mingw@fedora J=14 NETWORK=1
=== TEST SCRIPT END ===
The full log is available at
http://patchew.org/logs/[email protected]/testing.docker-mingw@fedora/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]