Convert swizzle to ISLE (AArch64) (#4400)

Converted the implementation of `swizzle` for AArch64 to ISLE.

Copyright (c) 2022 Arm Limited
This commit is contained in:
Damian Heaton
2022-07-07 18:29:33 +01:00
committed by GitHub
parent 038383dc42
commit 6a5fe20956
3 changed files with 13 additions and 12 deletions

View File

@@ -1537,6 +1537,13 @@
(_ Unit (emit (MInst.VecMisc op dst src size)))) (_ Unit (emit (MInst.VecMisc op dst src size))))
dst)) dst))
;; Helper for emitting `MInst.VecTbl` instructions.
(decl vec_tbl (Reg Reg bool) Reg)
(rule (vec_tbl rn rm is_extension)
(let ((dst WritableReg (temp_writable_reg $I8X16))
(_ Unit (emit (MInst.VecTbl dst rn rm is_extension))))
dst))
;; Helper for emitting `MInst.VecRRRLong` instructions. ;; Helper for emitting `MInst.VecRRRLong` instructions.
(decl vec_rrr_long (VecRRRLongOp Reg Reg bool) Reg) (decl vec_rrr_long (VecRRRLongOp Reg Reg bool) Reg)
(rule (vec_rrr_long op src1 src2 high_half) (rule (vec_rrr_long op src1 src2 high_half)

View File

@@ -99,6 +99,11 @@
(add_with_flags_paired $I64 x_lo y_lo) (add_with_flags_paired $I64 x_lo y_lo)
(adc_paired $I64 x_hi y_hi)))) (adc_paired $I64 x_hi y_hi))))
;;;; Rules for `swizzle` ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(rule (lower (has_type vec_i128_ty (swizzle rn rm)))
(vec_tbl rn rm #f))
;;;; Rules for `iadd_pairwise` ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; Rules for `iadd_pairwise` ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(rule (lower (has_type $I16X8 (iadd_pairwise (swiden_low x) (swiden_high y)))) (rule (lower (has_type $I16X8 (iadd_pairwise (swiden_low x) (swiden_high y))))

View File

@@ -1190,18 +1190,7 @@ pub(crate) fn lower_insn_to_regs<C: LowerCtx<I = Inst>>(
}); });
} }
Opcode::Swizzle => { Opcode::Swizzle => implemented_in_isle(ctx),
let rd = get_output_reg(ctx, outputs[0]).only_reg().unwrap();
let rm = put_input_in_reg(ctx, inputs[1], NarrowValueMode::None);
let rn = put_input_in_reg(ctx, inputs[0], NarrowValueMode::None);
ctx.emit(Inst::VecTbl {
rd,
rn,
rm,
is_extension: false,
});
}
Opcode::Isplit => { Opcode::Isplit => {
let input_ty = ctx.input_ty(insn, 0); let input_ty = ctx.input_ty(insn, 0);