add FCPYS and FCPYD

llvm-svn: 30995
This commit is contained in:
Rafael Espindola 2006-10-17 13:13:23 +00:00
parent 2794184191
commit c31ee94920
2 changed files with 16 additions and 3 deletions

View 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

View 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,