ARM TCG conversion 14/16.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4151 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
8f8e3aa451
commit
ad69471ce5
@ -211,7 +211,7 @@ LIBOBJS+= op_helper.o helper.o
|
||||
endif
|
||||
|
||||
ifeq ($(TARGET_BASE_ARCH), arm)
|
||||
LIBOBJS+= op_helper.o helper.o
|
||||
LIBOBJS+= op_helper.o helper.o neon_helper.o
|
||||
endif
|
||||
|
||||
ifeq ($(TARGET_BASE_ARCH), sh4)
|
||||
|
@ -256,30 +256,6 @@ void cpu_arm_close(CPUARMState *env)
|
||||
free(env);
|
||||
}
|
||||
|
||||
/* Polynomial multiplication is like integer multiplcation except the
|
||||
partial products are XORed, not added. */
|
||||
uint32_t helper_neon_mul_p8(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
uint32_t mask;
|
||||
uint32_t result;
|
||||
result = 0;
|
||||
while (op1) {
|
||||
mask = 0;
|
||||
if (op1 & 1)
|
||||
mask |= 0xff;
|
||||
if (op1 & (1 << 8))
|
||||
mask |= (0xff << 8);
|
||||
if (op1 & (1 << 16))
|
||||
mask |= (0xff << 16);
|
||||
if (op1 & (1 << 24))
|
||||
mask |= (0xff << 24);
|
||||
result ^= op2 & mask;
|
||||
op1 = (op1 >> 1) & 0x7f7f7f7f;
|
||||
op2 = (op2 << 1) & 0xfefefefe;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
uint32_t cpsr_read(CPUARMState *env)
|
||||
{
|
||||
int ZF;
|
||||
@ -376,6 +352,11 @@ uint32_t HELPER(rbit)(uint32_t x)
|
||||
return x;
|
||||
}
|
||||
|
||||
uint32_t HELPER(abs)(uint32_t x)
|
||||
{
|
||||
return ((int32_t)x < 0) ? -x : x;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_USER_ONLY)
|
||||
|
||||
void do_interrupt (CPUState *env)
|
||||
|
@ -84,6 +84,7 @@ 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))
|
||||
|
||||
#define PAS_OP(pfx) \
|
||||
DEF_HELPER_1_3(pfx ## add8, uint32_t, (uint32_t, uint32_t, uint32_t *)) \
|
||||
@ -208,6 +209,10 @@ 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))
|
||||
@ -223,6 +228,209 @@ 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))
|
||||
|
||||
/* 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))
|
||||
|
||||
#undef DEF_HELPER
|
||||
#undef DEF_HELPER_0_0
|
||||
#undef DEF_HELPER_0_1
|
||||
|
1449
target-arm/neon_helper.c
Normal file
1449
target-arm/neon_helper.c
Normal file
File diff suppressed because it is too large
Load Diff
@ -32,7 +32,5 @@
|
||||
#include "op_mem.h"
|
||||
#endif
|
||||
|
||||
#include "op_neon.h"
|
||||
|
||||
/* iwMMXt support */
|
||||
#include "op_iwmmxt.c"
|
||||
|
@ -20,6 +20,9 @@
|
||||
#include "exec.h"
|
||||
#include "helpers.h"
|
||||
|
||||
#define SIGNBIT (uint32_t)0x80000000
|
||||
#define SIGNBIT64 ((uint64_t)1 << 63)
|
||||
|
||||
void raise_exception(int tt)
|
||||
{
|
||||
env->exception_index = tt;
|
||||
@ -116,7 +119,8 @@ void tlb_fill (target_ulong addr, int is_write, int mmu_idx, void *retaddr)
|
||||
}
|
||||
#endif
|
||||
|
||||
#define SIGNBIT (uint32_t)0x80000000
|
||||
/* FIXME: Pass an axplicit pointer to QF to CPUState, and move saturating
|
||||
instructions into helper.c */
|
||||
uint32_t HELPER(add_setq)(uint32_t a, uint32_t b)
|
||||
{
|
||||
uint32_t res = a + b;
|
||||
@ -451,3 +455,114 @@ uint32_t HELPER(ror_cc)(uint32_t x, uint32_t i)
|
||||
}
|
||||
}
|
||||
|
||||
uint64_t HELPER(neon_add_saturate_s64)(uint64_t src1, uint64_t src2)
|
||||
{
|
||||
uint64_t res;
|
||||
|
||||
res = src1 + src2;
|
||||
if (((res ^ src1) & SIGNBIT64) && !((src1 ^ src2) & SIGNBIT64)) {
|
||||
env->QF = 1;
|
||||
res = ((int64_t)src1 >> 63) ^ ~SIGNBIT64;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
uint64_t HELPER(neon_add_saturate_u64)(uint64_t src1, uint64_t src2)
|
||||
{
|
||||
uint64_t res;
|
||||
|
||||
res = src1 + src2;
|
||||
if (res < src1) {
|
||||
env->QF = 1;
|
||||
res = ~(uint64_t)0;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
uint64_t HELPER(neon_sub_saturate_s64)(uint64_t src1, uint64_t src2)
|
||||
{
|
||||
uint64_t res;
|
||||
|
||||
res = src1 - src2;
|
||||
if (((res ^ src1) & SIGNBIT64) && ((src1 ^ src2) & SIGNBIT64)) {
|
||||
env->QF = 1;
|
||||
res = ((int64_t)src1 >> 63) ^ ~SIGNBIT64;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
uint64_t HELPER(neon_sub_saturate_u64)(uint64_t src1, uint64_t src2)
|
||||
{
|
||||
uint64_t res;
|
||||
|
||||
if (src1 < src2) {
|
||||
env->QF = 1;
|
||||
res = 0;
|
||||
} else {
|
||||
res = src1 - src2;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/* These need to return a pair of value, so still use T0/T1. */
|
||||
/* Transpose. Argument order is rather strange to avoid special casing
|
||||
the tranlation code.
|
||||
On input T0 = rm, T1 = rd. On output T0 = rd, T1 = rm */
|
||||
void HELPER(neon_trn_u8)(void)
|
||||
{
|
||||
uint32_t rd;
|
||||
uint32_t rm;
|
||||
rd = ((T0 & 0x00ff00ff) << 8) | (T1 & 0x00ff00ff);
|
||||
rm = ((T1 & 0xff00ff00) >> 8) | (T0 & 0xff00ff00);
|
||||
T0 = rd;
|
||||
T1 = rm;
|
||||
FORCE_RET();
|
||||
}
|
||||
|
||||
void HELPER(neon_trn_u16)(void)
|
||||
{
|
||||
uint32_t rd;
|
||||
uint32_t rm;
|
||||
rd = (T0 << 16) | (T1 & 0xffff);
|
||||
rm = (T1 >> 16) | (T0 & 0xffff0000);
|
||||
T0 = rd;
|
||||
T1 = rm;
|
||||
FORCE_RET();
|
||||
}
|
||||
|
||||
/* Worker routines for zip and unzip. */
|
||||
void HELPER(neon_unzip_u8)(void)
|
||||
{
|
||||
uint32_t rd;
|
||||
uint32_t rm;
|
||||
rd = (T0 & 0xff) | ((T0 >> 8) & 0xff00)
|
||||
| ((T1 << 16) & 0xff0000) | ((T1 << 8) & 0xff000000);
|
||||
rm = ((T0 >> 8) & 0xff) | ((T0 >> 16) & 0xff00)
|
||||
| ((T1 << 8) & 0xff0000) | (T1 & 0xff000000);
|
||||
T0 = rd;
|
||||
T1 = rm;
|
||||
FORCE_RET();
|
||||
}
|
||||
|
||||
void HELPER(neon_zip_u8)(void)
|
||||
{
|
||||
uint32_t rd;
|
||||
uint32_t rm;
|
||||
rd = (T0 & 0xff) | ((T1 << 8) & 0xff00)
|
||||
| ((T0 << 16) & 0xff0000) | ((T1 << 24) & 0xff000000);
|
||||
rm = ((T0 >> 16) & 0xff) | ((T1 >> 8) & 0xff00)
|
||||
| ((T0 >> 8) & 0xff0000) | (T1 & 0xff000000);
|
||||
T0 = rd;
|
||||
T1 = rm;
|
||||
FORCE_RET();
|
||||
}
|
||||
|
||||
void HELPER(neon_zip_u16)(void)
|
||||
{
|
||||
uint32_t tmp;
|
||||
|
||||
tmp = (T0 & 0xffff) | (T1 << 16);
|
||||
T1 = (T1 & 0xffff0000) | (T0 >> 16);
|
||||
T0 = tmp;
|
||||
FORCE_RET();
|
||||
}
|
||||
|
1690
target-arm/op_neon.h
1690
target-arm/op_neon.h
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user