Cranelift AArch64: Migrate Splat to ISLE (#4521)
Copyright (c) 2022, Arm Limited.
This commit is contained in:
@@ -868,7 +868,7 @@
|
||||
;; Pseudoinstruction to keep a value alive.
|
||||
(DummyUse
|
||||
(reg Reg))
|
||||
|
||||
|
||||
;; An unwind pseudoinstruction describing the state of the
|
||||
;; machine at this program point.
|
||||
(Unwind
|
||||
@@ -1641,15 +1641,6 @@
|
||||
(decl sinkable_inst (Inst) Value)
|
||||
(extern extractor sinkable_inst sinkable_inst)
|
||||
|
||||
;; Sink a sinkable instruction.
|
||||
;;
|
||||
;; This is a side-effectful operation that notifies the context that the
|
||||
;; sinkable instruction been sunk into another instruction, and no longer
|
||||
;; needs to be lowered.
|
||||
(decl sink_inst (Inst) Unit)
|
||||
(extern constructor sink_inst sink_inst)
|
||||
|
||||
|
||||
;; Sinkable big-endian load instruction.
|
||||
(decl sinkable_load (Inst) Value)
|
||||
(extractor (sinkable_load inst)
|
||||
|
||||
@@ -1656,8 +1656,9 @@
|
||||
|
||||
;; Insert vector lane from general-purpose register.
|
||||
(rule (lower (insertlane x @ (value_type ty)
|
||||
y @ (value_type (ty_int_bool_ref_scalar_64 _))
|
||||
y @ (value_type in_ty)
|
||||
(u8_from_uimm8 idx)))
|
||||
(if (ty_int_bool_ref_scalar_64 in_ty))
|
||||
(vec_insert_lane ty x y (be_lane_idx ty idx) (zero_reg)))
|
||||
|
||||
;; Insert vector lane from floating-point register.
|
||||
@@ -1771,8 +1772,9 @@
|
||||
;;;; Rules for `extractlane` ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
;; Extract vector lane to general-purpose register.
|
||||
(rule (lower (has_type (ty_int_bool_ref_scalar_64 _)
|
||||
(rule (lower (has_type out_ty
|
||||
(extractlane x @ (value_type ty) (u8_from_uimm8 idx))))
|
||||
(if (ty_int_bool_ref_scalar_64 out_ty))
|
||||
(vec_extract_lane ty x (be_lane_idx ty idx) (zero_reg)))
|
||||
|
||||
;; Extract vector lane to floating-point register.
|
||||
@@ -1828,8 +1830,8 @@
|
||||
;;;; Rules for `splat` ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
;; Load replicated value from general-purpose register.
|
||||
(rule (lower (has_type ty (splat
|
||||
x @ (value_type (ty_int_bool_ref_scalar_64 _)))))
|
||||
(rule (lower (has_type ty (splat x @ (value_type in_ty))))
|
||||
(if (ty_int_bool_ref_scalar_64 in_ty))
|
||||
(vec_replicate_lane ty (vec_insert_lane_undef ty x 0 (zero_reg)) 0))
|
||||
|
||||
;; Load replicated value from floating-point register.
|
||||
@@ -1888,7 +1890,8 @@
|
||||
|
||||
;; Load scalar value from general-purpose register.
|
||||
(rule (lower (has_type ty (scalar_to_vector
|
||||
x @ (value_type (ty_int_bool_ref_scalar_64 _)))))
|
||||
x @ (value_type in_ty))))
|
||||
(if (ty_int_bool_ref_scalar_64 in_ty))
|
||||
(vec_insert_lane ty (vec_imm ty 0) x (be_lane_idx ty 0) (zero_reg)))
|
||||
|
||||
;; Load scalar value from floating-point register.
|
||||
|
||||
@@ -666,11 +666,6 @@ where
|
||||
None
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn sink_inst(&mut self, inst: Inst) -> Unit {
|
||||
self.lower_ctx.sink_inst(inst);
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn emit(&mut self, inst: &MInst) -> Unit {
|
||||
self.lower_ctx.emit(inst.clone());
|
||||
|
||||
Reference in New Issue
Block a user