From c011d3154350b087c566e24f0a0354aeb2f35917 Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Fri, 1 Jul 2011 00:30:46 +0000 Subject: [PATCH] Add support for the ARM 't' register constraint. And another testcase for the 'x' register constraint. Part of rdar://9119939 llvm-svn: 134220 --- llvm/lib/Target/ARM/ARMISelLowering.cpp | 5 +++++ llvm/test/CodeGen/ARM/inlineasm3.ll | 20 ++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/llvm/lib/Target/ARM/ARMISelLowering.cpp b/llvm/lib/Target/ARM/ARMISelLowering.cpp index 1141f42f14dc..4a78ad4bf2db 100644 --- a/llvm/lib/Target/ARM/ARMISelLowering.cpp +++ b/llvm/lib/Target/ARM/ARMISelLowering.cpp @@ -7484,6 +7484,7 @@ ARMTargetLowering::getConstraintType(const std::string &Constraint) const { case 'w': return C_RegisterClass; case 'h': return C_RegisterClass; case 'x': return C_RegisterClass; + case 't': return C_RegisterClass; } } else if (Constraint.size() == 2) { switch (Constraint[0]) { @@ -7563,6 +7564,10 @@ ARMTargetLowering::getRegForInlineAsmConstraint(const std::string &Constraint, if (VT.getSizeInBits() == 128) return RCPair(0U, ARM::QPR_8RegisterClass); break; + case 't': + if (VT == MVT::f32) + return RCPair(0U, ARM::SPRRegisterClass); + break; } } if (StringRef("{cc}").equals_lower(Constraint)) diff --git a/llvm/test/CodeGen/ARM/inlineasm3.ll b/llvm/test/CodeGen/ARM/inlineasm3.ll index f09deb39f8c8..00257e1cdb3e 100644 --- a/llvm/test/CodeGen/ARM/inlineasm3.ll +++ b/llvm/test/CodeGen/ARM/inlineasm3.ll @@ -68,3 +68,23 @@ entry: %0 = tail call float asm "flds s15, $0", "=x"() nounwind ret float %0 } + +; Radar 9307836 & 9119939 + +define double @t7(double %y) nounwind ssp { +entry: +; CHECK: t7 +; CHECK: flds s15, d0 + %0 = tail call double asm "flds s15, $0", "=x"() nounwind + ret double %0 +} + +; Radar 9307836 & 9119939 + +define float @t8(float %y) nounwind ssp { +entry: +; CHECK: t8 +; CHECK: flds s15, s0 + %0 = tail call float asm "flds s15, $0", "=t"() nounwind + ret float %0 +}