Lines Matching refs:a
184 static bool trans_VCMLA(DisasContext *s, arg_VCMLA *a) in trans_VCMLA() argument
189 if (a->size == MO_16) { in trans_VCMLA()
193 return do_neon_ddda_fpst(s, a->q * 7, a->vd, a->vn, a->vm, a->rot, in trans_VCMLA()
196 return do_neon_ddda_fpst(s, a->q * 7, a->vd, a->vn, a->vm, a->rot, in trans_VCMLA()
200 static bool trans_VCADD(DisasContext *s, arg_VCADD *a) in trans_VCADD() argument
207 || (a->size == MO_16 && !dc_isar_feature(aa32_fp16_arith, s))) { in trans_VCADD()
213 ((a->vd | a->vn | a->vm) & 0x10)) { in trans_VCADD()
217 if ((a->vn | a->vm | a->vd) & a->q) { in trans_VCADD()
225 opr_sz = (1 + a->q) * 8; in trans_VCADD()
226 fpst = fpstatus_ptr(a->size == MO_16 ? FPST_STD_F16 : FPST_STD); in trans_VCADD()
227 fn_gvec_ptr = (a->size == MO_16) ? in trans_VCADD()
229 tcg_gen_gvec_3_ptr(vfp_reg_offset(1, a->vd), in trans_VCADD()
230 vfp_reg_offset(1, a->vn), in trans_VCADD()
231 vfp_reg_offset(1, a->vm), in trans_VCADD()
232 fpst, opr_sz, opr_sz, a->rot, in trans_VCADD()
237 static bool trans_VSDOT(DisasContext *s, arg_VSDOT *a) in trans_VSDOT() argument
242 return do_neon_ddda(s, a->q * 7, a->vd, a->vn, a->vm, 0, in trans_VSDOT()
246 static bool trans_VUDOT(DisasContext *s, arg_VUDOT *a) in trans_VUDOT() argument
251 return do_neon_ddda(s, a->q * 7, a->vd, a->vn, a->vm, 0, in trans_VUDOT()
255 static bool trans_VUSDOT(DisasContext *s, arg_VUSDOT *a) in trans_VUSDOT() argument
260 return do_neon_ddda(s, a->q * 7, a->vd, a->vn, a->vm, 0, in trans_VUSDOT()
264 static bool trans_VDOT_b16(DisasContext *s, arg_VDOT_b16 *a) in trans_VDOT_b16() argument
269 return do_neon_ddda(s, a->q * 7, a->vd, a->vn, a->vm, 0, in trans_VDOT_b16()
273 static bool trans_VFML(DisasContext *s, arg_VFML *a) in trans_VFML() argument
283 (a->vd & 0x10)) { in trans_VFML()
287 if (a->vd & a->q) { in trans_VFML()
295 opr_sz = (1 + a->q) * 8; in trans_VFML()
296 tcg_gen_gvec_3_ptr(vfp_reg_offset(1, a->vd), in trans_VFML()
297 vfp_reg_offset(a->q, a->vn), in trans_VFML()
298 vfp_reg_offset(a->q, a->vm), in trans_VFML()
299 tcg_env, opr_sz, opr_sz, a->s, /* is_2 == 0 */ in trans_VFML()
304 static bool trans_VCMLA_scalar(DisasContext *s, arg_VCMLA_scalar *a) in trans_VCMLA_scalar() argument
306 int data = (a->index << 2) | a->rot; in trans_VCMLA_scalar()
311 if (a->size == MO_16) { in trans_VCMLA_scalar()
315 return do_neon_ddda_fpst(s, a->q * 6, a->vd, a->vn, a->vm, data, in trans_VCMLA_scalar()
318 return do_neon_ddda_fpst(s, a->q * 6, a->vd, a->vn, a->vm, data, in trans_VCMLA_scalar()
322 static bool trans_VSDOT_scalar(DisasContext *s, arg_VSDOT_scalar *a) in trans_VSDOT_scalar() argument
327 return do_neon_ddda(s, a->q * 6, a->vd, a->vn, a->vm, a->index, in trans_VSDOT_scalar()
331 static bool trans_VUDOT_scalar(DisasContext *s, arg_VUDOT_scalar *a) in trans_VUDOT_scalar() argument
336 return do_neon_ddda(s, a->q * 6, a->vd, a->vn, a->vm, a->index, in trans_VUDOT_scalar()
340 static bool trans_VUSDOT_scalar(DisasContext *s, arg_VUSDOT_scalar *a) in trans_VUSDOT_scalar() argument
345 return do_neon_ddda(s, a->q * 6, a->vd, a->vn, a->vm, a->index, in trans_VUSDOT_scalar()
349 static bool trans_VSUDOT_scalar(DisasContext *s, arg_VSUDOT_scalar *a) in trans_VSUDOT_scalar() argument
354 return do_neon_ddda(s, a->q * 6, a->vd, a->vn, a->vm, a->index, in trans_VSUDOT_scalar()
358 static bool trans_VDOT_b16_scal(DisasContext *s, arg_VDOT_b16_scal *a) in trans_VDOT_b16_scal() argument
363 return do_neon_ddda(s, a->q * 6, a->vd, a->vn, a->vm, a->index, in trans_VDOT_b16_scal()
367 static bool trans_VFML_scalar(DisasContext *s, arg_VFML_scalar *a) in trans_VFML_scalar() argument
377 ((a->vd & 0x10) || (a->q && (a->vn & 0x10)))) { in trans_VFML_scalar()
381 if (a->vd & a->q) { in trans_VFML_scalar()
389 opr_sz = (1 + a->q) * 8; in trans_VFML_scalar()
390 tcg_gen_gvec_3_ptr(vfp_reg_offset(1, a->vd), in trans_VFML_scalar()
391 vfp_reg_offset(a->q, a->vn), in trans_VFML_scalar()
392 vfp_reg_offset(a->q, a->rm), in trans_VFML_scalar()
394 (a->index << 2) | a->s, /* is_2 == 0 */ in trans_VFML_scalar()
435 static bool trans_VLDST_multiple(DisasContext *s, arg_VLDST_multiple *a) in trans_VLDST_multiple() argument
441 int size = a->size; in trans_VLDST_multiple()
450 if (!dc_isar_feature(aa32_simd_r32, s) && (a->vd & 0x10)) { in trans_VLDST_multiple()
453 if (a->itype > 10) { in trans_VLDST_multiple()
457 switch (a->itype & 0xc) { in trans_VLDST_multiple()
459 if (a->align >= 2) { in trans_VLDST_multiple()
464 if (a->align == 3) { in trans_VLDST_multiple()
471 nregs = neon_ls_element_type[a->itype].nregs; in trans_VLDST_multiple()
472 interleave = neon_ls_element_type[a->itype].interleave; in trans_VLDST_multiple()
473 spacing = neon_ls_element_type[a->itype].spacing; in trans_VLDST_multiple()
489 if (a->align) { in trans_VLDST_multiple()
490 align = pow2_align(a->align + 2); /* 4 ** a->align */ in trans_VLDST_multiple()
509 load_reg_var(s, addr, a->rn); in trans_VLDST_multiple()
516 int tt = a->vd + reg + spacing * xs; in trans_VLDST_multiple()
518 if (a->l) { in trans_VLDST_multiple()
533 gen_neon_ldst_base_update(s, a->rm, a->rn, nregs * interleave * 8); in trans_VLDST_multiple()
537 static bool trans_VLD_all_lanes(DisasContext *s, arg_VLD_all_lanes *a) in trans_VLD_all_lanes() argument
541 int vd = a->vd; in trans_VLD_all_lanes()
542 int size = a->size; in trans_VLD_all_lanes()
543 int nregs = a->n + 1; in trans_VLD_all_lanes()
552 if (!dc_isar_feature(aa32_simd_r32, s) && (a->vd & 0x10)) { in trans_VLD_all_lanes()
558 if (nregs != 4 || a->a == 0) { in trans_VLD_all_lanes()
564 } else if (a->a) { in trans_VLD_all_lanes()
597 stride = a->t ? 2 : 1; in trans_VLD_all_lanes()
602 load_reg_var(s, addr, a->rn); in trans_VLD_all_lanes()
625 gen_neon_ldst_base_update(s, a->rm, a->rn, (1 << size) * nregs); in trans_VLD_all_lanes()
630 static bool trans_VLDST_single(DisasContext *s, arg_VLDST_single *a) in trans_VLDST_single() argument
634 int nregs = a->n + 1; in trans_VLDST_single()
635 int vd = a->vd; in trans_VLDST_single()
644 if (!dc_isar_feature(aa32_simd_r32, s) && (a->vd & 0x10)) { in trans_VLDST_single()
651 if (a->stride != 1) { in trans_VLDST_single()
654 if (((a->align & (1 << a->size)) != 0) || in trans_VLDST_single()
655 (a->size == 2 && (a->align == 1 || a->align == 2))) { in trans_VLDST_single()
660 if (a->size == 2 && (a->align & 2) != 0) { in trans_VLDST_single()
665 if (a->align != 0) { in trans_VLDST_single()
670 if (a->size == 2 && a->align == 3) { in trans_VLDST_single()
677 if ((vd + a->stride * (nregs - 1)) > 31) { in trans_VLDST_single()
691 mop = finalize_memop(s, a->size); in trans_VLDST_single()
693 if (a->align) { in trans_VLDST_single()
703 align_op = pow2_align(a->size + 1); in trans_VLDST_single()
706 if (a->size == MO_32) { in trans_VLDST_single()
711 align_op = pow2_align(a->size + a->align); in trans_VLDST_single()
714 align_op = pow2_align(a->size + 2); in trans_VLDST_single()
727 load_reg_var(s, addr, a->rn); in trans_VLDST_single()
730 if (a->l) { in trans_VLDST_single()
732 neon_store_element(vd, a->reg_idx, a->size, tmp); in trans_VLDST_single()
734 neon_load_element(tmp, vd, a->reg_idx, a->size); in trans_VLDST_single()
737 vd += a->stride; in trans_VLDST_single()
738 tcg_gen_addi_i32(addr, addr, 1 << a->size); in trans_VLDST_single()
744 gen_neon_ldst_base_update(s, a->rm, a->rn, (1 << a->size) * nregs); in trans_VLDST_single()
749 static bool do_3same(DisasContext *s, arg_3same *a, GVecGen3Fn fn) in do_3same() argument
751 int vec_size = a->q ? 16 : 8; in do_3same()
752 int rd_ofs = neon_full_reg_offset(a->vd); in do_3same()
753 int rn_ofs = neon_full_reg_offset(a->vn); in do_3same()
754 int rm_ofs = neon_full_reg_offset(a->vm); in do_3same()
762 ((a->vd | a->vn | a->vm) & 0x10)) { in do_3same()
766 if ((a->vn | a->vm | a->vd) & a->q) { in do_3same()
774 fn(a->size, rd_ofs, rn_ofs, rm_ofs, vec_size, vec_size); in do_3same()
779 static bool trans_##INSN##_3s(DisasContext *s, arg_3same *a) \
781 return do_3same(s, a, FUNC); \
813 static bool trans_##INSN##_3s(DisasContext *s, arg_3same *a) \
815 if (a->size == 3) { \
818 return do_3same(s, a, FUNC); \
858 static bool trans_VMUL_p_3s(DisasContext *s, arg_3same *a)
860 if (a->size != 0) {
863 return do_3same(s, a, gen_VMUL_p_3s);
867 static bool trans_##INSN##_3s(DisasContext *s, arg_3same *a) \
872 if (a->size != 1 && a->size != 2) { \
875 return do_3same(s, a, FUNC); \
883 static bool trans_##NAME##_3s(DisasContext *s, arg_3same *a) \ in DO_VQRDMLAH()
888 return do_3same(s, a, gen_##NAME##_3s); \ in DO_VQRDMLAH()
898 static bool trans_##NAME##_3s(DisasContext *s, arg_3same *a) \
903 return do_3same(s, a, gen_##NAME##_3s); \
947 static bool trans_##INSN##_3s(DisasContext *s, arg_3same *a) \
949 if (a->size > 2) { \
952 return do_3same(s, a, gen_##INSN##_3s); \
983 static bool trans_##INSN##_3s(DisasContext *s, arg_3same *a) \
985 if (a->size > 2) { \
988 return do_3same(s, a, gen_##INSN##_3s); \
1005 static bool do_3same_pair(DisasContext *s, arg_3same *a, NeonGenTwoOpFn *fn)
1016 ((a->vd | a->vn | a->vm) & 0x10)) {
1020 if (a->size == 3) {
1028 assert(a->q == 0); /* enforced by decode patterns */
1040 read_neon_element32(tmp, a->vn, 0, MO_32);
1041 read_neon_element32(tmp2, a->vn, 1, MO_32);
1044 read_neon_element32(tmp3, a->vm, 0, MO_32);
1045 read_neon_element32(tmp2, a->vm, 1, MO_32);
1048 write_neon_element32(tmp, a->vd, 0, MO_32);
1049 write_neon_element32(tmp3, a->vd, 1, MO_32);
1055 static bool trans_##INSN##_3s(DisasContext *s, arg_3same *a) \
1062 if (a->size > 2) { \
1065 return do_3same_pair(s, a, fns[a->size]); \
1094 static bool trans_##INSN##_3s(DisasContext *s, arg_3same *a) \
1096 if (a->size != 1 && a->size != 2) { \
1099 return do_3same(s, a, gen_##INSN##_3s); \
1118 static bool trans_##INSN##_fp_3s(DisasContext *s, arg_3same *a) \
1120 if (a->size == MO_16) { \
1124 return do_3same(s, a, gen_##INSN##_fp16_3s); \
1126 return do_3same(s, a, gen_##INSN##_fp32_3s); \
1153 static bool trans_VMAXNM_fp_3s(DisasContext *s, arg_3same *a)
1159 if (a->size == MO_16) {
1163 return do_3same(s, a, gen_VMAXNM_fp16_3s);
1165 return do_3same(s, a, gen_VMAXNM_fp32_3s);
1168 static bool trans_VMINNM_fp_3s(DisasContext *s, arg_3same *a) in trans_VMINNM_fp_3s() argument
1174 if (a->size == MO_16) { in trans_VMINNM_fp_3s()
1178 return do_3same(s, a, gen_VMINNM_fp16_3s); in trans_VMINNM_fp_3s()
1180 return do_3same(s, a, gen_VMINNM_fp32_3s); in trans_VMINNM_fp_3s()
1183 static bool do_3same_fp_pair(DisasContext *s, arg_3same *a, in do_3same_fp_pair() argument
1195 ((a->vd | a->vn | a->vm) & 0x10)) { in do_3same_fp_pair()
1203 assert(a->q == 0); /* enforced by decode patterns */ in do_3same_fp_pair()
1206 fpstatus = fpstatus_ptr(a->size == MO_16 ? FPST_STD_F16 : FPST_STD); in do_3same_fp_pair()
1207 tcg_gen_gvec_3_ptr(vfp_reg_offset(1, a->vd), in do_3same_fp_pair()
1208 vfp_reg_offset(1, a->vn), in do_3same_fp_pair()
1209 vfp_reg_offset(1, a->vm), in do_3same_fp_pair()
1220 static bool trans_##INSN##_fp_3s(DisasContext *s, arg_3same *a) \
1222 if (a->size == MO_16) { \
1226 return do_3same_fp_pair(s, a, FUNC##h); \
1228 return do_3same_fp_pair(s, a, FUNC##s); \
1235 static bool do_vector_2sh(DisasContext *s, arg_2reg_shift *a, GVecGen2iFn *fn) in DO_3S_FP_PAIR()
1238 int vec_size = a->q ? 16 : 8; in DO_3S_FP_PAIR()
1239 int rd_ofs = neon_full_reg_offset(a->vd); in DO_3S_FP_PAIR()
1240 int rm_ofs = neon_full_reg_offset(a->vm); in DO_3S_FP_PAIR()
1248 ((a->vd | a->vm) & 0x10)) { in DO_3S_FP_PAIR()
1252 if ((a->vm | a->vd) & a->q) { in DO_3S_FP_PAIR()
1260 fn(a->size, rd_ofs, rm_ofs, a->shift, vec_size, vec_size); in DO_3S_FP_PAIR()
1265 static bool trans_##INSN##_2sh(DisasContext *s, arg_2reg_shift *a) \
1267 return do_vector_2sh(s, a, FUNC); \
1280 static bool trans_VSHR_S_2sh(DisasContext *s, arg_2reg_shift *a) in DO_2SH()
1283 a->shift = MIN(a->shift, (8 << a->size) - 1); in DO_2SH()
1284 return do_vector_2sh(s, a, tcg_gen_gvec_sari); in DO_2SH()
1293 static bool trans_VSHR_U_2sh(DisasContext *s, arg_2reg_shift *a) in trans_VSHR_U_2sh() argument
1296 if (a->shift >= (8 << a->size)) { in trans_VSHR_U_2sh()
1297 return do_vector_2sh(s, a, gen_zero_rd_2sh); in trans_VSHR_U_2sh()
1299 return do_vector_2sh(s, a, tcg_gen_gvec_shri); in trans_VSHR_U_2sh()
1303 static bool do_2shift_env_64(DisasContext *s, arg_2reg_shift *a, in do_2shift_env_64() argument
1319 ((a->vd | a->vm) & 0x10)) { in do_2shift_env_64()
1323 if ((a->vm | a->vd) & a->q) { in do_2shift_env_64()
1335 constimm = tcg_constant_i64(dup_const(a->size, a->shift)); in do_2shift_env_64()
1337 for (pass = 0; pass < a->q + 1; pass++) { in do_2shift_env_64()
1340 read_neon_element64(tmp, a->vm, pass, MO_64); in do_2shift_env_64()
1342 write_neon_element64(tmp, a->vd, pass, MO_64); in do_2shift_env_64()
1347 static bool do_2shift_env_32(DisasContext *s, arg_2reg_shift *a, in do_2shift_env_32() argument
1363 ((a->vd | a->vm) & 0x10)) { in do_2shift_env_32()
1367 if ((a->vm | a->vd) & a->q) { in do_2shift_env_32()
1379 constimm = tcg_constant_i32(dup_const(a->size, a->shift)); in do_2shift_env_32()
1382 for (pass = 0; pass < (a->q ? 4 : 2); pass++) { in do_2shift_env_32()
1383 read_neon_element32(tmp, a->vm, pass, MO_32); in do_2shift_env_32()
1385 write_neon_element32(tmp, a->vd, pass, MO_32); in do_2shift_env_32()
1391 static bool trans_##INSN##_64_2sh(DisasContext *s, arg_2reg_shift *a) \
1393 return do_2shift_env_64(s, a, gen_helper_neon_##FUNC##64); \
1395 static bool trans_##INSN##_2sh(DisasContext *s, arg_2reg_shift *a) \
1402 assert(a->size < ARRAY_SIZE(fns)); \
1403 return do_2shift_env_32(s, a, fns[a->size]); \
1410 static bool do_2shift_narrow_64(DisasContext *s, arg_2reg_shift *a, in DO_2SHIFT_ENV()
1424 ((a->vd | a->vm) & 0x10)) { in DO_2SHIFT_ENV()
1428 if (a->vm & 1) { in DO_2SHIFT_ENV()
1440 constimm = tcg_constant_i64(-a->shift); in DO_2SHIFT_ENV()
1446 read_neon_element64(rm1, a->vm, 0, MO_64); in DO_2SHIFT_ENV()
1447 read_neon_element64(rm2, a->vm, 1, MO_64); in DO_2SHIFT_ENV()
1451 write_neon_element32(rd, a->vd, 0, MO_32); in DO_2SHIFT_ENV()
1455 write_neon_element32(rd, a->vd, 1, MO_32); in DO_2SHIFT_ENV()
1460 static bool do_2shift_narrow_32(DisasContext *s, arg_2reg_shift *a, in do_2shift_narrow_32() argument
1475 ((a->vd | a->vm) & 0x10)) { in do_2shift_narrow_32()
1479 if (a->vm & 1) { in do_2shift_narrow_32()
1492 if (a->size == 1) { in do_2shift_narrow_32()
1493 imm = (uint16_t)(-a->shift); in do_2shift_narrow_32()
1497 imm = -a->shift; in do_2shift_narrow_32()
1506 read_neon_element32(rm1, a->vm, 0, MO_32); in do_2shift_narrow_32()
1507 read_neon_element32(rm2, a->vm, 1, MO_32); in do_2shift_narrow_32()
1508 read_neon_element32(rm3, a->vm, 2, MO_32); in do_2shift_narrow_32()
1509 read_neon_element32(rm4, a->vm, 3, MO_32); in do_2shift_narrow_32()
1518 write_neon_element32(rm1, a->vd, 0, MO_32); in do_2shift_narrow_32()
1526 write_neon_element32(rm3, a->vd, 1, MO_32); in do_2shift_narrow_32()
1531 static bool trans_##INSN##_2sh(DisasContext *s, arg_2reg_shift *a) \
1533 return do_2shift_narrow_64(s, a, FUNC, NARROWFUNC); \
1536 static bool trans_##INSN##_2sh(DisasContext *s, arg_2reg_shift *a) \
1538 return do_2shift_narrow_32(s, a, FUNC, NARROWFUNC); \
1587 static bool do_vshll_2sh(DisasContext *s, arg_2reg_shift *a, in DO_2SN_64()
1600 ((a->vd | a->vm) & 0x10)) { in DO_2SN_64()
1604 if (a->vd & 1) { in DO_2SN_64()
1620 if ((a->shift != 0) && (a->size < 2 || u)) { in DO_2SN_64()
1621 int esize = 8 << a->size; in DO_2SN_64()
1623 widen_mask >>= esize - a->shift; in DO_2SN_64()
1624 widen_mask = dup_const(a->size + 1, widen_mask); in DO_2SN_64()
1629 read_neon_element32(rm0, a->vm, 0, MO_32); in DO_2SN_64()
1630 read_neon_element32(rm1, a->vm, 1, MO_32); in DO_2SN_64()
1634 if (a->shift != 0) { in DO_2SN_64()
1635 tcg_gen_shli_i64(tmp, tmp, a->shift); in DO_2SN_64()
1638 write_neon_element64(tmp, a->vd, 0, MO_64); in DO_2SN_64()
1641 if (a->shift != 0) { in DO_2SN_64()
1642 tcg_gen_shli_i64(tmp, tmp, a->shift); in DO_2SN_64()
1645 write_neon_element64(tmp, a->vd, 1, MO_64); in DO_2SN_64()
1649 static bool trans_VSHLL_S_2sh(DisasContext *s, arg_2reg_shift *a) in trans_VSHLL_S_2sh() argument
1656 return do_vshll_2sh(s, a, widenfn[a->size], false); in trans_VSHLL_S_2sh()
1659 static bool trans_VSHLL_U_2sh(DisasContext *s, arg_2reg_shift *a) in trans_VSHLL_U_2sh() argument
1666 return do_vshll_2sh(s, a, widenfn[a->size], true); in trans_VSHLL_U_2sh()
1669 static bool do_fp_2sh(DisasContext *s, arg_2reg_shift *a, in do_fp_2sh() argument
1673 int vec_size = a->q ? 16 : 8; in do_fp_2sh()
1674 int rd_ofs = neon_full_reg_offset(a->vd); in do_fp_2sh()
1675 int rm_ofs = neon_full_reg_offset(a->vm); in do_fp_2sh()
1682 if (a->size == MO_16) { in do_fp_2sh()
1690 ((a->vd | a->vm) & 0x10)) { in do_fp_2sh()
1694 if ((a->vm | a->vd) & a->q) { in do_fp_2sh()
1702 fpst = fpstatus_ptr(a->size == MO_16 ? FPST_STD_F16 : FPST_STD); in do_fp_2sh()
1703 tcg_gen_gvec_2_ptr(rd_ofs, rm_ofs, fpst, vec_size, vec_size, a->shift, fn); in do_fp_2sh()
1708 static bool trans_##INSN##_2sh(DisasContext *s, arg_2reg_shift *a) \
1710 return do_fp_2sh(s, a, FUNC); \
1723 static bool do_1reg_imm(DisasContext *s, arg_1reg_imm *a, in DO_FP_2SH()
1734 if (!dc_isar_feature(aa32_simd_r32, s) && (a->vd & 0x10)) { in DO_FP_2SH()
1738 if (a->vd & a->q) { in DO_FP_2SH()
1746 reg_ofs = neon_full_reg_offset(a->vd); in DO_FP_2SH()
1747 vec_size = a->q ? 16 : 8; in DO_FP_2SH()
1748 imm = asimd_imm_const(a->imm, a->cmode, a->op); in DO_FP_2SH()
1760 static bool trans_Vimm_1r(DisasContext *s, arg_1reg_imm *a) in trans_Vimm_1r() argument
1765 if ((a->cmode & 1) && a->cmode < 12) { in trans_Vimm_1r()
1767 fn = a->op ? tcg_gen_gvec_andi : tcg_gen_gvec_ori; in trans_Vimm_1r()
1770 if (a->cmode == 15 && a->op == 1) { in trans_Vimm_1r()
1775 return do_1reg_imm(s, a, fn); in trans_Vimm_1r()
1778 static bool do_prewiden_3d(DisasContext *s, arg_3diff *a, in do_prewiden_3d() argument
1792 ((a->vd | a->vn | a->vm) & 0x10)) { in do_prewiden_3d()
1801 if ((a->vd & 1) || (src1_mop == MO_UQ && (a->vn & 1))) { in do_prewiden_3d()
1814 read_neon_element64(rn0_64, a->vn, 0, src1_mop); in do_prewiden_3d()
1817 read_neon_element32(tmp, a->vn, 0, MO_32); in do_prewiden_3d()
1821 read_neon_element64(rm_64, a->vm, 0, src2_mop); in do_prewiden_3d()
1824 read_neon_element32(tmp, a->vm, 0, MO_32); in do_prewiden_3d()
1835 read_neon_element64(rn1_64, a->vn, 1, src1_mop); in do_prewiden_3d()
1838 read_neon_element32(tmp, a->vn, 1, MO_32); in do_prewiden_3d()
1842 read_neon_element64(rm_64, a->vm, 1, src2_mop); in do_prewiden_3d()
1845 read_neon_element32(tmp, a->vm, 1, MO_32); in do_prewiden_3d()
1849 write_neon_element64(rn0_64, a->vd, 0, MO_64); in do_prewiden_3d()
1852 write_neon_element64(rn1_64, a->vd, 1, MO_64); in do_prewiden_3d()
1858 static bool trans_##INSN##_3d(DisasContext *s, arg_3diff *a) \
1871 int narrow_mop = a->size == MO_32 ? MO_32 | SIGN : -1; \
1872 return do_prewiden_3d(s, a, widenfn[a->size], addfn[a->size], \
1886 static bool do_narrow_3d(DisasContext *s, arg_3diff *a, in DO_PREWIDEN()
1899 ((a->vd | a->vn | a->vm) & 0x10)) { in DO_PREWIDEN()
1908 if ((a->vn | a->vm) & 1) { in DO_PREWIDEN()
1921 read_neon_element64(rn_64, a->vn, 0, MO_64); in DO_PREWIDEN()
1922 read_neon_element64(rm_64, a->vm, 0, MO_64); in DO_PREWIDEN()
1928 read_neon_element64(rn_64, a->vn, 1, MO_64); in DO_PREWIDEN()
1929 read_neon_element64(rm_64, a->vm, 1, MO_64); in DO_PREWIDEN()
1935 write_neon_element32(rd0, a->vd, 0, MO_32); in DO_PREWIDEN()
1936 write_neon_element32(rd1, a->vd, 1, MO_32); in DO_PREWIDEN()
1942 static bool trans_##INSN##_3d(DisasContext *s, arg_3diff *a) \
1956 return do_narrow_3d(s, a, addfn[a->size], narrowfn[a->size]); \
1970 static bool do_long_3d(DisasContext *s, arg_3diff *a, in DO_NARROW_3D()
1989 ((a->vd | a->vn | a->vm) & 0x10)) { in DO_NARROW_3D()
1998 if (a->vd & 1) { in DO_NARROW_3D()
2011 read_neon_element32(rn, a->vn, 0, MO_32); in DO_NARROW_3D()
2012 read_neon_element32(rm, a->vm, 0, MO_32); in DO_NARROW_3D()
2015 read_neon_element32(rn, a->vn, 1, MO_32); in DO_NARROW_3D()
2016 read_neon_element32(rm, a->vm, 1, MO_32); in DO_NARROW_3D()
2022 read_neon_element64(tmp, a->vd, 0, MO_64); in DO_NARROW_3D()
2024 read_neon_element64(tmp, a->vd, 1, MO_64); in DO_NARROW_3D()
2028 write_neon_element64(rd0, a->vd, 0, MO_64); in DO_NARROW_3D()
2029 write_neon_element64(rd1, a->vd, 1, MO_64); in DO_NARROW_3D()
2034 static bool trans_VABDL_S_3d(DisasContext *s, arg_3diff *a) in trans_VABDL_S_3d() argument
2043 return do_long_3d(s, a, opfn[a->size], NULL); in trans_VABDL_S_3d()
2046 static bool trans_VABDL_U_3d(DisasContext *s, arg_3diff *a) in trans_VABDL_U_3d() argument
2055 return do_long_3d(s, a, opfn[a->size], NULL); in trans_VABDL_U_3d()
2058 static bool trans_VABAL_S_3d(DisasContext *s, arg_3diff *a) in trans_VABAL_S_3d() argument
2073 return do_long_3d(s, a, opfn[a->size], addfn[a->size]); in trans_VABAL_S_3d()
2076 static bool trans_VABAL_U_3d(DisasContext *s, arg_3diff *a) in trans_VABAL_U_3d() argument
2091 return do_long_3d(s, a, opfn[a->size], addfn[a->size]); in trans_VABAL_U_3d()
2112 static bool trans_VMULL_S_3d(DisasContext *s, arg_3diff *a) in trans_VMULL_S_3d() argument
2121 return do_long_3d(s, a, opfn[a->size], NULL); in trans_VMULL_S_3d()
2124 static bool trans_VMULL_U_3d(DisasContext *s, arg_3diff *a) in trans_VMULL_U_3d() argument
2133 return do_long_3d(s, a, opfn[a->size], NULL); in trans_VMULL_U_3d()
2137 static bool trans_##INSN##_3d(DisasContext *s, arg_3diff *a) \
2151 return do_long_3d(s, a, opfn[a->size], accfn[a->size]); \
2171 static bool trans_VQDMULL_3d(DisasContext *s, arg_3diff *a) in trans_VQDMULL_3d() argument
2180 return do_long_3d(s, a, opfn[a->size], NULL); in trans_VQDMULL_3d()
2193 static bool trans_VQDMLAL_3d(DisasContext *s, arg_3diff *a) in trans_VQDMLAL_3d() argument
2208 return do_long_3d(s, a, opfn[a->size], accfn[a->size]); in trans_VQDMLAL_3d()
2223 static bool trans_VQDMLSL_3d(DisasContext *s, arg_3diff *a) in trans_VQDMLSL_3d() argument
2238 return do_long_3d(s, a, opfn[a->size], accfn[a->size]); in trans_VQDMLSL_3d()
2241 static bool trans_VMULL_P_3d(DisasContext *s, arg_3diff *a) in trans_VMULL_P_3d() argument
2251 ((a->vd | a->vn | a->vm) & 0x10)) { in trans_VMULL_P_3d()
2255 if (a->vd & 1) { in trans_VMULL_P_3d()
2259 switch (a->size) { in trans_VMULL_P_3d()
2277 tcg_gen_gvec_3_ool(neon_full_reg_offset(a->vd), in trans_VMULL_P_3d()
2278 neon_full_reg_offset(a->vn), in trans_VMULL_P_3d()
2279 neon_full_reg_offset(a->vm), in trans_VMULL_P_3d()
2316 static bool do_2scalar(DisasContext *s, arg_2scalar *a, in do_2scalar() argument
2334 ((a->vd | a->vn | a->vm) & 0x10)) { in do_2scalar()
2343 if (a->q && ((a->vd | a->vn) & 1)) { in do_2scalar()
2351 scalar = neon_get_scalar(a->size, a->vm); in do_2scalar()
2354 for (pass = 0; pass < (a->q ? 4 : 2); pass++) { in do_2scalar()
2355 read_neon_element32(tmp, a->vn, pass, MO_32); in do_2scalar()
2359 read_neon_element32(rd, a->vd, pass, MO_32); in do_2scalar()
2362 write_neon_element32(tmp, a->vd, pass, MO_32); in do_2scalar()
2367 static bool trans_VMUL_2sc(DisasContext *s, arg_2scalar *a) in trans_VMUL_2sc() argument
2376 return do_2scalar(s, a, opfn[a->size], NULL); in trans_VMUL_2sc()
2379 static bool trans_VMLA_2sc(DisasContext *s, arg_2scalar *a) in trans_VMLA_2sc() argument
2394 return do_2scalar(s, a, opfn[a->size], accfn[a->size]); in trans_VMLA_2sc()
2397 static bool trans_VMLS_2sc(DisasContext *s, arg_2scalar *a) in trans_VMLS_2sc() argument
2412 return do_2scalar(s, a, opfn[a->size], accfn[a->size]); in trans_VMLS_2sc()
2415 static bool do_2scalar_fp_vec(DisasContext *s, arg_2scalar *a, in do_2scalar_fp_vec() argument
2419 int vec_size = a->q ? 16 : 8; in do_2scalar_fp_vec()
2420 int rd_ofs = neon_full_reg_offset(a->vd); in do_2scalar_fp_vec()
2421 int rn_ofs = neon_full_reg_offset(a->vn); in do_2scalar_fp_vec()
2432 ((a->vd | a->vn | a->vm) & 0x10)) { in do_2scalar_fp_vec()
2441 if (a->q && ((a->vd | a->vn) & 1)) { in do_2scalar_fp_vec()
2450 idx = extract32(a->vm, a->size + 2, 2); in do_2scalar_fp_vec()
2451 a->vm = extract32(a->vm, 0, a->size + 2); in do_2scalar_fp_vec()
2452 rm_ofs = neon_full_reg_offset(a->vm); in do_2scalar_fp_vec()
2454 fpstatus = fpstatus_ptr(a->size == 1 ? FPST_STD_F16 : FPST_STD); in do_2scalar_fp_vec()
2461 static bool trans_##NAME##_F_2sc(DisasContext *s, arg_2scalar *a) \
2469 if (a->size == MO_16 && !dc_isar_feature(aa32_fp16_arith, s)) { \
2472 return do_2scalar_fp_vec(s, a, opfn[a->size]); \
2484 static bool trans_VQDMULH_2sc(DisasContext *s, arg_2scalar *a) in DO_VMUL_F_2sc()
2493 return do_2scalar(s, a, opfn[a->size], NULL); in DO_VMUL_F_2sc()
2496 static bool trans_VQRDMULH_2sc(DisasContext *s, arg_2scalar *a) in trans_VQRDMULH_2sc() argument
2505 return do_2scalar(s, a, opfn[a->size], NULL); in trans_VQRDMULH_2sc()
2508 static bool do_vqrdmlah_2sc(DisasContext *s, arg_2scalar *a, in do_vqrdmlah_2sc() argument
2529 ((a->vd | a->vn | a->vm) & 0x10)) { in do_vqrdmlah_2sc()
2538 if (a->q && ((a->vd | a->vn) & 1)) { in do_vqrdmlah_2sc()
2546 scalar = neon_get_scalar(a->size, a->vm); in do_vqrdmlah_2sc()
2550 for (pass = 0; pass < (a->q ? 4 : 2); pass++) { in do_vqrdmlah_2sc()
2551 read_neon_element32(rn, a->vn, pass, MO_32); in do_vqrdmlah_2sc()
2552 read_neon_element32(rd, a->vd, pass, MO_32); in do_vqrdmlah_2sc()
2554 write_neon_element32(rd, a->vd, pass, MO_32); in do_vqrdmlah_2sc()
2559 static bool trans_VQRDMLAH_2sc(DisasContext *s, arg_2scalar *a) in trans_VQRDMLAH_2sc() argument
2567 return do_vqrdmlah_2sc(s, a, opfn[a->size]); in trans_VQRDMLAH_2sc()
2570 static bool trans_VQRDMLSH_2sc(DisasContext *s, arg_2scalar *a) in trans_VQRDMLSH_2sc() argument
2578 return do_vqrdmlah_2sc(s, a, opfn[a->size]); in trans_VQRDMLSH_2sc()
2581 static bool do_2scalar_long(DisasContext *s, arg_2scalar *a, in do_2scalar_long() argument
2600 ((a->vd | a->vn | a->vm) & 0x10)) { in do_2scalar_long()
2609 if (a->vd & 1) { in do_2scalar_long()
2617 scalar = neon_get_scalar(a->size, a->vm); in do_2scalar_long()
2621 read_neon_element32(rn, a->vn, 0, MO_32); in do_2scalar_long()
2625 read_neon_element32(rn, a->vn, 1, MO_32); in do_2scalar_long()
2631 read_neon_element64(t64, a->vd, 0, MO_64); in do_2scalar_long()
2633 read_neon_element64(t64, a->vd, 1, MO_64); in do_2scalar_long()
2637 write_neon_element64(rn0_64, a->vd, 0, MO_64); in do_2scalar_long()
2638 write_neon_element64(rn1_64, a->vd, 1, MO_64); in do_2scalar_long()
2642 static bool trans_VMULL_S_2sc(DisasContext *s, arg_2scalar *a) in trans_VMULL_S_2sc() argument
2651 return do_2scalar_long(s, a, opfn[a->size], NULL); in trans_VMULL_S_2sc()
2654 static bool trans_VMULL_U_2sc(DisasContext *s, arg_2scalar *a) in trans_VMULL_U_2sc() argument
2663 return do_2scalar_long(s, a, opfn[a->size], NULL); in trans_VMULL_U_2sc()
2667 static bool trans_##INSN##_2sc(DisasContext *s, arg_2scalar *a) \
2681 return do_2scalar_long(s, a, opfn[a->size], accfn[a->size]); \
2689 static bool trans_VQDMULL_2sc(DisasContext *s, arg_2scalar *a) in DO_VMLAL_2SC()
2698 return do_2scalar_long(s, a, opfn[a->size], NULL); in DO_VMLAL_2SC()
2701 static bool trans_VQDMLAL_2sc(DisasContext *s, arg_2scalar *a) in trans_VQDMLAL_2sc() argument
2716 return do_2scalar_long(s, a, opfn[a->size], accfn[a->size]); in trans_VQDMLAL_2sc()
2719 static bool trans_VQDMLSL_2sc(DisasContext *s, arg_2scalar *a) in trans_VQDMLSL_2sc() argument
2734 return do_2scalar_long(s, a, opfn[a->size], accfn[a->size]); in trans_VQDMLSL_2sc()
2737 static bool trans_VEXT(DisasContext *s, arg_VEXT *a) in trans_VEXT() argument
2745 ((a->vd | a->vn | a->vm) & 0x10)) { in trans_VEXT()
2749 if ((a->vn | a->vm | a->vd) & a->q) { in trans_VEXT()
2753 if (a->imm > 7 && !a->q) { in trans_VEXT()
2761 if (!a->q) { in trans_VEXT()
2769 read_neon_element64(right, a->vn, 0, MO_64); in trans_VEXT()
2770 read_neon_element64(left, a->vm, 0, MO_64); in trans_VEXT()
2771 tcg_gen_extract2_i64(dest, right, left, a->imm * 8); in trans_VEXT()
2772 write_neon_element64(dest, a->vd, 0, MO_64); in trans_VEXT()
2783 if (a->imm < 8) { in trans_VEXT()
2784 read_neon_element64(right, a->vn, 0, MO_64); in trans_VEXT()
2785 read_neon_element64(middle, a->vn, 1, MO_64); in trans_VEXT()
2786 tcg_gen_extract2_i64(destright, right, middle, a->imm * 8); in trans_VEXT()
2787 read_neon_element64(left, a->vm, 0, MO_64); in trans_VEXT()
2788 tcg_gen_extract2_i64(destleft, middle, left, a->imm * 8); in trans_VEXT()
2790 read_neon_element64(right, a->vn, 1, MO_64); in trans_VEXT()
2791 read_neon_element64(middle, a->vm, 0, MO_64); in trans_VEXT()
2792 tcg_gen_extract2_i64(destright, right, middle, (a->imm - 8) * 8); in trans_VEXT()
2793 read_neon_element64(left, a->vm, 1, MO_64); in trans_VEXT()
2794 tcg_gen_extract2_i64(destleft, middle, left, (a->imm - 8) * 8); in trans_VEXT()
2797 write_neon_element64(destright, a->vd, 0, MO_64); in trans_VEXT()
2798 write_neon_element64(destleft, a->vd, 1, MO_64); in trans_VEXT()
2803 static bool trans_VTBL(DisasContext *s, arg_VTBL *a) in trans_VTBL() argument
2814 ((a->vd | a->vn | a->vm) & 0x10)) { in trans_VTBL()
2818 if ((a->vn + a->len + 1) > 32) { in trans_VTBL()
2830 desc = tcg_constant_i32((a->vn << 2) | a->len); in trans_VTBL()
2832 if (a->op) { in trans_VTBL()
2833 read_neon_element64(def, a->vd, 0, MO_64); in trans_VTBL()
2838 read_neon_element64(val, a->vm, 0, MO_64); in trans_VTBL()
2841 write_neon_element64(val, a->vd, 0, MO_64); in trans_VTBL()
2845 static bool trans_VDUP_scalar(DisasContext *s, arg_VDUP_scalar *a) in trans_VDUP_scalar() argument
2853 ((a->vd | a->vm) & 0x10)) { in trans_VDUP_scalar()
2857 if (a->vd & a->q) { in trans_VDUP_scalar()
2865 tcg_gen_gvec_dup_mem(a->size, neon_full_reg_offset(a->vd), in trans_VDUP_scalar()
2866 neon_element_offset(a->vm, a->index, a->size), in trans_VDUP_scalar()
2867 a->q ? 16 : 8, a->q ? 16 : 8); in trans_VDUP_scalar()
2871 static bool trans_VREV64(DisasContext *s, arg_VREV64 *a) in trans_VREV64() argument
2882 ((a->vd | a->vm) & 0x10)) { in trans_VREV64()
2886 if ((a->vd | a->vm) & a->q) { in trans_VREV64()
2890 if (a->size == 3) { in trans_VREV64()
2901 for (pass = 0; pass < (a->q ? 2 : 1); pass++) { in trans_VREV64()
2903 read_neon_element32(tmp[half], a->vm, pass * 2 + half, MO_32); in trans_VREV64()
2904 switch (a->size) { in trans_VREV64()
2917 write_neon_element32(tmp[1], a->vd, pass * 2, MO_32); in trans_VREV64()
2918 write_neon_element32(tmp[0], a->vd, pass * 2 + 1, MO_32); in trans_VREV64()
2923 static bool do_2misc_pairwise(DisasContext *s, arg_2misc *a, in do_2misc_pairwise() argument
2941 ((a->vd | a->vm) & 0x10)) { in do_2misc_pairwise()
2945 if ((a->vd | a->vm) & a->q) { in do_2misc_pairwise()
2957 for (pass = 0; pass < a->q + 1; pass++) { in do_2misc_pairwise()
2966 read_neon_element32(tmp, a->vm, pass * 2, MO_32); in do_2misc_pairwise()
2968 read_neon_element32(tmp, a->vm, pass * 2 + 1, MO_32); in do_2misc_pairwise()
2975 read_neon_element64(tmp64, a->vd, pass, MO_64); in do_2misc_pairwise()
2978 write_neon_element64(rd_64, a->vd, pass, MO_64); in do_2misc_pairwise()
2983 static bool trans_VPADDL_S(DisasContext *s, arg_2misc *a) in trans_VPADDL_S() argument
2998 return do_2misc_pairwise(s, a, widenfn[a->size], opfn[a->size], NULL); in trans_VPADDL_S()
3001 static bool trans_VPADDL_U(DisasContext *s, arg_2misc *a) in trans_VPADDL_U() argument
3016 return do_2misc_pairwise(s, a, widenfn[a->size], opfn[a->size], NULL); in trans_VPADDL_U()
3019 static bool trans_VPADAL_S(DisasContext *s, arg_2misc *a) in trans_VPADAL_S() argument
3040 return do_2misc_pairwise(s, a, widenfn[a->size], opfn[a->size], in trans_VPADAL_S()
3041 accfn[a->size]); in trans_VPADAL_S()
3044 static bool trans_VPADAL_U(DisasContext *s, arg_2misc *a) in trans_VPADAL_U() argument
3065 return do_2misc_pairwise(s, a, widenfn[a->size], opfn[a->size], in trans_VPADAL_U()
3066 accfn[a->size]); in trans_VPADAL_U()
3071 static bool do_zip_uzp(DisasContext *s, arg_2misc *a, in do_zip_uzp() argument
3082 ((a->vd | a->vm) & 0x10)) { in do_zip_uzp()
3086 if ((a->vd | a->vm) & a->q) { in do_zip_uzp()
3099 pd = vfp_reg_ptr(true, a->vd); in do_zip_uzp()
3100 pm = vfp_reg_ptr(true, a->vm); in do_zip_uzp()
3105 static bool trans_VUZP(DisasContext *s, arg_2misc *a) in trans_VUZP() argument
3120 return do_zip_uzp(s, a, fn[a->q][a->size]); in trans_VUZP()
3123 static bool trans_VZIP(DisasContext *s, arg_2misc *a) in trans_VZIP() argument
3138 return do_zip_uzp(s, a, fn[a->q][a->size]); in trans_VZIP()
3141 static bool do_vmovn(DisasContext *s, arg_2misc *a, in do_vmovn() argument
3153 ((a->vd | a->vm) & 0x10)) { in do_vmovn()
3157 if (a->vm & 1) { in do_vmovn()
3173 read_neon_element64(rm, a->vm, 0, MO_64); in do_vmovn()
3175 read_neon_element64(rm, a->vm, 1, MO_64); in do_vmovn()
3177 write_neon_element32(rd0, a->vd, 0, MO_32); in do_vmovn()
3178 write_neon_element32(rd1, a->vd, 1, MO_32); in do_vmovn()
3183 static bool trans_##INSN(DisasContext *s, arg_2misc *a) \
3191 return do_vmovn(s, a, narrowfn[a->size]); \
3199 static bool trans_VSHLL(DisasContext *s, arg_2misc *a) in DO_VMOVN()
3209 NeonGenWidenFn *widenfn = widenfns[a->size]; in DO_VMOVN()
3217 ((a->vd | a->vm) & 0x10)) { in DO_VMOVN()
3221 if (a->vd & 1) { in DO_VMOVN()
3237 read_neon_element32(rm0, a->vm, 0, MO_32); in DO_VMOVN()
3238 read_neon_element32(rm1, a->vm, 1, MO_32); in DO_VMOVN()
3241 tcg_gen_shli_i64(rd, rd, 8 << a->size); in DO_VMOVN()
3242 write_neon_element64(rd, a->vd, 0, MO_64); in DO_VMOVN()
3244 tcg_gen_shli_i64(rd, rd, 8 << a->size); in DO_VMOVN()
3245 write_neon_element64(rd, a->vd, 1, MO_64); in DO_VMOVN()
3249 static bool trans_VCVT_B16_F32(DisasContext *s, arg_2misc *a) in trans_VCVT_B16_F32() argument
3261 ((a->vd | a->vm) & 0x10)) { in trans_VCVT_B16_F32()
3265 if ((a->vm & 1) || (a->size != 1)) { in trans_VCVT_B16_F32()
3278 read_neon_element64(tmp, a->vm, 0, MO_64); in trans_VCVT_B16_F32()
3281 read_neon_element64(tmp, a->vm, 1, MO_64); in trans_VCVT_B16_F32()
3284 write_neon_element32(dst0, a->vd, 0, MO_32); in trans_VCVT_B16_F32()
3285 write_neon_element32(dst1, a->vd, 1, MO_32); in trans_VCVT_B16_F32()
3289 static bool trans_VCVT_F16_F32(DisasContext *s, arg_2misc *a) in trans_VCVT_F16_F32() argument
3301 ((a->vd | a->vm) & 0x10)) { in trans_VCVT_F16_F32()
3305 if ((a->vm & 1) || (a->size != 1)) { in trans_VCVT_F16_F32()
3316 read_neon_element32(tmp, a->vm, 0, MO_32); in trans_VCVT_F16_F32()
3319 read_neon_element32(tmp2, a->vm, 1, MO_32); in trans_VCVT_F16_F32()
3323 read_neon_element32(tmp, a->vm, 2, MO_32); in trans_VCVT_F16_F32()
3326 read_neon_element32(tmp3, a->vm, 3, MO_32); in trans_VCVT_F16_F32()
3327 write_neon_element32(tmp2, a->vd, 0, MO_32); in trans_VCVT_F16_F32()
3331 write_neon_element32(tmp3, a->vd, 1, MO_32); in trans_VCVT_F16_F32()
3335 static bool trans_VCVT_F32_F16(DisasContext *s, arg_2misc *a) in trans_VCVT_F32_F16() argument
3347 ((a->vd | a->vm) & 0x10)) { in trans_VCVT_F32_F16()
3351 if ((a->vd & 1) || (a->size != 1)) { in trans_VCVT_F32_F16()
3364 read_neon_element32(tmp, a->vm, 0, MO_32); in trans_VCVT_F32_F16()
3365 read_neon_element32(tmp2, a->vm, 1, MO_32); in trans_VCVT_F32_F16()
3368 write_neon_element32(tmp3, a->vd, 0, MO_32); in trans_VCVT_F32_F16()
3371 write_neon_element32(tmp, a->vd, 1, MO_32); in trans_VCVT_F32_F16()
3374 write_neon_element32(tmp3, a->vd, 2, MO_32); in trans_VCVT_F32_F16()
3377 write_neon_element32(tmp2, a->vd, 3, MO_32); in trans_VCVT_F32_F16()
3381 static bool do_2misc_vec(DisasContext *s, arg_2misc *a, GVecGen2Fn *fn) in do_2misc_vec() argument
3383 int vec_size = a->q ? 16 : 8; in do_2misc_vec()
3384 int rd_ofs = neon_full_reg_offset(a->vd); in do_2misc_vec()
3385 int rm_ofs = neon_full_reg_offset(a->vm); in do_2misc_vec()
3393 ((a->vd | a->vm) & 0x10)) { in do_2misc_vec()
3397 if (a->size == 3) { in do_2misc_vec()
3401 if ((a->vd | a->vm) & a->q) { in do_2misc_vec()
3409 fn(a->size, rd_ofs, rm_ofs, vec_size, vec_size); in do_2misc_vec()
3415 static bool trans_##INSN(DisasContext *s, arg_2misc *a) \
3417 return do_2misc_vec(s, a, FN); \
3428 static bool trans_VMVN(DisasContext *s, arg_2misc *a) in DO_2MISC_VEC()
3430 if (a->size != 0) { in DO_2MISC_VEC()
3433 return do_2misc_vec(s, a, tcg_gen_gvec_not); in DO_2MISC_VEC()
3462 static bool trans_##INSN(DisasContext *s, arg_2misc *a) \
3464 if (!dc_isar_feature(FEATURE, s) || a->size != SIZE) { \
3467 return do_2misc_vec(s, a, gen_##INSN); \
3478 static bool do_2misc(DisasContext *s, arg_2misc *a, NeonGenOneOpFn *fn) in do_2misc() argument
3490 ((a->vd | a->vm) & 0x10)) { in do_2misc()
3498 if ((a->vd | a->vm) & a->q) { in do_2misc()
3507 for (pass = 0; pass < (a->q ? 4 : 2); pass++) { in do_2misc()
3508 read_neon_element32(tmp, a->vm, pass, MO_32); in do_2misc()
3510 write_neon_element32(tmp, a->vd, pass, MO_32); in do_2misc()
3515 static bool trans_VREV32(DisasContext *s, arg_2misc *a) in trans_VREV32() argument
3523 return do_2misc(s, a, fn[a->size]); in trans_VREV32()
3526 static bool trans_VREV16(DisasContext *s, arg_2misc *a) in trans_VREV16() argument
3528 if (a->size != 0) { in trans_VREV16()
3531 return do_2misc(s, a, gen_rev16); in trans_VREV16()
3534 static bool trans_VCLS(DisasContext *s, arg_2misc *a) in trans_VCLS() argument
3542 return do_2misc(s, a, fn[a->size]); in trans_VCLS()
3550 static bool trans_VCLZ(DisasContext *s, arg_2misc *a) in trans_VCLZ() argument
3558 return do_2misc(s, a, fn[a->size]); in trans_VCLZ()
3561 static bool trans_VCNT(DisasContext *s, arg_2misc *a) in trans_VCNT() argument
3563 if (a->size != 0) { in trans_VCNT()
3566 return do_2misc(s, a, gen_helper_neon_cnt_u8); in trans_VCNT()
3577 static bool trans_VABS_F(DisasContext *s, arg_2misc *a) in trans_VABS_F() argument
3579 if (a->size == MO_16) { in trans_VABS_F()
3583 } else if (a->size != MO_32) { in trans_VABS_F()
3586 return do_2misc_vec(s, a, gen_VABS_F); in trans_VABS_F()
3597 static bool trans_VNEG_F(DisasContext *s, arg_2misc *a) in trans_VNEG_F() argument
3599 if (a->size == MO_16) { in trans_VNEG_F()
3603 } else if (a->size != MO_32) { in trans_VNEG_F()
3606 return do_2misc_vec(s, a, gen_VNEG_F); in trans_VNEG_F()
3609 static bool trans_VRECPE(DisasContext *s, arg_2misc *a) in trans_VRECPE() argument
3611 if (a->size != 2) { in trans_VRECPE()
3614 return do_2misc(s, a, gen_helper_recpe_u32); in trans_VRECPE()
3617 static bool trans_VRSQRTE(DisasContext *s, arg_2misc *a) in trans_VRSQRTE() argument
3619 if (a->size != 2) { in trans_VRSQRTE()
3622 return do_2misc(s, a, gen_helper_rsqrte_u32); in trans_VRSQRTE()
3638 static bool trans_VQABS(DisasContext *s, arg_2misc *a) in WRAP_1OP_ENV_FN()
3646 return do_2misc(s, a, fn[a->size]); in WRAP_1OP_ENV_FN()
3649 static bool trans_VQNEG(DisasContext *s, arg_2misc *a) in trans_VQNEG() argument
3657 return do_2misc(s, a, fn[a->size]); in trans_VQNEG()
3673 static bool trans_##INSN(DisasContext *s, arg_2misc *a) \
3675 if (a->size == MO_16) { \
3679 } else if (a->size != MO_32) { \
3682 return do_2misc_vec(s, a, gen_##INSN); \
3699 static bool trans_VRINTX(DisasContext *s, arg_2misc *a) in DO_2MISC_FP_VEC()
3704 return trans_VRINTX_impl(s, a); in DO_2MISC_FP_VEC()
3723 static bool trans_##INSN(DisasContext *s, arg_2misc *a) \
3728 if (a->size == MO_16) { \
3732 } else if (a->size != MO_32) { \
3735 return do_2misc_vec(s, a, gen_##INSN); \
3753 static bool trans_VSWP(DisasContext *s, arg_2misc *a) in DO_VEC_RMODE()
3764 ((a->vd | a->vm) & 0x10)) { in DO_VEC_RMODE()
3768 if (a->size != 0) { in DO_VEC_RMODE()
3772 if ((a->vd | a->vm) & a->q) { in DO_VEC_RMODE()
3782 for (pass = 0; pass < (a->q ? 2 : 1); pass++) { in DO_VEC_RMODE()
3783 read_neon_element64(rm, a->vm, pass, MO_64); in DO_VEC_RMODE()
3784 read_neon_element64(rd, a->vd, pass, MO_64); in DO_VEC_RMODE()
3785 write_neon_element64(rm, a->vd, pass, MO_64); in DO_VEC_RMODE()
3786 write_neon_element64(rd, a->vm, pass, MO_64); in DO_VEC_RMODE()
3826 static bool trans_VTRN(DisasContext *s, arg_2misc *a) in trans_VTRN() argument
3837 ((a->vd | a->vm) & 0x10)) { in trans_VTRN()
3841 if ((a->vd | a->vm) & a->q) { in trans_VTRN()
3845 if (a->size == 3) { in trans_VTRN()
3855 if (a->size == MO_32) { in trans_VTRN()
3856 for (pass = 0; pass < (a->q ? 4 : 2); pass += 2) { in trans_VTRN()
3857 read_neon_element32(tmp, a->vm, pass, MO_32); in trans_VTRN()
3858 read_neon_element32(tmp2, a->vd, pass + 1, MO_32); in trans_VTRN()
3859 write_neon_element32(tmp2, a->vm, pass, MO_32); in trans_VTRN()
3860 write_neon_element32(tmp, a->vd, pass + 1, MO_32); in trans_VTRN()
3863 for (pass = 0; pass < (a->q ? 4 : 2); pass++) { in trans_VTRN()
3864 read_neon_element32(tmp, a->vm, pass, MO_32); in trans_VTRN()
3865 read_neon_element32(tmp2, a->vd, pass, MO_32); in trans_VTRN()
3866 if (a->size == MO_8) { in trans_VTRN()
3871 write_neon_element32(tmp2, a->vm, pass, MO_32); in trans_VTRN()
3872 write_neon_element32(tmp, a->vd, pass, MO_32); in trans_VTRN()
3878 static bool trans_VSMMLA(DisasContext *s, arg_VSMMLA *a) in trans_VSMMLA() argument
3883 return do_neon_ddda(s, 7, a->vd, a->vn, a->vm, 0, in trans_VSMMLA()
3887 static bool trans_VUMMLA(DisasContext *s, arg_VUMMLA *a) in trans_VUMMLA() argument
3892 return do_neon_ddda(s, 7, a->vd, a->vn, a->vm, 0, in trans_VUMMLA()
3896 static bool trans_VUSMMLA(DisasContext *s, arg_VUSMMLA *a) in trans_VUSMMLA() argument
3901 return do_neon_ddda(s, 7, a->vd, a->vn, a->vm, 0, in trans_VUSMMLA()
3905 static bool trans_VMMLA_b16(DisasContext *s, arg_VMMLA_b16 *a) in trans_VMMLA_b16() argument
3910 return do_neon_ddda(s, 7, a->vd, a->vn, a->vm, 0, in trans_VMMLA_b16()
3914 static bool trans_VFMA_b16(DisasContext *s, arg_VFMA_b16 *a) in trans_VFMA_b16() argument
3919 return do_neon_ddda_fpst(s, 7, a->vd, a->vn, a->vm, a->q, FPST_STD, in trans_VFMA_b16()
3923 static bool trans_VFMA_b16_scal(DisasContext *s, arg_VFMA_b16_scal *a) in trans_VFMA_b16_scal() argument
3928 return do_neon_ddda_fpst(s, 6, a->vd, a->vn, a->vm, in trans_VFMA_b16_scal()
3929 (a->index << 1) | a->q, FPST_STD, in trans_VFMA_b16_scal()