From eca405c6ff03fda968effe2458f21a4a23974fe5 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 26 Apr 2008 23:02:14 +0000 Subject: A few inline asm cleanups: - Make targetlowering.h fit in 80 cols. - Make LowerAsmOperandForConstraint const. - Make lowerXConstraint -> LowerXConstraint - Make LowerXConstraint return a const char* instead of taking a string byref. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50312 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/X86ISelLowering.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'lib/Target/X86/X86ISelLowering.cpp') diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp index 8d37663..5b606f2 100644 --- a/lib/Target/X86/X86ISelLowering.cpp +++ b/lib/Target/X86/X86ISelLowering.cpp @@ -6280,17 +6280,18 @@ X86TargetLowering::getConstraintType(const std::string &Constraint) const { /// LowerXConstraint - try to replace an X constraint, which matches anything, /// with another that has more specific requirements based on the type of the /// corresponding operand. -void X86TargetLowering::lowerXConstraint(MVT::ValueType ConstraintVT, - std::string& s) const { +const char *X86TargetLowering:: +LowerXConstraint(MVT::ValueType ConstraintVT) const { + // FP X constraints get lowered to SSE1/2 registers if available, otherwise + // 'f' like normal targets. if (MVT::isFloatingPoint(ConstraintVT)) { if (Subtarget->hasSSE2()) - s = "Y"; - else if (Subtarget->hasSSE1()) - s = "x"; - else - s = "f"; - } else - return TargetLowering::lowerXConstraint(ConstraintVT, s); + return "Y"; + if (Subtarget->hasSSE1()) + return "x"; + } + + return TargetLowering::LowerXConstraint(ConstraintVT); } /// LowerAsmOperandForConstraint - Lower the specified operand into the Ops @@ -6298,7 +6299,7 @@ void X86TargetLowering::lowerXConstraint(MVT::ValueType ConstraintVT, void X86TargetLowering::LowerAsmOperandForConstraint(SDOperand Op, char Constraint, std::vector&Ops, - SelectionDAG &DAG) { + SelectionDAG &DAG) const { SDOperand Result(0, 0); switch (Constraint) { -- cgit v1.1