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

Andrew Lenharth alenhar2 at cs.uiuc.edu
Mon Feb 7 15:02:38 PST 2005



Changes in directory llvm/lib/Target/Alpha:

AlphaISelPattern.cpp updated: 1.45 -> 1.46
AlphaInstrInfo.td updated: 1.21 -> 1.22
---
Log message:

fix store issue and an FP conversion (segfault) issue

---
Diffs of the changes:  (+21 -11)

 AlphaISelPattern.cpp |   30 ++++++++++++++++++++----------
 AlphaInstrInfo.td    |    2 +-
 2 files changed, 21 insertions(+), 11 deletions(-)


Index: llvm/lib/Target/Alpha/AlphaISelPattern.cpp
diff -u llvm/lib/Target/Alpha/AlphaISelPattern.cpp:1.45 llvm/lib/Target/Alpha/AlphaISelPattern.cpp:1.46
--- llvm/lib/Target/Alpha/AlphaISelPattern.cpp:1.45	Mon Feb  7 00:31:44 2005
+++ llvm/lib/Target/Alpha/AlphaISelPattern.cpp	Mon Feb  7 17:02:23 2005
@@ -1164,14 +1164,16 @@
 
 void ISel::Select(SDOperand N) {
   unsigned Tmp1, Tmp2, Opc;
+  unsigned opcode = N.getOpcode();
 
   // FIXME: Disable for our current expansion model!
   if (/*!N->hasOneUse() &&*/ !ExprMap.insert(std::make_pair(N, notIn)).second)
     return;  // Already selected.
 
   SDNode *Node = N.Val;
+  
 
-  switch (N.getOpcode()) {
+  switch (opcode) {
 
   default:
     Node->dump(); std::cerr << "\n";
@@ -1267,16 +1269,24 @@
       Select(Chain);
 
       Tmp1 = SelectExpr(Value); //value
-      switch(Value.getValueType()) {
-      default: assert(0 && "unknown Type in store");
-      case MVT::i64: Opc = Alpha::STQ; break;
-      case MVT::f64: Opc = Alpha::STT; break;
-      case MVT::f32: Opc = Alpha::STS; break;
-      case MVT::i1: //FIXME: DAG does not promote this load
-      case MVT::i8: Opc = Alpha::STB; break;
-      case MVT::i16: Opc = Alpha::STW; break;
-      case MVT::i32: Opc = Alpha::STL; break;
+
+      if (opcode == ISD::STORE) {
+        switch(Value.getValueType()) {
+        default: assert(0 && "unknown Type in store");
+        case MVT::i64: Opc = Alpha::STQ; break;
+        case MVT::f64: Opc = Alpha::STT; break;
+        case MVT::f32: Opc = Alpha::STS; break;
+        }
+      } else { //ISD::TRUNCSTORE
+        switch(cast<MVTSDNode>(Node)->getExtraValueType()) {
+        default: assert(0 && "unknown Type in store");
+        case MVT::i1: //FIXME: DAG does not promote this load
+        case MVT::i8: Opc = Alpha::STB; break;
+        case MVT::i16: Opc = Alpha::STW; break;
+        case MVT::i32: Opc = Alpha::STL; break;
+        }
       }
+
       if (Address.getOpcode() == ISD::GlobalAddress)
         {
           AlphaLowering.restoreGP(BB);


Index: llvm/lib/Target/Alpha/AlphaInstrInfo.td
diff -u llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.21 llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.22
--- llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.21	Sun Feb  6 10:22:15 2005
+++ llvm/lib/Target/Alpha/AlphaInstrInfo.td	Mon Feb  7 17:02:23 2005
@@ -358,7 +358,7 @@
 //CVTQL F-P 17.030 Convert quadword to longword
 def CVTQS : FPForm<0x16, 0x0BC,  (ops FPRC:$RC, FPRC:$RA), "cvtqs $RA,$RC">; //Convert quadword to S_floating
 def CVTQT : FPForm<0x16, 0x0BE,  (ops FPRC:$RC, FPRC:$RA), "cvtqt $RA,$RC">; //Convert quadword to T_floating
-def CVTST : FPForm<0x16, 0x2AC, (ops FPRC:$RC, FPRC:$RA), "cvtst $RA,$RC">; //Convert S_floating to T_floating
+def CVTST : FPForm<0x16, 0x2AC, (ops FPRC:$RC, FPRC:$RA), "cvtsts $RA,$RC">; //Convert S_floating to T_floating (use completion, may not have function code for that set right)
 def CVTTQ : FPForm<0x16, 0x0AF,  (ops FPRC:$RC, FPRC:$RA), "cvttq $RA,$RC">; //Convert T_floating to quadword
 def CVTTS : FPForm<0x16, 0x2AC, (ops FPRC:$RC, FPRC:$RA), "cvtts $RA,$RC">; //Convert T_floating to S_floating
 






More information about the llvm-commits mailing list