[llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp AlphaRegisterInfo.td

Andrew Lenharth alenhar2 at cs.uiuc.edu
Thu Jan 27 00:31:32 PST 2005



Changes in directory llvm/lib/Target/Alpha:

AlphaRegisterInfo.cpp updated: 1.3 -> 1.4
AlphaRegisterInfo.td updated: 1.1 -> 1.2
---
Log message:

stack frame fix and zero FP reg fix

---
Diffs of the changes:  (+19 -12)

 AlphaRegisterInfo.cpp |   27 +++++++++++++++++----------
 AlphaRegisterInfo.td  |    4 ++--
 2 files changed, 19 insertions(+), 12 deletions(-)


Index: llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp
diff -u llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp:1.3 llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp:1.4
--- llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp:1.3	Wed Jan 26 15:54:09 2005
+++ llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp	Thu Jan 27 02:31:19 2005
@@ -208,7 +208,7 @@
   if (NumBytes <= 32767) {
     MI=BuildMI(Alpha::LDA, 2, Alpha::R30).addImm(-NumBytes).addReg(Alpha::R30);
     MBB.insert(MBBI, MI);
-  } else if (NumBytes <= 32767 * 65536) {
+  } else if ((unsigned long)NumBytes <= (unsigned long)32767 * (unsigned long)65536) {
     long y = NumBytes / 65536;
     if (NumBytes % 65536 > 32767)
       ++y;
@@ -217,7 +217,7 @@
     MI=BuildMI(Alpha::LDA, 2, Alpha::R30).addImm(-(NumBytes - y * 65536)).addReg(Alpha::R30);
     MBB.insert(MBBI, MI);
   } else {
-    std::cerr << "Too big a stack frame\n";
+    std::cerr << "Too big a stack frame at " << NumBytes << "\n";
     abort();
   }
 }
@@ -235,14 +235,21 @@
 
    if (NumBytes != 0) 
      {
-       if (NumBytes <= 32000) //FIXME: do this better 
-	 {
-	   MI=BuildMI(Alpha::LDA, 2, Alpha::R30).addImm(NumBytes).addReg(Alpha::R30);
-	   MBB.insert(MBBI, MI);
-	 } else {
-	   std::cerr << "Too big a stack frame\n";
-	   abort();
-	 }
+       if (NumBytes <= 32767) {
+         MI=BuildMI(Alpha::LDA, 2, Alpha::R30).addImm(NumBytes).addReg(Alpha::R30);
+         MBB.insert(MBBI, MI);
+       } else if ((unsigned long)NumBytes <= (unsigned long)32767 * (unsigned long)65536) {
+         long y = NumBytes / 65536;
+         if (NumBytes % 65536 > 32767)
+           ++y;
+         MI=BuildMI(Alpha::LDAH, 2, Alpha::R30).addImm(y).addReg(Alpha::R30);
+         MBB.insert(MBBI, MI);
+         MI=BuildMI(Alpha::LDA, 2, Alpha::R30).addImm(NumBytes - y * 65536).addReg(Alpha::R30);
+         MBB.insert(MBBI, MI);
+       } else {
+         std::cerr << "Too big a stack frame at " << NumBytes << "\n";
+         abort();
+       }
      }
 }
 


Index: llvm/lib/Target/Alpha/AlphaRegisterInfo.td
diff -u llvm/lib/Target/Alpha/AlphaRegisterInfo.td:1.1 llvm/lib/Target/Alpha/AlphaRegisterInfo.td:1.2
--- llvm/lib/Target/Alpha/AlphaRegisterInfo.td:1.1	Sat Jan 22 17:41:55 2005
+++ llvm/lib/Target/Alpha/AlphaRegisterInfo.td	Thu Jan 27 02:31:19 2005
@@ -81,13 +81,13 @@
 //Volitle
      [R0, R1, R2, R3, R4, R5, R6, R7, R8, R16, R17, R18, R19, R20, R21, R22, R23, R24, R25, R27,
 //Non-Volitile
-     R9, R10, R11, R12, R13, R14, R15, R26, /*R28,*/ R29, R30, R31]>;
+     R9, R10, R11, R12, R13, R14, R15, R26, /*R28,*/ R29, R30 /*, R31*/ ]>;
 //R28 is reserved for the assembler
 
 //Don't allocate 15, 29, 30, 31
 //Allocation volatiles only for now
 def FPRC : RegisterClass<f64, 64, [F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, 
 	F10, F11, F12, F13, F14, F15, F16, F17, F18, F19,
-	F20, F21, F22, F23, F24, F25, F26, F27, F28, F29, F30, F31]>;
+	F20, F21, F22, F23, F24, F25, F26, F27, F28, F29, F30]>;
 
 






More information about the llvm-commits mailing list