[llvm-commits] [llvm] r57345 - /llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp

Anton Korobeynikov asl at math.spbu.ru
Fri Oct 10 03:14:47 PDT 2008


Author: asl
Date: Fri Oct 10 05:14:47 2008
New Revision: 57345

URL: http://llvm.org/viewvc/llvm-project?rev=57345&view=rev
Log:
Add dummy 'm' inline asm constraint handler for Sparc. I'm not sure, whether it is correct, however :)

Modified:
    llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp

Modified: llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp?rev=57345&r1=57344&r2=57345&view=diff

==============================================================================
--- llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp (original)
+++ llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp Fri Oct 10 05:14:47 2008
@@ -45,6 +45,12 @@
   bool SelectADDRri(SDValue Op, SDValue N, SDValue &Base,
                     SDValue &Offset);
 
+  /// SelectInlineAsmMemoryOperand - Implement addressing mode selection for
+  /// inline asm expressions.
+  virtual bool SelectInlineAsmMemoryOperand(const SDValue &Op,
+                                            char ConstraintCode,
+                                            std::vector<SDValue> &OutOps);
+
   /// InstructionSelect - This callback is invoked by
   /// SelectionDAGISel when it has created a SelectionDAG for us to codegen.
   virtual void InstructionSelect();
@@ -184,6 +190,26 @@
 }
 
 
+/// SelectInlineAsmMemoryOperand - Implement addressing mode selection for
+/// inline asm expressions.
+bool
+SparcDAGToDAGISel::SelectInlineAsmMemoryOperand(const SDValue &Op,
+                                                char ConstraintCode,
+                                                std::vector<SDValue> &OutOps) {
+  SDValue Op0, Op1;
+  switch (ConstraintCode) {
+  default: return true;
+  case 'm':   // memory
+   if (!SelectADDRrr(Op, Op, Op0, Op1))
+     SelectADDRri(Op, Op, Op0, Op1);
+   break;
+  }
+
+  OutOps.push_back(Op0);
+  OutOps.push_back(Op1);
+  return false;
+}
+
 /// createSparcISelDag - This pass converts a legalized DAG into a
 /// SPARC-specific DAG, ready for instruction scheduling.
 ///





More information about the llvm-commits mailing list