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

Andrew Lenharth alenhar2 at cs.uiuc.edu
Tue Jan 25 17:24:53 PST 2005



Changes in directory llvm/lib/Target/Alpha:

AlphaISelPattern.cpp updated: 1.4 -> 1.5
AlphaInstrInfo.td updated: 1.3 -> 1.4
---
Log message:

add some operations, fix others.  should compile several more tests now

---
Diffs of the changes:  (+26 -5)

 AlphaISelPattern.cpp |   17 ++++++++++++++++-
 AlphaInstrInfo.td    |   14 ++++++++++----
 2 files changed, 26 insertions(+), 5 deletions(-)


Index: llvm/lib/Target/Alpha/AlphaISelPattern.cpp
diff -u llvm/lib/Target/Alpha/AlphaISelPattern.cpp:1.4 llvm/lib/Target/Alpha/AlphaISelPattern.cpp:1.5
--- llvm/lib/Target/Alpha/AlphaISelPattern.cpp:1.4	Tue Jan 25 13:58:40 2005
+++ llvm/lib/Target/Alpha/AlphaISelPattern.cpp	Tue Jan 25 19:24:38 2005
@@ -50,6 +50,10 @@
       setOperationAction(ISD::SEXTLOAD         , MVT::i8   , Expand);
       setOperationAction(ISD::SEXTLOAD         , MVT::i16  , Expand);
 
+      setOperationAction(ISD::ZERO_EXTEND_INREG, MVT::i1, Expand);
+      setOperationAction(ISD::SIGN_EXTEND_INREG, MVT::i1, Expand);
+
+
       computeRegisterProperties();
       
       //      addLegalFPImmediate(+0.0); // FLD0
@@ -654,9 +658,20 @@
       }
 
   case ISD::UREM:
+  case ISD::SREM:
+  case ISD::SDIV:
+  case ISD::UDIV:
+    //FIXME: alpha really doesn't support any of these operations, 
+    // the ops are expanded into special library calls with
+    // special calling conventions
+    switch(N.getOpcode()) {
+    case UREM: Opc = Alpha::REMQU; break;
+    case SREM: Opc = Alpha::REMQ; break;
+    case UDIV: Opc = Alpha::DIVQU; break;
+    case SDIV: Opc = Alpha::DIVQ; break;
     Tmp1 = SelectExpr(N.getOperand(0));
     Tmp2 = SelectExpr(N.getOperand(1));
-        BuildMI(BB, Alpha::REMQU, 2, Result).addReg(Tmp1).addReg(Tmp2);
+    BuildMI(BB, Opc, 2, Result).addReg(Tmp1).addReg(Tmp2);
     return Result;
 
   case ISD::SELECT:


Index: llvm/lib/Target/Alpha/AlphaInstrInfo.td
diff -u llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.3 llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.4
--- llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.3	Mon Jan 24 18:35:34 2005
+++ llvm/lib/Target/Alpha/AlphaInstrInfo.td	Tue Jan 25 19:24:38 2005
@@ -50,22 +50,28 @@
 let isReturn = 1, isTerminator = 1 in
   def RETURN : PseudoInstAlpha<(ops ), "ret $$31,($$26),1">; //Return from subroutine
 
-def LOAD_IMM : PseudoInstAlpha<(ops GPRC:$RC, s64imm:$IMM), "ldiq $RC,$IMM">; //Load Immediate Quadword
+let Uses = [R28] in
+  def LOAD_IMM : PseudoInstAlpha<(ops GPRC:$RC, s64imm:$IMM), "ldiq $RC,$IMM">; //Load Immediate Quadword
 
-let Uses = [R29] in
+let Uses = [R29, R28] in
   def STORE : PseudoInstAlpha<(ops GPRC:$RA, s64imm:$DISP), "stq $RA,$DISP">; //Store quadword
 
-let Uses = [R29] in
+let Uses = [R29, R28] in
   def LOAD_ADDR : PseudoInstAlpha<(ops GPRC:$RA, s64imm:$DISP), "lda $RA,$DISP">;  //Load address
 
-let Uses = [R29] in
+let Uses = [R29, R28] in
   def LOAD : PseudoInstAlpha<(ops GPRC:$RA, s64imm:$DISP), "ldq $RA,$DISP">; //Load quadword
 
 def LDW : PseudoInstAlpha<(ops GPRC:$RA, s16imm:$DISP, GPRC:$RB), "ldw $RA,$DISP($RB)">; // Load sign-extended word
 def LDB : PseudoInstAlpha<(ops GPRC:$RA, s16imm:$DISP, GPRC:$RB), "ldb $RA,$DISP($RB)">; //Load byte
 
 let Uses = [R28, R23, R24, R25, R26] in
+{
   def REMQU : PseudoInstAlpha<(ops GPRC:$RC, GPRC:$RA, GPRC:$RB), "remqu $RA,$RB,$RC">; //unsigned remander
+  def REMQ  : PseudoInstAlpha<(ops GPRC:$RC, GPRC:$RA, GPRC:$RB), "remq $RA,$RB,$RC">; //unsigned remander
+  def DIVQU : PseudoInstAlpha<(ops GPRC:$RC, GPRC:$RA, GPRC:$RB), "divqu $RA,$RB,$RC">; //unsigned remander
+  def DIVQ  : PseudoInstAlpha<(ops GPRC:$RC, GPRC:$RA, GPRC:$RB), "divq $RA,$RB,$RC">; //unsigned remander
+}
 
 //***********************
 //Real instructions






More information about the llvm-commits mailing list