mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-01 15:17:25 +00:00
[MIPS] OperationAction for FP_TO_FP16, FP16_TO_FP
Summary: Set operation action for FP16 conversion opcodes, so the Op legalizer can choose the gnu_* libcalls for Mips. Set LoadExtAction and TruncStoreAction for f16 scalars and vectors to prevent (fpext (load )) and (store (fptrunc)) from getting combined into unsupported operations. Added test cases to test that these operations are handled correctly for f16 scalars and vectors. This patch depends on http://reviews.llvm.org/D8755. Reviewers: srhines Subscribers: llvm-commits, ab Differential Revision: http://reviews.llvm.org/D8804 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235341 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -221,9 +221,23 @@ MipsTargetLowering::MipsTargetLowering(const MipsTargetMachine &TM,
|
||||
setLoadExtAction(ISD::SEXTLOAD, VT, MVT::i1, Promote);
|
||||
}
|
||||
|
||||
// MIPS doesn't have extending float->double load/store
|
||||
for (MVT VT : MVT::fp_valuetypes())
|
||||
// MIPS doesn't have extending float->double load/store. Set LoadExtAction
|
||||
// for f32, f16
|
||||
for (MVT VT : MVT::fp_valuetypes()) {
|
||||
setLoadExtAction(ISD::EXTLOAD, VT, MVT::f32, Expand);
|
||||
setLoadExtAction(ISD::EXTLOAD, VT, MVT::f16, Expand);
|
||||
}
|
||||
|
||||
// Set LoadExtAction for f16 vectors to Expand
|
||||
for (MVT VT : MVT::fp_vector_valuetypes()) {
|
||||
MVT F16VT = MVT::getVectorVT(MVT::f16, VT.getVectorNumElements());
|
||||
if (F16VT.isValid())
|
||||
setLoadExtAction(ISD::EXTLOAD, VT, F16VT, Expand);
|
||||
}
|
||||
|
||||
setTruncStoreAction(MVT::f32, MVT::f16, Expand);
|
||||
setTruncStoreAction(MVT::f64, MVT::f16, Expand);
|
||||
|
||||
setTruncStoreAction(MVT::f64, MVT::f32, Expand);
|
||||
|
||||
// Used by legalize types to correctly generate the setcc result.
|
||||
@@ -339,6 +353,12 @@ MipsTargetLowering::MipsTargetLowering(const MipsTargetMachine &TM,
|
||||
setOperationAction(ISD::FREM, MVT::f32, Expand);
|
||||
setOperationAction(ISD::FREM, MVT::f64, Expand);
|
||||
|
||||
// Lower f16 conversion operations into library calls
|
||||
setOperationAction(ISD::FP16_TO_FP, MVT::f32, Expand);
|
||||
setOperationAction(ISD::FP_TO_FP16, MVT::f32, Expand);
|
||||
setOperationAction(ISD::FP16_TO_FP, MVT::f64, Expand);
|
||||
setOperationAction(ISD::FP_TO_FP16, MVT::f64, Expand);
|
||||
|
||||
setOperationAction(ISD::EH_RETURN, MVT::Other, Custom);
|
||||
|
||||
setOperationAction(ISD::VASTART, MVT::Other, Custom);
|
||||
|
||||
Reference in New Issue
Block a user