[llvm-commits] CVS: llvm/lib/Target/X86/X86ISelLowering.cpp X86InstrSSE.td

Evan Cheng evan.cheng at apple.com
Mon Apr 3 15:31:06 PDT 2006



Changes in directory llvm/lib/Target/X86:

X86ISelLowering.cpp updated: 1.152 -> 1.153
X86InstrSSE.td updated: 1.54 -> 1.55
---
Log message:

Use movlpd to: store lower f64 extracted from v2f64.
Use movhpd to: store upper f64 extracted from v2f64.


---
Diffs of the changes:  (+10 -6)

 X86ISelLowering.cpp |    2 ++
 X86InstrSSE.td      |   14 ++++++++------
 2 files changed, 10 insertions(+), 6 deletions(-)


Index: llvm/lib/Target/X86/X86ISelLowering.cpp
diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.152 llvm/lib/Target/X86/X86ISelLowering.cpp:1.153
--- llvm/lib/Target/X86/X86ISelLowering.cpp:1.152	Mon Apr  3 15:53:28 2006
+++ llvm/lib/Target/X86/X86ISelLowering.cpp	Mon Apr  3 17:30:54 2006
@@ -2712,6 +2712,8 @@
         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: llvm/lib/Target/X86/X86InstrSSE.td
diff -u llvm/lib/Target/X86/X86InstrSSE.td:1.54 llvm/lib/Target/X86/X86InstrSSE.td:1.55
--- llvm/lib/Target/X86/X86InstrSSE.td:1.54	Mon Apr  3 15:53:28 2006
+++ llvm/lib/Target/X86/X86InstrSSE.td	Mon Apr  3 17:30:54 2006
@@ -713,12 +713,18 @@
 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 @@
                      "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),






More information about the llvm-commits mailing list