Skip to content

Commit 358924c

Browse files
committed
X86: Support FCANONICALIZE on f64/f80 for i686 with SSE2 or AVX
1 parent 76b0187 commit 358924c

File tree

2 files changed

+335
-5
lines changed

2 files changed

+335
-5
lines changed

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,10 +334,10 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM,
334334
setOperationAction(ISD::FP_TO_SINT_SAT, VT, Custom);
335335
}
336336
setOperationAction(ISD::FCANONICALIZE, MVT::f32, Custom);
337+
setOperationAction(ISD::FCANONICALIZE, MVT::f64, Custom);
337338
if (Subtarget.is64Bit()) {
338339
setOperationAction(ISD::FP_TO_UINT_SAT, MVT::i64, Custom);
339340
setOperationAction(ISD::FP_TO_SINT_SAT, MVT::i64, Custom);
340-
setOperationAction(ISD::FCANONICALIZE, MVT::f64, Custom);
341341
}
342342
}
343343
if (Subtarget.hasAVX10_2()) {
@@ -367,7 +367,6 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM,
367367
setOperationAction(ISD::BITCAST , MVT::f32 , Expand);
368368
setOperationAction(ISD::BITCAST , MVT::i32 , Expand);
369369
setOperationAction(ISD::FCANONICALIZE, MVT::f32, Custom);
370-
setOperationAction(ISD::FCANONICALIZE, MVT::f80, Custom);
371370
setOperationAction(ISD::FCANONICALIZE, MVT::f64, Custom);
372371
if (Subtarget.is64Bit()) {
373372
setOperationAction(ISD::BITCAST , MVT::f64 , Expand);
@@ -890,6 +889,7 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM,
890889
setOperationAction(ISD::STRICT_FMUL , MVT::f80, Legal);
891890
setOperationAction(ISD::STRICT_FDIV , MVT::f80, Legal);
892891
setOperationAction(ISD::STRICT_FSQRT , MVT::f80, Legal);
892+
setOperationAction(ISD::FCANONICALIZE , MVT::f80, Custom);
893893
if (isTypeLegal(MVT::f16)) {
894894
setOperationAction(ISD::FP_EXTEND, MVT::f80, Custom);
895895
setOperationAction(ISD::STRICT_FP_EXTEND, MVT::f80, Custom);

0 commit comments

Comments
 (0)