[llvm-commits] [llvm] r140348 - /llvm/trunk/lib/Target/X86/X86InstrInfo.cpp

Jakob Stoklund Olesen stoklund at 2pi.dk
Thu Sep 22 15:45:24 PDT 2011


Author: stoklund
Date: Thu Sep 22 17:45:24 2011
New Revision: 140348

URL: http://llvm.org/viewvc/llvm-project?rev=140348&view=rev
Log:
Add support for GR32 <-> FR32 cross class copies.

We already support GR64 <-> VR128 copies.  All of these copies break
partial register dependencies by zeroing the high part of the target
register.

Modified:
    llvm/trunk/lib/Target/X86/X86InstrInfo.cpp

Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp?rev=140348&r1=140347&r2=140348&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Thu Sep 22 17:45:24 2011
@@ -2158,6 +2158,17 @@
       return X86::MOV64toSDrr;
   }
 
+  // SrcReg(FR32) -> DestReg(GR32)
+  // SrcReg(GR32) -> DestReg(FR32)
+
+  if (X86::GR32RegClass.contains(DestReg) && X86::FR32RegClass.contains(SrcReg))
+      // Copy from a FR32 register to a GR32 register.
+      return HasAVX ? X86::VMOVSS2DIrr : X86::MOVSS2DIrr;
+
+  if (X86::FR32RegClass.contains(DestReg) && X86::GR32RegClass.contains(SrcReg))
+      // Copy from a GR32 register to a FR32 register.
+      return HasAVX ? X86::VMOVDI2SSrr : X86::MOVDI2SSrr;
+
   return 0;
 }
 





More information about the llvm-commits mailing list