[llvm-commits] CVS: llvm/lib/Target/X86/X86ISelLowering.cpp
Chris Lattner
sabre at nondot.org
Tue Oct 31 11:42:59 PST 2006
Changes in directory llvm/lib/Target/X86:
X86ISelLowering.cpp updated: 1.284 -> 1.285
---
Log message:
handle "st" as "st(0)"
---
Diffs of the changes: (+12 -3)
X86ISelLowering.cpp | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
Index: llvm/lib/Target/X86/X86ISelLowering.cpp
diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.284 llvm/lib/Target/X86/X86ISelLowering.cpp:1.285
--- llvm/lib/Target/X86/X86ISelLowering.cpp:1.284 Tue Oct 31 02:31:24 2006
+++ llvm/lib/Target/X86/X86ISelLowering.cpp Tue Oct 31 13:42:44 2006
@@ -32,6 +32,7 @@
#include "llvm/Support/MathExtras.h"
#include "llvm/Target/TargetOptions.h"
#include "llvm/Support/CommandLine.h"
+#include "llvm/ADT/StringExtras.h"
using namespace llvm;
// FIXME: temporary.
@@ -5532,9 +5533,17 @@
// constraint into a member of a register class.
std::pair<unsigned, const TargetRegisterClass*> Res;
Res = TargetLowering::getRegForInlineAsmConstraint(Constraint, VT);
-
- // Not found? Bail out.
- if (Res.second == 0) return Res;
+
+ // Not found as a standard register?
+ if (Res.second == 0) {
+ // GCC calls "st(0)" just plain "st".
+ if (StringsEqualNoCase("{st}", Constraint)) {
+ Res.first = X86::ST0;
+ Res.second = X86::RSTRegisterClass;
+ }
+
+ return Res;
+ }
// Otherwise, check to see if this is a register class of the wrong value
// type. For example, we want to map "{ax},i32" -> {eax}, we don't want it to
More information about the llvm-commits
mailing list