aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/Alpha/AlphaRegisterInfo.cpp
diff options
context:
space:
mode:
authorAndrew Lenharth <andrewl@lenharth.org>2005-01-27 08:31:19 +0000
committerAndrew Lenharth <andrewl@lenharth.org>2005-01-27 08:31:19 +0000
commit04c868ef502d38c0f62549e5ef49987be6881b5d (patch)
tree5cbd6ba77da33ef6b7a5dd60c2141498b7e57cf4 /lib/Target/Alpha/AlphaRegisterInfo.cpp
parent10b400705dcdef25754b3c3c765c40c6513df1b1 (diff)
stack frame fix and zero FP reg fix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19857 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Alpha/AlphaRegisterInfo.cpp')
-rw-r--r--lib/Target/Alpha/AlphaRegisterInfo.cpp27
1 files changed, 17 insertions, 10 deletions
diff --git a/lib/Target/Alpha/AlphaRegisterInfo.cpp b/lib/Target/Alpha/AlphaRegisterInfo.cpp
index 0c5ca35202..e2cb4b0ad5 100644
--- a/lib/Target/Alpha/AlphaRegisterInfo.cpp
+++ b/lib/Target/Alpha/AlphaRegisterInfo.cpp
@@ -208,7 +208,7 @@ void AlphaRegisterInfo::emitPrologue(MachineFunction &MF) const {
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 @@ void AlphaRegisterInfo::emitPrologue(MachineFunction &MF) const {
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 @@ void AlphaRegisterInfo::emitEpilogue(MachineFunction &MF,
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();
+ }
}
}