try to make a bug bugpointable, add yet more constant pool stuff, fixup constant...
authorAndrew Lenharth <andrewl@lenharth.org>
Wed, 2 Feb 2005 03:36:35 +0000 (03:36 +0000)
committerAndrew Lenharth <andrewl@lenharth.org>
Wed, 2 Feb 2005 03:36:35 +0000 (03:36 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19985 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Alpha/AlphaISelPattern.cpp
lib/Target/Alpha/AlphaInstrInfo.td

index e8de3c8bd7b0fbd0a1ab630056f340cc73765452..344117dd80a86be8e1bf135d0c0d6a0d8418f76c 100644 (file)
@@ -351,7 +351,7 @@ unsigned ISel::SelectExprFP(SDOperand N, unsigned Result)
        {
          Select(Chain);
          AlphaLowering.restoreGP(BB);
-         Opc = DestType == MVT::f64 ? Alpha::LDS : Alpha::LDT;
+         Opc = DestType == MVT::f64 ? Alpha::LDS_SYM : Alpha::LDT_SYM;
          BuildMI(BB, Opc, 1, Result).addGlobalAddress(cast<GlobalAddressSDNode>(Address)->getGlobal());
        }
       else if (ConstantPoolSDNode *CP = dyn_cast<ConstantPoolSDNode>(Address)) {
@@ -1046,19 +1046,25 @@ unsigned ISel::SelectExpr(SDOperand N) {
       SDOperand Chain   = N.getOperand(0);
       SDOperand Address = N.getOperand(1);
 
+      assert(DestType == MVT::i64 && "unknown Load dest type");
+
       if (Address.getOpcode() == ISD::GlobalAddress)
-       {
-         Select(Chain);
-         AlphaLowering.restoreGP(BB);
-         BuildMI(BB, Alpha::LOAD, 1, Result).addGlobalAddress(cast<GlobalAddressSDNode>(Address)->getGlobal());
-       }
+        {
+          Select(Chain);
+          AlphaLowering.restoreGP(BB);
+          BuildMI(BB, Alpha::LOAD, 1, Result).addGlobalAddress(cast<GlobalAddressSDNode>(Address)->getGlobal());
+        }
+      else if (ConstantPoolSDNode *CP = dyn_cast<ConstantPoolSDNode>(Address)) {
+        AlphaLowering.restoreGP(BB);
+        BuildMI(BB, Alpha::LOAD, 1, Result).addConstantPoolIndex(CP->getIndex());
+      }
       else
-       {
-         Select(Chain);
-         Tmp2 = SelectExpr(Address);
-         BuildMI(BB, Alpha::LDQ, 2, Result).addImm(0).addReg(Tmp2);
-       }
-      return Result;
+        {
+          Select(Chain);
+          Tmp2 = SelectExpr(Address);
+          BuildMI(BB, Alpha::LDQ, 2, Result).addImm(0).addReg(Tmp2);
+        }
+     return Result;
     }
   }
 
index fbf3d7196e1987b1cecfa59765512dd58994568c..b9e2cc34541f3bcf89926ff0edd7ee64b83db240 100644 (file)
@@ -266,7 +266,7 @@ def STL : MForm<0x2C, (ops GPRC:$RA, s16imm:$DISP, GPRC:$RB), "stl $RA,$DISP($RB
 def STQ : MForm<0x2D, (ops GPRC:$RA, s16imm:$DISP, GPRC:$RB), "stq $RA,$DISP($RB)">; //Store quadword
 
 //Loads, int
-def LDL : MForm<0x28, (ops GPRC:$RA, s16imm:$DISP, GPRC:$RB), "ldq $RA,$DISP($RB)">; // Load sign-extended longword
+def LDL : MForm<0x28, (ops GPRC:$RA, s16imm:$DISP, GPRC:$RB), "ldl $RA,$DISP($RB)">; // Load sign-extended longword
 def LDQ : MForm<0x29, (ops GPRC:$RA, s16imm:$DISP, GPRC:$RB), "ldq $RA,$DISP($RB)">; //Load quadword
 def LDBU : MForm<0x0A, (ops GPRC:$RA, s16imm:$DISP, GPRC:$RB), "ldbu $RA,$DISP($RB)">; //Load zero-extended byte
 def LDWU : MForm<0x0C, (ops GPRC:$RA, s16imm:$DISP, GPRC:$RB), "ldwu $RA,$DISP($RB)">; //Load zero-extended word