mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-01-22 18:11:02 +00:00
target/arm: Convert Neon 3-reg-same logic ops to decodetree
Convert the Neon logic ops in the 3-reg-same grouping to decodetree. Note that for the logic ops the 'size' field forms part of their decode and the actual operations are always bitwise. Backports commit 35a548edb6f5043386183b9f6b4139d99d1f130a from qemu
This commit is contained in:
parent
eae3ce9899
commit
d30f99ca79
|
@ -42,5 +42,17 @@
|
|||
@3same .... ... . . . size:2 .... .... .... . q:1 . . .... \
|
||||
&3same vm=%vm_dp vn=%vn_dp vd=%vd_dp
|
||||
|
||||
@3same_logic .... ... . . . .. .... .... .... . q:1 .. .... \
|
||||
&3same vm=%vm_dp vn=%vn_dp vd=%vd_dp size=0
|
||||
|
||||
VAND_3s 1111 001 0 0 . 00 .... .... 0001 ... 1 .... @3same_logic
|
||||
VBIC_3s 1111 001 0 0 . 01 .... .... 0001 ... 1 .... @3same_logic
|
||||
VORR_3s 1111 001 0 0 . 10 .... .... 0001 ... 1 .... @3same_logic
|
||||
VORN_3s 1111 001 0 0 . 11 .... .... 0001 ... 1 .... @3same_logic
|
||||
VEOR_3s 1111 001 1 0 . 00 .... .... 0001 ... 1 .... @3same_logic
|
||||
VBSL_3s 1111 001 1 0 . 01 .... .... 0001 ... 1 .... @3same_logic
|
||||
VBIT_3s 1111 001 1 0 . 10 .... .... 0001 ... 1 .... @3same_logic
|
||||
VBIF_3s 1111 001 1 0 . 11 .... .... 0001 ... 1 .... @3same_logic
|
||||
|
||||
VADD_3s 1111 001 0 0 . .. .... .... 1000 . . . 0 .... @3same
|
||||
VSUB_3s 1111 001 1 0 . .. .... .... 1000 . . . 0 .... @3same
|
||||
|
|
|
@ -611,3 +611,22 @@ static bool do_3same(DisasContext *s, arg_3same *a, GVecGen3Fn fn)
|
|||
|
||||
DO_3SAME(VADD, tcg_gen_gvec_add)
|
||||
DO_3SAME(VSUB, tcg_gen_gvec_sub)
|
||||
DO_3SAME(VAND, tcg_gen_gvec_and)
|
||||
DO_3SAME(VBIC, tcg_gen_gvec_andc)
|
||||
DO_3SAME(VORR, tcg_gen_gvec_or)
|
||||
DO_3SAME(VORN, tcg_gen_gvec_orc)
|
||||
DO_3SAME(VEOR, tcg_gen_gvec_xor)
|
||||
|
||||
/* These insns are all gvec_bitsel but with the inputs in various orders. */
|
||||
#define DO_3SAME_BITSEL(INSN, O1, O2, O3) \
|
||||
static void gen_##INSN##_3s(TCGContext *s, unsigned vece, uint32_t rd_ofs, \
|
||||
uint32_t rn_ofs, uint32_t rm_ofs, \
|
||||
uint32_t oprsz, uint32_t maxsz) \
|
||||
{ \
|
||||
tcg_gen_gvec_bitsel(s, vece, rd_ofs, O1, O2, O3, oprsz, maxsz); \
|
||||
} \
|
||||
DO_3SAME(INSN, gen_##INSN##_3s)
|
||||
|
||||
DO_3SAME_BITSEL(VBSL, rd_ofs, rn_ofs, rm_ofs)
|
||||
DO_3SAME_BITSEL(VBIT, rm_ofs, rn_ofs, rd_ofs)
|
||||
DO_3SAME_BITSEL(VBIF, rm_ofs, rd_ofs, rn_ofs)
|
||||
|
|
|
@ -4979,43 +4979,6 @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn)
|
|||
}
|
||||
return 1;
|
||||
|
||||
case NEON_3R_LOGIC: /* Logic ops. */
|
||||
switch ((u << 2) | size) {
|
||||
case 0: /* VAND */
|
||||
tcg_gen_gvec_and(tcg_ctx, 0, rd_ofs, rn_ofs, rm_ofs,
|
||||
vec_size, vec_size);
|
||||
break;
|
||||
case 1: /* VBIC */
|
||||
tcg_gen_gvec_andc(tcg_ctx, 0, rd_ofs, rn_ofs, rm_ofs,
|
||||
vec_size, vec_size);
|
||||
break;
|
||||
case 2: /* VORR */
|
||||
tcg_gen_gvec_or(tcg_ctx, 0, rd_ofs, rn_ofs, rm_ofs,
|
||||
vec_size, vec_size);
|
||||
break;
|
||||
case 3: /* VORN */
|
||||
tcg_gen_gvec_orc(tcg_ctx, 0, rd_ofs, rn_ofs, rm_ofs,
|
||||
vec_size, vec_size);
|
||||
break;
|
||||
case 4: /* VEOR */
|
||||
tcg_gen_gvec_xor(tcg_ctx, 0, rd_ofs, rn_ofs, rm_ofs,
|
||||
vec_size, vec_size);
|
||||
break;
|
||||
case 5: /* VBSL */
|
||||
tcg_gen_gvec_bitsel(tcg_ctx, MO_8, rd_ofs, rd_ofs, rn_ofs, rm_ofs,
|
||||
vec_size, vec_size);
|
||||
break;
|
||||
case 6: /* VBIT */
|
||||
tcg_gen_gvec_bitsel(tcg_ctx, MO_8, rd_ofs, rm_ofs, rn_ofs, rd_ofs,
|
||||
vec_size, vec_size);
|
||||
break;
|
||||
case 7: /* VBIF */
|
||||
tcg_gen_gvec_bitsel(tcg_ctx, MO_8, rd_ofs, rm_ofs, rd_ofs, rn_ofs,
|
||||
vec_size, vec_size);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
|
||||
case NEON_3R_VQADD:
|
||||
tcg_gen_gvec_4(tcg_ctx, rd_ofs, offsetof(CPUARMState, vfp.qc),
|
||||
rn_ofs, rm_ofs, vec_size, vec_size,
|
||||
|
@ -5093,6 +5056,7 @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn)
|
|||
return 0;
|
||||
|
||||
case NEON_3R_VADD_VSUB:
|
||||
case NEON_3R_LOGIC:
|
||||
/* Already handled by decodetree */
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue