diff options
author | Vikram S. Adve <vadve@cs.uiuc.edu> | 2001-11-15 14:59:56 +0000 |
---|---|---|
committer | Vikram S. Adve <vadve@cs.uiuc.edu> | 2001-11-15 14:59:56 +0000 |
commit | 821b12975526b2722340ed2c6867df68f28ffccd (patch) | |
tree | b7262e041dfbed7fe886e558a295afd9a5152291 /llvm/lib/Target/Sparc/SparcInstrInfo.cpp | |
parent | 02c43c8609e393f95af72025ba7fcaf233a6ee4d (diff) | |
download | bcm5719-llvm-821b12975526b2722340ed2c6867df68f28ffccd.tar.gz bcm5719-llvm-821b12975526b2722340ed2c6867df68f28ffccd.zip |
Fix int->float conversion.
llvm-svn: 1314
Diffstat (limited to 'llvm/lib/Target/Sparc/SparcInstrInfo.cpp')
-rw-r--r-- | llvm/lib/Target/Sparc/SparcInstrInfo.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Target/Sparc/SparcInstrInfo.cpp b/llvm/lib/Target/Sparc/SparcInstrInfo.cpp index 465a1e781b0..f8162fcd25f 100644 --- a/llvm/lib/Target/Sparc/SparcInstrInfo.cpp +++ b/llvm/lib/Target/Sparc/SparcInstrInfo.cpp @@ -189,7 +189,8 @@ UltraSparcInstrInfo::CreateCodeToCopyIntToFloat(Method* method, // Store instruction stores `val' to [%fp+offset]. // The store and load opCodes are based on the value being copied, and - // they use the integer type that matches the destination type in size: + // they use integer and float types that accomodate the + // larger of the source type and the destination type: // On SparcV9: int for float, long for double. // Type* tmpType = (dest->getType() == Type::FloatTy)? Type::IntTy @@ -202,7 +203,7 @@ UltraSparcInstrInfo::CreateCodeToCopyIntToFloat(Method* method, // Load instruction loads [%fp+offset] to `dest'. // - MachineInstr* load = new MachineInstr(ChooseLoadInstruction(tmpType)); + MachineInstr* load =new MachineInstr(ChooseLoadInstruction(dest->getType())); load->SetMachineOperand(0, target.getRegInfo().getFramePointer()); load->SetMachineOperand(1, MachineOperand::MO_SignExtendedImmed, offset); load->SetMachineOperand(2, MachineOperand::MO_VirtualRegister, dest); @@ -239,7 +240,7 @@ UltraSparcInstrInfo::CreateCodeToCopyFloatToInt(Method* method, // Type* tmpType = (val->getType() == Type::FloatTy)? Type::IntTy : Type::LongTy; - MachineInstr* store = new MachineInstr(ChooseStoreInstruction(tmpType)); + MachineInstr* store=new MachineInstr(ChooseStoreInstruction(val->getType())); store->SetMachineOperand(0, MachineOperand::MO_VirtualRegister, val); store->SetMachineOperand(1, target.getRegInfo().getFramePointer()); store->SetMachineOperand(2, MachineOperand::MO_SignExtendedImmed, offset); |