From 87b63174b113094b862f4beb52f3d9d3a444f355 Mon Sep 17 00:00:00 2001 From: Trevor Elliott Date: Wed, 30 Nov 2022 14:37:01 -0800 Subject: [PATCH] Don't reuse registers in make_i64x2_from_lanes (#5355) Avoid reusing output registers in make_i64x2_from_lanes by threading the output name instead, and using smart constructors for x64_pinsrd instead of constructing the instructions directly. --- cranelift/codegen/src/isa/x64/inst.isle | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/cranelift/codegen/src/isa/x64/inst.isle b/cranelift/codegen/src/isa/x64/inst.isle index 865ed500d2..314f82e814 100644 --- a/cranelift/codegen/src/isa/x64/inst.isle +++ b/cranelift/codegen/src/isa/x64/inst.isle @@ -1566,22 +1566,10 @@ ;; Helper for creating an SSE register holding an `i64x2` from two `i64` values. (decl make_i64x2_from_lanes (GprMem GprMem) Xmm) (rule (make_i64x2_from_lanes lo hi) - (let ((dst_xmm WritableXmm (temp_writable_xmm)) - (dst_reg WritableReg dst_xmm) - (_ Unit (emit (MInst.XmmUninitializedValue dst_xmm))) - (_ Unit (emit (MInst.XmmRmRImm (SseOpcode.Pinsrd) - dst_reg - lo - dst_reg - 0 - (OperandSize.Size64)))) - (_ Unit (emit (MInst.XmmRmRImm (SseOpcode.Pinsrd) - dst_reg - hi - dst_reg - 1 - (OperandSize.Size64))))) - dst_xmm)) + (let ((dst Xmm (xmm_uninit_value)) + (dst Xmm (x64_pinsrd dst lo 0 (OperandSize.Size64))) + (dst Xmm (x64_pinsrd dst hi 1 (OperandSize.Size64)))) + dst)) ;; Move a `RegMemImm.Reg` operand to an XMM register, if necessary. (decl mov_rmi_to_xmm (RegMemImm) XmmMemImm)