mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-26 04:32:44 +01:00
[AArch64][Inline-Asm] Return the 32-bit floating point register class
when constraint "w" is used on a 32-bit operand. This enables compiling the following code, which used to error out in the backend: void foo1(int a) { asm volatile ("sqxtn h0, %s0\n" : : "w"(a):); } Fixes PR28633. llvm-svn: 276344
This commit is contained in:
parent
adecc6a299
commit
614eb1eca4
@ -4703,7 +4703,7 @@ AArch64TargetLowering::getRegForInlineAsmConstraint(
|
||||
return std::make_pair(0U, &AArch64::GPR64commonRegClass);
|
||||
return std::make_pair(0U, &AArch64::GPR32commonRegClass);
|
||||
case 'w':
|
||||
if (VT == MVT::f32)
|
||||
if (VT.getSizeInBits() == 32)
|
||||
return std::make_pair(0U, &AArch64::FPR32RegClass);
|
||||
if (VT.getSizeInBits() == 64)
|
||||
return std::make_pair(0U, &AArch64::FPR64RegClass);
|
||||
|
@ -246,3 +246,11 @@ define <4 x float> @test_vreg_128bit(<4 x float> %in) nounwind {
|
||||
; CHECK fadd v14.4s, v0.4s, v0.4s:
|
||||
ret <4 x float> %1
|
||||
}
|
||||
|
||||
define void @test_constraint_w(i32 %a) {
|
||||
; CHECK: fmov [[SREG:s[0-9]+]], {{w[0-9]+}}
|
||||
; CHECK: sqxtn h0, [[SREG]]
|
||||
|
||||
tail call void asm sideeffect "sqxtn h0, ${0:s}\0A", "w"(i32 %a)
|
||||
ret void
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user