Remove some redundant checks, add a couple of new ones. This allows us to
[oota-llvm.git] / lib / Target / Alpha / AlphaRegisterInfo.cpp
index 2513e7aa2186321aa792be030e4d71ce6c9600e4..96a05938f1a59f32fe447963f64885a67c82443a 100644 (file)
@@ -31,9 +31,9 @@
 using namespace llvm;
 
 //These describe LDAx
-static const long IMM_LOW  = 0xffffffffffff8000;
-static const long IMM_HIGH = 0x0000000000007fff;
-static const long IMM_MULT = 65536;
+static const int IMM_LOW  = -32768;
+static const int IMM_HIGH = 32767;
+static const int IMM_MULT = 65536;
 
 static long getUpper16(long l)
 {
@@ -196,7 +196,7 @@ AlphaRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II) const {
     //insert the new
     MachineInstr* nMI=BuildMI(Alpha::LDAH, 2, Alpha::R28)
       .addImm(getUpper16(Offset)).addReg(FP ? Alpha::R15 : Alpha::R30);
-    MBB.insert(--II, nMI);
+    MBB.insert(II, nMI);
   } else {
     MI.SetMachineOperandConst(i, MachineOperand::MO_SignExtendedImmed, Offset);
   }
@@ -274,7 +274,7 @@ void AlphaRegisterInfo::emitEpilogue(MachineFunction &MF,
   bool FP = hasFP(MF);
  
   // Get the number of bytes allocated from the FrameInfo...
-  unsigned NumBytes = MFI->getStackSize();
+  long NumBytes = MFI->getStackSize();
 
   //now if we need to, restore the old FP
   if (FP)