mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 20:51:52 +01:00
[X86] Only allow f32, f64, or f80 to be used with 'f' inline assembly constraint.
Avoids crash when using i128. Gives better error than 'scalar-to-vector conversion failed' for other types.
This commit is contained in:
parent
d1c7a5a9fb
commit
892a44aaf7
@ -48541,7 +48541,9 @@ X86TargetLowering::getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI,
|
|||||||
return std::make_pair(0U, &X86::RFP32RegClass);
|
return std::make_pair(0U, &X86::RFP32RegClass);
|
||||||
if (VT == MVT::f64 && !isScalarFPTypeInSSEReg(VT))
|
if (VT == MVT::f64 && !isScalarFPTypeInSSEReg(VT))
|
||||||
return std::make_pair(0U, &X86::RFP64RegClass);
|
return std::make_pair(0U, &X86::RFP64RegClass);
|
||||||
return std::make_pair(0U, &X86::RFP80RegClass);
|
if (VT == MVT::f32 || VT == MVT::f64 || VT == MVT::f80)
|
||||||
|
return std::make_pair(0U, &X86::RFP80RegClass);
|
||||||
|
break;
|
||||||
case 'y': // MMX_REGS if MMX allowed.
|
case 'y': // MMX_REGS if MMX allowed.
|
||||||
if (!Subtarget.hasMMX()) break;
|
if (!Subtarget.hasMMX()) break;
|
||||||
return std::make_pair(0U, &X86::VR64RegClass);
|
return std::make_pair(0U, &X86::VR64RegClass);
|
||||||
|
@ -12,3 +12,10 @@ define void @fp80(x86_fp80) {
|
|||||||
tail call void asm sideeffect "", "r"(x86_fp80 %0)
|
tail call void asm sideeffect "", "r"(x86_fp80 %0)
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
|
; CHECK: error: couldn't allocate input reg for constraint 'f'
|
||||||
|
define void @f_constraint_i128(i128* %0) {
|
||||||
|
%2 = load i128, i128* %0, align 16
|
||||||
|
tail call void asm sideeffect "", "f"(i128 %2)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user