[llvm-commits] [llvm] r48104 - /llvm/trunk/lib/Target/X86/X86InstrInfo.cpp
Chris Lattner
sabre at nondot.org
Sun Mar 9 00:46:19 PST 2008
Author: lattner
Date: Sun Mar 9 03:46:19 2008
New Revision: 48104
URL: http://llvm.org/viewvc/llvm-project?rev=48104&view=rev
Log:
add some code to support cross-register class copying from
RST -> RFP{32/64/80}. We only handle ST(0) for now.
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=48104&r1=48103&r2=48104&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Sun Mar 9 03:46:19 2008
@@ -1400,10 +1400,10 @@
}
void X86InstrInfo::copyRegToReg(MachineBasicBlock &MBB,
- MachineBasicBlock::iterator MI,
- unsigned DestReg, unsigned SrcReg,
- const TargetRegisterClass *DestRC,
- const TargetRegisterClass *SrcRC) const {
+ MachineBasicBlock::iterator MI,
+ unsigned DestReg, unsigned SrcReg,
+ const TargetRegisterClass *DestRC,
+ const TargetRegisterClass *SrcRC) const {
if (DestRC == SrcRC) {
unsigned Opc;
if (DestRC == &X86::GR64RegClass) {
@@ -1464,6 +1464,24 @@
return;
}
}
+
+ // Moving ST(0) to/from a register turns into FpGET_ST0_32 etc.
+ if (SrcRC == &X86::RSTRegClass) {
+ // Copying from ST(0). FIXME: handle ST(1) also
+ assert(SrcReg == X86::ST0 && "Can only copy from TOS right now");
+ unsigned Opc;
+ if (DestRC == &X86::RFP32RegClass)
+ Opc = X86::FpGET_ST0_32;
+ else if (DestRC == &X86::RFP64RegClass)
+ Opc = X86::FpGET_ST0_64;
+ else {
+ assert(DestRC == &X86::RFP80RegClass);
+ Opc = X86::FpGET_ST0_80;
+ }
+ BuildMI(MBB, MI, get(Opc), DestReg);
+ return;
+ }
+
cerr << "Not yet supported!";
abort();
}
More information about the llvm-commits
mailing list