[llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaISelPattern.cpp AlphaInstrInfo.td
Andrew Lenharth
alenhar2 at cs.uiuc.edu
Tue Jun 28 17:39:28 PDT 2005
Changes in directory llvm/lib/Target/Alpha:
AlphaISelPattern.cpp updated: 1.137 -> 1.138
AlphaInstrInfo.td updated: 1.49 -> 1.50
---
Log message:
support more relocations for stores also
---
Diffs of the changes: (+36 -1)
AlphaISelPattern.cpp | 26 +++++++++++++++++++++++++-
AlphaInstrInfo.td | 11 +++++++++++
2 files changed, 36 insertions(+), 1 deletion(-)
Index: llvm/lib/Target/Alpha/AlphaISelPattern.cpp
diff -u llvm/lib/Target/Alpha/AlphaISelPattern.cpp:1.137 llvm/lib/Target/Alpha/AlphaISelPattern.cpp:1.138
--- llvm/lib/Target/Alpha/AlphaISelPattern.cpp:1.137 Tue Jun 28 19:31:08 2005
+++ llvm/lib/Target/Alpha/AlphaISelPattern.cpp Tue Jun 28 19:39:17 2005
@@ -855,6 +855,13 @@
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 @@
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)
Index: llvm/lib/Target/Alpha/AlphaInstrInfo.td
diff -u llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.49 llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.50
--- llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.49 Tue Jun 28 19:31:08 2005
+++ llvm/lib/Target/Alpha/AlphaInstrInfo.td Tue Jun 28 19:39:17 2005
@@ -350,6 +350,17 @@
//Load quad, rellocated literal form
def LDQl : MForm<0x29, (ops GPRC:$RA, s16imm:$DISP, GPRC:$RB), "ldq $RA,$DISP($RB) !literal">; //Load quadword
+//Stores, int
+def STBr : MForm<0x0E, (ops GPRC:$RA, s16imm:$DISP, GPRC:$RB), "stb $RA,$DISP($RB) !gprellow">; // Store byte
+def STWr : MForm<0x0D, (ops GPRC:$RA, s16imm:$DISP, GPRC:$RB), "stw $RA,$DISP($RB) !gprellow">; // Store word
+def STLr : MForm<0x2C, (ops GPRC:$RA, s16imm:$DISP, GPRC:$RB), "stl $RA,$DISP($RB) !gprellow">; // Store longword
+def STQr : MForm<0x2D, (ops GPRC:$RA, s16imm:$DISP, GPRC:$RB), "stq $RA,$DISP($RB) !gprellow">; //Store quadword
+
+//Stores, float
+def STSr : MForm<0x26, (ops FPRC:$RA, s16imm:$DISP, GPRC:$RB), "sts $RA,$DISP($RB) !gprellow">; //Store S_floating
+def STTr : MForm<0x27, (ops FPRC:$RA, s16imm:$DISP, GPRC:$RB), "stt $RA,$DISP($RB) !gprellow">; //Store T_floating
+
+
//Branches, int
def BEQ : BForm<0x39, (ops GPRC:$RA, s21imm:$DISP), "beq $RA,$DISP">; //Branch if = zero
def BGE : BForm<0x3E, (ops GPRC:$RA, s21imm:$DISP), "bge $RA,$DISP">; //Branch if >= zero
More information about the llvm-commits
mailing list