diff --git a/cranelift/codegen/src/isa/x64/lower.isle b/cranelift/codegen/src/isa/x64/lower.isle index 53f07b98e0..b665d66d6c 100644 --- a/cranelift/codegen/src/isa/x64/lower.isle +++ b/cranelift/codegen/src/isa/x64/lower.isle @@ -189,37 +189,6 @@ ;; (No `iadd_ifcout` for `i128`.) -;;;; Rules for `iadd_imm` ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -;; `i64` and smaller. - -;; When the immediate fits in a `RegMemImm.Imm`, use that. -(rule (lower (has_type (fits_in_64 ty) (iadd_imm y (simm32_from_imm64 x)))) - (x64_add ty y x)) - -;; Otherwise, put the immediate into a register. -(rule (lower (has_type (fits_in_64 ty) (iadd_imm y (u64_from_imm64 x)))) - (x64_add ty y (imm ty x))) - -;; `i128` - -;; When the immediate fits in a `RegMemImm.Imm`, use that. -(rule (lower (has_type $I128 (iadd_imm y (simm32_from_imm64 x)))) - (let ((y_regs ValueRegs y) - (y_lo Gpr (value_regs_get_gpr y_regs 0)) - (y_hi Gpr (value_regs_get_gpr y_regs 1))) - (with_flags (x64_add_with_flags_paired $I64 y_lo x) - (x64_adc_paired $I64 y_hi (RegMemImm.Imm 0))))) - -;; Otherwise, put the immediate into a register. -(rule (lower (has_type $I128 (iadd_imm y (u64_from_imm64 x)))) - (let ((y_regs ValueRegs y) - (y_lo Gpr (value_regs_get_gpr y_regs 0)) - (y_hi Gpr (value_regs_get_gpr y_regs 1)) - (x_lo Gpr (imm $I64 x))) - (with_flags (x64_add_with_flags_paired $I64 y_lo x_lo) - (x64_adc_paired $I64 y_hi (RegMemImm.Imm 0))))) - ;;;; Rules for `isub` ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; `i64` and smaller.