Use movlpd to: store lower f64 extracted from v2f64.
authorEvan Cheng <evan.cheng@apple.com>
Mon, 3 Apr 2006 22:30:54 +0000 (22:30 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Mon, 3 Apr 2006 22:30:54 +0000 (22:30 +0000)
Use movhpd to: store upper f64 extracted from v2f64.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27382 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86ISelLowering.cpp
lib/Target/X86/X86InstrSSE.td

index 693189b67651e7129d5f32f43e67c0367307cb22..87438d0b6bee1f42978b97ebead97141f0d33c8b 100644 (file)
@@ -2712,6 +2712,8 @@ SDOperand X86TargetLowering::LowerOperation(SDOperand Op, SelectionDAG &DAG) {
         return Op;
 
       // UNPCKHPD the element to the lowest double word, then movsd.
+      // Note if the lower 64 bits of the result of the UNPCKHPD is then stored
+      // to a f64mem, the whole operation is folded into a single MOVHPDmr.
       MVT::ValueType MaskVT = MVT::getIntVectorWithNumElements(4);
       std::vector<SDOperand> IdxVec;
       IdxVec.push_back(DAG.getConstant(1, MVT::getVectorBaseType(MaskVT)));
index 5fc0004d51184009545197a94b0dec60b7225a83..5fc0a238c3862d2b2801c61853f8eee691059768 100644 (file)
@@ -713,12 +713,18 @@ def MOVHPDrm : PDI<0x16, MRMSrcMem, (ops VR128:$dst, VR128:$src1, f64mem:$src2),
 def MOVLPSmr : PSI<0x13, MRMDestMem, (ops f64mem:$dst, VR128:$src),
                    "movlps {$src, $dst|$dst, $src}", []>;
 def MOVLPDmr : PDI<0x13, MRMDestMem, (ops f64mem:$dst, VR128:$src),
-                   "movlpd {$src, $dst|$dst, $src}", []>;
+                   "movlpd {$src, $dst|$dst, $src}",
+                   [(store (f64 (vector_extract (v2f64 VR128:$src),
+                                 (i32 0))), addr:$dst)]>;
 
 def MOVHPSmr : PSI<0x17, MRMDestMem, (ops f64mem:$dst, VR128:$src),
                    "movhps {$src, $dst|$dst, $src}", []>;
 def MOVHPDmr : PDI<0x17, MRMDestMem, (ops f64mem:$dst, VR128:$src),
-                   "movhpd {$src, $dst|$dst, $src}", []>;
+                   "movhpd {$src, $dst|$dst, $src}",
+                   [(store (f64 (vector_extract
+                                 (v2f64 (vector_shuffle VR128:$src, (undef),
+                                         UNPCKH_shuffle_mask)), (i32 0))),
+                     addr:$dst)]>;
 
 let isTwoAddress = 1 in {
 def MOVLHPSrr : PSI<0x16, MRMSrcReg, (ops VR128:$dst, VR128:$src1, VR128:$src2),
@@ -1561,10 +1567,6 @@ def MOVPD2SDrr : SDI<0x10, MRMSrcReg, (ops FR64:$dst, VR128:$src),
                      "movsd {$src, $dst|$dst, $src}",
                      [(set FR64:$dst, (vector_extract (v2f64 VR128:$src),
                                        (i32 0)))]>;
-def MOVPD2SDmr : SDI<0x10, MRMDestMem, (ops f64mem:$dst, VR128:$src),
-                     "movsd {$src, $dst|$dst, $src}",
-                     [(store (f64 (vector_extract (v2f64 VR128:$src),
-                                   (i32 0))), addr:$dst)]>;
 def MOVPDI2DIrr  : PDI<0x7E, MRMSrcReg, (ops R32:$dst, VR128:$src),
                        "movd {$src, $dst|$dst, $src}",
                        [(set R32:$dst, (vector_extract (v4i32 VR128:$src),