diff options
author | Andrew Lenharth <andrewl@lenharth.org> | 2005-06-29 00:39:17 +0000 |
---|---|---|
committer | Andrew Lenharth <andrewl@lenharth.org> | 2005-06-29 00:39:17 +0000 |
commit | fce587e58b88d1a10921c09acc6951b2e38d76f6 (patch) | |
tree | 33251cc3385e7d180c94f2105a95027533be4f56 /lib/Target/Alpha/AlphaISelPattern.cpp | |
parent | c7989cef9d5cff8172bec2fb2dd9e41d6d3b4221 (diff) |
support more relocations for stores also
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22306 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Alpha/AlphaISelPattern.cpp')
-rw-r--r-- | lib/Target/Alpha/AlphaISelPattern.cpp | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/lib/Target/Alpha/AlphaISelPattern.cpp b/lib/Target/Alpha/AlphaISelPattern.cpp index 112872c3e4..eef0d8410d 100644 --- a/lib/Target/Alpha/AlphaISelPattern.cpp +++ b/lib/Target/Alpha/AlphaISelPattern.cpp @@ -855,6 +855,13 @@ static unsigned GetRelVersion(unsigned opcode) case Alpha::LDL: return Alpha::LDLr; case Alpha::LDBU: return Alpha::LDBUr; case Alpha::LDWU: return Alpha::LDWUr; + case Alpha::STB: return Alpha::STBr; + case Alpha::STW: return Alpha::STWr; + case Alpha::STL: return Alpha::STLr; + case Alpha::STQ: return Alpha::STQr; + case Alpha::STS: return Alpha::STSr; + case Alpha::STT: return Alpha::STTr; + } } @@ -2302,7 +2309,24 @@ void AlphaISel::Select(SDOperand N) { j = getFunctionOffset(BB->getParent()->getFunction()); } - if(Address.getOpcode() == ISD::FrameIndex) { + if (GlobalAddressSDNode *GASD = + dyn_cast<GlobalAddressSDNode>(Address)) { + if (GASD->getGlobal()->isExternal()) { + Tmp2 = SelectExpr(Address); + if (EnableAlphaLSMark) + BuildMI(BB, Alpha::MEMLABEL, 3).addImm(j).addImm(i).addImm(getUID()); + BuildMI(BB, Opc, 3).addReg(Tmp1).addImm(0).addReg(Tmp2); + } else { + Tmp2 = MakeReg(MVT::i64); + AlphaLowering.restoreGP(BB); + BuildMI(BB, Alpha::LDAHr, 2, Tmp2) + .addGlobalAddress(GASD->getGlobal()).addReg(Alpha::R29); + if (EnableAlphaLSMark) + BuildMI(BB, Alpha::MEMLABEL, 3).addImm(j).addImm(i).addImm(getUID()); + BuildMI(BB, GetRelVersion(Opc), 3).addReg(Tmp1) + .addGlobalAddress(GASD->getGlobal()).addReg(Tmp2); + } + } else if(Address.getOpcode() == ISD::FrameIndex) { if (EnableAlphaLSMark) BuildMI(BB, Alpha::MEMLABEL, 3).addImm(j).addImm(i).addImm(getUID()); BuildMI(BB, Opc, 3).addReg(Tmp1) |