[llvm-commits] CVS: llvm/lib/Target/X86/X86ISelLowering.cpp X86ISelLowering.h

Chris Lattner lattner at cs.uiuc.edu
Mon Jul 10 19:54:16 PDT 2006



Changes in directory llvm/lib/Target/X86:

X86ISelLowering.cpp updated: 1.235 -> 1.236
X86ISelLowering.h updated: 1.68 -> 1.69
---
Log message:

Implement the inline asm 'A' constraint.  This implements PR825: http://llvm.org/PR825  and
CodeGen/X86/2006-07-10-InlineAsmAConstraint.ll


---
Diffs of the changes:  (+17 -1)

 X86ISelLowering.cpp |   16 +++++++++++++++-
 X86ISelLowering.h   |    2 ++
 2 files changed, 17 insertions(+), 1 deletion(-)


Index: llvm/lib/Target/X86/X86ISelLowering.cpp
diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.235 llvm/lib/Target/X86/X86ISelLowering.cpp:1.236
--- llvm/lib/Target/X86/X86ISelLowering.cpp:1.235	Mon Jul 10 16:37:44 2006
+++ llvm/lib/Target/X86/X86ISelLowering.cpp	Mon Jul 10 21:54:03 2006
@@ -4135,6 +4135,16 @@
 //                           X86 Inline Assembly Support
 //===----------------------------------------------------------------------===//
 
+/// getConstraintType - Given a constraint letter, return the type of
+/// constraint it is for this target.
+X86TargetLowering::ConstraintType
+X86TargetLowering::getConstraintType(char ConstraintLetter) const {
+  switch (ConstraintLetter) {
+  case 'A': return C_RegisterClass;
+  default: return TargetLowering::getConstraintType(ConstraintLetter);
+  }
+}
+
 std::vector<unsigned> X86TargetLowering::
 getRegClassForInlineAsmConstraint(const std::string &Constraint,
                                   MVT::ValueType VT) const {
@@ -4142,7 +4152,11 @@
     // FIXME: not handling fp-stack yet!
     // FIXME: not handling MMX registers yet ('y' constraint).
     switch (Constraint[0]) {      // GCC X86 Constraint Letters
-    default: break;  // Unknown constriant letter
+    default: break;  // Unknown constraint letter
+    case 'A':   // EAX/EDX
+      if (VT == MVT::i32 || VT == MVT::i64)
+        return make_vector<unsigned>(X86::EAX, X86::EDX, 0);
+      break;
     case 'r':   // GENERAL_REGS
     case 'R':   // LEGACY_REGS
       if (VT == MVT::i32)


Index: llvm/lib/Target/X86/X86ISelLowering.h
diff -u llvm/lib/Target/X86/X86ISelLowering.h:1.68 llvm/lib/Target/X86/X86ISelLowering.h:1.69
--- llvm/lib/Target/X86/X86ISelLowering.h:1.68	Fri Jul  7 03:33:52 2006
+++ llvm/lib/Target/X86/X86ISelLowering.h	Mon Jul 10 21:54:03 2006
@@ -310,6 +310,8 @@
     
     SDOperand getReturnAddressFrameIndex(SelectionDAG &DAG);
 
+    ConstraintType getConstraintType(char ConstraintLetter) const;
+     
     std::vector<unsigned> 
       getRegClassForInlineAsmConstraint(const std::string &Constraint,
                                         MVT::ValueType VT) const;






More information about the llvm-commits mailing list