Skip to content

Commit

Permalink
[AArch64] Cleanup dynamic lowering (bytecodealliance#4432)
Browse files Browse the repository at this point in the history
Copyright (c) 2022, Arm Limited.
  • Loading branch information
sparker-arm authored Jul 18, 2022
1 parent d792646 commit e5678e8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
9 changes: 0 additions & 9 deletions cranelift/codegen/src/isa/aarch64/lower.isle
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,6 @@
(rule (lower (has_type ty @ (multi_lane _ _) (iadd x y)))
(add_vec x y (vector_size ty)))

(rule (lower (has_type ty @ (dynamic_lane _ _) (iadd x y)))
(value_reg (vec_rrr (VecALUOp.Add) (put_in_reg x) (put_in_reg y) (vector_size ty))))

;; `i128`
(rule (lower (has_type $I128 (iadd x y)))
(let
Expand Down Expand Up @@ -199,8 +196,6 @@
;; vectors
(rule (lower (has_type ty @ (multi_lane _ _) (isub x y)))
(sub_vec x y (vector_size ty)))
(rule (lower (has_type ty @ (dynamic_lane _ _) (isub x y)))
(value_reg (sub_vec (put_in_reg x) (put_in_reg y) (vector_size ty))))

;; `i128`
(rule (lower (has_type $I128 (isub x y)))
Expand Down Expand Up @@ -288,10 +283,6 @@
(rule (lower (has_type (ty_vec128 ty @ (not_i64x2)) (imul x y)))
(mul x y (vector_size ty)))

;; Case for 'dynamic' i8x16, i16x8, and i32x4.
(rule (lower (has_type ty @ (dynamic_lane _ _) (imul x y)))
(value_reg (vec_rrr (VecALUOp.Mul) (put_in_reg x) (put_in_reg y) (vector_size ty))))

;; Special lowering for i64x2.
;;
;; This I64X2 multiplication is performed with several 32-bit
Expand Down
6 changes: 3 additions & 3 deletions cranelift/codegen/src/isa/aarch64/lower_dynamic_neon.isle
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@

;;;; Rules for `iadd` ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(rule (lower (has_type ty @ (dynamic_lane _ _) (iadd x y)))
(value_reg (vec_rrr (VecALUOp.Add) (put_in_reg x) (put_in_reg y) (vector_size ty))))
(value_reg (add_vec (put_in_reg x) (put_in_reg y) (vector_size ty))))

;;;; Rules for `isub` ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(rule (lower (has_type ty @ (dynamic_lane _ _) (isub x y)))
(value_reg (vec_rrr (VecALUOp.Sub) (put_in_reg x) (put_in_reg y) (vector_size ty))))
(value_reg (sub_vec (put_in_reg x) (put_in_reg y) (vector_size ty))))

;;;; Rules for `imul` ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(rule (lower (has_type (lane_fits_in_32 ty @ (dynamic_lane _ _)) (imul x y)))
(value_reg (vec_rrr (VecALUOp.Mul) (put_in_reg x) (put_in_reg y) (vector_size ty))))

;;;; Rules for `fsub` ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; Rules for `fadd` ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(rule (lower (has_type ty @ (dynamic_lane _ _) (fadd x y)))
(value_reg (vec_rrr (VecALUOp.Fadd) (put_in_reg x) (put_in_reg y) (vector_size ty))))

Expand Down

0 comments on commit e5678e8

Please sign in to comment.