accel/tcg: Remove most MO_TE uses in cpu_ld/st_code/data()
v3 cover accel/tcg: Remove most MO_TE uses in cpu_ld/st_code/data()
Quick attempt to remove MO_TE uses for fixed-endianness targets.
v3: convert all CODE uses, almost all DATA uses (except PPC/MIPS).
v2: convert all but mips targets and remove unexplicit API.
Superseeded: <[email protected]>
Philippe Mathieu-Daudé (21):
accel/tcg: Add endianness variants of cpu_ld{uw,l,q}_code() target/alpha: Use little-endian variant of cpu_ldl_code() target/loongarch: Use little-endian variant of cpu_ldl_code() target/sparc: Use big-endian variant of cpu_ldl_code() target/s390x: Use big-endian variant of cpu_ld{uw,l}_code() target/riscv: Use little-endian variant of cpu_ld{l,q}_code() target/ppc: Replace cpu_ldl_code() by explicit endianness variants target/mips: Replace cpu_ld{uw,l}_code() by explicit endianness
variants
accel/tcg: Remove non-explicit endian cpu_ld*_code() helpers target/hexagon: Use little-endian variant of cpu_ld/st_data*() target/tricore: Use little-endian variant of cpu_ld/st_data*() target/rx: Use little-endian variant of cpu_ld/st_data*() target/m68k: Use little-endian variant of cpu_ld/st_data*() target/s390x: Use little-endian variant of cpu_ld/st_data*() target/sparc: Use little-endian variant of cpu_ld/st_data*() target/i386: Use little-endian variant of cpu_ld/st_data*() target/hppa: Use little-endian variant of cpu_ld/st_data*() target/riscv: Use little-endian variant of cpu_ld/st_data*() for
vector
target/sh4: Replace cpu_stl_data() by explicit endianness variants target/mips: Use big-endian variant of cpu_ld/st_data*() for MSA accel/tcg: Remove non-explicit endian cpu_ld/st*_data*() helpers
include/accel/tcg/cpu-ldst.h | 79 +++++--------- target/hexagon/macros.h | 6 +- target/i386/ops_sse.h | 12 +-- target/i386/tcg/seg_helper.h | 12 +-- linux-user/vm86.c | 4 +- target/alpha/mem_helper.c | 2 +- target/hexagon/op_helper.c | 6 +- target/hppa/op_helper.c | 44 ++++---- target/i386/tcg/mem_helper.c | 8 +- target/i386/tcg/mpx_helper.c | 28 ++--- target/i386/tcg/seg_helper.c | 16 +-- target/i386/tcg/system/excp_helper.c | 8 +- target/i386/tcg/system/svm_helper.c | 48 ++++----- target/loongarch/tcg/tcg_cpu.c | 2 +- target/m68k/fpu_helper.c | 12 +-- target/m68k/op_helper.c | 88 ++++++++-------- target/mips/tcg/msa_helper.c | 51 +++++---- target/mips/tcg/system/tlb_helper.c | 22 +++- target/ppc/tcg-excp_helper.c | 16 +-- target/riscv/translate.c | 2 +- target/riscv/vector_helper.c | 12 +-- target/riscv/zce_helper.c | 4 +- target/rx/helper.c | 14 +-- target/rx/op_helper.c | 6 +- target/s390x/tcg/mem_helper.c | 54 +++++----- target/s390x/tcg/vec_helper.c | 8 +- target/sh4/op_helper.c | 6 +- target/sparc/int32_helper.c | 2 +- target/sparc/ldst_helper.c | 6 +- target/tricore/op_helper.c | 152 +++++++++++++-------------- 30 files changed, 360 insertions(+), 370 deletions(-)
Signature · 1 line
2.51.0
PATCH v3 1/21 accel/tcg: Add endianness variants of cpu_ld{uw, l, q}_code()
Allow target with fixed-endianness to not use the MO_TE definition.
--- include/accel/tcg/cpu-ldst.h | 43 +++++++++++++++++++++++++++++++----- 1 file changed, 37 insertions(+), 6 deletions(-)
include/accel/tcg/cpu-ldst.h +37 -6
@@ -481,25 +481,56 @@ static inline uint32_t cpu_ldub_code(CPUArchState *env, abi_ptr addr)return cpu_ldb_code_mmu (env, addr, oi,0 ); } -static inline uint32_t cpu_lduw_code (CPUArchState *env,abi_ptr addr) +static inline uint32_t cpu_lduw_le_code (CPUArchState *env,abi_ptr addr) {CPUState *cs =env_cpu (env); -MemOpIdx oi =make_memop_idx (MO_TEUW ,cpu_mmu_index (cs, true)); +MemOpIdx oi =make_memop_idx (MO_LEUW ,cpu_mmu_index (cs, true));return cpu_ldw_code_mmu (env, addr, oi,0 ); } -static inline uint32_t cpu_ldl_code (CPUArchState *env,abi_ptr addr) +static inline uint32_t cpu_ldl_le_code (CPUArchState *env,abi_ptr addr) {CPUState *cs =env_cpu (env); -MemOpIdx oi =make_memop_idx (MO_TEUL ,cpu_mmu_index (cs, true)); +MemOpIdx oi =make_memop_idx (MO_LEUL ,cpu_mmu_index (cs, true));return cpu_ldl_code_mmu (env, addr, oi,0 ); } -static inline uint64_t cpu_ldq_code (CPUArchState *env,abi_ptr addr) +static inline uint64_t cpu_ldq_le_code (CPUArchState *env,abi_ptr addr) {CPUState *cs =env_cpu (env); -MemOpIdx oi =make_memop_idx (MO_TEUQ ,cpu_mmu_index (cs, true)); +MemOpIdx oi =make_memop_idx (MO_LEUQ ,cpu_mmu_index (cs, true));return cpu_ldq_code_mmu (env, addr, oi,0 ); } +static inline uint32_t cpu_lduw_be_code (CPUArchState *env,abi_ptr addr) +{ +CPUState *cs =env_cpu (env); +MemOpIdx oi =make_memop_idx (MO_BEUW ,cpu_mmu_index (cs, true)); +return cpu_ldw_code_mmu (env, addr, oi,0 ); +} + +static inline uint32_t cpu_ldl_be_code (CPUArchState *env,abi_ptr addr) +{ +CPUState *cs =env_cpu (env); +MemOpIdx oi =make_memop_idx (MO_BEUL ,cpu_mmu_index (cs, true)); +return cpu_ldl_code_mmu (env, addr, oi,0 ); +} + +static inline uint64_t cpu_ldq_be_code (CPUArchState *env,abi_ptr addr) +{ +CPUState *cs =env_cpu (env); +MemOpIdx oi =make_memop_idx (MO_BEUQ ,cpu_mmu_index (cs, true)); +return cpu_ldq_code_mmu (env, addr, oi,0 ); +} + +#if TARGET_BIG_ENDIAN +# define cpu_lduw_code cpu_lduw_be_code +# define cpu_ldl_code cpu_ldl_be_code +# define cpu_ldq_code cpu_ldq_be_code +#else +# define cpu_lduw_code cpu_lduw_le_code +# define cpu_ldl_code cpu_ldl_le_code +# define cpu_ldq_code cpu_ldq_le_code +#endif +#endif /* ACCEL_TCG_CPU_LDST_H */
Signature · 1 line
2.51.0
Re: [RFC-PATCH-for-11.0 v3 01/21] accel/tcg: Add endianness variants of cpu_ld{uw,l,q}_code()
Quoted 6 lines · Philippe Mathieu-Daudé
Allow target with fixed-endianness to not use the
MO_TEdefinition.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- include/accel/tcg/cpu-ldst.h | 43 +++++++++++++++++++++++++++++++----- 1 file changed, 37 insertions(+), 6 deletions(-)
There are 28 uses left.
Perhaps we can finish the conversion to cpu_ld*_code_mmu.
r~
PATCH v3 2/21 target/alpha: Use little-endian variant of cpu_ldl_code()
In reply to Philippe Mathieu-DaudéAlpha instructions are always stored in little-endian order.
--- target/alpha/mem_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
target/alpha/mem_helper.c +1 -1
@@ -30,7 +30,7 @@ static void do_unaligned_access(CPUAlphaState *env, vaddr addr, uintptr_t retaddcpu_restore_state (env_cpu (env), retaddr); pc = env->pc; - insn =cpu_ldl_code (env, pc); + insn =cpu_ldl_le_code (env, pc); env->trap_arg0 = addr; env->trap_arg1 = insn >>26 ;/* opcode */
Signature · 1 line
2.51.0
PATCH v3 3/21 target/loongarch: Use little-endian variant of cpu_ldl_code()
In reply to Philippe Mathieu-DaudéLoongArch instructions are always stored in little-endian order.
--- target/loongarch/tcg/tcg_cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
target/loongarch/tcg/tcg_cpu.c +1 -1
@@ -140,7 +140,7 @@ static void loongarch_cpu_do_interrupt(CPUState *cs) }if (update_badinstr) { - env->CSR_BADI =cpu_ldl_code (env, env->pc); + env->CSR_BADI =cpu_ldl_le_code (env, env->pc); }/* Save PLV and IE */
Signature · 1 line
2.51.0
PATCH v3 4/21 target/sparc: Use big-endian variant of cpu_ldl_code()
In reply to Philippe Mathieu-DaudéSPARC instructions are always stored in big-endian order.
--- target/sparc/int32_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
target/sparc/int32_helper.c +1 -1
@@ -151,7 +151,7 @@ void sparc_cpu_do_interrupt(CPUState *cs)if (!env->fsr_qne) { env->fsr_qne =FSR_QNE ; env->fq.s.addr = env->pc; - env->fq.s.insn =cpu_ldl_code (env, env->pc); + env->fq.s.insn =cpu_ldl_be_code (env, env->pc); } env->pc = env->npc; env->npc = env->npc +4 ;
Signature · 1 line
2.51.0
PATCH v3 5/21 target/s390x: Use big-endian variant of cpu_ld{uw, l}_code()
In reply to Philippe Mathieu-DaudéS390x instructions are always stored in big-endian order.
--- target/s390x/tcg/mem_helper.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
target/s390x/tcg/mem_helper.c +3 -3
@@ -2437,7 +2437,7 @@ void HELPER(ex)(CPUS390XState *env, uint32_t ilen, uint64_t r1, uint64_t addr)tcg_s390_program_interrupt (env,PGM_SPECIFICATION ,GETPC ()); } - insn =cpu_lduw_code (env, addr); + insn =cpu_lduw_be_code (env, addr); opc = insn >>8 ;/* Or in the contents of R1[56:63]. */
@@ -2449,10 +2449,10 @@ void HELPER(ex)(CPUS390XState *env, uint32_t ilen, uint64_t r1, uint64_t addr)case 2 :break ;case 4 : - insn |= (uint64_t )cpu_lduw_code (env, addr +2 ) <<32 ; + insn |= (uint64_t )cpu_lduw_be_code (env, addr +2 ) <<32 ;break ;case 6 : - insn |= (uint64_t )(uint32_t )cpu_ldl_code (env, addr +2 ) <<16 ; + insn |= (uint64_t )(uint32_t )cpu_ldl_be_code (env, addr +2 ) <<16 ;break ;default :g_assert_not_reached ();
Signature · 1 line
2.51.0
PATCH v3 6/21 target/riscv: Use little-endian variant of cpu_ld{l, q}_code()
In reply to Philippe Mathieu-DaudéRISC-V instructions are always stored in little-endian order (see "Volume I: RISC-V Unprivileged ISA" document, chapter 'Instruction Encoding Spaces and Prefixes': "instruction fetch in RISC-V is little-endian").
--- target/riscv/translate.c | 2 +- target/riscv/zce_helper.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
target/riscv/translate.c +1 -1
@@ -1182,7 +1182,7 @@ static uint32_t opcode_at(DisasContextBase *dcbase, target_ulong pc)CPUState *cpu = ctx->cs;CPURISCVState *env =cpu_env (cpu); -return cpu_ldl_code (env, pc); +return cpu_ldl_le_code (env, pc); }#define SS_MMU_INDEX (ctx) (ctx->mem_idx | MMU_IDX_SS_WRITE)
target/riscv/zce_helper.c +2 -2
@@ -44,10 +44,10 @@ target_ulong HELPER(cm_jalt)(CPURISCVState *env, uint32_t index)if (xlen ==32 ) { t0 = base + (index <<2 ); - target =cpu_ldl_code (env, t0); + target =cpu_ldl_le_code (env, t0); }else { t0 = base + (index <<3 ); - target =cpu_ldq_code (env, t0); + target =cpu_ldq_le_code (env, t0); }return target & ~0x1 ;
Signature · 1 line
2.51.0
PATCH v3 7/21 target/ppc: Replace cpu_ldl_code() by explicit endianness variants
In reply to Philippe Mathieu-Daudé--- target/ppc/tcg-excp_helper.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-)
target/ppc/tcg-excp_helper.c +2 -14
@@ -424,22 +424,10 @@ G_NORETURN void powerpc_checkstop(CPUPPCState *env, const char *reason)cpu_loop_exit_noexc (cs); } -/* Return true iff byteswap is needed to load instruction */ -static inline bool insn_need_byteswap (CPUArchState *env) -{ -/* SYSTEM builds TARGET_BIG_ENDIAN. Need to swap when MSR[LE] is set */ -return !!(env->msr & ((target_ulong )1 <<MSR_LE )); -} -uint32_t ppc_ldl_code (CPUArchState *env,target_ulong addr) { -uint32_t insn =cpu_ldl_code (env, addr); - -if (insn_need_byteswap (env)) { - insn =bswap32 (insn); - } - -return insn; +return FIELD_EX64 (env->msr,MSR ,LE ) ?cpu_ldl_le_code (env, addr) + :cpu_ldl_be_code (env, addr); }#if defined(TARGET_PPC64 )
Signature · 1 line
2.51.0
PATCH v3 8/21 target/mips: Replace cpu_ld{uw, l}_code() by explicit endianness variants
In reply to Philippe Mathieu-Daudé--- target/mips/tcg/system/tlb_helper.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-)
target/mips/tcg/system/tlb_helper.c +17 -5
@@ -997,18 +997,30 @@ static void set_hflags_for_handler(CPUMIPSState *env) } } +static uint16_t lduw_code (CPUMIPSState *env,target_ulong addr) +{ +return mips_env_is_bigendian (env) ?cpu_lduw_be_code (env, addr) + :cpu_lduw_le_code (env, addr); +} + +static uint32_t ldl_code (CPUMIPSState *env,target_ulong addr) +{ +return mips_env_is_bigendian (env) ?cpu_ldl_be_code (env, addr) + :cpu_ldl_le_code (env, addr); +} +static inline void set_badinstr_registers (CPUMIPSState *env) {if (env->insn_flags &ISA_NANOMIPS32 ) {if (env->CP0_Config3 & (1 <<CP0C3_BI )) { -uint32_t instr = (cpu_lduw_code (env, env->active_tc.PC)) <<16 ; +uint32_t instr = (lduw_code (env, env->active_tc.PC)) <<16 ;if ((instr &0x10000000 ) ==0 ) { - instr |=cpu_lduw_code (env, env->active_tc.PC +2 ); + instr |=lduw_code (env, env->active_tc.PC +2 ); } env->CP0_BadInstr = instr;if ((instr &0xFC000000 ) ==0x60000000 ) { - instr =cpu_lduw_code (env, env->active_tc.PC +4 ) <<16 ; + instr =lduw_code (env, env->active_tc.PC +4 ) <<16 ; env->CP0_BadInstrX = instr; } }
@@ -1020,11 +1032,11 @@ static inline void set_badinstr_registers(CPUMIPSState *env)return ; }if (env->CP0_Config3 & (1 <<CP0C3_BI )) { - env->CP0_BadInstr =cpu_ldl_code (env, env->active_tc.PC); + env->CP0_BadInstr =ldl_code (env, env->active_tc.PC); }if ((env->CP0_Config3 & (1 <<CP0C3_BP )) && (env->hflags &MIPS_HFLAG_BMASK )) { - env->CP0_BadInstrP =cpu_ldl_code (env, env->active_tc.PC -4 ); + env->CP0_BadInstrP =ldl_code (env, env->active_tc.PC -4 ); } }
Signature · 1 line
2.51.0
PATCH v3 9/21 accel/tcg: Remove non-explicit endian cpu_ld*_code() helpers
In reply to Philippe Mathieu-DaudéAll uses were converted to the explicit cpu_ld*_{be,le}_code() helpers, no need for the non-explicit versions anymore.
--- include/accel/tcg/cpu-ldst.h | 10 ---------- 1 file changed, 10 deletions(-)
include/accel/tcg/cpu-ldst.h +0 -10
@@ -523,14 +523,4 @@ static inline uint64_t cpu_ldq_be_code(CPUArchState *env, abi_ptr addr) return cpu_ldq_code_mmu(env, addr, oi, 0); } -#if TARGET_BIG_ENDIAN -# define cpu_lduw_code cpu_lduw_be_code -# define cpu_ldl_code cpu_ldl_be_code -# define cpu_ldq_code cpu_ldq_be_code -#else -# define cpu_lduw_code cpu_lduw_le_code -# define cpu_ldl_code cpu_ldl_le_code -# define cpu_ldq_code cpu_ldq_le_code -#endif -#endif /* ACCEL_TCG_CPU_LDST_H */
Signature · 1 line
2.51.0
PATCH v3 10/21 target/hexagon: Use little-endian variant of cpu_ld/st_data*()
In reply to Philippe Mathieu-DaudéWe only build the Hexagon target using little endianness order, therefore the cpu_ld/st_data*() definitions expand to the little endian declarations. Use the explicit little-endian variants.
Mechanical change running:
$ tgt=hexagon; \
end=le; \
for op in data mmuidx_ra; do \
for ac in uw sw l q; do \
sed -i -e "s/cpu_ld${ac}_${op}/cpu_ld${ac}_${end}_${op}/" \
$(git grep -l cpu_ target/${tgt}/); \
done;
for ac in w l q; do \
sed -i -e "s/cpu_st${ac}_${op}/cpu_st${ac}_${end}_${op}/" \
$(git grep -l cpu_ target/${tgt}/); \
done;
done--- target/hexagon/macros.h | 6 +++--- target/hexagon/op_helper.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-)
target/hexagon/macros.h +3 -3
@@ -519,9 +519,9 @@ static inline TCGv gen_read_ireg(TCGv result, TCGv val, int shift)#define fLOAD (NUM ,SIZE ,SIGN ,EA ,DST ) MEM_LOAD##SIZE##SIGN(DST, EA)#else #define MEM_LOAD1 cpu_ldub_data_ra -#define MEM_LOAD2 cpu_lduw_data_ra -#define MEM_LOAD4 cpu_ldl_data_ra -#define MEM_LOAD8 cpu_ldq_data_ra +#define MEM_LOAD2 cpu_lduw_le_data_ra +#define MEM_LOAD4 cpu_ldl_le_data_ra +#define MEM_LOAD8 cpu_ldq_le_data_ra#define fLOAD (NUM ,SIZE ,SIGN ,EA ,DST ) \ do { \
target/hexagon/op_helper.c +3 -3
@@ -77,13 +77,13 @@ static void commit_store(CPUHexagonState *env, int slot_num, uintptr_t ra)cpu_stb_data_ra (env, va, env->mem_log_stores[slot_num].data32, ra);break ;case 2 : -cpu_stw_data_ra (env, va, env->mem_log_stores[slot_num].data32, ra); +cpu_stw_le_data_ra (env, va, env->mem_log_stores[slot_num].data32, ra);break ;case 4 : -cpu_stl_data_ra (env, va, env->mem_log_stores[slot_num].data32, ra); +cpu_stl_le_data_ra (env, va, env->mem_log_stores[slot_num].data32, ra);break ;case 8 : -cpu_stq_data_ra (env, va, env->mem_log_stores[slot_num].data64, ra); +cpu_stq_le_data_ra (env, va, env->mem_log_stores[slot_num].data64, ra);break ;default :g_assert_not_reached ();
Signature · 1 line
2.51.0
Re: [RFC-PATCH-for-11.0 v3 10/21] target/hexagon: Use little-endian variant of cpu_ld/st_data*()
Quoted 19 lines · Philippe Mathieu-Daudé
We only build the Hexagon target using little endianness order, therefore the cpu_ld/st_data*() definitions expand to the little endian declarations. Use the explicit little-endian variants.
Mechanical change running:
$ tgt=hexagon; \ end=le; \ for op in data mmuidx_ra; do \ for ac in uw sw l q; do \ sed -i -e "s/cpu_ld${ac}_${op}/cpu_ld${ac}_${end}_${op}/" \ $(git grep -l cpu_ target/${tgt}/); \ done; for ac in w l q; do \ sed -i -e "s/cpu_st${ac}_${op}/cpu_st${ac}_${end}_${op}/" \ $(git grep -l cpu_ target/${tgt}/); \ done; done
Quoted 3 lines
Signed-off-by Philippe Mathieu-Daudé <[email protected]>---
Quoted 56 lines
target/hexagon/macros.h | 6 +++--- target/hexagon/op_helper.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-)target/hexagon/macros.h +3
-3@@ -519,9 +519,9 @@ static inline TCGv gen_read_ireg(TCGv result, TCGv val, int shift)#define fLOAD (NUM ,SIZE ,SIGN ,EA ,DST ) MEM_LOAD##SIZE##SIGN(DST, EA)#else #define MEM_LOAD1 cpu_ldub_data_ra -#define MEM_LOAD2 cpu_lduw_data_ra -#define MEM_LOAD4 cpu_ldl_data_ra -#define MEM_LOAD8 cpu_ldq_data_ra +#define MEM_LOAD2 cpu_lduw_le_data_ra +#define MEM_LOAD4 cpu_ldl_le_data_ra +#define MEM_LOAD8 cpu_ldq_le_data_ra#define fLOAD (NUM ,SIZE ,SIGN ,EA ,DST ) \do { \target/hexagon/op_helper.c +2
-2@@ -77,13 +77,13 @@ static void commit_store(CPUHexagonState *env, int slot_num, uintptr_t ra)cpu_stb_data_ra (env, va, env->mem_log_stores[slot_num].data32, ra);break ;case 2 : -cpu_stw_data_ra (env, va, env->mem_log_stores[slot_num].data32, ra); +cpu_stw_le_data_ra (env, va, env->mem_log_stores[slot_num].data32, ra);break ;case 4 : -cpu_stl_data_ra (env, va, env->mem_log_stores[slot_num].data32, ra); +cpu_stl_le_data_ra (env, va, env->mem_log_stores[slot_num].data32, ra);break; case 8: - cpu_stq_data_ra(env, va, env->mem_log_stores[slot_num].data64, ra); + cpu_stq_le_data_ra(env, va, env->mem_log_stores[slot_num].data64, ra); break; default: g_assert_not_reached();--
2.51.0
PATCH v3 11/21 target/tricore: Use little-endian variant of cpu_ld/st_data*()
In reply to Philippe Mathieu-DaudéWe only build the TriCore target using little endianness order, therefore the cpu_ld/st_data*() definitions expand to the little endian declarations. Use the explicit little-endian variants.
Mechanical change running:
$ tgt=tricore; \
end=le; \
for op in data mmuidx_ra; do \
for ac in uw sw l q; do \
sed -i -e "s/cpu_ld${ac}_${op}/cpu_ld${ac}_${end}_${op}/" \
$(git grep -l cpu_ target/${tgt}/); \
done;
for ac in w l q; do \
sed -i -e "s/cpu_st${ac}_${op}/cpu_st${ac}_${end}_${op}/" \
$(git grep -l cpu_ target/${tgt}/); \
done;
done--- target/tricore/op_helper.c | 152 ++++++++++++++++++------------------- 1 file changed, 76 insertions(+), 76 deletions(-)
target/tricore/op_helper.c +76 -76
@@ -2451,84 +2451,84 @@ static bool cdc_zero(uint32_t *psw)static void save_context_upper (CPUTriCoreState *env,uint32_t ea) { -cpu_stl_data (env, ea, env->PCXI); -cpu_stl_data (env, ea+4 ,psw_read (env)); -cpu_stl_data (env, ea+8 , env->gpr_a[10 ]); -cpu_stl_data (env, ea+12 , env->gpr_a[11 ]); -cpu_stl_data (env, ea+16 , env->gpr_d[8 ]); -cpu_stl_data (env, ea+20 , env->gpr_d[9 ]); -cpu_stl_data (env, ea+24 , env->gpr_d[10 ]); -cpu_stl_data (env, ea+28 , env->gpr_d[11 ]); -cpu_stl_data (env, ea+32 , env->gpr_a[12 ]); -cpu_stl_data (env, ea+36 , env->gpr_a[13 ]); -cpu_stl_data (env, ea+40 , env->gpr_a[14 ]); -cpu_stl_data (env, ea+44 , env->gpr_a[15 ]); -cpu_stl_data (env, ea+48 , env->gpr_d[12 ]); -cpu_stl_data (env, ea+52 , env->gpr_d[13 ]); -cpu_stl_data (env, ea+56 , env->gpr_d[14 ]); -cpu_stl_data (env, ea+60 , env->gpr_d[15 ]); +cpu_stl_le_data (env, ea, env->PCXI); +cpu_stl_le_data (env, ea+4 ,psw_read (env)); +cpu_stl_le_data (env, ea+8 , env->gpr_a[10 ]); +cpu_stl_le_data (env, ea+12 , env->gpr_a[11 ]); +cpu_stl_le_data (env, ea+16 , env->gpr_d[8 ]); +cpu_stl_le_data (env, ea+20 , env->gpr_d[9 ]); +cpu_stl_le_data (env, ea+24 , env->gpr_d[10 ]); +cpu_stl_le_data (env, ea+28 , env->gpr_d[11 ]); +cpu_stl_le_data (env, ea+32 , env->gpr_a[12 ]); +cpu_stl_le_data (env, ea+36 , env->gpr_a[13 ]); +cpu_stl_le_data (env, ea+40 , env->gpr_a[14 ]); +cpu_stl_le_data (env, ea+44 , env->gpr_a[15 ]); +cpu_stl_le_data (env, ea+48 , env->gpr_d[12 ]); +cpu_stl_le_data (env, ea+52 , env->gpr_d[13 ]); +cpu_stl_le_data (env, ea+56 , env->gpr_d[14 ]); +cpu_stl_le_data (env, ea+60 , env->gpr_d[15 ]); }static void save_context_lower (CPUTriCoreState *env,uint32_t ea) { -cpu_stl_data (env, ea, env->PCXI); -cpu_stl_data (env, ea+4 , env->gpr_a[11 ]); -cpu_stl_data (env, ea+8 , env->gpr_a[2 ]); -cpu_stl_data (env, ea+12 , env->gpr_a[3 ]); -cpu_stl_data (env, ea+16 , env->gpr_d[0 ]); -cpu_stl_data (env, ea+20 , env->gpr_d[1 ]); -cpu_stl_data (env, ea+24 , env->gpr_d[2 ]); -cpu_stl_data (env, ea+28 , env->gpr_d[3 ]); -cpu_stl_data (env, ea+32 , env->gpr_a[4 ]); -cpu_stl_data (env, ea+36 , env->gpr_a[5 ]); -cpu_stl_data (env, ea+40 , env->gpr_a[6 ]); -cpu_stl_data (env, ea+44 , env->gpr_a[7 ]); -cpu_stl_data (env, ea+48 , env->gpr_d[4 ]); -cpu_stl_data (env, ea+52 , env->gpr_d[5 ]); -cpu_stl_data (env, ea+56 , env->gpr_d[6 ]); -cpu_stl_data (env, ea+60 , env->gpr_d[7 ]); +cpu_stl_le_data (env, ea, env->PCXI); +cpu_stl_le_data (env, ea+4 , env->gpr_a[11 ]); +cpu_stl_le_data (env, ea+8 , env->gpr_a[2 ]); +cpu_stl_le_data (env, ea+12 , env->gpr_a[3 ]); +cpu_stl_le_data (env, ea+16 , env->gpr_d[0 ]); +cpu_stl_le_data (env, ea+20 , env->gpr_d[1 ]); +cpu_stl_le_data (env, ea+24 , env->gpr_d[2 ]); +cpu_stl_le_data (env, ea+28 , env->gpr_d[3 ]); +cpu_stl_le_data (env, ea+32 , env->gpr_a[4 ]); +cpu_stl_le_data (env, ea+36 , env->gpr_a[5 ]); +cpu_stl_le_data (env, ea+40 , env->gpr_a[6 ]); +cpu_stl_le_data (env, ea+44 , env->gpr_a[7 ]); +cpu_stl_le_data (env, ea+48 , env->gpr_d[4 ]); +cpu_stl_le_data (env, ea+52 , env->gpr_d[5 ]); +cpu_stl_le_data (env, ea+56 , env->gpr_d[6 ]); +cpu_stl_le_data (env, ea+60 , env->gpr_d[7 ]); }static void restore_context_upper (CPUTriCoreState *env,uint32_t ea,uint32_t *new_PCXI,uint32_t *new_PSW) { - *new_PCXI =cpu_ldl_data (env, ea); - *new_PSW =cpu_ldl_data (env, ea+4 ); - env->gpr_a[10 ] =cpu_ldl_data (env, ea+8 ); - env->gpr_a[11 ] =cpu_ldl_data (env, ea+12 ); - env->gpr_d[8 ] =cpu_ldl_data (env, ea+16 ); - env->gpr_d[9 ] =cpu_ldl_data (env, ea+20 ); - env->gpr_d[10 ] =cpu_ldl_data (env, ea+24 ); - env->gpr_d[11 ] =cpu_ldl_data (env, ea+28 ); - env->gpr_a[12 ] =cpu_ldl_data (env, ea+32 ); - env->gpr_a[13 ] =cpu_ldl_data (env, ea+36 ); - env->gpr_a[14 ] =cpu_ldl_data (env, ea+40 ); - env->gpr_a[15 ] =cpu_ldl_data (env, ea+44 ); - env->gpr_d[12 ] =cpu_ldl_data (env, ea+48 ); - env->gpr_d[13 ] =cpu_ldl_data (env, ea+52 ); - env->gpr_d[14 ] =cpu_ldl_data (env, ea+56 ); - env->gpr_d[15 ] =cpu_ldl_data (env, ea+60 ); + *new_PCXI =cpu_ldl_le_data (env, ea); + *new_PSW =cpu_ldl_le_data (env, ea+4 ); + env->gpr_a[10 ] =cpu_ldl_le_data (env, ea+8 ); + env->gpr_a[11 ] =cpu_ldl_le_data (env, ea+12 ); + env->gpr_d[8 ] =cpu_ldl_le_data (env, ea+16 ); + env->gpr_d[9 ] =cpu_ldl_le_data (env, ea+20 ); + env->gpr_d[10 ] =cpu_ldl_le_data (env, ea+24 ); + env->gpr_d[11 ] =cpu_ldl_le_data (env, ea+28 ); + env->gpr_a[12 ] =cpu_ldl_le_data (env, ea+32 ); + env->gpr_a[13 ] =cpu_ldl_le_data (env, ea+36 ); + env->gpr_a[14 ] =cpu_ldl_le_data (env, ea+40 ); + env->gpr_a[15 ] =cpu_ldl_le_data (env, ea+44 ); + env->gpr_d[12 ] =cpu_ldl_le_data (env, ea+48 ); + env->gpr_d[13 ] =cpu_ldl_le_data (env, ea+52 ); + env->gpr_d[14 ] =cpu_ldl_le_data (env, ea+56 ); + env->gpr_d[15 ] =cpu_ldl_le_data (env, ea+60 ); }static void restore_context_lower (CPUTriCoreState *env,uint32_t ea,uint32_t *ra,uint32_t *pcxi) { - *pcxi =cpu_ldl_data (env, ea); - *ra =cpu_ldl_data (env, ea+4 ); - env->gpr_a[2 ] =cpu_ldl_data (env, ea+8 ); - env->gpr_a[3 ] =cpu_ldl_data (env, ea+12 ); - env->gpr_d[0 ] =cpu_ldl_data (env, ea+16 ); - env->gpr_d[1 ] =cpu_ldl_data (env, ea+20 ); - env->gpr_d[2 ] =cpu_ldl_data (env, ea+24 ); - env->gpr_d[3 ] =cpu_ldl_data (env, ea+28 ); - env->gpr_a[4 ] =cpu_ldl_data (env, ea+32 ); - env->gpr_a[5 ] =cpu_ldl_data (env, ea+36 ); - env->gpr_a[6 ] =cpu_ldl_data (env, ea+40 ); - env->gpr_a[7 ] =cpu_ldl_data (env, ea+44 ); - env->gpr_d[4 ] =cpu_ldl_data (env, ea+48 ); - env->gpr_d[5 ] =cpu_ldl_data (env, ea+52 ); - env->gpr_d[6 ] =cpu_ldl_data (env, ea+56 ); - env->gpr_d[7 ] =cpu_ldl_data (env, ea+60 ); + *pcxi =cpu_ldl_le_data (env, ea); + *ra =cpu_ldl_le_data (env, ea+4 ); + env->gpr_a[2 ] =cpu_ldl_le_data (env, ea+8 ); + env->gpr_a[3 ] =cpu_ldl_le_data (env, ea+12 ); + env->gpr_d[0 ] =cpu_ldl_le_data (env, ea+16 ); + env->gpr_d[1 ] =cpu_ldl_le_data (env, ea+20 ); + env->gpr_d[2 ] =cpu_ldl_le_data (env, ea+24 ); + env->gpr_d[3 ] =cpu_ldl_le_data (env, ea+28 ); + env->gpr_a[4 ] =cpu_ldl_le_data (env, ea+32 ); + env->gpr_a[5 ] =cpu_ldl_le_data (env, ea+36 ); + env->gpr_a[6 ] =cpu_ldl_le_data (env, ea+40 ); + env->gpr_a[7 ] =cpu_ldl_le_data (env, ea+44 ); + env->gpr_d[4 ] =cpu_ldl_le_data (env, ea+48 ); + env->gpr_d[5 ] =cpu_ldl_le_data (env, ea+52 ); + env->gpr_d[6 ] =cpu_ldl_le_data (env, ea+56 ); + env->gpr_d[7 ] =cpu_ldl_le_data (env, ea+60 ); }void helper_call (CPUTriCoreState *env,uint32_t next_pc)
@@ -2566,7 +2566,7 @@ void helper_call(CPUTriCoreState *env, uint32_t next_pc) ea = ((env->FCX &MASK_FCX_FCXS ) <<12 ) + ((env->FCX &MASK_FCX_FCXO ) <<6 );/* new_FCX = M(EA, word); */ - new_FCX =cpu_ldl_data (env, ea); + new_FCX =cpu_ldl_le_data (env, ea);/* M(EA, 16 * word) = {PCXI, PSW, A[10], A[11], D[8], D[9], D[10], D[11], A[12], A[13], A[14], A[15], D[12], D[13], D[14], D[15]}; */
@@ -2632,7 +2632,7 @@ void helper_ret(CPUTriCoreState *env)A[13], A[14], A[15], D[12], D[13], D[14], D[15]} = M(EA, 16 * word); */ restore_context_upper (env, ea, &new_PCXI, &new_PSW);/* M(EA, word) = FCX; */ -cpu_stl_data (env, ea, env->FCX); +cpu_stl_le_data (env, ea, env->FCX);/* FCX[19: 0] = PCXI[19: 0]; */ env->FCX = (env->FCX &0xfff00000 ) + (env->PCXI &0x000fffff );/* PCXI = new_PCXI; */
@@ -2662,7 +2662,7 @@ void helper_bisr(CPUTriCoreState *env, uint32_t const9) ea = ((env->FCX &0xf0000 ) <<12 ) + ((env->FCX &0xffff ) <<6 );/* new_FCX = M(EA, word); */ - new_FCX =cpu_ldl_data (env, ea); + new_FCX =cpu_ldl_le_data (env, ea);/* M(EA, 16 * word) = {PCXI, A[11], A[2], A[3], D[0], D[1], D[2], D[3], A[4] , A[5], A[6], A[7], D[4], D[5], D[6], D[7]}; */ save_context_lower (env, ea);
@@ -2726,7 +2726,7 @@ void helper_rfe(CPUTriCoreState *env)A[13], A[14], A[15], D[12], D[13], D[14], D[15]} = M(EA, 16 * word); */ restore_context_upper (env, ea, &new_PCXI, &new_PSW);/* M(EA, word) = FCX;*/ -cpu_stl_data (env, ea, env->FCX); +cpu_stl_le_data (env, ea, env->FCX);/* FCX[19: 0] = PCXI[19: 0]; */ env->FCX = (env->FCX &0xfff00000 ) + (env->PCXI &0x000fffff );/* PCXI = new_PCXI; */
@@ -2744,10 +2744,10 @@ void helper_rfm(CPUTriCoreState *env)icr_set_ccpn (env,pcxi_get_pcpn (env));/* {PCXI, PSW, A[10], A[11]} = M(DCX, 4 * word); */ - env->PCXI =cpu_ldl_data (env, env->DCX); -psw_write (env,cpu_ldl_data (env, env->DCX+4 )); - env->gpr_a[10 ] =cpu_ldl_data (env, env->DCX+8 ); - env->gpr_a[11 ] =cpu_ldl_data (env, env->DCX+12 ); + env->PCXI =cpu_ldl_le_data (env, env->DCX); +psw_write (env,cpu_ldl_le_data (env, env->DCX+4 )); + env->gpr_a[10 ] =cpu_ldl_le_data (env, env->DCX+8 ); + env->gpr_a[11 ] =cpu_ldl_le_data (env, env->DCX+12 );if (tricore_has_feature (env,TRICORE_FEATURE_131 )) { env->DBGTCR =0 ;
@@ -2794,7 +2794,7 @@ void helper_svlcx(CPUTriCoreState *env) ea = ((env->FCX &MASK_FCX_FCXS ) <<12 ) + ((env->FCX &MASK_FCX_FCXO ) <<6 );/* new_FCX = M(EA, word); */ - new_FCX =cpu_ldl_data (env, ea); + new_FCX =cpu_ldl_le_data (env, ea);/* M(EA, 16 * word) = {PCXI, PSW, A[10], A[11], D[8], D[9], D[10], D[11], A[12], A[13], A[14], A[15], D[12], D[13], D[14], D[15]}; */
@@ -2837,7 +2837,7 @@ void helper_svucx(CPUTriCoreState *env) ea = ((env->FCX &MASK_FCX_FCXS ) <<12 ) + ((env->FCX &MASK_FCX_FCXO ) <<6 );/* new_FCX = M(EA, word); */ - new_FCX =cpu_ldl_data (env, ea); + new_FCX =cpu_ldl_le_data (env, ea);/* M(EA, 16 * word) = {PCXI, PSW, A[10], A[11], D[8], D[9], D[10], D[11], A[12], A[13], A[14], A[15], D[12], D[13], D[14], D[15]}; */
@@ -2887,9 +2887,9 @@ void helper_rslcx(CPUTriCoreState *env)A[13], A[14], A[15], D[12], D[13], D[14], D[15]} = M(EA, 16 * word); */ restore_context_lower (env, ea, &env->gpr_a[11 ], &new_PCXI);/* M(EA, word) = FCX; */ -cpu_stl_data (env, ea, env->FCX); +cpu_stl_le_data (env, ea, env->FCX);/* M(EA, word) = FCX; */ -cpu_stl_data (env, ea, env->FCX); +cpu_stl_le_data (env, ea, env->FCX);/* FCX[19: 0] = PCXI[19: 0]; */ env->FCX = (env->FCX &0xfff00000 ) + (env->PCXI &0x000fffff );/* PCXI = new_PCXI; */
Signature · 1 line
2.51.0
PATCH v3 12/21 target/rx: Use little-endian variant of cpu_ld/st_data*()
In reply to Philippe Mathieu-DaudéWe only build the RX target using little endianness order, therefore the cpu_ld/st_data*() definitions expand to the little endian declarations. Use the explicit little-endian variants.
Mechanical change running:
$ tgt=rx; \
end=le; \
for op in data mmuidx_ra; do \
for ac in uw sw l q; do \
sed -i -e "s/cpu_ld${ac}_${op}/cpu_ld${ac}_${end}_${op}/" \
$(git grep -l cpu_ target/${tgt}/); \
done;
for ac in w l q; do \
sed -i -e "s/cpu_st${ac}_${op}/cpu_st${ac}_${end}_${op}/" \
$(git grep -l cpu_ target/${tgt}/); \
done;
done--- target/rx/helper.c | 14 +++++++------- target/rx/op_helper.c | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-)
target/rx/helper.c +7 -7
@@ -68,10 +68,10 @@ void rx_cpu_do_interrupt(CPUState *cs)qemu_log_mask (CPU_LOG_INT ,"fast interrupt raised\n" ); }else if (cpu_test_interrupt (cs,CPU_INTERRUPT_HARD )) { env->isp -=4 ; -cpu_stl_data (env, env->isp, save_psw); +cpu_stl_le_data (env, env->isp, save_psw); env->isp -=4 ; -cpu_stl_data (env, env->isp, env->pc); - env->pc =cpu_ldl_data (env, env->intb + env->ack_irq *4 ); +cpu_stl_le_data (env, env->isp, env->pc); + env->pc =cpu_ldl_le_data (env, env->intb + env->ack_irq *4 ); env->psw_ipl = env->ack_ipl;cpu_reset_interrupt (cs,CPU_INTERRUPT_HARD );qemu_set_irq (env->ack, env->ack_irq);
@@ -82,14 +82,14 @@ void rx_cpu_do_interrupt(CPUState *cs)const char *expname ="unknown exception" ; env->isp -=4 ; -cpu_stl_data (env, env->isp, save_psw); +cpu_stl_le_data (env, env->isp, save_psw); env->isp -=4 ; -cpu_stl_data (env, env->isp, env->pc); +cpu_stl_le_data (env, env->isp, env->pc);if (vec <0x100 ) { - env->pc =cpu_ldl_data (env,0xffffff80 + vec *4 ); + env->pc =cpu_ldl_le_data (env,0xffffff80 + vec *4 ); }else { - env->pc =cpu_ldl_data (env, env->intb + (vec &0xff ) *4 ); + env->pc =cpu_ldl_le_data (env, env->intb + (vec &0xff ) *4 ); }if (vec ==30 ) {
target/rx/op_helper.c +3 -3
@@ -217,20 +217,20 @@ void helper_scmpu(CPURXState *env)static uint32_t (*const cpu_ldufn[])(CPUArchState *env,abi_ptr ptr,uintptr_t retaddr) = { - cpu_ldub_data_ra, cpu_lduw_data_ra, cpu_ldl_data_ra, + cpu_ldub_data_ra, cpu_lduw_le_data_ra, cpu_ldl_le_data_ra, };static uint32_t (*const cpu_ldfn[])(CPUArchState *env,abi_ptr ptr,uintptr_t retaddr) = { - cpu_ldub_data_ra, cpu_lduw_data_ra, cpu_ldl_data_ra, + cpu_ldub_data_ra, cpu_lduw_le_data_ra, cpu_ldl_le_data_ra, };static void (*const cpu_stfn[])(CPUArchState *env,abi_ptr ptr,uint32_t val,uintptr_t retaddr) = { - cpu_stb_data_ra, cpu_stw_data_ra, cpu_stl_data_ra, + cpu_stb_data_ra, cpu_stw_le_data_ra, cpu_stl_le_data_ra, };void helper_sstr (CPURXState *env,uint32_t sz)
Signature · 1 line
2.51.0
PATCH v3 13/21 target/m68k: Use little-endian variant of cpu_ld/st_data*()
In reply to Philippe Mathieu-DaudéWe only build the M68k target using little endianness order, therefore the cpu_ld/st_data*() definitions expand to the little endian declarations. Use the explicit little-endian variants.
Mechanical change running:
$ tgt=m68k; \
end=be; \
for op in data mmuidx_ra; do \
for ac in uw sw l q; do \
sed -i -e "s/cpu_ld${ac}_${op}/cpu_ld${ac}_${end}_${op}/" \
$(git grep -l cpu_ target/${tgt}/); \
done;
for ac in w l q; do \
sed -i -e "s/cpu_st${ac}_${op}/cpu_st${ac}_${end}_${op}/" \
$(git grep -l cpu_ target/${tgt}/); \
done;
done--- target/m68k/fpu_helper.c | 12 +++--- target/m68k/op_helper.c | 88 ++++++++++++++++++++-------------------- 2 files changed, 50 insertions(+), 50 deletions(-)
target/m68k/fpu_helper.c +6 -6
@@ -510,8 +510,8 @@ static int cpu_ld_floatx80_ra(CPUM68KState *env, uint32_t addr, FPReg *fp,uint32_t high;uint64_t low; - high =cpu_ldl_data_ra (env, addr, ra); - low =cpu_ldq_data_ra (env, addr +4 , ra); + high =cpu_ldl_be_data_ra (env, addr, ra); + low =cpu_ldq_be_data_ra (env, addr +4 , ra); fp->l.upper = high >>16 ; fp->l.lower = low;
@@ -522,8 +522,8 @@ static int cpu_ld_floatx80_ra(CPUM68KState *env, uint32_t addr, FPReg *fp,static int cpu_st_floatx80_ra (CPUM68KState *env,uint32_t addr,FPReg *fp,uintptr_t ra) { -cpu_stl_data_ra (env, addr, fp->l.upper <<16 , ra); -cpu_stq_data_ra (env, addr +4 , fp->l.lower, ra); +cpu_stl_be_data_ra (env, addr, fp->l.upper <<16 , ra); +cpu_stq_be_data_ra (env, addr +4 , fp->l.lower, ra);return 12 ; }
@@ -533,7 +533,7 @@ static int cpu_ld_float64_ra(CPUM68KState *env, uint32_t addr, FPReg *fp, {uint64_t val; - val =cpu_ldq_data_ra (env, addr, ra); + val =cpu_ldq_be_data_ra (env, addr, ra); fp->d =float64_to_floatx80 (*(float64 *)&val, &env->fp_status);return 8 ;
@@ -545,7 +545,7 @@ static int cpu_st_float64_ra(CPUM68KState *env, uint32_t addr, FPReg *fp,float64 val; val =floatx80_to_float64 (fp->d, &env->fp_status); -cpu_stq_data_ra (env, addr, *(uint64_t *)&val, ra); +cpu_stq_be_data_ra (env, addr, *(uint64_t *)&val, ra);return 8 ; }
target/m68k/op_helper.c +44 -44
205 lines not on this page · raw message
Signature · 1 line
2.51.0
PATCH v3 14/21 target/s390x: Use little-endian variant of cpu_ld/st_data*()
In reply to Philippe Mathieu-DaudéWe only build the S390x target using little endianness order, therefore the cpu_ld/st_data*() definitions expand to the little endian declarations. Use the explicit little-endian variants.
Mechanical change running:
$ tgt=s390x; \
end=be; \
for op in data mmuidx_ra; do \
for ac in uw sw l q; do \
sed -i -e "s/cpu_ld${ac}_${op}/cpu_ld${ac}_${end}_${op}/" \
$(git grep -l cpu_ target/${tgt}/); \
done;
for ac in w l q; do \
sed -i -e "s/cpu_st${ac}_${op}/cpu_st${ac}_${end}_${op}/" \
$(git grep -l cpu_ target/${tgt}/); \
done;
done--- target/s390x/tcg/mem_helper.c | 48 +++++++++++++++++------------------ target/s390x/tcg/vec_helper.c | 8 +++--- 2 files changed, 28 insertions(+), 28 deletions(-)
target/s390x/tcg/mem_helper.c +24 -24
@@ -101,7 +101,7 @@ static inline uint64_t cpu_ldusize_data_ra(CPUS390XState *env, uint64_t addr,case 1 :return cpu_ldub_data_ra (env, addr, ra);case 2 : -return cpu_lduw_data_ra (env, addr, ra); +return cpu_lduw_be_data_ra (env, addr, ra);default :abort (); }
@@ -117,7 +117,7 @@ static inline void cpu_stsize_data_ra(CPUS390XState *env, uint64_t addr,cpu_stb_data_ra (env, addr, value, ra);break ;case 2 : -cpu_stw_data_ra (env, addr, value, ra); +cpu_stw_be_data_ra (env, addr, value, ra);break ;default :abort ();
@@ -865,7 +865,7 @@ void HELPER(srstu)(CPUS390XState *env, uint32_t r1, uint32_t r2) env->cc_op =2 ;return ; } - v =cpu_lduw_data_ra (env, str + len, ra); + v =cpu_lduw_be_data_ra (env, str + len, ra);if (v == c) {/* Character found. Set R1 to the location; R2 is unmodified. */ env->cc_op =1 ;
@@ -1022,7 +1022,7 @@ void HELPER(lam)(CPUS390XState *env, uint32_t r1, uint64_t a2, uint32_t r3) }for (i = r1;; i = (i +1 ) %16 ) { - env->aregs[i] =cpu_ldl_data_ra (env, a2, ra); + env->aregs[i] =cpu_ldl_be_data_ra (env, a2, ra); a2 +=4 ;if (i == r3) {
@@ -1042,7 +1042,7 @@ void HELPER(stam)(CPUS390XState *env, uint32_t r1, uint64_t a2, uint32_t r3) }for (i = r1;; i = (i +1 ) %16 ) { -cpu_stl_data_ra (env, a2, env->aregs[i], ra); +cpu_stl_be_data_ra (env, a2, env->aregs[i], ra); a2 +=4 ;if (i == r3) {
@@ -1363,7 +1363,7 @@ Int128 HELPER(cksm)(CPUS390XState *env, uint64_t r1,/* Process full words as available. */ for (len =0 ; len +4 <= max_len; len +=4 , src +=4 ) { - cksm += (uint32_t )cpu_ldl_data_ra (env, src, ra); + cksm += (uint32_t )cpu_ldl_be_data_ra (env, src, ra); }switch (max_len - len) {
@@ -1372,11 +1372,11 @@ Int128 HELPER(cksm)(CPUS390XState *env, uint64_t r1, len +=1 ;break ;case 2 : - cksm +=cpu_lduw_data_ra (env, src, ra) <<16 ; + cksm +=cpu_lduw_be_data_ra (env, src, ra) <<16 ; len +=2 ;break ;case 3 : - cksm +=cpu_lduw_data_ra (env, src, ra) <<16 ; + cksm +=cpu_lduw_be_data_ra (env, src, ra) <<16 ; cksm +=cpu_ldub_data_ra (env, src +2 , ra) <<8 ; len +=3 ;break ;
@@ -1955,7 +1955,7 @@ void HELPER(lctlg)(CPUS390XState *env, uint32_t r1, uint64_t a2, uint32_t r3) }for (i = r1;; i = (i +1 ) %16 ) { -uint64_t val =cpu_ldq_data_ra (env, src, ra); +uint64_t val =cpu_ldq_be_data_ra (env, src, ra);if (env->cregs[i] != val && i >=9 && i <=11 ) { PERchanged = true; }
@@ -1992,7 +1992,7 @@ void HELPER(lctl)(CPUS390XState *env, uint32_t r1, uint64_t a2, uint32_t r3) }for (i = r1;; i = (i +1 ) %16 ) { -uint32_t val =cpu_ldl_data_ra (env, src, ra); +uint32_t val =cpu_ldl_be_data_ra (env, src, ra);uint64_t val64 =deposit64 (env->cregs[i],0 ,32 , val);if ((uint32_t )env->cregs[i] != val && i >=9 && i <=11 ) { PERchanged = true;
@@ -2028,7 +2028,7 @@ void HELPER(stctg)(CPUS390XState *env, uint32_t r1, uint64_t a2, uint32_t r3) }for (i = r1;; i = (i +1 ) %16 ) { -cpu_stq_data_ra (env, dest, env->cregs[i], ra); +cpu_stq_be_data_ra (env, dest, env->cregs[i], ra); dest +=sizeof (uint64_t );if (i == r3) {
@@ -2048,7 +2048,7 @@ void HELPER(stctl)(CPUS390XState *env, uint32_t r1, uint64_t a2, uint32_t r3) }for (i = r1;; i = (i +1 ) %16 ) { -cpu_stl_data_ra (env, dest, env->cregs[i], ra); +cpu_stl_be_data_ra (env, dest, env->cregs[i], ra); dest +=sizeof (uint32_t );if (i == r3) {
@@ -2065,7 +2065,7 @@ uint32_t HELPER(testblock)(CPUS390XState *env, uint64_t real_addr) real_addr =wrap_address (env, real_addr) &TARGET_PAGE_MASK ;for (i =0 ; i <TARGET_PAGE_SIZE ; i +=8 ) { -cpu_stq_mmuidx_ra (env, real_addr + i,0 ,MMU_REAL_IDX , ra); +cpu_stq_be_mmuidx_ra (env, real_addr + i,0 ,MMU_REAL_IDX , ra); }return 0 ;
@@ -2324,11 +2324,11 @@ void HELPER(idte)(CPUS390XState *env, uint64_t r1, uint64_t r2, uint32_t m4)for (i =0 ; i < entries; i++) {/* addresses are not wrapped in 24/31bit mode but table index is */ raddr = table + ((index + i) &0x7ff ) *sizeof (entry); - entry =cpu_ldq_mmuidx_ra (env, raddr,MMU_REAL_IDX , ra); + entry =cpu_ldq_be_mmuidx_ra (env, raddr,MMU_REAL_IDX , ra);if (!(entry ®ION_ENTRY_I )) {/* we are allowed to not store if already invalid */ entry |=REGION_ENTRY_I ; -cpu_stq_mmuidx_ra (env, raddr, entry,MMU_REAL_IDX , ra); +cpu_stq_be_mmuidx_ra (env, raddr, entry,MMU_REAL_IDX , ra); } } }
@@ -2355,9 +2355,9 @@ void HELPER(ipte)(CPUS390XState *env, uint64_t pto, uint64_t vaddr, pte_addr +=VADDR_PAGE_TX (vaddr) *8 ;/* Mark the page table entry as invalid */ - pte =cpu_ldq_mmuidx_ra (env, pte_addr,MMU_REAL_IDX , ra); + pte =cpu_ldq_be_mmuidx_ra (env, pte_addr,MMU_REAL_IDX , ra); pte |=PAGE_ENTRY_I ; -cpu_stq_mmuidx_ra (env, pte_addr, pte,MMU_REAL_IDX , ra); +cpu_stq_be_mmuidx_ra (env, pte_addr, pte,MMU_REAL_IDX , ra);/* XXX we exploit the fact that Linux passes the exact virtual address here - it's not obliged to! */
@@ -2695,7 +2695,7 @@ static int decode_utf16(CPUS390XState *env, uint64_t addr, uint64_t ilen,if (ilen <2 ) {return 0 ; } - s0 =cpu_lduw_data_ra (env, addr, ra); + s0 =cpu_lduw_be_data_ra (env, addr, ra);if ((s0 &0xfc00 ) !=0xd800 ) {/* one word character */ l =2 ;
@@ -2706,7 +2706,7 @@ static int decode_utf16(CPUS390XState *env, uint64_t addr, uint64_t ilen,if (ilen <4 ) {return 0 ; } - s1 =cpu_lduw_data_ra (env, addr +2 , ra); + s1 =cpu_lduw_be_data_ra (env, addr +2 , ra); c =extract32 (s0,6 ,4 ) +1 ; c = (c <<6 ) | (s0 &0x3f ); c = (c <<10 ) | (s1 &0x3ff );
@@ -2730,7 +2730,7 @@ static int decode_utf32(CPUS390XState *env, uint64_t addr, uint64_t ilen,if (ilen <4 ) {return 0 ; } - c =cpu_ldl_data_ra (env, addr, ra); + c =cpu_ldl_be_data_ra (env, addr, ra);if ((c >=0xd800 && c <=0xdbff ) || c >0x10ffff ) {/* invalid unicode character */ return 2 ;
@@ -2792,7 +2792,7 @@ static int encode_utf16(CPUS390XState *env, uint64_t addr, uint64_t ilen,if (ilen <2 ) {return 1 ; } -cpu_stw_data_ra (env, addr, c, ra); +cpu_stw_be_data_ra (env, addr, c, ra); *olen =2 ; }else {/* two word character */
@@ -2802,8 +2802,8 @@ static int encode_utf16(CPUS390XState *env, uint64_t addr, uint64_t ilen, d1 =0xdc00 |extract32 (c,0 ,10 ); d0 =0xd800 |extract32 (c,10 ,6 ); d0 =deposit32 (d0,6 ,4 ,extract32 (c,16 ,5 ) -1 ); -cpu_stw_data_ra (env, addr +0 , d0, ra); -cpu_stw_data_ra (env, addr +2 , d1, ra); +cpu_stw_be_data_ra (env, addr +0 , d0, ra); +cpu_stw_be_data_ra (env, addr +2 , d1, ra); *olen =4 ; }
@@ -2816,7 +2816,7 @@ static int encode_utf32(CPUS390XState *env, uint64_t addr, uint64_t ilen,if (ilen <4 ) {return 1 ; } -cpu_stl_data_ra (env, addr, c, ra); +cpu_stl_be_data_ra (env, addr, c, ra); *olen =4 ;return -1 ; }
target/s390x/tcg/vec_helper.c +4 -4
@@ -45,9 +45,9 @@ void HELPER(vll)(CPUS390XState *env, void *v1, uint64_t addr, uint64_t bytes)if (likely (bytes >=16 )) {uint64_t t0, t1; - t0 =cpu_ldq_data_ra (env, addr,GETPC ()); + t0 =cpu_ldq_be_data_ra (env, addr,GETPC ()); addr =wrap_address (env, addr +8 ); - t1 =cpu_ldq_data_ra (env, addr,GETPC ()); + t1 =cpu_ldq_be_data_ra (env, addr,GETPC ());s390_vec_write_element64 (v1,0 , t0);s390_vec_write_element64 (v1,1 , t1); }else {
@@ -195,9 +195,9 @@ void HELPER(vstl)(CPUS390XState *env, const void *v1, uint64_t addr,probe_write_access (env, addr,MIN (bytes,16 ),GETPC ());if (likely (bytes >=16 )) { -cpu_stq_data_ra (env, addr,s390_vec_read_element64 (v1,0 ),GETPC ()); +cpu_stq_be_data_ra (env, addr,s390_vec_read_element64 (v1,0 ),GETPC ()); addr =wrap_address (env, addr +8 ); -cpu_stq_data_ra (env, addr,s390_vec_read_element64 (v1,1 ),GETPC ()); +cpu_stq_be_data_ra (env, addr,s390_vec_read_element64 (v1,1 ),GETPC ()); }else {int i;
Signature · 1 line
2.51.0
PATCH v3 15/21 target/sparc: Use little-endian variant of cpu_ld/st_data*()
In reply to Philippe Mathieu-DaudéWe only build the SPARC targets using little endianness order, therefore the cpu_ld/st_data*() definitions expand to the little endian declarations. Use the explicit little-endian variants.
Mechanical change running:
$ tgt=sparc; \
end=be; \
for op in data mmuidx_ra; do \
for ac in uw sw l q; do \
sed -i -e "s/cpu_ld${ac}_${op}/cpu_ld${ac}_${end}_${op}/" \
$(git grep -l cpu_ target/${tgt}/); \
done;
for ac in w l q; do \
sed -i -e "s/cpu_st${ac}_${op}/cpu_st${ac}_${end}_${op}/" \
$(git grep -l cpu_ target/${tgt}/); \
done;
done--- target/sparc/ldst_helper.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
target/sparc/ldst_helper.c +3 -3
@@ -1228,13 +1228,13 @@ uint64_t helper_ld_asi(CPUSPARCState *env, target_ulong addr, ret =cpu_ldub_data (env, addr);break ;case 2 : - ret =cpu_lduw_data (env, addr); + ret =cpu_lduw_be_data (env, addr);break ;case 4 : - ret =cpu_ldl_data (env, addr); + ret =cpu_ldl_be_data (env, addr);break ;case 8 : - ret =cpu_ldq_data (env, addr); + ret =cpu_ldq_be_data (env, addr);break ;default :g_assert_not_reached ();
Signature · 1 line
2.51.0
PATCH v3 16/21 target/i386: Use little-endian variant of cpu_ld/st_data*()
In reply to Philippe Mathieu-DaudéWe only build the X86 targets using little endianness order, therefore the cpu_ld/st_data*() definitions expand to the little endian declarations. Use the explicit little-endian variants.
Mechanical change running:
$ tgt=i386; \
end=le; \
for op in data mmuidx_ra; do \
for ac in uw sw l q; do \
sed -i -e "s/cpu_ld${ac}_${op}/cpu_ld${ac}_${end}_${op}/" \
$(git grep -l cpu_ target/${tgt}/); \
done;
for ac in w l q; do \
sed -i -e "s/cpu_st${ac}_${op}/cpu_st${ac}_${end}_${op}/" \
$(git grep -l cpu_ target/${tgt}/); \
done;
done--- target/i386/ops_sse.h | 12 +++---- target/i386/tcg/seg_helper.h | 12 +++---- linux-user/vm86.c | 4 +-- target/i386/tcg/mem_helper.c | 8 ++--- target/i386/tcg/mpx_helper.c | 28 ++++++++-------- target/i386/tcg/seg_helper.c | 16 +++++----- target/i386/tcg/system/excp_helper.c | 8 ++--- target/i386/tcg/system/svm_helper.c | 48 ++++++++++++++-------------- 8 files changed, 68 insertions(+), 68 deletions(-)
target/i386/ops_sse.h +6 -6
@@ -2326,7 +2326,7 @@ void glue(helper_vpmaskmovd_st, SUFFIX)(CPUX86State *env,for (i =0 ; i < (2 <<SHIFT ); i++) {if (v->L (i) >>31 ) { -cpu_stl_data_ra (env, a0 + i *4 , s->L (i),GETPC ()); +cpu_stl_le_data_ra (env, a0 + i *4 , s->L (i),GETPC ()); } } }
@@ -2338,7 +2338,7 @@ void glue(helper_vpmaskmovq_st, SUFFIX)(CPUX86State *env,for (i =0 ; i < (1 <<SHIFT ); i++) {if (v->Q (i) >>63 ) { -cpu_stq_data_ra (env, a0 + i *8 , s->Q (i),GETPC ()); +cpu_stq_le_data_ra (env, a0 + i *8 , s->Q (i),GETPC ()); } } }
@@ -2369,7 +2369,7 @@ void glue(helper_vpgatherdd, SUFFIX)(CPUX86State *env,if (v->L (i) >>31 ) {target_ulong addr = a0 + ((target_ulong )(int32_t )s->L (i) << scale); - d->L (i) =cpu_ldl_data_ra (env, addr,GETPC ()); + d->L (i) =cpu_ldl_le_data_ra (env, addr,GETPC ()); } v->L (i) =0 ; }
@@ -2383,7 +2383,7 @@ void glue(helper_vpgatherdq, SUFFIX)(CPUX86State *env,if (v->Q (i) >>63 ) {target_ulong addr = a0 + ((target_ulong )(int32_t )s->L (i) << scale); - d->Q (i) =cpu_ldq_data_ra (env, addr,GETPC ()); + d->Q (i) =cpu_ldq_le_data_ra (env, addr,GETPC ()); } v->Q (i) =0 ; }
@@ -2397,7 +2397,7 @@ void glue(helper_vpgatherqd, SUFFIX)(CPUX86State *env,if (v->L (i) >>31 ) {target_ulong addr = a0 + ((target_ulong )(int64_t )s->Q (i) << scale); - d->L (i) =cpu_ldl_data_ra (env, addr,GETPC ()); + d->L (i) =cpu_ldl_le_data_ra (env, addr,GETPC ()); } v->L (i) =0 ; }
@@ -2415,7 +2415,7 @@ void glue(helper_vpgatherqq, SUFFIX)(CPUX86State *env,if (v->Q (i) >>63 ) {target_ulong addr = a0 + ((target_ulong )(int64_t )s->Q (i) << scale); - d->Q (i) =cpu_ldq_data_ra (env, addr,GETPC ()); + d->Q (i) =cpu_ldq_le_data_ra (env, addr,GETPC ()); } v->Q (i) =0 ; }
target/i386/tcg/seg_helper.h +6 -6
@@ -40,18 +40,18 @@ int cpu_mmu_index_kernel(CPUX86State *env);* and use *_mmuidx_ra directly. */ #define cpu_lduw_kernel_ra (e, p, r) \ - cpu_lduw_mmuidx_ra(e, p, cpu_mmu_index_kernel(e), r) + cpu_lduw_le_mmuidx_ra(e, p, cpu_mmu_index_kernel(e), r)#define cpu_ldl_kernel_ra (e, p, r) \ - cpu_ldl_mmuidx_ra(e, p, cpu_mmu_index_kernel(e), r) + cpu_ldl_le_mmuidx_ra(e, p, cpu_mmu_index_kernel(e), r)#define cpu_ldq_kernel_ra (e, p, r) \ - cpu_ldq_mmuidx_ra(e, p, cpu_mmu_index_kernel(e), r) + cpu_ldq_le_mmuidx_ra(e, p, cpu_mmu_index_kernel(e), r)#define cpu_stw_kernel_ra (e, p, v, r) \ - cpu_stw_mmuidx_ra(e, p, v, cpu_mmu_index_kernel(e), r) + cpu_stw_le_mmuidx_ra(e, p, v, cpu_mmu_index_kernel(e), r)#define cpu_stl_kernel_ra (e, p, v, r) \ - cpu_stl_mmuidx_ra(e, p, v, cpu_mmu_index_kernel(e), r) + cpu_stl_le_mmuidx_ra(e, p, v, cpu_mmu_index_kernel(e), r)#define cpu_stq_kernel_ra (e, p, v, r) \ - cpu_stq_mmuidx_ra(e, p, v, cpu_mmu_index_kernel(e), r) + cpu_stq_le_mmuidx_ra(e, p, v, cpu_mmu_index_kernel(e), r)#define cpu_lduw_kernel (e, p) cpu_lduw_kernel_ra(e, p, 0)#define cpu_ldl_kernel (e, p) cpu_ldl_kernel_ra(e, p, 0)
linux-user/vm86.c +2 -2
@@ -44,7 +44,7 @@ static inline int is_revectored(int nr, struct target_revectored_struct *bitmap)static inline void vm_putw (CPUX86State *env,uint32_t segptr,unsigned int reg16,unsigned int val) { -cpu_stw_data (env, segptr + (reg16 &0xffff ), val); +cpu_stw_le_data (env, segptr + (reg16 &0xffff ), val); }void save_v86_state (CPUX86State *env)
@@ -157,7 +157,7 @@ static void do_int(CPUX86State *env, int intno) &ts->vm86plus.int21_revectored)) goto cannot_handle; int_addr = (intno <<2 ); - segoffs =cpu_ldl_data (env, int_addr); + segoffs =cpu_ldl_le_data (env, int_addr);if ((segoffs >>16 ) ==TARGET_BIOSSEG ) goto cannot_handle; LOG_VM86("VM86: emulating int 0x%x. CS:IP=%04x:%04x\n",
target/i386/tcg/mem_helper.c +4 -4
@@ -30,8 +30,8 @@ void helper_boundw(CPUX86State *env, target_ulong a0, int v) {int low, high; - low =cpu_ldsw_data_ra (env, a0,GETPC ()); - high =cpu_ldsw_data_ra (env, a0 +2 ,GETPC ()); + low =cpu_ldsw_le_data_ra (env, a0,GETPC ()); + high =cpu_ldsw_le_data_ra (env, a0 +2 ,GETPC ()); v = (int16_t )v;if (v < low || v > high) {if (env->hflags &HF_MPX_EN_MASK ) {
@@ -45,8 +45,8 @@ void helper_boundl(CPUX86State *env, target_ulong a0, int v) {int low, high; - low =cpu_ldl_data_ra (env, a0,GETPC ()); - high =cpu_ldl_data_ra (env, a0 +4 ,GETPC ()); + low =cpu_ldl_le_data_ra (env, a0,GETPC ()); + high =cpu_ldl_le_data_ra (env, a0 +4 ,GETPC ());if (v < low || v > high) {if (env->hflags &HF_MPX_EN_MASK ) { env->bndcs_regs.sts =0 ;
target/i386/tcg/mpx_helper.c +14 -14
@@ -44,7 +44,7 @@ static uint64_t lookup_bte64(CPUX86State *env, uint64_t base, uintptr_t ra) } bde = (extract64 (base,20 ,28 ) <<3 ) + (extract64 (bndcsr,20 ,44 ) <<12 ); - bt =cpu_ldq_data_ra (env, bde, ra); + bt =cpu_ldq_le_data_ra (env, bde, ra);if ((bt &1 ) ==0 ) { env->bndcs_regs.sts = bde |2 ;raise_exception_ra (env,EXCP05_BOUND , ra);
@@ -64,7 +64,7 @@ static uint32_t lookup_bte32(CPUX86State *env, uint32_t base, uintptr_t ra) } bde = (extract32 (base,12 ,20 ) <<2 ) + (bndcsr &TARGET_PAGE_MASK ); - bt =cpu_ldl_data_ra (env, bde, ra); + bt =cpu_ldl_le_data_ra (env, bde, ra);if ((bt &1 ) ==0 ) { env->bndcs_regs.sts = bde |2 ;raise_exception_ra (env,EXCP05_BOUND , ra);
@@ -79,9 +79,9 @@ uint64_t helper_bndldx64(CPUX86State *env, target_ulong base, target_ulong ptr)uint64_t bte, lb, ub, pt; bte =lookup_bte64 (env, base, ra); - lb =cpu_ldq_data_ra (env, bte, ra); - ub =cpu_ldq_data_ra (env, bte +8 , ra); - pt =cpu_ldq_data_ra (env, bte +16 , ra); + lb =cpu_ldq_le_data_ra (env, bte, ra); + ub =cpu_ldq_le_data_ra (env, bte +8 , ra); + pt =cpu_ldq_le_data_ra (env, bte +16 , ra);if (pt != ptr) { lb = ub =0 ;
@@ -96,9 +96,9 @@ uint64_t helper_bndldx32(CPUX86State *env, target_ulong base, target_ulong ptr)uint32_t bte, lb, ub, pt; bte =lookup_bte32 (env, base, ra); - lb =cpu_ldl_data_ra (env, bte, ra); - ub =cpu_ldl_data_ra (env, bte +4 , ra); - pt =cpu_ldl_data_ra (env, bte +8 , ra); + lb =cpu_ldl_le_data_ra (env, bte, ra); + ub =cpu_ldl_le_data_ra (env, bte +4 , ra); + pt =cpu_ldl_le_data_ra (env, bte +8 , ra);if (pt != ptr) { lb = ub =0 ;
@@ -113,9 +113,9 @@ void helper_bndstx64(CPUX86State *env, target_ulong base, target_ulong ptr,uint64_t bte; bte =lookup_bte64 (env, base, ra); -cpu_stq_data_ra (env, bte, lb, ra); -cpu_stq_data_ra (env, bte +8 , ub, ra); -cpu_stq_data_ra (env, bte +16 , ptr, ra); +cpu_stq_le_data_ra (env, bte, lb, ra); +cpu_stq_le_data_ra (env, bte +8 , ub, ra); +cpu_stq_le_data_ra (env, bte +16 , ptr, ra); } void helper_bndstx32(CPUX86State *env, target_ulong base, target_ulong ptr,
@@ -125,9 +125,9 @@ void helper_bndstx32(CPUX86State *env, target_ulong base, target_ulong ptr,uint32_t bte; bte =lookup_bte32 (env, base, ra); -cpu_stl_data_ra (env, bte, lb, ra); -cpu_stl_data_ra (env, bte +4 , ub, ra); -cpu_stl_data_ra (env, bte +8 , ptr, ra); +cpu_stl_le_data_ra (env, bte, lb, ra); +cpu_stl_le_data_ra (env, bte +4 , ub, ra); +cpu_stl_le_data_ra (env, bte +8 , ptr, ra); }void helper_bnd_jmp (CPUX86State *env)
target/i386/tcg/seg_helper.c +8 -8
@@ -65,20 +65,20 @@ typedef struct StackAccessstatic void pushw (StackAccess *sa,uint16_t val) { sa->sp -=2 ; -cpu_stw_mmuidx_ra (sa->env, sa->ss_base + (sa->sp & sa->sp_mask), +cpu_stw_le_mmuidx_ra (sa->env, sa->ss_base + (sa->sp & sa->sp_mask), val, sa->mmu_index, sa->ra); }static void pushl (StackAccess *sa,uint32_t val) { sa->sp -=4 ; -cpu_stl_mmuidx_ra (sa->env, sa->ss_base + (sa->sp & sa->sp_mask), +cpu_stl_le_mmuidx_ra (sa->env, sa->ss_base + (sa->sp & sa->sp_mask), val, sa->mmu_index, sa->ra); }static uint16_t popw (StackAccess *sa) { -uint16_t ret =cpu_lduw_mmuidx_ra (sa->env, +uint16_t ret =cpu_lduw_le_mmuidx_ra (sa->env, sa->ss_base + (sa->sp & sa->sp_mask), sa->mmu_index, sa->ra); sa->sp +=2 ;
@@ -87,7 +87,7 @@ static uint16_t popw(StackAccess *sa)static uint32_t popl (StackAccess *sa) { -uint32_t ret =cpu_ldl_mmuidx_ra (sa->env, +uint32_t ret =cpu_ldl_le_mmuidx_ra (sa->env, sa->ss_base + (sa->sp & sa->sp_mask), sa->mmu_index, sa->ra); sa->sp +=4 ;
@@ -905,12 +905,12 @@ static void do_interrupt_protected(CPUX86State *env, int intno, int is_int,static void pushq (StackAccess *sa,uint64_t val) { sa->sp -=8 ; -cpu_stq_mmuidx_ra (sa->env, sa->sp, val, sa->mmu_index, sa->ra); +cpu_stq_le_mmuidx_ra (sa->env, sa->sp, val, sa->mmu_index, sa->ra); }static uint64_t popq (StackAccess *sa) { -uint64_t ret =cpu_ldq_mmuidx_ra (sa->env, sa->sp, sa->mmu_index, sa->ra); +uint64_t ret =cpu_ldq_le_mmuidx_ra (sa->env, sa->sp, sa->mmu_index, sa->ra); sa->sp +=8 ;return ret; }
@@ -1887,7 +1887,7 @@ void helper_lcall_protected(CPUX86State *env, int new_cs, target_ulong new_eip,pushl (&sa, env->segs[R_SS ].selector);pushl (&sa, env->regs[R_ESP ]);for (i = param_count -1 ; i >=0 ; i--) { - val =cpu_ldl_data_ra (env, + val =cpu_ldl_le_data_ra (env, old_ssp + ((env->regs[R_ESP ] + i *4 ) & old_sp_mask),GETPC ());pushl (&sa, val);
@@ -1896,7 +1896,7 @@ void helper_lcall_protected(CPUX86State *env, int new_cs, target_ulong new_eip,pushw (&sa, env->segs[R_SS ].selector);pushw (&sa, env->regs[R_ESP ]);for (i = param_count -1 ; i >=0 ; i--) { - val =cpu_lduw_data_ra (env, + val =cpu_lduw_le_data_ra (env, old_ssp + ((env->regs[R_ESP ] + i *2 ) & old_sp_mask),GETPC ());pushw (&sa, val);
target/i386/tcg/system/excp_helper.c +4 -4
@@ -90,7 +90,7 @@ static inline uint32_t ptw_ldl(const PTETranslate *in, uint64_t ra)if (likely (in->haddr)) {return ldl_p (in->haddr); } -return cpu_ldl_mmuidx_ra (in->env, in->gaddr, in->ptw_idx, ra); +return cpu_ldl_le_mmuidx_ra (in->env, in->gaddr, in->ptw_idx, ra); }static inline uint64_t ptw_ldq (const PTETranslate *in,uint64_t ra)
@@ -98,7 +98,7 @@ static inline uint64_t ptw_ldq(const PTETranslate *in, uint64_t ra)if (likely (in->haddr)) {return ldq_p (in->haddr); } -return cpu_ldq_mmuidx_ra (in->env, in->gaddr, in->ptw_idx, ra); +return cpu_ldq_le_mmuidx_ra (in->env, in->gaddr, in->ptw_idx, ra); }/*
@@ -116,9 +116,9 @@ static bool ptw_setl_slow(const PTETranslate *in, uint32_t old, uint32_t new)cpu_exec_end (cpu);/* Does x86 really perform a rmw cycle on mmio for ptw? */ start_exclusive (); - cmp =cpu_ldl_mmuidx_ra (in->env, in->gaddr, in->ptw_idx,0 ); + cmp =cpu_ldl_le_mmuidx_ra (in->env, in->gaddr, in->ptw_idx,0 );if (cmp == old) { -cpu_stl_mmuidx_ra (in->env, in->gaddr, new, in->ptw_idx,0 ); +cpu_stl_le_mmuidx_ra (in->env, in->gaddr, new, in->ptw_idx,0 ); }end_exclusive ();cpu_exec_start (cpu);
target/i386/tcg/system/svm_helper.c +24 -24
106 lines not on this page · raw message
Signature · 1 line
2.51.0
PATCH v3 17/21 target/hppa: Use little-endian variant of cpu_ld/st_data*()
In reply to Philippe Mathieu-DaudéWe only build the HPPA target using little endianness order, therefore the cpu_ld/st_data*() definitions expand to the little endian declarations. Use the explicit little-endian variants.
Mechanical change running:
$ tgt=hppa; \
end=be; \
for op in data mmuidx_ra; do \
for ac in uw sw l q; do \
sed -i -e "s/cpu_ld${ac}_${op}/cpu_ld${ac}_${end}_${op}/" \
$(git grep -l cpu_ target/${tgt}/); \
done;
for ac in w l q; do \
sed -i -e "s/cpu_st${ac}_${op}/cpu_st${ac}_${end}_${op}/" \
$(git grep -l cpu_ target/${tgt}/); \
done;
done--- target/hppa/op_helper.c | 44 ++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 22 deletions(-)
target/hppa/op_helper.c +22 -22
@@ -107,7 +107,7 @@ static void do_stby_b(CPUHPPAState *env, target_ulong addr, target_ulong val,cpu_stb_data_ra (env, addr, val, ra);break ;case 2 : -cpu_stw_data_ra (env, addr, val, ra); +cpu_stw_be_data_ra (env, addr, val, ra);break ;case 1 :/* The 3 byte store must appear atomic. */
@@ -115,11 +115,11 @@ static void do_stby_b(CPUHPPAState *env, target_ulong addr, target_ulong val,atomic_store_mask32 (env, addr, val,0x00ffffffu , ra); }else {cpu_stb_data_ra (env, addr, val >>16 , ra); -cpu_stw_data_ra (env, addr +1 , val, ra); +cpu_stw_be_data_ra (env, addr +1 , val, ra); }break ;default : -cpu_stl_data_ra (env, addr, val, ra); +cpu_stl_be_data_ra (env, addr, val, ra);break ; } }
@@ -132,7 +132,7 @@ static void do_stdby_b(CPUHPPAState *env, target_ulong addr, uint64_t val,cpu_stb_data_ra (env, addr, val, ra);break ;case 6 : -cpu_stw_data_ra (env, addr, val, ra); +cpu_stw_be_data_ra (env, addr, val, ra);break ;case 5 :/* The 3 byte store must appear atomic. */
@@ -140,11 +140,11 @@ static void do_stdby_b(CPUHPPAState *env, target_ulong addr, uint64_t val,atomic_store_mask32 (env, addr, val,0x00ffffffu , ra); }else {cpu_stb_data_ra (env, addr, val >>16 , ra); -cpu_stw_data_ra (env, addr +1 , val, ra); +cpu_stw_be_data_ra (env, addr +1 , val, ra); }break ;case 4 : -cpu_stl_data_ra (env, addr, val, ra); +cpu_stl_be_data_ra (env, addr, val, ra);break ;case 3 :/* The 5 byte store must appear atomic. */
@@ -152,7 +152,7 @@ static void do_stdby_b(CPUHPPAState *env, target_ulong addr, uint64_t val,atomic_store_mask64 (env, addr, val,0x000000ffffffffffull ,5 , ra); }else {cpu_stb_data_ra (env, addr, val >>32 , ra); -cpu_stl_data_ra (env, addr +1 , val, ra); +cpu_stl_be_data_ra (env, addr +1 , val, ra); }break ;case 2 :
@@ -160,8 +160,8 @@ static void do_stdby_b(CPUHPPAState *env, target_ulong addr, uint64_t val,if (parallel) {atomic_store_mask64 (env, addr, val,0x0000ffffffffffffull ,6 , ra); }else { -cpu_stw_data_ra (env, addr, val >>32 , ra); -cpu_stl_data_ra (env, addr +2 , val, ra); +cpu_stw_be_data_ra (env, addr, val >>32 , ra); +cpu_stl_be_data_ra (env, addr +2 , val, ra); }break ;case 1 :
@@ -170,12 +170,12 @@ static void do_stdby_b(CPUHPPAState *env, target_ulong addr, uint64_t val,atomic_store_mask64 (env, addr, val,0x00ffffffffffffffull ,7 , ra); }else {cpu_stb_data_ra (env, addr, val >>48 , ra); -cpu_stw_data_ra (env, addr +1 , val >>32 , ra); -cpu_stl_data_ra (env, addr +3 , val, ra); +cpu_stw_be_data_ra (env, addr +1 , val >>32 , ra); +cpu_stl_be_data_ra (env, addr +3 , val, ra); }break ;default : -cpu_stq_data_ra (env, addr, val, ra); +cpu_stq_be_data_ra (env, addr, val, ra);break ; } }
@@ -211,12 +211,12 @@ static void do_stby_e(CPUHPPAState *env, target_ulong addr, target_ulong val,if (parallel) {atomic_store_mask32 (env, addr -3 , val,0xffffff00u , ra); }else { -cpu_stw_data_ra (env, addr -3 , val >>16 , ra); +cpu_stw_be_data_ra (env, addr -3 , val >>16 , ra);cpu_stb_data_ra (env, addr -1 , val >>8 , ra); }break ;case 2 : -cpu_stw_data_ra (env, addr -2 , val >>16 , ra); +cpu_stw_be_data_ra (env, addr -2 , val >>16 , ra);break ;case 1 :cpu_stb_data_ra (env, addr -1 , val >>24 , ra);
@@ -239,8 +239,8 @@ static void do_stdby_e(CPUHPPAState *env, target_ulong addr, uint64_t val,atomic_store_mask64 (env, addr -7 , val,0xffffffffffffff00ull ,7 , ra); }else { -cpu_stl_data_ra (env, addr -7 , val >>32 , ra); -cpu_stw_data_ra (env, addr -3 , val >>16 , ra); +cpu_stl_be_data_ra (env, addr -7 , val >>32 , ra); +cpu_stw_be_data_ra (env, addr -3 , val >>16 , ra);cpu_stb_data_ra (env, addr -1 , val >>8 , ra); }break ;
@@ -250,8 +250,8 @@ static void do_stdby_e(CPUHPPAState *env, target_ulong addr, uint64_t val,atomic_store_mask64 (env, addr -6 , val,0xffffffffffff0000ull ,6 , ra); }else { -cpu_stl_data_ra (env, addr -6 , val >>32 , ra); -cpu_stw_data_ra (env, addr -2 , val >>16 , ra); +cpu_stl_be_data_ra (env, addr -6 , val >>32 , ra); +cpu_stw_be_data_ra (env, addr -2 , val >>16 , ra); }break ;case 5 :
@@ -260,24 +260,24 @@ static void do_stdby_e(CPUHPPAState *env, target_ulong addr, uint64_t val,atomic_store_mask64 (env, addr -5 , val,0xffffffffff000000ull ,5 , ra); }else { -cpu_stl_data_ra (env, addr -5 , val >>32 , ra); +cpu_stl_be_data_ra (env, addr -5 , val >>32 , ra);cpu_stb_data_ra (env, addr -1 , val >>24 , ra); }break ;case 4 : -cpu_stl_data_ra (env, addr -4 , val >>32 , ra); +cpu_stl_be_data_ra (env, addr -4 , val >>32 , ra);break ;case 3 :/* The 3 byte store must appear atomic. */ if (parallel) {atomic_store_mask32 (env, addr -3 , val >>32 ,0xffffff00u , ra); }else { -cpu_stw_data_ra (env, addr -3 , val >>48 , ra); +cpu_stw_be_data_ra (env, addr -3 , val >>48 , ra);cpu_stb_data_ra (env, addr -1 , val >>40 , ra); }break ;case 2 : -cpu_stw_data_ra (env, addr -2 , val >>48 , ra); +cpu_stw_be_data_ra (env, addr -2 , val >>48 , ra);break ;case 1 :cpu_stb_data_ra (env, addr -1 , val >>56 , ra);
Signature · 1 line
2.51.0
PATCH v3 18/21 target/riscv: Use little-endian variant of cpu_ld/st_data*() for vector
In reply to Philippe Mathieu-DaudéRISC-V vector "elements are simply packed in order from the least-signicant to most-signicant bits of the vector register" [*] which is little endianness, therefore the cpu_ld/st_data*() definitions expand to the little endian declarations. Use the explicit little-endian variants.
[*] RISC-V "V" Vector Extension v1.0
--- target/riscv/vector_helper.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
target/riscv/vector_helper.c +6 -6
@@ -193,9 +193,9 @@ void NAME##_host(void *vd, uint32_t idx, void *host) \ } GEN_VEXT_LD_ELEM(lde_b, uint8_t, H1, ldub) -GEN_VEXT_LD_ELEM(lde_h, uint16_t, H2, lduw) -GEN_VEXT_LD_ELEM(lde_w, uint32_t, H4, ldl) -GEN_VEXT_LD_ELEM(lde_d, uint64_t, H8, ldq) +GEN_VEXT_LD_ELEM(lde_h, uint16_t, H2, lduw_le) +GEN_VEXT_LD_ELEM(lde_w, uint32_t, H4, ldl_le) +GEN_VEXT_LD_ELEM(lde_d, uint64_t, H8, ldq_le)#define GEN_VEXT_ST_ELEM (NAME ,ETYPE ,H ,STSUF ) \ static inline QEMU_ALWAYS_INLINE \
@@ -214,9 +214,9 @@ void NAME##_host(void *vd, uint32_t idx, void *host) \ } GEN_VEXT_ST_ELEM(ste_b, uint8_t, H1, stb) -GEN_VEXT_ST_ELEM(ste_h, uint16_t, H2, stw) -GEN_VEXT_ST_ELEM(ste_w, uint32_t, H4, stl) -GEN_VEXT_ST_ELEM(ste_d, uint64_t, H8, stq) +GEN_VEXT_ST_ELEM(ste_h, uint16_t, H2, stw_le) +GEN_VEXT_ST_ELEM(ste_w, uint32_t, H4, stl_le) +GEN_VEXT_ST_ELEM(ste_d, uint64_t, H8, stq_le) static inline QEMU_ALWAYS_INLINE void vext_continuous_ldst_tlb(CPURISCVState *env, vext_ldst_elem_fn_tlb *ldst_tlb,
Signature · 1 line
2.51.0
PATCH v3 19/21 target/sh4: Replace cpu_stl_data() by explicit endianness variants
In reply to Philippe Mathieu-DaudéSee commit 852d481faf7 ("SH: Improve movca.l/ocbi emulation") for more context on this code.
--- target/sh4/op_helper.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
target/sh4/op_helper.c +5 -1
@@ -143,7 +143,11 @@ void helper_ocbi(CPUSH4State *env, uint32_t address)if ((a & ~0x1F ) == (address & ~0x1F )) {memory_content *next = (*current)->next; -cpu_stl_data (env, a, (*current)->value); +if (TARGET_BIG_ENDIAN ) { +cpu_stl_be_data (env, a, (*current)->value); + }else { +cpu_stl_le_data (env, a, (*current)->value); + }if (next ==NULL ) {
Signature · 1 line
2.51.0
PATCH v3 20/21 target/mips: Use big-endian variant of cpu_ld/st_data*() for MSA
In reply to Philippe Mathieu-DaudéMSA vectors are accessed in big endianness.
Per the "MIPS® SIMD Architecture" (MD00926 rev 1.03):
3.1 Registers Layout
MSA vectors are stored in memory starting from the 0th element at the lowest byte address. The byte order of each element follows the big- or little-endian convention of the system configuration.
Use the explicit big-endian variants of cpu_ld/st_data*().
Running files in tests/tcg/mips/user/ase/msa shows:
NLOC.B | PASS: 80 | FAIL: 0 | elapsed time: 0.21 ms | NLOC.H | PASS: 80 | FAIL: 0 | elapsed time: 0.22 ms | NLOC.W | PASS: 80 | FAIL: 0 | elapsed time: 0.18 ms | NLOC.D | PASS: 80 | FAIL: 0 | elapsed time: 0.18 ms | NLZC.B | PASS: 80 | FAIL: 0 | elapsed time: 0.19 ms | NLZC.H | PASS: 80 | FAIL: 0 | elapsed time: 0.18 ms | NLZC.W | PASS: 80 | FAIL: 0 | elapsed time: 0.21 ms | NLZC.D | PASS: 80 | FAIL: 0 | elapsed time: 0.18 ms | PCNT.B | PASS: 80 | FAIL: 0 | elapsed time: 0.17 ms | PCNT.H | PASS: 80 | FAIL: 0 | elapsed time: 0.19 ms | PCNT.W | PASS: 80 | FAIL: 0 | elapsed time: 0.18 ms | PCNT.D | PASS: 80 | FAIL: 0 | elapsed time: 0.19 ms | BINSL.B | PASS: 112 | FAIL: 0 | elapsed time: 0.57 ms | BINSL.H | PASS: 112 | FAIL: 0 | elapsed time: 0.57 ms | BINSL.W | PASS: 112 | FAIL: 0 | elapsed time: 0.57 ms | BINSL.D | PASS: 112 | FAIL: 0 | elapsed time: 0.56 ms | BINSR.B | PASS: 112 | FAIL: 0 | elapsed time: 0.57 ms | BINSR.H | PASS: 112 | FAIL: 0 | elapsed time: 0.58 ms | BINSR.W | PASS: 112 | FAIL: 0 | elapsed time: 0.58 ms | BINSR.D | PASS: 112 | FAIL: 0 | elapsed time: 0.57 ms | BMNZ.V | PASS: 112 | FAIL: 0 | elapsed time: 0.65 ms | BMZ.V | PASS: 112 | FAIL: 0 | elapsed time: 0.59 ms | BSEL.V | PASS: 112 | FAIL: 0 | elapsed time: 0.60 ms | BCLR.B | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | BCLR.H | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | BCLR.W | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | BCLR.D | PASS: 80 | FAIL: 0 | elapsed time: 0.31 ms | BNEG.B | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | BNEG.H | PASS: 80 | FAIL: 0 | elapsed time: 0.29 ms | BNEG.W | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | BNEG.D | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | BSET.B | PASS: 80 | FAIL: 0 | elapsed time: 0.32 ms | BSET.H | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | BSET.W | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | BSET.D | PASS: 80 | FAIL: 0 | elapsed time: 0.33 ms | MADD_Q.H | PASS: 112 | FAIL: 0 | elapsed time: 0.60 ms | MADD_Q.W | PASS: 112 | FAIL: 0 | elapsed time: 0.83 ms | MADDR_Q.H | PASS: 112 | FAIL: 0 | elapsed time: 0.62 ms | MADDR_Q.W | PASS: 112 | FAIL: 0 | elapsed time: 0.56 ms | MSUB_Q.H | PASS: 112 | FAIL: 0 | elapsed time: 0.57 ms | MSUB_Q.W | PASS: 112 | FAIL: 0 | elapsed time: 0.57 ms | MSUBR_Q.H | PASS: 112 | FAIL: 0 | elapsed time: 0.56 ms | MSUBR_Q.W | PASS: 112 | FAIL: 0 | elapsed time: 0.56 ms | MUL_Q.H | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | MUL_Q.W | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | MULR_Q.H | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | MULR_Q.W | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | FMAX_A.W | PASS: 80 | FAIL: 0 | elapsed time: 0.36 ms | FMAX_A.D | PASS: 80 | FAIL: 0 | elapsed time: 0.34 ms | FMAX.W | PASS: 80 | FAIL: 0 | elapsed time: 0.33 ms | FMAX.D | PASS: 80 | FAIL: 0 | elapsed time: 0.34 ms | FMIN_A.W | PASS: 80 | FAIL: 0 | elapsed time: 0.36 ms | FMIN_A.D | PASS: 80 | FAIL: 0 | elapsed time: 0.34 ms | FMIN.W | PASS: 80 | FAIL: 0 | elapsed time: 0.35 ms | FMIN.D | PASS: 80 | FAIL: 0 | elapsed time: 0.32 ms | ADD_A.B | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | ADD_A.H | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | ADD_A.W | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | ADD_A.D | PASS: 80 | FAIL: 0 | elapsed time: 0.29 ms | ADDS_A.B | PASS: 80 | FAIL: 0 | elapsed time: 0.31 ms | ADDS_A.H | PASS: 80 | FAIL: 0 | elapsed time: 0.33 ms | ADDS_A.W | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | ADDS_A.D | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | ADDS_S.B | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | ADDS_S.H | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | ADDS_S.W | PASS: 80 | FAIL: 0 | elapsed time: 0.80 ms | ADDS_S.D | PASS: 80 | FAIL: 0 | elapsed time: 0.32 ms | ADDS_U.B | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | ADDS_U.H | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | ADDS_U.W | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | ADDS_U.D | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | ADDV.B | PASS: 80 | FAIL: 0 | elapsed time: 0.32 ms | ADDV.H | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | ADDV.W | PASS: 80 | FAIL: 0 | elapsed time: 0.32 ms | ADDV.D | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | HADD_S.H | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | HADD_S.W | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | HADD_S.D | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | HADD_U.H | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | HADD_U.W | PASS: 80 | FAIL: 0 | elapsed time: 0.33 ms | HADD_U.D | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | AVE_S.B | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | AVE_S.H | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | AVE_S.W | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | AVE_S.D | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | AVE_U.B | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | AVE_U.H | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | AVE_U.W | PASS: 80 | FAIL: 0 | elapsed time: 0.29 ms | AVE_U.D | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | AVER_S.B | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | AVER_S.H | PASS: 80 | FAIL: 0 | elapsed time: 0.29 ms | AVER_S.W | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | AVER_S.D | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | AVER_U.B | PASS: 80 | FAIL: 0 | elapsed time: 0.31 ms | AVER_U.H | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | AVER_U.W | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | AVER_U.D | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | CEQ.B | PASS: 80 | FAIL: 0 | elapsed time: 0.29 ms | CEQ.H | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | CEQ.W | PASS: 80 | FAIL: 0 | elapsed time: 0.38 ms | CEQ.D | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | CLE_S.B | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | CLE_S.H | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | CLE_S.W | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | CLE_S.D | PASS: 80 | FAIL: 0 | elapsed time: 0.29 ms | CLE_U.B | PASS: 80 | FAIL: 0 | elapsed time: 0.29 ms | CLE_U.H | PASS: 80 | FAIL: 0 | elapsed time: 0.29 ms | CLE_U.W | PASS: 80 | FAIL: 0 | elapsed time: 0.34 ms | CLE_U.D | PASS: 80 | FAIL: 0 | elapsed time: 0.32 ms | CLT_S.B | PASS: 80 | FAIL: 0 | elapsed time: 0.34 ms | CLT_S.H | PASS: 80 | FAIL: 0 | elapsed time: 0.29 ms | CLT_S.W | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | CLT_S.D | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | CLT_U.B | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | CLT_U.H | PASS: 80 | FAIL: 0 | elapsed time: 0.34 ms | CLT_U.W | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | CLT_U.D | PASS: 80 | FAIL: 0 | elapsed time: 0.29 ms | DIV_S.B | PASS: 80 | FAIL: 0 | elapsed time: 0.31 ms | DIV_S.H | PASS: 80 | FAIL: 0 | elapsed time: 0.32 ms | DIV_S.W | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | DIV_S.D | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | DIV_U.B | PASS: 80 | FAIL: 0 | elapsed time: 0.39 ms | DIV_U.H | PASS: 80 | FAIL: 0 | elapsed time: 0.31 ms | DIV_U.W | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | DIV_U.D | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | DOTP_S.H | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | DOTP_S.W | PASS: 80 | FAIL: 0 | elapsed time: 0.35 ms | DOTP_S.D | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | DOTP_U.H | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | DOTP_U.W | PASS: 80 | FAIL: 0 | elapsed time: 0.34 ms | DOTP_U.D | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | DPADD_S.H | PASS: 112 | FAIL: 0 | elapsed time: 0.59 ms | DPADD_S.W | PASS: 112 | FAIL: 0 | elapsed time: 0.56 ms | DPADD_S.D | PASS: 112 | FAIL: 0 | elapsed time: 0.58 ms | DPADD_U.H | PASS: 112 | FAIL: 0 | elapsed time: 0.56 ms | DPADD_U.W | PASS: 112 | FAIL: 0 | elapsed time: 0.56 ms | DPADD_U.D | PASS: 112 | FAIL: 0 | elapsed time: 0.56 ms | DPSUB_S.H | PASS: 112 | FAIL: 0 | elapsed time: 0.56 ms | DPSUB_S.W | PASS: 112 | FAIL: 0 | elapsed time: 0.57 ms | DPSUB_S.D | PASS: 112 | FAIL: 0 | elapsed time: 0.56 ms | DPSUB_U.H | PASS: 112 | FAIL: 0 | elapsed time: 0.58 ms | DPSUB_U.W | PASS: 112 | FAIL: 0 | elapsed time: 0.59 ms | DPSUB_U.D | PASS: 112 | FAIL: 0 | elapsed time: 0.56 ms | MAX_A.B | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | MAX_A.H | PASS: 80 | FAIL: 0 | elapsed time: 0.31 ms | MAX_A.W | PASS: 80 | FAIL: 0 | elapsed time: 0.33 ms | MAX_A.D | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | MAX_S.B | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | MAX_S.H | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | MAX_S.W | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | MAX_S.D | PASS: 80 | FAIL: 0 | elapsed time: 0.35 ms | MAX_U.B | PASS: 80 | FAIL: 0 | elapsed time: 0.35 ms | MAX_U.H | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | MAX_U.W | PASS: 80 | FAIL: 0 | elapsed time: 0.29 ms | MAX_U.D | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | MIN_A.B | PASS: 80 | FAIL: 0 | elapsed time: 0.29 ms | MIN_A.H | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | MIN_A.W | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | MIN_A.D | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | MIN_S.B | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | MIN_S.H | PASS: 80 | FAIL: 0 | elapsed time: 0.33 ms | MIN_S.W | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | MIN_S.D | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | MIN_U.B | PASS: 80 | FAIL: 0 | elapsed time: 0.29 ms | MIN_U.H | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | MIN_U.W | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | MIN_U.D | PASS: 80 | FAIL: 0 | elapsed time: 0.29 ms | MOD_S.B | PASS: 80 | FAIL: 0 | elapsed time: 0.31 ms | MOD_S.H | PASS: 80 | FAIL: 0 | elapsed time: 0.31 ms | MOD_S.W | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | MOD_S.D | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | MOD_U.B | PASS: 80 | FAIL: 0 | elapsed time: 0.37 ms | MOD_U.H | PASS: 80 | FAIL: 0 | elapsed time: 0.32 ms | MOD_U.W | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | MOD_U.D | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | MADDV.B | PASS: 112 | FAIL: 0 | elapsed time: 0.57 ms | MADDV.H | PASS: 112 | FAIL: 0 | elapsed time: 0.63 ms | MADDV.W | PASS: 112 | FAIL: 0 | elapsed time: 0.56 ms | MADDV.D | PASS: 112 | FAIL: 0 | elapsed time: 0.57 ms | MSUBV.B | PASS: 112 | FAIL: 0 | elapsed time: 0.56 ms | MSUBV.H | PASS: 112 | FAIL: 0 | elapsed time: 0.65 ms | MSUBV.W | PASS: 112 | FAIL: 0 | elapsed time: 0.56 ms | MSUBV.D | PASS: 112 | FAIL: 0 | elapsed time: 0.65 ms | MULV.B | PASS: 80 | FAIL: 0 | elapsed time: 0.29 ms | MULV.H | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | MULV.W | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | MULV.D | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | ASUB_S.B | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | ASUB_S.H | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | ASUB_S.W | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | ASUB_S.D | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | ASUB_U.B | PASS: 80 | FAIL: 0 | elapsed time: 0.44 ms | ASUB_U.H | PASS: 80 | FAIL: 0 | elapsed time: 0.32 ms | ASUB_U.W | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | ASUB_U.D | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | HSUB_S.H | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | HSUB_S.W | PASS: 80 | FAIL: 0 | elapsed time: 0.29 ms | HSUB_S.D | PASS: 80 | FAIL: 0 | elapsed time: 0.32 ms | HSUB_U.H | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | HSUB_U.W | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | HSUB_U.D | PASS: 80 | FAIL: 0 | elapsed time: 0.29 ms | SUBS_S.B | PASS: 80 | FAIL: 0 | elapsed time: 0.32 ms | SUBS_S.H | PASS: 80 | FAIL: 0 | elapsed time: 0.38 ms | SUBS_S.W | PASS: 80 | FAIL: 0 | elapsed time: 0.32 ms | SUBS_S.D | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | SUBS_U.B | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | SUBS_U.H | PASS: 80 | FAIL: 0 | elapsed time: 0.34 ms | SUBS_U.W | PASS: 80 | FAIL: 0 | elapsed time: 0.29 ms | SUBS_U.D | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | SUBSUS_U.B | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | SUBSUS_U.H | PASS: 80 | FAIL: 0 | elapsed time: 0.32 ms | SUBSUS_U.W | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | SUBSUS_U.D | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | SUBSUU_S.B | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | SUBSUU_S.H | PASS: 80 | FAIL: 0 | elapsed time: 0.29 ms | SUBSUU_S.W | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | SUBSUU_S.D | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | SUBV.B | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | SUBV.H | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | SUBV.W | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | SUBV.D | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | ILVEV.B | PASS: 80 | FAIL: 0 | elapsed time: 0.35 ms | ILVEV.H | PASS: 80 | FAIL: 0 | elapsed time: 0.32 ms | ILVEV.W | PASS: 80 | FAIL: 0 | elapsed time: 0.31 ms | ILVEV.D | PASS: 80 | FAIL: 0 | elapsed time: 0.34 ms | ILVOD.B | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | ILVOD.H | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | ILVOD.W | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | ILVOD.D | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | ILVL.B | PASS: 80 | FAIL: 0 | elapsed time: 0.29 ms | ILVL.H | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | ILVL.W | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | ILVL.D | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | ILVR.B | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | ILVR.H | PASS: 80 | FAIL: 0 | elapsed time: 0.29 ms | ILVR.W | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | ILVR.D | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | AND.V | PASS: 80 | FAIL: 0 | elapsed time: 0.29 ms | NOR.V | PASS: 80 | FAIL: 0 | elapsed time: 0.29 ms | OR.V | PASS: 80 | FAIL: 0 | elapsed time: 0.29 ms | XOR.V | PASS: 80 | FAIL: 0 | elapsed time: 0.29 ms | MOVE.V | PASS: 80 | FAIL: 0 | elapsed time: 0.18 ms | PCKEV.B | PASS: 112 | FAIL: 0 | elapsed time: 0.56 ms | PCKEV.H | PASS: 112 | FAIL: 0 | elapsed time: 0.56 ms | PCKEV.W | PASS: 112 | FAIL: 0 | elapsed time: 0.68 ms | PCKEV.D | PASS: 112 | FAIL: 0 | elapsed time: 0.57 ms | PCKOD.B | PASS: 112 | FAIL: 0 | elapsed time: 0.61 ms | PCKOD.H | PASS: 112 | FAIL: 0 | elapsed time: 0.62 ms | PCKOD.W | PASS: 112 | FAIL: 0 | elapsed time: 0.58 ms | PCKOD.D | PASS: 112 | FAIL: 0 | elapsed time: 0.58 ms | VSHF.B | PASS: 112 | FAIL: 0 | elapsed time: 0.57 ms | VSHF.H | PASS: 112 | FAIL: 0 | elapsed time: 0.57 ms | VSHF.W | PASS: 112 | FAIL: 0 | elapsed time: 0.62 ms | VSHF.D | PASS: 112 | FAIL: 0 | elapsed time: 0.57 ms | SLL.B | PASS: 80 | FAIL: 0 | elapsed time: 0.34 ms | SLL.H | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | SLL.W | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | SLL.D | PASS: 80 | FAIL: 0 | elapsed time: 0.38 ms | SRA.B | PASS: 80 | FAIL: 0 | elapsed time: 0.31 ms | SRA.H | PASS: 80 | FAIL: 0 | elapsed time: 0.29 ms | SRA.W | PASS: 80 | FAIL: 0 | elapsed time: 0.37 ms | SRA.D | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | SRAR.B | PASS: 80 | FAIL: 0 | elapsed time: 0.32 ms | SRAR.H | PASS: 80 | FAIL: 0 | elapsed time: 0.32 ms | SRAR.W | PASS: 80 | FAIL: 0 | elapsed time: 0.31 ms | SRAR.D | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | SRL.B | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | SRL.H | PASS: 80 | FAIL: 0 | elapsed time: 0.32 ms | SRL.W | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | SRL.D | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | SRLR.B | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms | SRLR.H | PASS: 80 | FAIL: 0 | elapsed time: 0.29 ms | SRLR.W | PASS: 80 | FAIL: 0 | elapsed time: 0.31 ms | SRLR.D | PASS: 80 | FAIL: 0 | elapsed time: 0.30 ms |
--- target/mips/tcg/msa_helper.c | 51 ++++++++++++++++++++++-------------- 1 file changed, 31 insertions(+), 20 deletions(-)
target/mips/tcg/msa_helper.c +31 -20
@@ -8231,8 +8231,8 @@ void helper_msa_ld_b(CPUMIPSState *env, uint32_t wd,uint64_t d0, d1;/* Load 8 bytes at a time. Vector element ordering makes this LE. */ - d0 =cpu_ldq_le_data_ra (env, addr +0 , ra); - d1 =cpu_ldq_le_data_ra (env, addr +8 , ra); + d0 =cpu_ldq_be_data_ra (env, addr +0 , ra); + d1 =cpu_ldq_be_data_ra (env, addr +8 , ra); pwd->d[0 ] = d0; pwd->d[1 ] = d1; }
@@ -8248,9 +8248,9 @@ void helper_msa_ld_h(CPUMIPSState *env, uint32_t wd,* Load 8 bytes at a time. Use little-endian load, then for * big-endian target, we must then swap the four halfwords. */ - d0 =cpu_ldq_le_data_ra (env, addr +0 , ra); - d1 =cpu_ldq_le_data_ra (env, addr +8 , ra); -if (mips_env_is_bigendian (env)) { + d0 =cpu_ldq_be_data_ra (env, addr +0 , ra); + d1 =cpu_ldq_be_data_ra (env, addr +8 , ra); +if (!mips_env_is_bigendian (env)) { d0 =bswap16x4 (d0); d1 =bswap16x4 (d1); }
@@ -8269,9 +8269,9 @@ void helper_msa_ld_w(CPUMIPSState *env, uint32_t wd,* Load 8 bytes at a time. Use little-endian load, then for * big-endian target, we must then bswap the two words. */ - d0 =cpu_ldq_le_data_ra (env, addr +0 , ra); - d1 =cpu_ldq_le_data_ra (env, addr +8 , ra); -if (mips_env_is_bigendian (env)) { + d0 =cpu_ldq_be_data_ra (env, addr +0 , ra); + d1 =cpu_ldq_be_data_ra (env, addr +8 , ra); +if (!mips_env_is_bigendian (env)) { d0 =bswap32x2 (d0); d1 =bswap32x2 (d1); }
@@ -8286,8 +8286,12 @@ void helper_msa_ld_d(CPUMIPSState *env, uint32_t wd,uintptr_t ra =GETPC ();uint64_t d0, d1; - d0 =cpu_ldq_data_ra (env, addr +0 , ra); - d1 =cpu_ldq_data_ra (env, addr +8 , ra); + d0 =cpu_ldq_be_data_ra (env, addr +0 , ra); + d1 =cpu_ldq_be_data_ra (env, addr +8 , ra); +if (!mips_env_is_bigendian (env)) { + d0 =bswap64 (d0); + d1 =bswap64 (d1); + } pwd->d[0 ] = d0; pwd->d[1 ] = d1; }
@@ -8320,8 +8324,8 @@ void helper_msa_st_b(CPUMIPSState *env, uint32_t wd,ensure_writable_pages (env, addr, mmu_idx, ra);/* Store 8 bytes at a time. Vector element ordering makes this LE. */ -cpu_stq_le_data_ra (env, addr +0 , pwd->d[0 ], ra); -cpu_stq_le_data_ra (env, addr +8 , pwd->d[1 ], ra); +cpu_stq_be_data_ra (env, addr +0 , pwd->d[0 ], ra); +cpu_stq_be_data_ra (env, addr +8 , pwd->d[1 ], ra); } void helper_msa_st_h(CPUMIPSState *env, uint32_t wd,
@@ -8337,12 +8341,12 @@ void helper_msa_st_h(CPUMIPSState *env, uint32_t wd,/* Store 8 bytes at a time. See helper_msa_ld_h. */ d0 = pwd->d[0 ]; d1 = pwd->d[1 ]; -if (mips_env_is_bigendian (env)) { +if (!mips_env_is_bigendian (env)) { d0 =bswap16x4 (d0); d1 =bswap16x4 (d1); } -cpu_stq_le_data_ra (env, addr +0 , d0, ra); -cpu_stq_le_data_ra (env, addr +8 , d1, ra); +cpu_stq_be_data_ra (env, addr +0 , d0, ra); +cpu_stq_be_data_ra (env, addr +8 , d1, ra); } void helper_msa_st_w(CPUMIPSState *env, uint32_t wd,
@@ -8358,12 +8362,12 @@ void helper_msa_st_w(CPUMIPSState *env, uint32_t wd,/* Store 8 bytes at a time. See helper_msa_ld_w. */ d0 = pwd->d[0 ]; d1 = pwd->d[1 ]; -if (mips_env_is_bigendian (env)) { +if (!mips_env_is_bigendian (env)) { d0 =bswap32x2 (d0); d1 =bswap32x2 (d1); } -cpu_stq_le_data_ra (env, addr +0 , d0, ra); -cpu_stq_le_data_ra (env, addr +8 , d1, ra); +cpu_stq_be_data_ra (env, addr +0 , d0, ra); +cpu_stq_be_data_ra (env, addr +8 , d1, ra); } void helper_msa_st_d(CPUMIPSState *env, uint32_t wd,
@@ -8372,9 +8376,16 @@ void helper_msa_st_d(CPUMIPSState *env, uint32_t wd,wr_t *pwd = &(env->active_fpu.fpr[wd].wr);int mmu_idx =mips_env_mmu_index (env);uintptr_t ra =GETPC (); +uint64_t d0, d1;ensure_writable_pages (env, addr, mmu_idx,GETPC ()); -cpu_stq_data_ra (env, addr +0 , pwd->d[0 ], ra); -cpu_stq_data_ra (env, addr +8 , pwd->d[1 ], ra); + d0 = pwd->d[0 ]; + d1 = pwd->d[1 ]; +if (!mips_env_is_bigendian (env)) { + d0 =bswap64 (d0); + d1 =bswap64 (d1); + } +cpu_stq_be_data_ra (env, addr +0 , d0, ra); +cpu_stq_be_data_ra (env, addr +8 , d1, ra); }
Signature · 1 line
2.51.0
PATCH v3 21/21 accel/tcg: Remove non-explicit endian cpu_ld/st*_data*() helpers
In reply to Philippe Mathieu-DaudéAll uses were converted to the explicit cpu_ld/st*_{be,le}_data*() helpers, no need for the non-explicit versions anymore.
---
FIXME: Still some PPC/MIPS uses
--- include/accel/tcg/cpu-ldst.h | 46 ------------------------------------ 1 file changed, 46 deletions(-)
include/accel/tcg/cpu-ldst.h +0 -46
@@ -428,52 +428,6 @@ cpu_stq_le_data(CPUArchState *env, abi_ptr addr, uint64_t val)cpu_stq_le_data_ra (env, addr, val,0 ); } -#if TARGET_BIG_ENDIAN -# define cpu_lduw_data cpu_lduw_be_data -# define cpu_ldsw_data cpu_ldsw_be_data -# define cpu_ldl_data cpu_ldl_be_data -# define cpu_ldq_data cpu_ldq_be_data -# define cpu_lduw_data_ra cpu_lduw_be_data_ra -# define cpu_ldsw_data_ra cpu_ldsw_be_data_ra -# define cpu_ldl_data_ra cpu_ldl_be_data_ra -# define cpu_ldq_data_ra cpu_ldq_be_data_ra -# define cpu_lduw_mmuidx_ra cpu_lduw_be_mmuidx_ra -# define cpu_ldsw_mmuidx_ra cpu_ldsw_be_mmuidx_ra -# define cpu_ldl_mmuidx_ra cpu_ldl_be_mmuidx_ra -# define cpu_ldq_mmuidx_ra cpu_ldq_be_mmuidx_ra -# define cpu_stw_data cpu_stw_be_data -# define cpu_stl_data cpu_stl_be_data -# define cpu_stq_data cpu_stq_be_data -# define cpu_stw_data_ra cpu_stw_be_data_ra -# define cpu_stl_data_ra cpu_stl_be_data_ra -# define cpu_stq_data_ra cpu_stq_be_data_ra -# define cpu_stw_mmuidx_ra cpu_stw_be_mmuidx_ra -# define cpu_stl_mmuidx_ra cpu_stl_be_mmuidx_ra -# define cpu_stq_mmuidx_ra cpu_stq_be_mmuidx_ra -#else -# define cpu_lduw_data cpu_lduw_le_data -# define cpu_ldsw_data cpu_ldsw_le_data -# define cpu_ldl_data cpu_ldl_le_data -# define cpu_ldq_data cpu_ldq_le_data -# define cpu_lduw_data_ra cpu_lduw_le_data_ra -# define cpu_ldsw_data_ra cpu_ldsw_le_data_ra -# define cpu_ldl_data_ra cpu_ldl_le_data_ra -# define cpu_ldq_data_ra cpu_ldq_le_data_ra -# define cpu_lduw_mmuidx_ra cpu_lduw_le_mmuidx_ra -# define cpu_ldsw_mmuidx_ra cpu_ldsw_le_mmuidx_ra -# define cpu_ldl_mmuidx_ra cpu_ldl_le_mmuidx_ra -# define cpu_ldq_mmuidx_ra cpu_ldq_le_mmuidx_ra -# define cpu_stw_data cpu_stw_le_data -# define cpu_stl_data cpu_stl_le_data -# define cpu_stq_data cpu_stq_le_data -# define cpu_stw_data_ra cpu_stw_le_data_ra -# define cpu_stl_data_ra cpu_stl_le_data_ra -# define cpu_stq_data_ra cpu_stq_le_data_ra -# define cpu_stw_mmuidx_ra cpu_stw_le_mmuidx_ra -# define cpu_stl_mmuidx_ra cpu_stl_le_mmuidx_ra -# define cpu_stq_mmuidx_ra cpu_stq_le_mmuidx_ra -#endif -static inline uint32_t cpu_ldub_code (CPUArchState *env,abi_ptr addr) {CPUState *cs =env_cpu (env);
Signature · 1 line
2.51.0