aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/Alpha/AlphaRegisterInfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Target/Alpha/AlphaRegisterInfo.cpp')
-rw-r--r--lib/Target/Alpha/AlphaRegisterInfo.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/Target/Alpha/AlphaRegisterInfo.cpp b/lib/Target/Alpha/AlphaRegisterInfo.cpp
index 4f0e1d2c88..f7c3e5402c 100644
--- a/lib/Target/Alpha/AlphaRegisterInfo.cpp
+++ b/lib/Target/Alpha/AlphaRegisterInfo.cpp
@@ -226,8 +226,16 @@ void AlphaRegisterInfo::emitPrologue(MachineFunction &MF) const {
MachineFrameInfo *MFI = MF.getFrameInfo();
bool FP = hasFP(MF);
+ static int curgpdist = 0;
+
//handle GOP offset
- BuildMI(MBB, MBBI, Alpha::LDGP, 0);
+ BuildMI(MBB, MBBI, Alpha::LDAHg, 3, Alpha::R29)
+ .addGlobalAddress(const_cast<Function*>(MF.getFunction()))
+ .addReg(Alpha::R27).addImm(++curgpdist);
+ BuildMI(MBB, MBBI, Alpha::LDAg, 3, Alpha::R29)
+ .addGlobalAddress(const_cast<Function*>(MF.getFunction()))
+ .addReg(Alpha::R29).addImm(curgpdist);
+
//evil const_cast until MO stuff setup to handle const
BuildMI(MBB, MBBI, Alpha::ALTENT, 1).addGlobalAddress(const_cast<Function*>(MF.getFunction()), true);