Skip to content

Commit bfa7de0

Browse files
authored
X86: Support FCANONICALIZE on f64/f80 for i686 with SSE2 or AVX (#123917)
Currently, FCANONICALIZE is not enabled for f64 with SSE2, and is not enabled for f80 for 32bit system. Let's enable them.
1 parent c9637af commit bfa7de0

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);
@@ -889,6 +888,7 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM,
889888
setOperationAction(ISD::STRICT_FMUL , MVT::f80, Legal);
890889
setOperationAction(ISD::STRICT_FDIV , MVT::f80, Legal);
891890
setOperationAction(ISD::STRICT_FSQRT , MVT::f80, Legal);
891+
setOperationAction(ISD::FCANONICALIZE , MVT::f80, Custom);
892892
if (isTypeLegal(MVT::f16)) {
893893
setOperationAction(ISD::FP_EXTEND, MVT::f80, Custom);
894894
setOperationAction(ISD::STRICT_FP_EXTEND, MVT::f80, Custom);

0 commit comments

Comments
 (0)