diff options
Diffstat (limited to 'llvm/lib/Target/X86/X86ISelLowering.cpp')
| -rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index 90408c8da33..229810d0ffd 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -5701,6 +5701,22 @@ X86TargetLowering::getConstraintType(const std::string &Constraint) const { return TargetLowering::getConstraintType(Constraint); } +/// 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 { + if (MVT::isFloatingPoint(ConstraintVT)) { + if (Subtarget->hasSSE2()) + s = "Y"; + else if (Subtarget->hasSSE1()) + s = "x"; + else + s = "f"; + } else + return TargetLowering::lowerXConstraint(ConstraintVT, s); +} + /// LowerAsmOperandForConstraint - Lower the specified operand into the Ops /// vector. If it is invalid, don't add anything to Ops. void X86TargetLowering::LowerAsmOperandForConstraint(SDOperand Op, |

