add FCPYS and FCPYD
authorRafael Espindola <rafael.espindola@gmail.com>
Tue, 17 Oct 2006 13:13:23 +0000 (13:13 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Tue, 17 Oct 2006 13:13:23 +0000 (13:13 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30995 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMInstrInfo.td
lib/Target/ARM/ARMRegisterInfo.cpp

index 099b499c52a0af504b2e1dd6d98acf0d57164506..e427050440a01617cecdd0930df0acb5355ceb07 100644 (file)
@@ -212,6 +212,11 @@ def fcmpd   : InstARM<(ops DFPRegs:$a, DFPRegs:$b),
                       "fcmpd $a, $b",
                       [(armcmp DFPRegs:$a, DFPRegs:$b)]>;
 
+// Floating Point Copy
+def FCPYS   : InstARM<(ops FPRegs:$dst, FPRegs:$src), "fcpys $dst, $src", []>;
+
+def FCPYD   : InstARM<(ops DFPRegs:$dst, DFPRegs:$src), "fcpyd $dst, $src", []>;
+
 // Floating Point Conversion
 // We use bitconvert for moving the data between the register classes.
 // The format conversion is done with ARM specific nodes
index fd04f5aecf2c0b48c71393e74d3c0e3561e986f4..703952367f7cacc2b0363863db6e8d0101fb6aa0 100644 (file)
@@ -47,9 +47,17 @@ void ARMRegisterInfo::copyRegToReg(MachineBasicBlock &MBB,
                                      MachineBasicBlock::iterator I,
                                      unsigned DestReg, unsigned SrcReg,
                                      const TargetRegisterClass *RC) const {
-  assert (RC == ARM::IntRegsRegisterClass);
-  BuildMI(MBB, I, ARM::MOV, 3, DestReg).addReg(SrcReg).addImm(0)
-         .addImm(ARMShift::LSL);
+  assert(RC == ARM::IntRegsRegisterClass ||
+         RC == ARM::FPRegsRegisterClass  ||
+         RC == ARM::DFPRegsRegisterClass);
+
+  if (RC == ARM::IntRegsRegisterClass)
+    BuildMI(MBB, I, ARM::MOV, 3, DestReg).addReg(SrcReg).addImm(0)
+      .addImm(ARMShift::LSL);
+  else if (RC == ARM::FPRegsRegisterClass)
+    BuildMI(MBB, I, ARM::FCPYS, 1, DestReg).addReg(SrcReg);
+  else
+    BuildMI(MBB, I, ARM::FCPYD, 1, DestReg).addReg(SrcReg);
 }
 
 MachineInstr *ARMRegisterInfo::foldMemoryOperand(MachineInstr* MI,