diff options
Diffstat (limited to 'target-arm')
-rw-r--r-- | target-arm/helpers.h | 913 | ||||
-rw-r--r-- | target-arm/op_addsub.h | 4 | ||||
-rw-r--r-- | target-arm/translate.c | 218 |
3 files changed, 533 insertions, 602 deletions
diff --git a/target-arm/helpers.h b/target-arm/helpers.h index 8b31372..67207cb 100644 --- a/target-arm/helpers.h +++ b/target-arm/helpers.h @@ -1,469 +1,394 @@ -#define DEF_HELPER(name, ret, args) ret glue(helper_,name) args; - -#ifdef GEN_HELPER -#define DEF_HELPER_0_0(name, ret, args) \ -DEF_HELPER(name, ret, args) \ -static inline void gen_helper_##name(void) \ -{ \ - tcg_gen_helper_0_0(helper_##name); \ -} -#define DEF_HELPER_0_1(name, ret, args) \ -DEF_HELPER(name, ret, args) \ -static inline void gen_helper_##name(TCGv arg1) \ -{ \ - tcg_gen_helper_0_1(helper_##name, arg1); \ -} -#define DEF_HELPER_0_2(name, ret, args) \ -DEF_HELPER(name, ret, args) \ -static inline void gen_helper_##name(TCGv arg1, TCGv arg2) \ -{ \ - tcg_gen_helper_0_2(helper_##name, arg1, arg2); \ -} -#define DEF_HELPER_0_3(name, ret, args) \ -DEF_HELPER(name, ret, args) \ -static inline void gen_helper_##name( \ - TCGv arg1, TCGv arg2, TCGv arg3) \ -{ \ - tcg_gen_helper_0_3(helper_##name, arg1, arg2, arg3); \ -} -#define DEF_HELPER_1_0(name, ret, args) \ -DEF_HELPER(name, ret, args) \ -static inline void gen_helper_##name(TCGv ret) \ -{ \ - tcg_gen_helper_1_0(helper_##name, ret); \ -} -#define DEF_HELPER_1_1(name, ret, args) \ -DEF_HELPER(name, ret, args) \ -static inline void gen_helper_##name(TCGv ret, TCGv arg1) \ -{ \ - tcg_gen_helper_1_1(helper_##name, ret, arg1); \ -} -#define DEF_HELPER_1_2(name, ret, args) \ -DEF_HELPER(name, ret, args) \ -static inline void gen_helper_##name(TCGv ret, TCGv arg1, TCGv arg2) \ -{ \ - tcg_gen_helper_1_2(helper_##name, ret, arg1, arg2); \ -} -#define DEF_HELPER_1_3(name, ret, args) \ -DEF_HELPER(name, ret, args) \ -static inline void gen_helper_##name(TCGv ret, \ - TCGv arg1, TCGv arg2, TCGv arg3) \ -{ \ - tcg_gen_helper_1_3(helper_##name, ret, arg1, arg2, arg3); \ -} -#define DEF_HELPER_1_4(name, ret, args) \ -DEF_HELPER(name, ret, args) \ -static inline void gen_helper_##name(TCGv ret, \ - TCGv arg1, TCGv arg2, TCGv arg3, TCGv arg4) \ -{ \ - tcg_gen_helper_1_4(helper_##name, ret, arg1, arg2, arg3, arg4); \ -} -#else /* !GEN_HELPER */ -#define DEF_HELPER_0_0 DEF_HELPER -#define DEF_HELPER_0_1 DEF_HELPER -#define DEF_HELPER_0_2 DEF_HELPER -#define DEF_HELPER_0_3 DEF_HELPER -#define DEF_HELPER_1_0 DEF_HELPER -#define DEF_HELPER_1_1 DEF_HELPER -#define DEF_HELPER_1_2 DEF_HELPER -#define DEF_HELPER_1_3 DEF_HELPER -#define DEF_HELPER_1_4 DEF_HELPER -#define HELPER(x) glue(helper_,x) -#endif - -DEF_HELPER_1_1(clz, uint32_t, (uint32_t)) -DEF_HELPER_1_1(sxtb16, uint32_t, (uint32_t)) -DEF_HELPER_1_1(uxtb16, uint32_t, (uint32_t)) - -DEF_HELPER_1_2(add_setq, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(add_saturate, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(sub_saturate, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(add_usaturate, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(sub_usaturate, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_1(double_saturate, uint32_t, (int32_t)) -DEF_HELPER_1_2(sdiv, int32_t, (int32_t, int32_t)) -DEF_HELPER_1_2(udiv, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_1(rbit, uint32_t, (uint32_t)) -DEF_HELPER_1_1(abs, uint32_t, (uint32_t)) +#include "def-helper.h" + +DEF_HELPER_1(clz, i32, i32) +DEF_HELPER_1(sxtb16, i32, i32) +DEF_HELPER_1(uxtb16, i32, i32) + +DEF_HELPER_2(add_setq, i32, i32, i32) +DEF_HELPER_2(add_saturate, i32, i32, i32) +DEF_HELPER_2(sub_saturate, i32, i32, i32) +DEF_HELPER_2(add_usaturate, i32, i32, i32) +DEF_HELPER_2(sub_usaturate, i32, i32, i32) +DEF_HELPER_1(double_saturate, i32, s32) +DEF_HELPER_2(sdiv, s32, s32, s32) +DEF_HELPER_2(udiv, i32, i32, i32) +DEF_HELPER_1(rbit, i32, i32) +DEF_HELPER_1(abs, i32, i32) #define PAS_OP(pfx) \ - DEF_HELPER_1_3(pfx ## add8, uint32_t, (uint32_t, uint32_t, uint32_t *)) \ - DEF_HELPER_1_3(pfx ## sub8, uint32_t, (uint32_t, uint32_t, uint32_t *)) \ - DEF_HELPER_1_3(pfx ## sub16, uint32_t, (uint32_t, uint32_t, uint32_t *)) \ - DEF_HELPER_1_3(pfx ## add16, uint32_t, (uint32_t, uint32_t, uint32_t *)) \ - DEF_HELPER_1_3(pfx ## addsubx, uint32_t, (uint32_t, uint32_t, uint32_t *)) \ - DEF_HELPER_1_3(pfx ## subaddx, uint32_t, (uint32_t, uint32_t, uint32_t *)) + DEF_HELPER_3(pfx ## add8, i32, i32, i32, ptr) \ + DEF_HELPER_3(pfx ## sub8, i32, i32, i32, ptr) \ + DEF_HELPER_3(pfx ## sub16, i32, i32, i32, ptr) \ + DEF_HELPER_3(pfx ## add16, i32, i32, i32, ptr) \ + DEF_HELPER_3(pfx ## addsubx, i32, i32, i32, ptr) \ + DEF_HELPER_3(pfx ## subaddx, i32, i32, i32, ptr) PAS_OP(s) PAS_OP(u) #undef PAS_OP #define PAS_OP(pfx) \ - DEF_HELPER_1_2(pfx ## add8, uint32_t, (uint32_t, uint32_t)) \ - DEF_HELPER_1_2(pfx ## sub8, uint32_t, (uint32_t, uint32_t)) \ - DEF_HELPER_1_2(pfx ## sub16, uint32_t, (uint32_t, uint32_t)) \ - DEF_HELPER_1_2(pfx ## add16, uint32_t, (uint32_t, uint32_t)) \ - DEF_HELPER_1_2(pfx ## addsubx, uint32_t, (uint32_t, uint32_t)) \ - DEF_HELPER_1_2(pfx ## subaddx, uint32_t, (uint32_t, uint32_t)) + DEF_HELPER_2(pfx ## add8, i32, i32, i32) \ + DEF_HELPER_2(pfx ## sub8, i32, i32, i32) \ + DEF_HELPER_2(pfx ## sub16, i32, i32, i32) \ + DEF_HELPER_2(pfx ## add16, i32, i32, i32) \ + DEF_HELPER_2(pfx ## addsubx, i32, i32, i32) \ + DEF_HELPER_2(pfx ## subaddx, i32, i32, i32) PAS_OP(q) PAS_OP(sh) PAS_OP(uq) PAS_OP(uh) #undef PAS_OP -DEF_HELPER_1_2(ssat, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(usat, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(ssat16, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(usat16, uint32_t, (uint32_t, uint32_t)) - -DEF_HELPER_1_2(usad8, uint32_t, (uint32_t, uint32_t)) - -DEF_HELPER_1_1(logicq_cc, uint32_t, (uint64_t)) - -DEF_HELPER_1_3(sel_flags, uint32_t, (uint32_t, uint32_t, uint32_t)) -DEF_HELPER_0_1(exception, void, (uint32_t)) -DEF_HELPER_0_0(wfi, void, (void)) - -DEF_HELPER_0_2(cpsr_write, void, (uint32_t, uint32_t)) -DEF_HELPER_1_0(cpsr_read, uint32_t, (void)) - -DEF_HELPER_0_3(v7m_msr, void, (CPUState *, uint32_t, uint32_t)) -DEF_HELPER_1_2(v7m_mrs, uint32_t, (CPUState *, uint32_t)) - -DEF_HELPER_0_3(set_cp15, void, (CPUState *, uint32_t, uint32_t)) -DEF_HELPER_1_2(get_cp15, uint32_t, (CPUState *, uint32_t)) - -DEF_HELPER_0_3(set_cp, void, (CPUState *, uint32_t, uint32_t)) -DEF_HELPER_1_2(get_cp, uint32_t, (CPUState *, uint32_t)) - -DEF_HELPER_1_2(get_r13_banked, uint32_t, (CPUState *, uint32_t)) -DEF_HELPER_0_3(set_r13_banked, void, (CPUState *, uint32_t, uint32_t)) - -DEF_HELPER_0_2(mark_exclusive, void, (CPUState *, uint32_t)) -DEF_HELPER_1_2(test_exclusive, uint32_t, (CPUState *, uint32_t)) -DEF_HELPER_0_1(clrex, void, (CPUState *)) - -DEF_HELPER_1_1(get_user_reg, uint32_t, (uint32_t)) -DEF_HELPER_0_2(set_user_reg, void, (uint32_t, uint32_t)) - -DEF_HELPER_1_1(vfp_get_fpscr, uint32_t, (CPUState *)) -DEF_HELPER_0_2(vfp_set_fpscr, void, (CPUState *, uint32_t)) - -DEF_HELPER_1_3(vfp_adds, float32, (float32, float32, CPUState *)) -DEF_HELPER_1_3(vfp_addd, float64, (float64, float64, CPUState *)) -DEF_HELPER_1_3(vfp_subs, float32, (float32, float32, CPUState *)) -DEF_HELPER_1_3(vfp_subd, float64, (float64, float64, CPUState *)) -DEF_HELPER_1_3(vfp_muls, float32, (float32, float32, CPUState *)) -DEF_HELPER_1_3(vfp_muld, float64, (float64, float64, CPUState *)) -DEF_HELPER_1_3(vfp_divs, float32, (float32, float32, CPUState *)) -DEF_HELPER_1_3(vfp_divd, float64, (float64, float64, CPUState *)) -DEF_HELPER_1_1(vfp_negs, float32, (float32)) -DEF_HELPER_1_1(vfp_negd, float64, (float64)) -DEF_HELPER_1_1(vfp_abss, float32, (float32)) -DEF_HELPER_1_1(vfp_absd, float64, (float64)) -DEF_HELPER_1_2(vfp_sqrts, float32, (float32, CPUState *)) -DEF_HELPER_1_2(vfp_sqrtd, float64, (float64, CPUState *)) -DEF_HELPER_0_3(vfp_cmps, void, (float32, float32, CPUState *)) -DEF_HELPER_0_3(vfp_cmpd, void, (float64, float64, CPUState *)) -DEF_HELPER_0_3(vfp_cmpes, void, (float32, float32, CPUState *)) -DEF_HELPER_0_3(vfp_cmped, void, (float64, float64, CPUState *)) - -DEF_HELPER_1_2(vfp_fcvtds, float64, (float32, CPUState *)) -DEF_HELPER_1_2(vfp_fcvtsd, float32, (float64, CPUState *)) - -DEF_HELPER_1_2(vfp_uitos, float32, (float32, CPUState *)) -DEF_HELPER_1_2(vfp_uitod, float64, (float32, CPUState *)) -DEF_HELPER_1_2(vfp_sitos, float32, (float32, CPUState *)) -DEF_HELPER_1_2(vfp_sitod, float64, (float32, CPUState *)) - -DEF_HELPER_1_2(vfp_touis, float32, (float32, CPUState *)) -DEF_HELPER_1_2(vfp_touid, float32, (float64, CPUState *)) -DEF_HELPER_1_2(vfp_touizs, float32, (float32, CPUState *)) -DEF_HELPER_1_2(vfp_touizd, float32, (float64, CPUState *)) -DEF_HELPER_1_2(vfp_tosis, float32, (float32, CPUState *)) -DEF_HELPER_1_2(vfp_tosid, float32, (float64, CPUState *)) -DEF_HELPER_1_2(vfp_tosizs, float32, (float32, CPUState *)) -DEF_HELPER_1_2(vfp_tosizd, float32, (float64, CPUState *)) - -DEF_HELPER_1_3(vfp_toshs, float32, (float32, uint32_t, CPUState *)) -DEF_HELPER_1_3(vfp_tosls, float32, (float32, uint32_t, CPUState *)) -DEF_HELPER_1_3(vfp_touhs, float32, (float32, uint32_t, CPUState *)) -DEF_HELPER_1_3(vfp_touls, float32, (float32, uint32_t, CPUState *)) -DEF_HELPER_1_3(vfp_toshd, float64, (float64, uint32_t, CPUState *)) -DEF_HELPER_1_3(vfp_tosld, float64, (float64, uint32_t, CPUState *)) -DEF_HELPER_1_3(vfp_touhd, float64, (float64, uint32_t, CPUState *)) -DEF_HELPER_1_3(vfp_tould, float64, (float64, uint32_t, CPUState *)) -DEF_HELPER_1_3(vfp_shtos, float32, (float32, uint32_t, CPUState *)) -DEF_HELPER_1_3(vfp_sltos, float32, (float32, uint32_t, CPUState *)) -DEF_HELPER_1_3(vfp_uhtos, float32, (float32, uint32_t, CPUState *)) -DEF_HELPER_1_3(vfp_ultos, float32, (float32, uint32_t, CPUState *)) -DEF_HELPER_1_3(vfp_shtod, float64, (float64, uint32_t, CPUState *)) -DEF_HELPER_1_3(vfp_sltod, float64, (float64, uint32_t, CPUState *)) -DEF_HELPER_1_3(vfp_uhtod, float64, (float64, uint32_t, CPUState *)) -DEF_HELPER_1_3(vfp_ultod, float64, (float64, uint32_t, CPUState *)) - -DEF_HELPER_1_3(recps_f32, float32, (float32, float32, CPUState *)) -DEF_HELPER_1_3(rsqrts_f32, float32, (float32, float32, CPUState *)) -DEF_HELPER_1_2(recpe_f32, float32, (float32, CPUState *)) -DEF_HELPER_1_2(rsqrte_f32, float32, (float32, CPUState *)) -DEF_HELPER_1_2(recpe_u32, uint32_t, (uint32_t, CPUState *)) -DEF_HELPER_1_2(rsqrte_u32, uint32_t, (uint32_t, CPUState *)) -DEF_HELPER_1_4(neon_tbl, uint32_t, (uint32_t, uint32_t, uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_add_saturate_u64, uint64_t, (uint64_t, uint64_t)) -DEF_HELPER_1_2(neon_add_saturate_s64, uint64_t, (uint64_t, uint64_t)) -DEF_HELPER_1_2(neon_sub_saturate_u64, uint64_t, (uint64_t, uint64_t)) -DEF_HELPER_1_2(neon_sub_saturate_s64, uint64_t, (uint64_t, uint64_t)) - -DEF_HELPER_1_2(add_cc, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(adc_cc, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(sub_cc, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(sbc_cc, uint32_t, (uint32_t, uint32_t)) - -DEF_HELPER_1_2(shl, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(shr, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(sar, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(ror, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(shl_cc, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(shr_cc, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(sar_cc, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(ror_cc, uint32_t, (uint32_t, uint32_t)) +DEF_HELPER_2(ssat, i32, i32, i32) +DEF_HELPER_2(usat, i32, i32, i32) +DEF_HELPER_2(ssat16, i32, i32, i32) +DEF_HELPER_2(usat16, i32, i32, i32) + +DEF_HELPER_2(usad8, i32, i32, i32) + +DEF_HELPER_1(logicq_cc, i32, i64) + +DEF_HELPER_3(sel_flags, i32, i32, i32, i32) +DEF_HELPER_1(exception, void, i32) +DEF_HELPER_0(wfi, void) + +DEF_HELPER_2(cpsr_write, void, i32, i32) +DEF_HELPER_0(cpsr_read, i32) + +DEF_HELPER_3(v7m_msr, void, env, i32, i32) +DEF_HELPER_2(v7m_mrs, i32, env, i32) + +DEF_HELPER_3(set_cp15, void, env, i32, i32) +DEF_HELPER_2(get_cp15, i32, env, i32) + +DEF_HELPER_3(set_cp, void, env, i32, i32) +DEF_HELPER_2(get_cp, i32, env, i32) + +DEF_HELPER_2(get_r13_banked, i32, env, i32) +DEF_HELPER_3(set_r13_banked, void, env, i32, i32) + +DEF_HELPER_2(mark_exclusive, void, env, i32) +DEF_HELPER_2(test_exclusive, i32, env, i32) +DEF_HELPER_1(clrex, void, env) + +DEF_HELPER_1(get_user_reg, i32, i32) +DEF_HELPER_2(set_user_reg, void, i32, i32) + +DEF_HELPER_1(vfp_get_fpscr, i32, env) +DEF_HELPER_2(vfp_set_fpscr, void, env, i32) + +DEF_HELPER_3(vfp_adds, f32, f32, f32, env) +DEF_HELPER_3(vfp_addd, f64, f64, f64, env) +DEF_HELPER_3(vfp_subs, f32, f32, f32, env) +DEF_HELPER_3(vfp_subd, f64, f64, f64, env) +DEF_HELPER_3(vfp_muls, f32, f32, f32, env) +DEF_HELPER_3(vfp_muld, f64, f64, f64, env) +DEF_HELPER_3(vfp_divs, f32, f32, f32, env) +DEF_HELPER_3(vfp_divd, f64, f64, f64, env) +DEF_HELPER_1(vfp_negs, f32, f32) +DEF_HELPER_1(vfp_negd, f64, f64) +DEF_HELPER_1(vfp_abss, f32, f32) +DEF_HELPER_1(vfp_absd, f64, f64) +DEF_HELPER_2(vfp_sqrts, f32, f32, env) +DEF_HELPER_2(vfp_sqrtd, f64, f64, env) +DEF_HELPER_3(vfp_cmps, void, f32, f32, env) +DEF_HELPER_3(vfp_cmpd, void, f64, f64, env) +DEF_HELPER_3(vfp_cmpes, void, f32, f32, env) +DEF_HELPER_3(vfp_cmped, void, f64, f64, env) + +DEF_HELPER_2(vfp_fcvtds, f64, f32, env) +DEF_HELPER_2(vfp_fcvtsd, f32, f64, env) + +DEF_HELPER_2(vfp_uitos, f32, f32, env) +DEF_HELPER_2(vfp_uitod, f64, f32, env) +DEF_HELPER_2(vfp_sitos, f32, f32, env) +DEF_HELPER_2(vfp_sitod, f64, f32, env) + +DEF_HELPER_2(vfp_touis, f32, f32, env) +DEF_HELPER_2(vfp_touid, f32, f64, env) +DEF_HELPER_2(vfp_touizs, f32, f32, env) +DEF_HELPER_2(vfp_touizd, f32, f64, env) +DEF_HELPER_2(vfp_tosis, f32, f32, env) +DEF_HELPER_2(vfp_tosid, f32, f64, env) +DEF_HELPER_2(vfp_tosizs, f32, f32, env) +DEF_HELPER_2(vfp_tosizd, f32, f64, env) + +DEF_HELPER_3(vfp_toshs, f32, f32, i32, env) +DEF_HELPER_3(vfp_tosls, f32, f32, i32, env) +DEF_HELPER_3(vfp_touhs, f32, f32, i32, env) +DEF_HELPER_3(vfp_touls, f32, f32, i32, env) +DEF_HELPER_3(vfp_toshd, f64, f64, i32, env) +DEF_HELPER_3(vfp_tosld, f64, f64, i32, env) +DEF_HELPER_3(vfp_touhd, f64, f64, i32, env) +DEF_HELPER_3(vfp_tould, f64, f64, i32, env) +DEF_HELPER_3(vfp_shtos, f32, f32, i32, env) +DEF_HELPER_3(vfp_sltos, f32, f32, i32, env) +DEF_HELPER_3(vfp_uhtos, f32, f32, i32, env) +DEF_HELPER_3(vfp_ultos, f32, f32, i32, env) +DEF_HELPER_3(vfp_shtod, f64, f64, i32, env) +DEF_HELPER_3(vfp_sltod, f64, f64, i32, env) +DEF_HELPER_3(vfp_uhtod, f64, f64, i32, env) +DEF_HELPER_3(vfp_ultod, f64, f64, i32, env) + +DEF_HELPER_3(recps_f32, f32, f32, f32, env) +DEF_HELPER_3(rsqrts_f32, f32, f32, f32, env) +DEF_HELPER_2(recpe_f32, f32, f32, env) +DEF_HELPER_2(rsqrte_f32, f32, f32, env) +DEF_HELPER_2(recpe_u32, i32, i32, env) +DEF_HELPER_2(rsqrte_u32, i32, i32, env) +DEF_HELPER_4(neon_tbl, i32, i32, i32, i32, i32) +DEF_HELPER_2(neon_add_saturate_u64, i64, i64, i64) +DEF_HELPER_2(neon_add_saturate_s64, i64, i64, i64) +DEF_HELPER_2(neon_sub_saturate_u64, i64, i64, i64) +DEF_HELPER_2(neon_sub_saturate_s64, i64, i64, i64) + +DEF_HELPER_2(add_cc, i32, i32, i32) +DEF_HELPER_2(adc_cc, i32, i32, i32) +DEF_HELPER_2(sub_cc, i32, i32, i32) +DEF_HELPER_2(sbc_cc, i32, i32, i32) + +DEF_HELPER_2(shl, i32, i32, i32) +DEF_HELPER_2(shr, i32, i32, i32) +DEF_HELPER_2(sar, i32, i32, i32) +DEF_HELPER_2(ror, i32, i32, i32) +DEF_HELPER_2(shl_cc, i32, i32, i32) +DEF_HELPER_2(shr_cc, i32, i32, i32) +DEF_HELPER_2(sar_cc, i32, i32, i32) +DEF_HELPER_2(ror_cc, i32, i32, i32) /* neon_helper.c */ -DEF_HELPER_1_3(neon_qadd_u8, uint32_t, (CPUState *, uint32_t, uint32_t)) -DEF_HELPER_1_3(neon_qadd_s8, uint32_t, (CPUState *, uint32_t, uint32_t)) -DEF_HELPER_1_3(neon_qadd_u16, uint32_t, (CPUState *, uint32_t, uint32_t)) -DEF_HELPER_1_3(neon_qadd_s16, uint32_t, (CPUState *, uint32_t, uint32_t)) -DEF_HELPER_1_3(neon_qsub_u8, uint32_t, (CPUState *, uint32_t, uint32_t)) -DEF_HELPER_1_3(neon_qsub_s8, uint32_t, (CPUState *, uint32_t, uint32_t)) -DEF_HELPER_1_3(neon_qsub_u16, uint32_t, (CPUState *, uint32_t, uint32_t)) -DEF_HELPER_1_3(neon_qsub_s16, uint32_t, (CPUState *, uint32_t, uint32_t)) - -DEF_HELPER_1_2(neon_hadd_s8, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_hadd_u8, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_hadd_s16, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_hadd_u16, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_hadd_s32, int32_t, (int32_t, int32_t)) -DEF_HELPER_1_2(neon_hadd_u32, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_rhadd_s8, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_rhadd_u8, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_rhadd_s16, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_rhadd_u16, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_rhadd_s32, int32_t, (int32_t, int32_t)) -DEF_HELPER_1_2(neon_rhadd_u32, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_hsub_s8, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_hsub_u8, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_hsub_s16, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_hsub_u16, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_hsub_s32, int32_t, (int32_t, int32_t)) -DEF_HELPER_1_2(neon_hsub_u32, uint32_t, (uint32_t, uint32_t)) - -DEF_HELPER_1_2(neon_cgt_u8, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_cgt_s8, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_cgt_u16, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_cgt_s16, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_cgt_u32, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_cgt_s32, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_cge_u8, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_cge_s8, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_cge_u16, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_cge_s16, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_cge_u32, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_cge_s32, uint32_t, (uint32_t, uint32_t)) - -DEF_HELPER_1_2(neon_min_u8, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_min_s8, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_min_u16, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_min_s16, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_min_u32, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_min_s32, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_max_u8, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_max_s8, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_max_u16, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_max_s16, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_max_u32, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_max_s32, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_pmin_u8, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_pmin_s8, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_pmin_u16, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_pmin_s16, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_pmin_u32, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_pmin_s32, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_pmax_u8, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_pmax_s8, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_pmax_u16, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_pmax_s16, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_pmax_u32, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_pmax_s32, uint32_t, (uint32_t, uint32_t)) - -DEF_HELPER_1_2(neon_abd_u8, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_abd_s8, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_abd_u16, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_abd_s16, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_abd_u32, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_abd_s32, uint32_t, (uint32_t, uint32_t)) - -DEF_HELPER_1_2(neon_shl_u8, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_shl_s8, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_shl_u16, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_shl_s16, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_shl_u32, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_shl_s32, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_shl_u64, uint64_t, (uint64_t, uint64_t)) -DEF_HELPER_1_2(neon_shl_s64, uint64_t, (uint64_t, uint64_t)) -DEF_HELPER_1_2(neon_rshl_u8, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_rshl_s8, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_rshl_u16, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_rshl_s16, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_rshl_u32, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_rshl_s32, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_rshl_u64, uint64_t, (uint64_t, uint64_t)) -DEF_HELPER_1_2(neon_rshl_s64, uint64_t, (uint64_t, uint64_t)) -DEF_HELPER_1_3(neon_qshl_u8, uint32_t, (CPUState *, uint32_t, uint32_t)) -DEF_HELPER_1_3(neon_qshl_s8, uint32_t, (CPUState *, uint32_t, uint32_t)) -DEF_HELPER_1_3(neon_qshl_u16, uint32_t, (CPUState *, uint32_t, uint32_t)) -DEF_HELPER_1_3(neon_qshl_s16, uint32_t, (CPUState *, uint32_t, uint32_t)) -DEF_HELPER_1_3(neon_qshl_u32, uint32_t, (CPUState *, uint32_t, uint32_t)) -DEF_HELPER_1_3(neon_qshl_s32, uint32_t, (CPUState *, uint32_t, uint32_t)) -DEF_HELPER_1_3(neon_qshl_u64, uint64_t, (CPUState *, uint64_t, uint64_t)) -DEF_HELPER_1_3(neon_qshl_s64, uint64_t, (CPUState *, uint64_t, uint64_t)) -DEF_HELPER_1_3(neon_qrshl_u8, uint32_t, (CPUState *, uint32_t, uint32_t)) -DEF_HELPER_1_3(neon_qrshl_s8, uint32_t, (CPUState *, uint32_t, uint32_t)) -DEF_HELPER_1_3(neon_qrshl_u16, uint32_t, (CPUState *, uint32_t, uint32_t)) -DEF_HELPER_1_3(neon_qrshl_s16, uint32_t, (CPUState *, uint32_t, uint32_t)) -DEF_HELPER_1_3(neon_qrshl_u32, uint32_t, (CPUState *, uint32_t, uint32_t)) -DEF_HELPER_1_3(neon_qrshl_s32, uint32_t, (CPUState *, uint32_t, uint32_t)) -DEF_HELPER_1_3(neon_qrshl_u64, uint64_t, (CPUState *, uint64_t, uint64_t)) -DEF_HELPER_1_3(neon_qrshl_s64, uint64_t, (CPUState *, uint64_t, uint64_t)) - -DEF_HELPER_1_2(neon_add_u8, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_add_u16, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_padd_u8, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_padd_u16, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_sub_u8, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_sub_u16, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_mul_u8, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_mul_u16, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_mul_p8, uint32_t, (uint32_t, uint32_t)) - -DEF_HELPER_1_2(neon_tst_u8, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_tst_u16, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_tst_u32, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_ceq_u8, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_ceq_u16, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_ceq_u32, uint32_t, (uint32_t, uint32_t)) - -DEF_HELPER_1_1(neon_abs_s8, uint32_t, (uint32_t)) -DEF_HELPER_1_1(neon_abs_s16, uint32_t, (uint32_t)) -DEF_HELPER_1_1(neon_clz_u8, uint32_t, (uint32_t)) -DEF_HELPER_1_1(neon_clz_u16, uint32_t, (uint32_t)) -DEF_HELPER_1_1(neon_cls_s8, uint32_t, (uint32_t)) -DEF_HELPER_1_1(neon_cls_s16, uint32_t, (uint32_t)) -DEF_HELPER_1_1(neon_cls_s32, uint32_t, (uint32_t)) -DEF_HELPER_1_1(neon_cnt_u8, uint32_t, (uint32_t)) - -DEF_HELPER_1_3(neon_qdmulh_s16, uint32_t, (CPUState *, uint32_t, uint32_t)) -DEF_HELPER_1_3(neon_qrdmulh_s16, uint32_t, (CPUState *, uint32_t, uint32_t)) -DEF_HELPER_1_3(neon_qdmulh_s32, uint32_t, (CPUState *, uint32_t, uint32_t)) -DEF_HELPER_1_3(neon_qrdmulh_s32, uint32_t, (CPUState *, uint32_t, uint32_t)) - -DEF_HELPER_1_1(neon_narrow_u8, uint32_t, (uint64_t)) -DEF_HELPER_1_1(neon_narrow_u16, uint32_t, (uint64_t)) -DEF_HELPER_1_2(neon_narrow_sat_u8, uint32_t, (CPUState *, uint64_t)) -DEF_HELPER_1_2(neon_narrow_sat_s8, uint32_t, (CPUState *, uint64_t)) -DEF_HELPER_1_2(neon_narrow_sat_u16, uint32_t, (CPUState *, uint64_t)) -DEF_HELPER_1_2(neon_narrow_sat_s16, uint32_t, (CPUState *, uint64_t)) -DEF_HELPER_1_2(neon_narrow_sat_u32, uint32_t, (CPUState *, uint64_t)) -DEF_HELPER_1_2(neon_narrow_sat_s32, uint32_t, (CPUState *, uint64_t)) -DEF_HELPER_1_1(neon_narrow_high_u8, uint32_t, (uint64_t)) -DEF_HELPER_1_1(neon_narrow_high_u16, uint32_t, (uint64_t)) -DEF_HELPER_1_1(neon_narrow_round_high_u8, uint32_t, (uint64_t)) -DEF_HELPER_1_1(neon_narrow_round_high_u16, uint32_t, (uint64_t)) -DEF_HELPER_1_1(neon_widen_u8, uint64_t, (uint32_t)) -DEF_HELPER_1_1(neon_widen_s8, uint64_t, (uint32_t)) -DEF_HELPER_1_1(neon_widen_u16, uint64_t, (uint32_t)) -DEF_HELPER_1_1(neon_widen_s16, uint64_t, (uint32_t)) - -DEF_HELPER_1_2(neon_addl_u16, uint64_t, (uint64_t, uint64_t)) -DEF_HELPER_1_2(neon_addl_u32, uint64_t, (uint64_t, uint64_t)) -DEF_HELPER_1_2(neon_paddl_u16, uint64_t, (uint64_t, uint64_t)) -DEF_HELPER_1_2(neon_paddl_u32, uint64_t, (uint64_t, uint64_t)) -DEF_HELPER_1_2(neon_subl_u16, uint64_t, (uint64_t, uint64_t)) -DEF_HELPER_1_2(neon_subl_u32, uint64_t, (uint64_t, uint64_t)) -DEF_HELPER_1_3(neon_addl_saturate_s32, uint64_t, (CPUState *, uint64_t, uint64_t)) -DEF_HELPER_1_3(neon_addl_saturate_s64, uint64_t, (CPUState *, uint64_t, uint64_t)) -DEF_HELPER_1_2(neon_abdl_u16, uint64_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_abdl_s16, uint64_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_abdl_u32, uint64_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_abdl_s32, uint64_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_abdl_u64, uint64_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_abdl_s64, uint64_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_mull_u8, uint64_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_mull_s8, uint64_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_mull_u16, uint64_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_mull_s16, uint64_t, (uint32_t, uint32_t)) - -DEF_HELPER_1_1(neon_negl_u16, uint64_t, (uint64_t)) -DEF_HELPER_1_1(neon_negl_u32, uint64_t, (uint64_t)) -DEF_HELPER_1_1(neon_negl_u64, uint64_t, (uint64_t)) - -DEF_HELPER_1_2(neon_qabs_s8, uint32_t, (CPUState *, uint32_t)) -DEF_HELPER_1_2(neon_qabs_s16, uint32_t, (CPUState *, uint32_t)) -DEF_HELPER_1_2(neon_qabs_s32, uint32_t, (CPUState *, uint32_t)) -DEF_HELPER_1_2(neon_qneg_s8, uint32_t, (CPUState *, uint32_t)) -DEF_HELPER_1_2(neon_qneg_s16, uint32_t, (CPUState *, uint32_t)) -DEF_HELPER_1_2(neon_qneg_s32, uint32_t, (CPUState *, uint32_t)) - -DEF_HELPER_0_0(neon_trn_u8, void, (void)) -DEF_HELPER_0_0(neon_trn_u16, void, (void)) -DEF_HELPER_0_0(neon_unzip_u8, void, (void)) -DEF_HELPER_0_0(neon_zip_u8, void, (void)) -DEF_HELPER_0_0(neon_zip_u16, void, (void)) - -DEF_HELPER_1_2(neon_min_f32, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_max_f32, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_abd_f32, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_add_f32, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_sub_f32, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_mul_f32, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_ceq_f32, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_cge_f32, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_cgt_f32, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_acge_f32, uint32_t, (uint32_t, uint32_t)) -DEF_HELPER_1_2(neon_acgt_f32, uint32_t, (uint32_t, uint32_t)) +DEF_HELPER_3(neon_qadd_u8, i32, env, i32, i32) +DEF_HELPER_3(neon_qadd_s8, i32, env, i32, i32) +DEF_HELPER_3(neon_qadd_u16, i32, env, i32, i32) +DEF_HELPER_3(neon_qadd_s16, i32, env, i32, i32) +DEF_HELPER_3(neon_qsub_u8, i32, env, i32, i32) +DEF_HELPER_3(neon_qsub_s8, i32, env, i32, i32) +DEF_HELPER_3(neon_qsub_u16, i32, env, i32, i32) +DEF_HELPER_3(neon_qsub_s16, i32, env, i32, i32) + +DEF_HELPER_2(neon_hadd_s8, i32, i32, i32) +DEF_HELPER_2(neon_hadd_u8, i32, i32, i32) +DEF_HELPER_2(neon_hadd_s16, i32, i32, i32) +DEF_HELPER_2(neon_hadd_u16, i32, i32, i32) +DEF_HELPER_2(neon_hadd_s32, s32, s32, s32) +DEF_HELPER_2(neon_hadd_u32, i32, i32, i32) +DEF_HELPER_2(neon_rhadd_s8, i32, i32, i32) +DEF_HELPER_2(neon_rhadd_u8, i32, i32, i32) +DEF_HELPER_2(neon_rhadd_s16, i32, i32, i32) +DEF_HELPER_2(neon_rhadd_u16, i32, i32, i32) +DEF_HELPER_2(neon_rhadd_s32, s32, s32, s32) +DEF_HELPER_2(neon_rhadd_u32, i32, i32, i32) +DEF_HELPER_2(neon_hsub_s8, i32, i32, i32) +DEF_HELPER_2(neon_hsub_u8, i32, i32, i32) +DEF_HELPER_2(neon_hsub_s16, i32, i32, i32) +DEF_HELPER_2(neon_hsub_u16, i32, i32, i32) +DEF_HELPER_2(neon_hsub_s32, s32, s32, s32) +DEF_HELPER_2(neon_hsub_u32, i32, i32, i32) + +DEF_HELPER_2(neon_cgt_u8, i32, i32, i32) +DEF_HELPER_2(neon_cgt_s8, i32, i32, i32) +DEF_HELPER_2(neon_cgt_u16, i32, i32, i32) +DEF_HELPER_2(neon_cgt_s16, i32, i32, i32) +DEF_HELPER_2(neon_cgt_u32, i32, i32, i32) +DEF_HELPER_2(neon_cgt_s32, i32, i32, i32) +DEF_HELPER_2(neon_cge_u8, i32, i32, i32) +DEF_HELPER_2(neon_cge_s8, i32, i32, i32) +DEF_HELPER_2(neon_cge_u16, i32, i32, i32) +DEF_HELPER_2(neon_cge_s16, i32, i32, i32) +DEF_HELPER_2(neon_cge_u32, i32, i32, i32) +DEF_HELPER_2(neon_cge_s32, i32, i32, i32) + +DEF_HELPER_2(neon_min_u8, i32, i32, i32) +DEF_HELPER_2(neon_min_s8, i32, i32, i32) +DEF_HELPER_2(neon_min_u16, i32, i32, i32) +DEF_HELPER_2(neon_min_s16, i32, i32, i32) +DEF_HELPER_2(neon_min_u32, i32, i32, i32) +DEF_HELPER_2(neon_min_s32, i32, i32, i32) +DEF_HELPER_2(neon_max_u8, i32, i32, i32) +DEF_HELPER_2(neon_max_s8, i32, i32, i32) +DEF_HELPER_2(neon_max_u16, i32, i32, i32) +DEF_HELPER_2(neon_max_s16, i32, i32, i32) +DEF_HELPER_2(neon_max_u32, i32, i32, i32) +DEF_HELPER_2(neon_max_s32, i32, i32, i32) +DEF_HELPER_2(neon_pmin_u8, i32, i32, i32) +DEF_HELPER_2(neon_pmin_s8, i32, i32, i32) +DEF_HELPER_2(neon_pmin_u16, i32, i32, i32) +DEF_HELPER_2(neon_pmin_s16, i32, i32, i32) +DEF_HELPER_2(neon_pmax_u8, i32, i32, i32) +DEF_HELPER_2(neon_pmax_s8, i32, i32, i32) +DEF_HELPER_2(neon_pmax_u16, i32, i32, i32) +DEF_HELPER_2(neon_pmax_s16, i32, i32, i32) + +DEF_HELPER_2(neon_abd_u8, i32, i32, i32) +DEF_HELPER_2(neon_abd_s8, i32, i32, i32) +DEF_HELPER_2(neon_abd_u16, i32, i32, i32) +DEF_HELPER_2(neon_abd_s16, i32, i32, i32) +DEF_HELPER_2(neon_abd_u32, i32, i32, i32) +DEF_HELPER_2(neon_abd_s32, i32, i32, i32) + +DEF_HELPER_2(neon_shl_u8, i32, i32, i32) +DEF_HELPER_2(neon_shl_s8, i32, i32, i32) +DEF_HELPER_2(neon_shl_u16, i32, i32, i32) +DEF_HELPER_2(neon_shl_s16, i32, i32, i32) +DEF_HELPER_2(neon_shl_u32, i32, i32, i32) +DEF_HELPER_2(neon_shl_s32, i32, i32, i32) +DEF_HELPER_2(neon_shl_u64, i64, i64, i64) +DEF_HELPER_2(neon_shl_s64, i64, i64, i64) +DEF_HELPER_2(neon_rshl_u8, i32, i32, i32) +DEF_HELPER_2(neon_rshl_s8, i32, i32, i32) +DEF_HELPER_2(neon_rshl_u16, i32, i32, i32) +DEF_HELPER_2(neon_rshl_s16, i32, i32, i32) +DEF_HELPER_2(neon_rshl_u32, i32, i32, i32) +DEF_HELPER_2(neon_rshl_s32, i32, i32, i32) +DEF_HELPER_2(neon_rshl_u64, i64, i64, i64) +DEF_HELPER_2(neon_rshl_s64, i64, i64, i64) +DEF_HELPER_3(neon_qshl_u8, i32, env, i32, i32) +DEF_HELPER_3(neon_qshl_s8, i32, env, i32, i32) +DEF_HELPER_3(neon_qshl_u16, i32, env, i32, i32) +DEF_HELPER_3(neon_qshl_s16, i32, env, i32, i32) +DEF_HELPER_3(neon_qshl_u32, i32, env, i32, i32) +DEF_HELPER_3(neon_qshl_s32, i32, env, i32, i32) +DEF_HELPER_3(neon_qshl_u64, i64, env, i64, i64) +DEF_HELPER_3(neon_qshl_s64, i64, env, i64, i64) +DEF_HELPER_3(neon_qrshl_u8, i32, env, i32, i32) +DEF_HELPER_3(neon_qrshl_s8, i32, env, i32, i32) +DEF_HELPER_3(neon_qrshl_u16, i32, env, i32, i32) +DEF_HELPER_3(neon_qrshl_s16, i32, env, i32, i32) +DEF_HELPER_3(neon_qrshl_u32, i32, env, i32, i32) +DEF_HELPER_3(neon_qrshl_s32, i32, env, i32, i32) +DEF_HELPER_3(neon_qrshl_u64, i64, env, i64, i64) +DEF_HELPER_3(neon_qrshl_s64, i64, env, i64, i64) + +DEF_HELPER_2(neon_add_u8, i32, i32, i32) +DEF_HELPER_2(neon_add_u16, i32, i32, i32) +DEF_HELPER_2(neon_padd_u8, i32, i32, i32) +DEF_HELPER_2(neon_padd_u16, i32, i32, i32) +DEF_HELPER_2(neon_sub_u8, i32, i32, i32) +DEF_HELPER_2(neon_sub_u16, i32, i32, i32) +DEF_HELPER_2(neon_mul_u8, i32, i32, i32) +DEF_HELPER_2(neon_mul_u16, i32, i32, i32) +DEF_HELPER_2(neon_mul_p8, i32, i32, i32) + +DEF_HELPER_2(neon_tst_u8, i32, i32, i32) +DEF_HELPER_2(neon_tst_u16, i32, i32, i32) +DEF_HELPER_2(neon_tst_u32, i32, i32, i32) +DEF_HELPER_2(neon_ceq_u8, i32, i32, i32) +DEF_HELPER_2(neon_ceq_u16, i32, i32, i32) +DEF_HELPER_2(neon_ceq_u32, i32, i32, i32) + +DEF_HELPER_1(neon_abs_s8, i32, i32) +DEF_HELPER_1(neon_abs_s16, i32, i32) +DEF_HELPER_1(neon_clz_u8, i32, i32) +DEF_HELPER_1(neon_clz_u16, i32, i32) +DEF_HELPER_1(neon_cls_s8, i32, i32) +DEF_HELPER_1(neon_cls_s16, i32, i32) +DEF_HELPER_1(neon_cls_s32, i32, i32) +DEF_HELPER_1(neon_cnt_u8, i32, i32) + +DEF_HELPER_3(neon_qdmulh_s16, i32, env, i32, i32) +DEF_HELPER_3(neon_qrdmulh_s16, i32, env, i32, i32) +DEF_HELPER_3(neon_qdmulh_s32, i32, env, i32, i32) +DEF_HELPER_3(neon_qrdmulh_s32, i32, env, i32, i32) + +DEF_HELPER_1(neon_narrow_u8, i32, i64) +DEF_HELPER_1(neon_narrow_u16, i32, i64) +DEF_HELPER_2(neon_narrow_sat_u8, i32, env, i64) +DEF_HELPER_2(neon_narrow_sat_s8, i32, env, i64) +DEF_HELPER_2(neon_narrow_sat_u16, i32, env, i64) +DEF_HELPER_2(neon_narrow_sat_s16, i32, env, i64) +DEF_HELPER_2(neon_narrow_sat_u32, i32, env, i64) +DEF_HELPER_2(neon_narrow_sat_s32, i32, env, i64) +DEF_HELPER_1(neon_narrow_high_u8, i32, i64) +DEF_HELPER_1(neon_narrow_high_u16, i32, i64) +DEF_HELPER_1(neon_narrow_round_high_u8, i32, i64) +DEF_HELPER_1(neon_narrow_round_high_u16, i32, i64) +DEF_HELPER_1(neon_widen_u8, i64, i32) +DEF_HELPER_1(neon_widen_s8, i64, i32) +DEF_HELPER_1(neon_widen_u16, i64, i32) +DEF_HELPER_1(neon_widen_s16, i64, i32) + +DEF_HELPER_2(neon_addl_u16, i64, i64, i64) +DEF_HELPER_2(neon_addl_u32, i64, i64, i64) +DEF_HELPER_2(neon_paddl_u16, i64, i64, i64) +DEF_HELPER_2(neon_paddl_u32, i64, i64, i64) +DEF_HELPER_2(neon_subl_u16, i64, i64, i64) +DEF_HELPER_2(neon_subl_u32, i64, i64, i64) +DEF_HELPER_3(neon_addl_saturate_s32, i64, env, i64, i64) +DEF_HELPER_3(neon_addl_saturate_s64, i64, env, i64, i64) +DEF_HELPER_2(neon_abdl_u16, i64, i32, i32) +DEF_HELPER_2(neon_abdl_s16, i64, i32, i32) +DEF_HELPER_2(neon_abdl_u32, i64, i32, i32) +DEF_HELPER_2(neon_abdl_s32, i64, i32, i32) +DEF_HELPER_2(neon_abdl_u64, i64, i32, i32) +DEF_HELPER_2(neon_abdl_s64, i64, i32, i32) +DEF_HELPER_2(neon_mull_u8, i64, i32, i32) +DEF_HELPER_2(neon_mull_s8, i64, i32, i32) +DEF_HELPER_2(neon_mull_u16, i64, i32, i32) +DEF_HELPER_2(neon_mull_s16, i64, i32, i32) + +DEF_HELPER_1(neon_negl_u16, i64, i64) +DEF_HELPER_1(neon_negl_u32, i64, i64) +DEF_HELPER_1(neon_negl_u64, i64, i64) + +DEF_HELPER_2(neon_qabs_s8, i32, env, i32) +DEF_HELPER_2(neon_qabs_s16, i32, env, i32) +DEF_HELPER_2(neon_qabs_s32, i32, env, i32) +DEF_HELPER_2(neon_qneg_s8, i32, env, i32) +DEF_HELPER_2(neon_qneg_s16, i32, env, i32) +DEF_HELPER_2(neon_qneg_s32, i32, env, i32) + +DEF_HELPER_0(neon_trn_u8, void) +DEF_HELPER_0(neon_trn_u16, void) +DEF_HELPER_0(neon_unzip_u8, void) +DEF_HELPER_0(neon_zip_u8, void) +DEF_HELPER_0(neon_zip_u16, void) + +DEF_HELPER_2(neon_min_f32, i32, i32, i32) +DEF_HELPER_2(neon_max_f32, i32, i32, i32) +DEF_HELPER_2(neon_abd_f32, i32, i32, i32) +DEF_HELPER_2(neon_add_f32, i32, i32, i32) +DEF_HELPER_2(neon_sub_f32, i32, i32, i32) +DEF_HELPER_2(neon_mul_f32, i32, i32, i32) +DEF_HELPER_2(neon_ceq_f32, i32, i32, i32) +DEF_HELPER_2(neon_cge_f32, i32, i32, i32) +DEF_HELPER_2(neon_cgt_f32, i32, i32, i32) +DEF_HELPER_2(neon_acge_f32, i32, i32, i32) +DEF_HELPER_2(neon_acgt_f32, i32, i32, i32) /* iwmmxt_helper.c */ -DEF_HELPER_1_2(iwmmxt_maddsq, uint64_t, (uint64_t, uint64_t)) -DEF_HELPER_1_2(iwmmxt_madduq, uint64_t, (uint64_t, uint64_t)) -DEF_HELPER_1_2(iwmmxt_sadb, uint64_t, (uint64_t, uint64_t)) -DEF_HELPER_1_2(iwmmxt_sadw, uint64_t, (uint64_t, uint64_t)) -DEF_HELPER_1_2(iwmmxt_mulslw, uint64_t, (uint64_t, uint64_t)) -DEF_HELPER_1_2(iwmmxt_mulshw, uint64_t, (uint64_t, uint64_t)) -DEF_HELPER_1_2(iwmmxt_mululw, uint64_t, (uint64_t, uint64_t)) -DEF_HELPER_1_2(iwmmxt_muluhw, uint64_t, (uint64_t, uint64_t)) -DEF_HELPER_1_2(iwmmxt_macsw, uint64_t, (uint64_t, uint64_t)) -DEF_HELPER_1_2(iwmmxt_macuw, uint64_t, (uint64_t, uint64_t)) -DEF_HELPER_1_1(iwmmxt_setpsr_nz, uint32_t, (uint64_t)) +DEF_HELPER_2(iwmmxt_maddsq, i64, i64, i64) +DEF_HELPER_2(iwmmxt_madduq, i64, i64, i64) +DEF_HELPER_2(iwmmxt_sadb, i64, i64, i64) +DEF_HELPER_2(iwmmxt_sadw, i64, i64, i64) +DEF_HELPER_2(iwmmxt_mulslw, i64, i64, i64) +DEF_HELPER_2(iwmmxt_mulshw, i64, i64, i64) +DEF_HELPER_2(iwmmxt_mululw, i64, i64, i64) +DEF_HELPER_2(iwmmxt_muluhw, i64, i64, i64) +DEF_HELPER_2(iwmmxt_macsw, i64, i64, i64) +DEF_HELPER_2(iwmmxt_macuw, i64, i64, i64) +DEF_HELPER_1(iwmmxt_setpsr_nz, i32, i64) #define DEF_IWMMXT_HELPER_SIZE_ENV(name) \ -DEF_HELPER_1_3(iwmmxt_##name##b, uint64_t, (CPUState *, uint64_t, uint64_t)) \ -DEF_HELPER_1_3(iwmmxt_##name##w, uint64_t, (CPUState *, uint64_t, uint64_t)) \ -DEF_HELPER_1_3(iwmmxt_##name##l, uint64_t, (CPUState *, uint64_t, uint64_t)) \ +DEF_HELPER_3(iwmmxt_##name##b, i64, env, i64, i64) \ +DEF_HELPER_3(iwmmxt_##name##w, i64, env, i64, i64) \ +DEF_HELPER_3(iwmmxt_##name##l, i64, env, i64, i64) \ DEF_IWMMXT_HELPER_SIZE_ENV(unpackl) DEF_IWMMXT_HELPER_SIZE_ENV(unpackh) -DEF_HELPER_1_2(iwmmxt_unpacklub, uint64_t, (CPUState *, uint64_t)) -DEF_HELPER_1_2(iwmmxt_unpackluw, uint64_t, (CPUState *, uint64_t)) -DEF_HELPER_1_2(iwmmxt_unpacklul, uint64_t, (CPUState *, uint64_t)) -DEF_HELPER_1_2(iwmmxt_unpackhub, uint64_t, (CPUState *, uint64_t)) -DEF_HELPER_1_2(iwmmxt_unpackhuw, uint64_t, (CPUState *, uint64_t)) -DEF_HELPER_1_2(iwmmxt_unpackhul, uint64_t, (CPUState *, uint64_t)) -DEF_HELPER_1_2(iwmmxt_unpacklsb, uint64_t, (CPUState *, uint64_t)) -DEF_HELPER_1_2(iwmmxt_unpacklsw, uint64_t, (CPUState *, uint64_t)) -DEF_HELPER_1_2(iwmmxt_unpacklsl, uint64_t, (CPUState *, uint64_t)) -DEF_HELPER_1_2(iwmmxt_unpackhsb, uint64_t, (CPUState *, uint64_t)) -DEF_HELPER_1_2(iwmmxt_unpackhsw, uint64_t, (CPUState *, uint64_t)) -DEF_HELPER_1_2(iwmmxt_unpackhsl, uint64_t, (CPUState *, uint64_t)) +DEF_HELPER_2(iwmmxt_unpacklub, i64, env, i64) +DEF_HELPER_2(iwmmxt_unpackluw, i64, env, i64) +DEF_HELPER_2(iwmmxt_unpacklul, i64, env, i64) +DEF_HELPER_2(iwmmxt_unpackhub, i64, env, i64) +DEF_HELPER_2(iwmmxt_unpackhuw, i64, env, i64) +DEF_HELPER_2(iwmmxt_unpackhul, i64, env, i64) +DEF_HELPER_2(iwmmxt_unpacklsb, i64, env, i64) +DEF_HELPER_2(iwmmxt_unpacklsw, i64, env, i64) +DEF_HELPER_2(iwmmxt_unpacklsl, i64, env, i64) +DEF_HELPER_2(iwmmxt_unpackhsb, i64, env, i64) +DEF_HELPER_2(iwmmxt_unpackhsw, i64, env, i64) +DEF_HELPER_2(iwmmxt_unpackhsl, i64, env, i64) DEF_IWMMXT_HELPER_SIZE_ENV(cmpeq) DEF_IWMMXT_HELPER_SIZE_ENV(cmpgtu) @@ -481,59 +406,51 @@ DEF_IWMMXT_HELPER_SIZE_ENV(addu) DEF_IWMMXT_HELPER_SIZE_ENV(subs) DEF_IWMMXT_HELPER_SIZE_ENV(adds) -DEF_HELPER_1_3(iwmmxt_avgb0, uint64_t, (CPUState *, uint64_t, uint64_t)) -DEF_HELPER_1_3(iwmmxt_avgb1, uint64_t, (CPUState *, uint64_t, uint64_t)) -DEF_HELPER_1_3(iwmmxt_avgw0, uint64_t, (CPUState *, uint64_t, uint64_t)) -DEF_HELPER_1_3(iwmmxt_avgw1, uint64_t, (CPUState *, uint64_t, uint64_t)) - -DEF_HELPER_1_2(iwmmxt_msadb, uint64_t, (uint64_t, uint64_t)) - -DEF_HELPER_1_3(iwmmxt_align, uint64_t, (uint64_t, uint64_t, uint32_t)) -DEF_HELPER_1_4(iwmmxt_insr, uint64_t, (uint64_t, uint32_t, uint32_t, uint32_t)) - -DEF_HELPER_1_1(iwmmxt_bcstb, uint64_t, (uint32_t)) -DEF_HELPER_1_1(iwmmxt_bcstw, uint64_t, (uint32_t)) -DEF_HELPER_1_1(iwmmxt_bcstl, uint64_t, (uint32_t)) - -DEF_HELPER_1_1(iwmmxt_addcb, uint64_t, (uint64_t)) -DEF_HELPER_1_1(iwmmxt_addcw, uint64_t, (uint64_t)) -DEF_HELPER_1_1(iwmmxt_addcl, uint64_t, (uint64_t)) - -DEF_HELPER_1_1(iwmmxt_msbb, uint32_t, (uint64_t)) -DEF_HELPER_1_1(iwmmxt_msbw, uint32_t, (uint64_t)) -DEF_HELPER_1_1(iwmmxt_msbl, uint32_t, (uint64_t)) - -DEF_HELPER_1_3(iwmmxt_srlw, uint64_t, (CPUState *, uint64_t, uint32_t)) -DEF_HELPER_1_3(iwmmxt_srll, uint64_t, (CPUState *, uint64_t, uint32_t)) -DEF_HELPER_1_3(iwmmxt_srlq, uint64_t, (CPUState *, uint64_t, uint32_t)) -DEF_HELPER_1_3(iwmmxt_sllw, uint64_t, (CPUState *, uint64_t, uint32_t)) -DEF_HELPER_1_3(iwmmxt_slll, uint64_t, (CPUState *, uint64_t, uint32_t)) -DEF_HELPER_1_3(iwmmxt_sllq, uint64_t, (CPUState *, uint64_t, uint32_t)) -DEF_HELPER_1_3(iwmmxt_sraw, uint64_t, (CPUState *, uint64_t, uint32_t)) -DEF_HELPER_1_3(iwmmxt_sral, uint64_t, (CPUState *, uint64_t, uint32_t)) -DEF_HELPER_1_3(iwmmxt_sraq, uint64_t, (CPUState *, uint64_t, uint32_t)) -DEF_HELPER_1_3(iwmmxt_rorw, uint64_t, (CPUState *, uint64_t, uint32_t)) -DEF_HELPER_1_3(iwmmxt_rorl, uint64_t, (CPUState *, uint64_t, uint32_t)) -DEF_HELPER_1_3(iwmmxt_rorq, uint64_t, (CPUState *, uint64_t, uint32_t)) -DEF_HELPER_1_3(iwmmxt_shufh, uint64_t, (CPUState *, uint64_t, uint32_t)) - -DEF_HELPER_1_3(iwmmxt_packuw, uint64_t, (CPUState *, uint64_t, uint64_t)) -DEF_HELPER_1_3(iwmmxt_packul, uint64_t, (CPUState *, uint64_t, uint64_t)) -DEF_HELPER_1_3(iwmmxt_packuq, uint64_t, (CPUState *, uint64_t, uint64_t)) -DEF_HELPER_1_3(iwmmxt_packsw, uint64_t, (CPUState *, uint64_t, uint64_t)) -DEF_HELPER_1_3(iwmmxt_packsl, uint64_t, (CPUState *, uint64_t, uint64_t)) -DEF_HELPER_1_3(iwmmxt_packsq, uint64_t, (CPUState *, uint64_t, uint64_t)) - -DEF_HELPER_1_3(iwmmxt_muladdsl, uint64_t, (uint64_t, uint32_t, uint32_t)) -DEF_HELPER_1_3(iwmmxt_muladdsw, uint64_t, (uint64_t, uint32_t, uint32_t)) -DEF_HELPER_1_3(iwmmxt_muladdswl, uint64_t, (uint64_t, uint32_t, uint32_t)) - -#undef DEF_HELPER -#undef DEF_HELPER_0_0 -#undef DEF_HELPER_0_1 -#undef DEF_HELPER_0_2 -#undef DEF_HELPER_1_0 -#undef DEF_HELPER_1_1 -#undef DEF_HELPER_1_2 -#undef DEF_HELPER_1_3 -#undef GEN_HELPER +DEF_HELPER_3(iwmmxt_avgb0, i64, env, i64, i64) +DEF_HELPER_3(iwmmxt_avgb1, i64, env, i64, i64) +DEF_HELPER_3(iwmmxt_avgw0, i64, env, i64, i64) +DEF_HELPER_3(iwmmxt_avgw1, i64, env, i64, i64) + +DEF_HELPER_2(iwmmxt_msadb, i64, i64, i64) + +DEF_HELPER_3(iwmmxt_align, i64, i64, i64, i32) +DEF_HELPER_4(iwmmxt_insr, i64, i64, i32, i32, i32) + +DEF_HELPER_1(iwmmxt_bcstb, i64, i32) +DEF_HELPER_1(iwmmxt_bcstw, i64, i32) +DEF_HELPER_1(iwmmxt_bcstl, i64, i32) + +DEF_HELPER_1(iwmmxt_addcb, i64, i64) +DEF_HELPER_1(iwmmxt_addcw, i64, i64) +DEF_HELPER_1(iwmmxt_addcl, i64, i64) + +DEF_HELPER_1(iwmmxt_msbb, i32, i64) +DEF_HELPER_1(iwmmxt_msbw, i32, i64) +DEF_HELPER_1(iwmmxt_msbl, i32, i64) + +DEF_HELPER_3(iwmmxt_srlw, i64, env, i64, i32) +DEF_HELPER_3(iwmmxt_srll, i64, env, i64, i32) +DEF_HELPER_3(iwmmxt_srlq, i64, env, i64, i32) +DEF_HELPER_3(iwmmxt_sllw, i64, env, i64, i32) +DEF_HELPER_3(iwmmxt_slll, i64, env, i64, i32) +DEF_HELPER_3(iwmmxt_sllq, i64, env, i64, i32) +DEF_HELPER_3(iwmmxt_sraw, i64, env, i64, i32) +DEF_HELPER_3(iwmmxt_sral, i64, env, i64, i32) +DEF_HELPER_3(iwmmxt_sraq, i64, env, i64, i32) +DEF_HELPER_3(iwmmxt_rorw, i64, env, i64, i32) +DEF_HELPER_3(iwmmxt_rorl, i64, env, i64, i32) +DEF_HELPER_3(iwmmxt_rorq, i64, env, i64, i32) +DEF_HELPER_3(iwmmxt_shufh, i64, env, i64, i32) + +DEF_HELPER_3(iwmmxt_packuw, i64, env, i64, i64) +DEF_HELPER_3(iwmmxt_packul, i64, env, i64, i64) +DEF_HELPER_3(iwmmxt_packuq, i64, env, i64, i64) +DEF_HELPER_3(iwmmxt_packsw, i64, env, i64, i64) +DEF_HELPER_3(iwmmxt_packsl, i64, env, i64, i64) +DEF_HELPER_3(iwmmxt_packsq, i64, env, i64, i64) + +DEF_HELPER_3(iwmmxt_muladdsl, i64, i64, i32, i32) +DEF_HELPER_3(iwmmxt_muladdsw, i64, i64, i32, i32) +DEF_HELPER_3(iwmmxt_muladdswl, i64, i64, i32, i32) + +#include "def-helper.h" diff --git a/target-arm/op_addsub.h b/target-arm/op_addsub.h index 376ee27..29f77ba 100644 --- a/target-arm/op_addsub.h +++ b/target-arm/op_addsub.h @@ -8,9 +8,9 @@ */ #ifdef ARITH_GE -#define GE_ARG , uint32_t *gep +#define GE_ARG , void *gep #define DECLARE_GE uint32_t ge = 0 -#define SET_GE *gep = ge +#define SET_GE *(uint32_t *)gep = ge #else #define GE_ARG #define DECLARE_GE do{}while(0) diff --git a/target-arm/translate.c b/target-arm/translate.c index ab8cee5..9d52991 100644 --- a/target-arm/translate.c +++ b/target-arm/translate.c @@ -31,6 +31,7 @@ #include "tcg-op.h" #include "qemu-log.h" +#include "helpers.h" #define GEN_HELPER 1 #include "helpers.h" @@ -73,13 +74,14 @@ typedef struct DisasContext { #define DISAS_WFI 4 #define DISAS_SWI 5 -static TCGv cpu_env; +static TCGv_ptr cpu_env; /* We reuse the same 64-bit temporaries for efficiency. */ -static TCGv cpu_V0, cpu_V1, cpu_M0; +static TCGv_i64 cpu_V0, cpu_V1, cpu_M0; /* FIXME: These should be removed. */ static TCGv cpu_T[2]; -static TCGv cpu_F0s, cpu_F1s, cpu_F0d, cpu_F1d; +static TCGv cpu_F0s, cpu_F1s; +static TCGv_i64 cpu_F0d, cpu_F1d; #define ICOUNT_TEMP cpu_T[0] #include "gen-icount.h" @@ -87,10 +89,13 @@ static TCGv cpu_F0s, cpu_F1s, cpu_F0d, cpu_F1d; /* initialize TCG globals. */ void arm_translate_init(void) { - cpu_env = tcg_global_reg_new(TCG_TYPE_PTR, TCG_AREG0, "env"); + cpu_env = tcg_global_reg_new_ptr(TCG_AREG0, "env"); + + cpu_T[0] = tcg_global_reg_new_i32(TCG_AREG1, "T0"); + cpu_T[1] = tcg_global_reg_new_i32(TCG_AREG2, "T1"); - cpu_T[0] = tcg_global_reg_new(TCG_TYPE_I32, TCG_AREG1, "T0"); - cpu_T[1] = tcg_global_reg_new(TCG_TYPE_I32, TCG_AREG2, "T1"); +#define GEN_HELPER 2 +#include "helpers.h" } /* The code generator doesn't like lots of temporaries, so maintain our own @@ -100,16 +105,16 @@ static int num_temps; static TCGv temps[MAX_TEMPS]; /* Allocate a temporary variable. */ -static TCGv new_tmp(void) +static TCGv_i32 new_tmp(void) { TCGv tmp; if (num_temps == MAX_TEMPS) abort(); - if (GET_TCGV(temps[num_temps])) + if (GET_TCGV_I32(temps[num_temps])) return temps[num_temps++]; - tmp = tcg_temp_new(TCG_TYPE_I32); + tmp = tcg_temp_new_i32(); temps[num_temps++] = tmp; return tmp; } @@ -120,11 +125,11 @@ static void dead_tmp(TCGv tmp) int i; num_temps--; i = num_temps; - if (GET_TCGV(temps[i]) == GET_TCGV(tmp)) + if (TCGV_EQUAL(temps[i], tmp)) return; /* Shuffle this temp to the last slot. */ - while (GET_TCGV(temps[i]) != GET_TCGV(tmp)) + while (!TCGV_EQUAL(temps[i], tmp)) i--; while (i < num_temps) { temps[i] = temps[i + 1]; @@ -324,10 +329,10 @@ static void gen_roundqd(TCGv a, TCGv b) /* FIXME: Most targets have native widening multiplication. It would be good to use that instead of a full wide multiply. */ /* 32x32->64 multiply. Marks inputs as dead. */ -static TCGv gen_mulu_i64_i32(TCGv a, TCGv b) +static TCGv_i64 gen_mulu_i64_i32(TCGv a, TCGv b) { - TCGv tmp1 = tcg_temp_new(TCG_TYPE_I64); - TCGv tmp2 = tcg_temp_new(TCG_TYPE_I64); + TCGv_i64 tmp1 = tcg_temp_new_i64(); + TCGv_i64 tmp2 = tcg_temp_new_i64(); tcg_gen_extu_i32_i64(tmp1, a); dead_tmp(a); @@ -337,10 +342,10 @@ static TCGv gen_mulu_i64_i32(TCGv a, TCGv b) return tmp1; } -static TCGv gen_muls_i64_i32(TCGv a, TCGv b) +static TCGv_i64 gen_muls_i64_i32(TCGv a, TCGv b) { - TCGv tmp1 = tcg_temp_new(TCG_TYPE_I64); - TCGv tmp2 = tcg_temp_new(TCG_TYPE_I64); + TCGv_i64 tmp1 = tcg_temp_new_i64(); + TCGv_i64 tmp2 = tcg_temp_new_i64(); tcg_gen_ext_i32_i64(tmp1, a); dead_tmp(a); @@ -353,8 +358,8 @@ static TCGv gen_muls_i64_i32(TCGv a, TCGv b) /* Unsigned 32x32->64 multiply. */ static void gen_op_mull_T0_T1(void) { - TCGv tmp1 = tcg_temp_new(TCG_TYPE_I64); - TCGv tmp2 = tcg_temp_new(TCG_TYPE_I64); + TCGv_i64 tmp1 = tcg_temp_new_i64(); + TCGv_i64 tmp2 = tcg_temp_new_i64(); tcg_gen_extu_i32_i64(tmp1, cpu_T[0]); tcg_gen_extu_i32_i64(tmp2, cpu_T[1]); @@ -367,8 +372,8 @@ static void gen_op_mull_T0_T1(void) /* Signed 32x32->64 multiply. */ static void gen_imull(TCGv a, TCGv b) { - TCGv tmp1 = tcg_temp_new(TCG_TYPE_I64); - TCGv tmp2 = tcg_temp_new(TCG_TYPE_I64); + TCGv_i64 tmp1 = tcg_temp_new_i64(); + TCGv_i64 tmp2 = tcg_temp_new_i64(); tcg_gen_ext_i32_i64(tmp1, a); tcg_gen_ext_i32_i64(tmp2, b); @@ -580,17 +585,17 @@ static inline void gen_arm_shift_reg(TCGv var, int shiftop, } static void gen_arm_parallel_addsub(int op1, int op2, TCGv a, TCGv b) { - TCGv tmp; + TCGv_ptr tmp; switch (op1) { #define gen_pas_helper(name) glue(gen_helper_,name)(a, a, b, tmp) case 1: - tmp = tcg_temp_new(TCG_TYPE_PTR); + tmp = tcg_temp_new_ptr(); tcg_gen_addi_ptr(tmp, cpu_env, offsetof(CPUState, GE)); PAS_OP(s) break; case 5: - tmp = tcg_temp_new(TCG_TYPE_PTR); + tmp = tcg_temp_new_ptr(); tcg_gen_addi_ptr(tmp, cpu_env, offsetof(CPUState, GE)); PAS_OP(u) break; @@ -625,17 +630,17 @@ static void gen_arm_parallel_addsub(int op1, int op2, TCGv a, TCGv b) } static void gen_thumb2_parallel_addsub(int op1, int op2, TCGv a, TCGv b) { - TCGv tmp; + TCGv_ptr tmp; switch (op1) { #define gen_pas_helper(name) glue(gen_helper_,name)(a, a, b, tmp) case 0: - tmp = tcg_temp_new(TCG_TYPE_PTR); + tmp = tcg_temp_new_ptr(); tcg_gen_addi_ptr(tmp, cpu_env, offsetof(CPUState, GE)); PAS_OP(s) break; case 4: - tmp = tcg_temp_new(TCG_TYPE_PTR); + tmp = tcg_temp_new_ptr(); tcg_gen_addi_ptr(tmp, cpu_env, offsetof(CPUState, GE)); PAS_OP(u) break; @@ -1181,12 +1186,12 @@ static void neon_store_reg(int reg, int pass, TCGv var) dead_tmp(var); } -static inline void neon_load_reg64(TCGv var, int reg) +static inline void neon_load_reg64(TCGv_i64 var, int reg) { tcg_gen_ld_i64(var, cpu_env, vfp_reg_offset(1, reg)); } -static inline void neon_store_reg64(TCGv var, int reg) +static inline void neon_store_reg64(TCGv_i64 var, int reg) { tcg_gen_st_i64(var, cpu_env, vfp_reg_offset(1, reg)); } @@ -1222,12 +1227,12 @@ static inline void gen_mov_vreg_F0(int dp, int reg) #define ARM_CP_RW_BIT (1 << 20) -static inline void iwmmxt_load_reg(TCGv var, int reg) +static inline void iwmmxt_load_reg(TCGv_i64 var, int reg) { tcg_gen_ld_i64(var, cpu_env, offsetof(CPUState, iwmmxt.regs[reg])); } -static inline void iwmmxt_store_reg(TCGv var, int reg) +static inline void iwmmxt_store_reg(TCGv_i64 var, int reg) { tcg_gen_st_i64(var, cpu_env, offsetof(CPUState, iwmmxt.regs[reg])); } @@ -3907,7 +3912,7 @@ static void gen_neon_bsl(TCGv dest, TCGv t, TCGv f, TCGv c) tcg_gen_or_i32(dest, t, f); } -static inline void gen_neon_narrow(int size, TCGv dest, TCGv src) +static inline void gen_neon_narrow(int size, TCGv dest, TCGv_i64 src) { switch (size) { case 0: gen_helper_neon_narrow_u8(dest, src); break; @@ -3917,7 +3922,7 @@ static inline void gen_neon_narrow(int size, TCGv dest, TCGv src) } } -static inline void gen_neon_narrow_sats(int size, TCGv dest, TCGv src) +static inline void gen_neon_narrow_sats(int size, TCGv dest, TCGv_i64 src) { switch (size) { case 0: gen_helper_neon_narrow_sat_s8(dest, cpu_env, src); break; @@ -3927,7 +3932,7 @@ static inline void gen_neon_narrow_sats(int size, TCGv dest, TCGv src) } } -static inline void gen_neon_narrow_satu(int size, TCGv dest, TCGv src) +static inline void gen_neon_narrow_satu(int size, TCGv dest, TCGv_i64 src) { switch (size) { case 0: gen_helper_neon_narrow_sat_u8(dest, cpu_env, src); break; @@ -3971,7 +3976,7 @@ static inline void gen_neon_shift_narrow(int size, TCGv var, TCGv shift, } } -static inline void gen_neon_widen(TCGv dest, TCGv src, int size, int u) +static inline void gen_neon_widen(TCGv_i64 dest, TCGv src, int size, int u) { if (u) { switch (size) { @@ -4011,7 +4016,7 @@ static inline void gen_neon_subl(int size) } } -static inline void gen_neon_negl(TCGv var, int size) +static inline void gen_neon_negl(TCGv_i64 var, int size) { switch (size) { case 0: gen_helper_neon_negl_u16(var, var); break; @@ -4021,7 +4026,7 @@ static inline void gen_neon_negl(TCGv var, int size) } } -static inline void gen_neon_addl_saturate(TCGv op0, TCGv op1, int size) +static inline void gen_neon_addl_saturate(TCGv_i64 op0, TCGv_i64 op1, int size) { switch (size) { case 1: gen_helper_neon_addl_saturate_s32(op0, cpu_env, op0, op1); break; @@ -4030,9 +4035,9 @@ static inline void gen_neon_addl_saturate(TCGv op0, TCGv op1, int size) } } -static inline void gen_neon_mull(TCGv dest, TCGv a, TCGv b, int size, int u) +static inline void gen_neon_mull(TCGv_i64 dest, TCGv a, TCGv b, int size, int u) { - TCGv tmp; + TCGv_i64 tmp; switch ((size << 1) | u) { case 0: gen_helper_neon_mull_s8(dest, a, b); break; @@ -4076,6 +4081,7 @@ static int disas_neon_data_insn(CPUState * env, DisasContext *s, uint32_t insn) TCGv tmp; TCGv tmp2; TCGv tmp3; + TCGv_i64 tmp64; if (!vfp_enabled(env)) return 1; @@ -4632,12 +4638,15 @@ static int disas_neon_data_insn(CPUState * env, DisasContext *s, uint32_t insn) imm = (uint16_t)shift; imm |= imm << 16; tmp2 = tcg_const_i32(imm); + TCGV_UNUSED_I64(tmp64); break; case 2: imm = (uint32_t)shift; tmp2 = tcg_const_i32(imm); + TCGV_UNUSED_I64(tmp64); case 3: - tmp2 = tcg_const_i64(shift); + tmp64 = tcg_const_i64(shift); + TCGV_UNUSED(tmp2); break; default: abort(); @@ -4648,14 +4657,14 @@ static int disas_neon_data_insn(CPUState * env, DisasContext *s, uint32_t insn) neon_load_reg64(cpu_V0, rm + pass); if (q) { if (u) - gen_helper_neon_rshl_u64(cpu_V0, cpu_V0, tmp2); + gen_helper_neon_rshl_u64(cpu_V0, cpu_V0, tmp64); else - gen_helper_neon_rshl_s64(cpu_V0, cpu_V0, tmp2); + gen_helper_neon_rshl_s64(cpu_V0, cpu_V0, tmp64); } else { if (u) - gen_helper_neon_shl_u64(cpu_V0, cpu_V0, tmp2); + gen_helper_neon_shl_u64(cpu_V0, cpu_V0, tmp64); else - gen_helper_neon_shl_s64(cpu_V0, cpu_V0, tmp2); + gen_helper_neon_shl_s64(cpu_V0, cpu_V0, tmp64); } } else { tmp = neon_load_reg(rm + pass, 0); @@ -5130,16 +5139,16 @@ static int disas_neon_data_insn(CPUState * env, DisasContext *s, uint32_t insn) neon_load_reg64(cpu_V1, rm); } } else if (q) { - tmp = tcg_temp_new(TCG_TYPE_I64); + tmp64 = tcg_temp_new_i64(); if (imm < 8) { neon_load_reg64(cpu_V0, rn); - neon_load_reg64(tmp, rn + 1); + neon_load_reg64(tmp64, rn + 1); } else { neon_load_reg64(cpu_V0, rn + 1); - neon_load_reg64(tmp, rm); + neon_load_reg64(tmp64, rm); } tcg_gen_shri_i64(cpu_V0, cpu_V0, (imm & 7) * 8); - tcg_gen_shli_i64(cpu_V1, tmp, 64 - ((imm & 7) * 8)); + tcg_gen_shli_i64(cpu_V1, tmp64, 64 - ((imm & 7) * 8)); tcg_gen_or_i64(cpu_V0, cpu_V0, cpu_V1); if (imm < 8) { neon_load_reg64(cpu_V1, rm); @@ -5148,13 +5157,14 @@ static int disas_neon_data_insn(CPUState * env, DisasContext *s, uint32_t insn) imm -= 8; } tcg_gen_shli_i64(cpu_V1, cpu_V1, 64 - (imm * 8)); - tcg_gen_shri_i64(tmp, tmp, imm * 8); - tcg_gen_or_i64(cpu_V1, cpu_V1, tmp); + tcg_gen_shri_i64(tmp64, tmp64, imm * 8); + tcg_gen_or_i64(cpu_V1, cpu_V1, tmp64); } else { + /* BUGFIX */ neon_load_reg64(cpu_V0, rn); - tcg_gen_shri_i32(cpu_V0, cpu_V0, imm * 8); + tcg_gen_shri_i64(cpu_V0, cpu_V0, imm * 8); neon_load_reg64(cpu_V1, rm); - tcg_gen_shli_i32(cpu_V1, cpu_V1, 64 - (imm * 8)); + tcg_gen_shli_i64(cpu_V1, cpu_V1, 64 - (imm * 8)); tcg_gen_or_i64(cpu_V0, cpu_V0, cpu_V1); } neon_store_reg64(cpu_V0, rd); @@ -5578,7 +5588,7 @@ static int disas_coproc_insn(CPUState * env, DisasContext *s, uint32_t insn) /* Store a 64-bit value to a register pair. Clobbers val. */ -static void gen_storeq_reg(DisasContext *s, int rlow, int rhigh, TCGv val) +static void gen_storeq_reg(DisasContext *s, int rlow, int rhigh, TCGv_i64 val) { TCGv tmp; tmp = new_tmp(); @@ -5591,13 +5601,13 @@ static void gen_storeq_reg(DisasContext *s, int rlow, int rhigh, TCGv val) } /* load a 32-bit value from a register and perform a 64-bit accumulate. */ -static void gen_addq_lo(DisasContext *s, TCGv val, int rlow) +static void gen_addq_lo(DisasContext *s, TCGv_i64 val, int rlow) { - TCGv tmp; + TCGv_i64 tmp; TCGv tmp2; /* Load value and extend to 64 bits. */ - tmp = tcg_temp_new(TCG_TYPE_I64); + tmp = tcg_temp_new_i64(); tmp2 = load_reg(s, rlow); tcg_gen_extu_i32_i64(tmp, tmp2); dead_tmp(tmp2); @@ -5605,16 +5615,16 @@ static void gen_addq_lo(DisasContext *s, TCGv val, int rlow) } /* load and add a 64-bit value from a register pair. */ -static void gen_addq(DisasContext *s, TCGv val, int rlow, int rhigh) +static void gen_addq(DisasContext *s, TCGv_i64 val, int rlow, int rhigh) { - TCGv tmp; + TCGv_i64 tmp; TCGv tmpl; TCGv tmph; /* Load 64-bit value rd:rn. */ tmpl = load_reg(s, rlow); tmph = load_reg(s, rhigh); - tmp = tcg_temp_new(TCG_TYPE_I64); + tmp = tcg_temp_new_i64(); tcg_gen_concat_i32_i64(tmp, tmpl, tmph); dead_tmp(tmpl); dead_tmp(tmph); @@ -5622,7 +5632,7 @@ static void gen_addq(DisasContext *s, TCGv val, int rlow, int rhigh) } /* Set N and Z flags from a 64-bit value. */ -static void gen_logicq_cc(TCGv val) +static void gen_logicq_cc(TCGv_i64 val) { TCGv tmp = new_tmp(); gen_helper_logicq_cc(tmp, val); @@ -5637,6 +5647,7 @@ static void disas_arm_insn(CPUState * env, DisasContext *s) TCGv tmp2; TCGv tmp3; TCGv addr; + TCGv_i64 tmp64; insn = ldl_code(s->pc); s->pc += 4; @@ -5971,10 +5982,10 @@ static void disas_arm_insn(CPUState * env, DisasContext *s) tcg_gen_sari_i32(tmp2, tmp2, 16); else gen_sxth(tmp2); - tmp2 = gen_muls_i64_i32(tmp, tmp2); - tcg_gen_shri_i64(tmp2, tmp2, 16); + tmp64 = gen_muls_i64_i32(tmp, tmp2); + tcg_gen_shri_i64(tmp64, tmp64, 16); tmp = new_tmp(); - tcg_gen_trunc_i64_i32(tmp, tmp2); + tcg_gen_trunc_i64_i32(tmp, tmp64); if ((sh & 2) == 0) { tmp2 = load_reg(s, rn); gen_helper_add_setq(tmp, tmp, tmp2); @@ -5988,11 +5999,11 @@ static void disas_arm_insn(CPUState * env, DisasContext *s) gen_mulxy(tmp, tmp2, sh & 2, sh & 4); dead_tmp(tmp2); if (op1 == 2) { - tmp2 = tcg_temp_new(TCG_TYPE_I64); - tcg_gen_ext_i32_i64(tmp2, tmp); + tmp64 = tcg_temp_new_i64(); + tcg_gen_ext_i32_i64(tmp64, tmp); dead_tmp(tmp); - gen_addq(s, tmp2, rn, rd); - gen_storeq_reg(s, rn, rd, tmp2); + gen_addq(s, tmp64, rn, rd); + gen_storeq_reg(s, rn, rd, tmp64); } else { if (op1 == 0) { tmp2 = load_reg(s, rn); @@ -6205,19 +6216,19 @@ static void disas_arm_insn(CPUState * env, DisasContext *s) tmp = load_reg(s, rs); tmp2 = load_reg(s, rm); if (insn & (1 << 22)) - tmp = gen_muls_i64_i32(tmp, tmp2); + tmp64 = gen_muls_i64_i32(tmp, tmp2); else - tmp = gen_mulu_i64_i32(tmp, tmp2); + tmp64 = gen_mulu_i64_i32(tmp, tmp2); if (insn & (1 << 21)) /* mult accumulate */ - gen_addq(s, tmp, rn, rd); + gen_addq(s, tmp64, rn, rd); if (!(insn & (1 << 23))) { /* double accumulate */ ARCH(6); - gen_addq_lo(s, tmp, rn); - gen_addq_lo(s, tmp, rd); + gen_addq_lo(s, tmp64, rn); + gen_addq_lo(s, tmp64, rd); } if (insn & (1 << 20)) - gen_logicq_cc(tmp); - gen_storeq_reg(s, rn, rd, tmp); + gen_logicq_cc(tmp64); + gen_storeq_reg(s, rn, rd, tmp64); break; } } else { @@ -6515,12 +6526,12 @@ static void disas_arm_insn(CPUState * env, DisasContext *s) tmp2 = load_reg(s, rs); if (insn & (1 << 20)) { /* Signed multiply most significant [accumulate]. */ - tmp2 = gen_muls_i64_i32(tmp, tmp2); + tmp64 = gen_muls_i64_i32(tmp, tmp2); if (insn & (1 << 5)) - tcg_gen_addi_i64(tmp2, tmp2, 0x80000000u); - tcg_gen_shri_i64(tmp2, tmp2, 32); + tcg_gen_addi_i64(tmp64, tmp64, 0x80000000u); + tcg_gen_shri_i64(tmp64, tmp64, 32); tmp = new_tmp(); - tcg_gen_trunc_i64_i32(tmp, tmp2); + tcg_gen_trunc_i64_i32(tmp, tmp64); if (rn != 15) { tmp2 = load_reg(s, rn); if (insn & (1 << 6)) { @@ -6544,11 +6555,11 @@ static void disas_arm_insn(CPUState * env, DisasContext *s) dead_tmp(tmp2); if (insn & (1 << 22)) { /* smlald, smlsld */ - tmp2 = tcg_temp_new(TCG_TYPE_I64); - tcg_gen_ext_i32_i64(tmp2, tmp); + tmp64 = tcg_temp_new_i64(); + tcg_gen_ext_i32_i64(tmp64, tmp); dead_tmp(tmp); - gen_addq(s, tmp2, rd, rn); - gen_storeq_reg(s, rd, rn, tmp2); + gen_addq(s, tmp64, rd, rn); + gen_storeq_reg(s, rd, rn, tmp64); } else { /* smuad, smusd, smlad, smlsd */ if (rd != 15) @@ -6917,6 +6928,7 @@ static int disas_thumb2_insn(CPUState *env, DisasContext *s, uint16_t insn_hw1) TCGv tmp2; TCGv tmp3; TCGv addr; + TCGv_i64 tmp64; int op; int shiftop; int conds; @@ -7393,10 +7405,10 @@ static int disas_thumb2_insn(CPUState *env, DisasContext *s, uint16_t insn_hw1) tcg_gen_sari_i32(tmp2, tmp2, 16); else gen_sxth(tmp2); - tmp2 = gen_muls_i64_i32(tmp, tmp2); - tcg_gen_shri_i64(tmp2, tmp2, 16); + tmp64 = gen_muls_i64_i32(tmp, tmp2); + tcg_gen_shri_i64(tmp64, tmp64, 16); tmp = new_tmp(); - tcg_gen_trunc_i64_i32(tmp, tmp2); + tcg_gen_trunc_i64_i32(tmp, tmp64); if (rs != 15) { tmp2 = load_reg(s, rs); @@ -7460,36 +7472,38 @@ static int disas_thumb2_insn(CPUState *env, DisasContext *s, uint16_t insn_hw1) tcg_gen_add_i32(tmp, tmp, tmp2); } dead_tmp(tmp2); - tmp2 = tcg_temp_new(TCG_TYPE_I64); - gen_addq(s, tmp, rs, rd); - gen_storeq_reg(s, rs, rd, tmp); + /* BUGFIX */ + tmp64 = tcg_temp_new_i64(); + tcg_gen_ext_i32_i64(tmp64, tmp); + dead_tmp(tmp); + gen_addq(s, tmp64, rs, rd); + gen_storeq_reg(s, rs, rd, tmp64); } else { if (op & 0x20) { /* Unsigned 64-bit multiply */ - tmp = gen_mulu_i64_i32(tmp, tmp2); + tmp64 = gen_mulu_i64_i32(tmp, tmp2); } else { if (op & 8) { /* smlalxy */ gen_mulxy(tmp, tmp2, op & 2, op & 1); dead_tmp(tmp2); - tmp2 = tcg_temp_new(TCG_TYPE_I64); - tcg_gen_ext_i32_i64(tmp2, tmp); + tmp64 = tcg_temp_new_i64(); + tcg_gen_ext_i32_i64(tmp64, tmp); dead_tmp(tmp); - tmp = tmp2; } else { /* Signed 64-bit multiply */ - tmp = gen_muls_i64_i32(tmp, tmp2); + tmp64 = gen_muls_i64_i32(tmp, tmp2); } } if (op & 4) { /* umaal */ - gen_addq_lo(s, tmp, rs); - gen_addq_lo(s, tmp, rd); + gen_addq_lo(s, tmp64, rs); + gen_addq_lo(s, tmp64, rd); } else if (op & 0x40) { /* 64-bit accumulate. */ - gen_addq(s, tmp, rs, rd); + gen_addq(s, tmp64, rs, rd); } - gen_storeq_reg(s, rs, rd, tmp); + gen_storeq_reg(s, rs, rd, tmp64); } break; } @@ -8618,14 +8632,14 @@ static inline void gen_intermediate_code_internal(CPUState *env, dc->user = (env->uncached_cpsr & 0x1f) == ARM_CPU_MODE_USR; } #endif - cpu_F0s = tcg_temp_new(TCG_TYPE_I32); - cpu_F1s = tcg_temp_new(TCG_TYPE_I32); - cpu_F0d = tcg_temp_new(TCG_TYPE_I64); - cpu_F1d = tcg_temp_new(TCG_TYPE_I64); + cpu_F0s = tcg_temp_new_i32(); + cpu_F1s = tcg_temp_new_i32(); + cpu_F0d = tcg_temp_new_i64(); + cpu_F1d = tcg_temp_new_i64(); cpu_V0 = cpu_F0d; cpu_V1 = cpu_F1d; /* FIXME: cpu_M0 can probably be the same as cpu_V0. */ - cpu_M0 = tcg_temp_new(TCG_TYPE_I64); + cpu_M0 = tcg_temp_new_i64(); next_page_start = (pc_start & TARGET_PAGE_MASK) + TARGET_PAGE_SIZE; lj = -1; num_insns = 0; |