target/arm: Convert ABS, NEG to decodetree
Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20241211163036.2297116-37-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
df79bfcf75
commit
9187b72cff
@ -1632,8 +1632,12 @@ SQRSHRUN_si 0111 11110 .... ... 10001 1 ..... ..... @shri_s
|
|||||||
|
|
||||||
SQABS_s 0101 1110 ..1 00000 01111 0 ..... ..... @rr_e
|
SQABS_s 0101 1110 ..1 00000 01111 0 ..... ..... @rr_e
|
||||||
SQNEG_s 0111 1110 ..1 00000 01111 0 ..... ..... @rr_e
|
SQNEG_s 0111 1110 ..1 00000 01111 0 ..... ..... @rr_e
|
||||||
|
ABS_s 0101 1110 111 00000 10111 0 ..... ..... @rr
|
||||||
|
NEG_s 0111 1110 111 00000 10111 0 ..... ..... @rr
|
||||||
|
|
||||||
# Advanced SIMD two-register miscellaneous
|
# Advanced SIMD two-register miscellaneous
|
||||||
|
|
||||||
SQABS_v 0.00 1110 ..1 00000 01111 0 ..... ..... @qrr_e
|
SQABS_v 0.00 1110 ..1 00000 01111 0 ..... ..... @qrr_e
|
||||||
SQNEG_v 0.10 1110 ..1 00000 01111 0 ..... ..... @qrr_e
|
SQNEG_v 0.10 1110 ..1 00000 01111 0 ..... ..... @qrr_e
|
||||||
|
ABS_v 0.00 1110 ..1 00000 10111 0 ..... ..... @qrr_e
|
||||||
|
NEG_v 0.10 1110 ..1 00000 10111 0 ..... ..... @qrr_e
|
||||||
|
@ -8889,6 +8889,33 @@ static const ENVScalar1 f_scalar_sqneg = {
|
|||||||
TRANS(SQNEG_s, do_env_scalar1, a, &f_scalar_sqneg)
|
TRANS(SQNEG_s, do_env_scalar1, a, &f_scalar_sqneg)
|
||||||
TRANS(SQNEG_v, do_env_vector1, a, &f_scalar_sqneg)
|
TRANS(SQNEG_v, do_env_vector1, a, &f_scalar_sqneg)
|
||||||
|
|
||||||
|
static bool do_scalar1_d(DisasContext *s, arg_rr *a, ArithOneOp *f)
|
||||||
|
{
|
||||||
|
if (fp_access_check(s)) {
|
||||||
|
TCGv_i64 t = read_fp_dreg(s, a->rn);
|
||||||
|
f(t, t);
|
||||||
|
write_fp_dreg(s, a->rd, t);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
TRANS(ABS_s, do_scalar1_d, a, tcg_gen_abs_i64)
|
||||||
|
TRANS(NEG_s, do_scalar1_d, a, tcg_gen_neg_i64)
|
||||||
|
|
||||||
|
static bool do_gvec_fn2(DisasContext *s, arg_qrr_e *a, GVecGen2Fn *fn)
|
||||||
|
{
|
||||||
|
if (!a->q && a->esz == MO_64) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (fp_access_check(s)) {
|
||||||
|
gen_gvec_fn2(s, a->q, a->rd, a->rn, fn, a->esz);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
TRANS(ABS_v, do_gvec_fn2, a, tcg_gen_gvec_abs)
|
||||||
|
TRANS(NEG_v, do_gvec_fn2, a, tcg_gen_gvec_neg)
|
||||||
|
|
||||||
/* Common vector code for handling integer to FP conversion */
|
/* Common vector code for handling integer to FP conversion */
|
||||||
static void handle_simd_intfp_conv(DisasContext *s, int rd, int rn,
|
static void handle_simd_intfp_conv(DisasContext *s, int rd, int rn,
|
||||||
int elements, int is_signed,
|
int elements, int is_signed,
|
||||||
@ -9213,13 +9240,6 @@ static void handle_2misc_64(DisasContext *s, int opcode, bool u,
|
|||||||
case 0x9: /* CMEQ, CMLE */
|
case 0x9: /* CMEQ, CMLE */
|
||||||
cond = u ? TCG_COND_LE : TCG_COND_EQ;
|
cond = u ? TCG_COND_LE : TCG_COND_EQ;
|
||||||
goto do_cmop;
|
goto do_cmop;
|
||||||
case 0xb: /* ABS, NEG */
|
|
||||||
if (u) {
|
|
||||||
tcg_gen_neg_i64(tcg_rd, tcg_rn);
|
|
||||||
} else {
|
|
||||||
tcg_gen_abs_i64(tcg_rd, tcg_rn);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 0x2f: /* FABS */
|
case 0x2f: /* FABS */
|
||||||
gen_vfp_absd(tcg_rd, tcg_rn);
|
gen_vfp_absd(tcg_rd, tcg_rn);
|
||||||
break;
|
break;
|
||||||
@ -9264,6 +9284,7 @@ static void handle_2misc_64(DisasContext *s, int opcode, bool u,
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
case 0x7: /* SQABS, SQNEG */
|
case 0x7: /* SQABS, SQNEG */
|
||||||
|
case 0xb: /* ABS, NEG */
|
||||||
g_assert_not_reached();
|
g_assert_not_reached();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -9614,7 +9635,6 @@ static void disas_simd_scalar_two_reg_misc(DisasContext *s, uint32_t insn)
|
|||||||
/* fall through */
|
/* fall through */
|
||||||
case 0x8: /* CMGT, CMGE */
|
case 0x8: /* CMGT, CMGE */
|
||||||
case 0x9: /* CMEQ, CMLE */
|
case 0x9: /* CMEQ, CMLE */
|
||||||
case 0xb: /* ABS, NEG */
|
|
||||||
if (size != 3) {
|
if (size != 3) {
|
||||||
unallocated_encoding(s);
|
unallocated_encoding(s);
|
||||||
return;
|
return;
|
||||||
@ -9705,6 +9725,7 @@ static void disas_simd_scalar_two_reg_misc(DisasContext *s, uint32_t insn)
|
|||||||
default:
|
default:
|
||||||
case 0x3: /* USQADD / SUQADD */
|
case 0x3: /* USQADD / SUQADD */
|
||||||
case 0x7: /* SQABS / SQNEG */
|
case 0x7: /* SQABS / SQNEG */
|
||||||
|
case 0xb: /* ABS, NEG */
|
||||||
unallocated_encoding(s);
|
unallocated_encoding(s);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -10103,7 +10124,6 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn)
|
|||||||
/* fall through */
|
/* fall through */
|
||||||
case 0x8: /* CMGT, CMGE */
|
case 0x8: /* CMGT, CMGE */
|
||||||
case 0x9: /* CMEQ, CMLE */
|
case 0x9: /* CMEQ, CMLE */
|
||||||
case 0xb: /* ABS, NEG */
|
|
||||||
if (size == 3 && !is_q) {
|
if (size == 3 && !is_q) {
|
||||||
unallocated_encoding(s);
|
unallocated_encoding(s);
|
||||||
return;
|
return;
|
||||||
@ -10280,6 +10300,7 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn)
|
|||||||
default:
|
default:
|
||||||
case 0x3: /* SUQADD, USQADD */
|
case 0x3: /* SUQADD, USQADD */
|
||||||
case 0x7: /* SQABS, SQNEG */
|
case 0x7: /* SQABS, SQNEG */
|
||||||
|
case 0xb: /* ABS, NEG */
|
||||||
unallocated_encoding(s);
|
unallocated_encoding(s);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -10324,12 +10345,7 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn)
|
|||||||
gen_gvec_fn2(s, is_q, rd, rn, gen_gvec_clt0, size);
|
gen_gvec_fn2(s, is_q, rd, rn, gen_gvec_clt0, size);
|
||||||
return;
|
return;
|
||||||
case 0xb:
|
case 0xb:
|
||||||
if (u) { /* ABS, NEG */
|
g_assert_not_reached();
|
||||||
gen_gvec_fn2(s, is_q, rd, rn, tcg_gen_gvec_neg, size);
|
|
||||||
} else {
|
|
||||||
gen_gvec_fn2(s, is_q, rd, rn, tcg_gen_gvec_abs, size);
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (size == 3) {
|
if (size == 3) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user