mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-18 11:24:01 +00:00
Don't try to form FGETSIGN after legalization; it is possible in some cases, but the existing code can't do it correctly. PR11570.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146630 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -1792,7 +1792,8 @@ bool TargetLowering::SimplifyDemandedBits(SDValue Op,
|
|||||||
case ISD::BITCAST:
|
case ISD::BITCAST:
|
||||||
// If this is an FP->Int bitcast and if the sign bit is the only
|
// If this is an FP->Int bitcast and if the sign bit is the only
|
||||||
// thing demanded, turn this into a FGETSIGN.
|
// thing demanded, turn this into a FGETSIGN.
|
||||||
if (!Op.getValueType().isVector() &&
|
if (!TLO.LegalOperations() &&
|
||||||
|
!Op.getValueType().isVector() &&
|
||||||
!Op.getOperand(0).getValueType().isVector() &&
|
!Op.getOperand(0).getValueType().isVector() &&
|
||||||
NewMask == APInt::getSignBit(Op.getValueType().getSizeInBits()) &&
|
NewMask == APInt::getSignBit(Op.getValueType().getSizeInBits()) &&
|
||||||
Op.getOperand(0).getValueType().isFloatingPoint()) {
|
Op.getOperand(0).getValueType().isFloatingPoint()) {
|
||||||
|
@ -78,6 +78,22 @@ entry:
|
|||||||
ret i32 %shr.i
|
ret i32 %shr.i
|
||||||
}
|
}
|
||||||
|
|
||||||
|
; PR11570
|
||||||
|
define void @float_call_signbit(double %n) {
|
||||||
|
entry:
|
||||||
|
; FIXME: This should also use movmskps; we don't form the FGETSIGN node
|
||||||
|
; in this case, though.
|
||||||
|
; CHECK: float_call_signbit:
|
||||||
|
; CHECK: movd %xmm0, %rdi
|
||||||
|
; FIXME
|
||||||
|
%t0 = bitcast double %n to i64
|
||||||
|
%tobool.i.i.i.i = icmp slt i64 %t0, 0
|
||||||
|
tail call void @float_call_signbit_callee(i1 zeroext %tobool.i.i.i.i)
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
declare void @float_call_signbit_callee(i1 zeroext)
|
||||||
|
|
||||||
|
|
||||||
; rdar://10247336
|
; rdar://10247336
|
||||||
; movmskp{s|d} only set low 4/2 bits, high bits are known zero
|
; movmskp{s|d} only set low 4/2 bits, high bits are known zero
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user