Move MOVHLPS patterns close to MOVHLPS definition, and duplicate the
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>
Wed, 24 Aug 2011 23:17:59 +0000 (23:17 +0000)
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>
Wed, 24 Aug 2011 23:17:59 +0000 (23:17 +0000)
pattern for 128-bit AVX mode.

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

lib/Target/X86/X86InstrSSE.td

index e68804843a96c73c89ab103489c4c08d79ae0e51..6bbb5178f3e985a78b3eb2ac8771a7851a7a3769 100644 (file)
@@ -514,6 +514,11 @@ let Predicates = [HasAVX] in {
     def : Pat<(v4i32 (movhlps_undef VR128:$src1, (undef))),
               (VMOVHLPSrr VR128:$src1, VR128:$src1)>;
   }
+
+  def : Pat<(v4f32 (X86Movhlps VR128:$src1, VR128:$src2)),
+            (VMOVHLPSrr VR128:$src1, VR128:$src2)>;
+  def : Pat<(v4i32 (X86Movhlps VR128:$src1, VR128:$src2)),
+            (VMOVHLPSrr VR128:$src1, VR128:$src2)>;
 }
 
 let Predicates = [HasSSE1] in {
@@ -557,6 +562,11 @@ let Predicates = [HasSSE1] in {
     def : Pat<(v4i32 (movhlps_undef VR128:$src1, (undef))),
               (MOVHLPSrr VR128:$src1, VR128:$src1)>;
   }
+
+  def : Pat<(v4f32 (X86Movhlps VR128:$src1, VR128:$src2)),
+            (MOVHLPSrr VR128:$src1, VR128:$src2)>;
+  def : Pat<(v4i32 (X86Movhlps VR128:$src1, VR128:$src2)),
+            (MOVHLPSrr VR128:$src1, VR128:$src2)>;
 }
 
 //===----------------------------------------------------------------------===//
@@ -6011,12 +6021,6 @@ def VZEROUPPER : I<0x77, RawFrm, (outs), (ins), "vzeroupper",
 // The AVX version of some but not all of them are described here, and more
 // should come in a near future.
 
-// Shuffle with MOVHLPS instruction
-def : Pat<(v4f32 (X86Movhlps VR128:$src1, VR128:$src2)),
-          (MOVHLPSrr VR128:$src1, VR128:$src2)>;
-def : Pat<(v4i32 (X86Movhlps VR128:$src1, VR128:$src2)),
-          (MOVHLPSrr VR128:$src1, VR128:$src2)>;
-
 // Shuffle with MOVDDUP instruction
 def : Pat<(X86Movddup (memopv2f64 addr:$src)),
           (VMOVDDUPrm addr:$src)>, Requires<[HasAVX]>;