forked from OSchip/llvm-project
Let the inline asm 'q' constraint match float, and on 64-bit double too.
Fixes PR9602! llvm-svn: 134665
This commit is contained in:
parent
7a2a0f80de
commit
9badf60203
|
@ -12891,19 +12891,19 @@ X86TargetLowering::getRegForInlineAsmConstraint(const std::string &Constraint,
|
||||||
// in the normal allocation?
|
// in the normal allocation?
|
||||||
case 'q': // GENERAL_REGS in 64-bit mode, Q_REGS in 32-bit mode.
|
case 'q': // GENERAL_REGS in 64-bit mode, Q_REGS in 32-bit mode.
|
||||||
if (Subtarget->is64Bit()) {
|
if (Subtarget->is64Bit()) {
|
||||||
if (VT == MVT::i32)
|
if (VT == MVT::i32 || VT == MVT::f32)
|
||||||
return std::make_pair(0U, X86::GR32RegisterClass);
|
return std::make_pair(0U, X86::GR32RegisterClass);
|
||||||
else if (VT == MVT::i16)
|
else if (VT == MVT::i16)
|
||||||
return std::make_pair(0U, X86::GR16RegisterClass);
|
return std::make_pair(0U, X86::GR16RegisterClass);
|
||||||
else if (VT == MVT::i8)
|
else if (VT == MVT::i8)
|
||||||
return std::make_pair(0U, X86::GR8RegisterClass);
|
return std::make_pair(0U, X86::GR8RegisterClass);
|
||||||
else if (VT == MVT::i64)
|
else if (VT == MVT::i64 || VT == MVT::f64)
|
||||||
return std::make_pair(0U, X86::GR64RegisterClass);
|
return std::make_pair(0U, X86::GR64RegisterClass);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// 32-bit fallthrough
|
// 32-bit fallthrough
|
||||||
case 'Q': // Q_REGS
|
case 'Q': // Q_REGS
|
||||||
if (VT == MVT::i32)
|
if (VT == MVT::i32 || VT == MVT::f32)
|
||||||
return std::make_pair(0U, X86::GR32_ABCDRegisterClass);
|
return std::make_pair(0U, X86::GR32_ABCDRegisterClass);
|
||||||
else if (VT == MVT::i16)
|
else if (VT == MVT::i16)
|
||||||
return std::make_pair(0U, X86::GR16_ABCDRegisterClass);
|
return std::make_pair(0U, X86::GR16_ABCDRegisterClass);
|
||||||
|
|
|
@ -3,8 +3,20 @@
|
||||||
|
|
||||||
%0 = type { i64, i64, i64, i64, i64 } ; type %0
|
%0 = type { i64, i64, i64, i64, i64 } ; type %0
|
||||||
|
|
||||||
define void @t() nounwind {
|
define void @test1() nounwind {
|
||||||
entry:
|
entry:
|
||||||
%asmtmp = call %0 asm sideeffect "mov %cr0, $0 \0Amov %cr2, $1 \0Amov %cr3, $2 \0Amov %cr4, $3 \0Amov %cr8, $0 \0A", "=q,=q,=q,=q,=q,~{dirflag},~{fpsr},~{flags}"() nounwind ; <%0> [#uses=0]
|
%asmtmp = call %0 asm sideeffect "mov %cr0, $0 \0Amov %cr2, $1 \0Amov %cr3, $2 \0Amov %cr4, $3 \0Amov %cr8, $0 \0A", "=q,=q,=q,=q,=q,~{dirflag},~{fpsr},~{flags}"() nounwind ; <%0> [#uses=0]
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
|
; PR9602
|
||||||
|
define void @test2(float %tmp) nounwind {
|
||||||
|
call void asm sideeffect "$0", "q"(float %tmp) nounwind
|
||||||
|
call void asm sideeffect "$0", "Q"(float %tmp) nounwind
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
define void @test3(double %tmp) nounwind {
|
||||||
|
call void asm sideeffect "$0", "q"(double %tmp) nounwind
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue