Skip to content

Commit 483b0e9

Browse files
committed
CodeGen: add sensible defaults for the ISD::FROUND operation
Some exotic types didn't know how to handle FROUND, which ARM64 uses. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205088 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent bc702ae commit 483b0e9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/CodeGen/TargetLoweringBase.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,11 @@ static void InitLibcallNames(const char **Names, const TargetMachine &TM) {
205205
Names[RTLIB::FLOOR_F80] = "floorl";
206206
Names[RTLIB::FLOOR_F128] = "floorl";
207207
Names[RTLIB::FLOOR_PPCF128] = "floorl";
208+
Names[RTLIB::ROUND_F32] = "roundf";
209+
Names[RTLIB::ROUND_F64] = "round";
210+
Names[RTLIB::ROUND_F80] = "roundl";
211+
Names[RTLIB::ROUND_F128] = "roundl";
212+
Names[RTLIB::ROUND_PPCF128] = "roundl";
208213
Names[RTLIB::COPYSIGN_F32] = "copysignf";
209214
Names[RTLIB::COPYSIGN_F64] = "copysign";
210215
Names[RTLIB::COPYSIGN_F80] = "copysignl";
@@ -760,6 +765,7 @@ void TargetLoweringBase::initActions() {
760765
setOperationAction(ISD::FCEIL, MVT::f16, Expand);
761766
setOperationAction(ISD::FRINT, MVT::f16, Expand);
762767
setOperationAction(ISD::FTRUNC, MVT::f16, Expand);
768+
setOperationAction(ISD::FROUND, MVT::f16, Expand);
763769
setOperationAction(ISD::FLOG , MVT::f32, Expand);
764770
setOperationAction(ISD::FLOG2, MVT::f32, Expand);
765771
setOperationAction(ISD::FLOG10, MVT::f32, Expand);
@@ -770,6 +776,7 @@ void TargetLoweringBase::initActions() {
770776
setOperationAction(ISD::FCEIL, MVT::f32, Expand);
771777
setOperationAction(ISD::FRINT, MVT::f32, Expand);
772778
setOperationAction(ISD::FTRUNC, MVT::f32, Expand);
779+
setOperationAction(ISD::FROUND, MVT::f32, Expand);
773780
setOperationAction(ISD::FLOG , MVT::f64, Expand);
774781
setOperationAction(ISD::FLOG2, MVT::f64, Expand);
775782
setOperationAction(ISD::FLOG10, MVT::f64, Expand);
@@ -780,6 +787,7 @@ void TargetLoweringBase::initActions() {
780787
setOperationAction(ISD::FCEIL, MVT::f64, Expand);
781788
setOperationAction(ISD::FRINT, MVT::f64, Expand);
782789
setOperationAction(ISD::FTRUNC, MVT::f64, Expand);
790+
setOperationAction(ISD::FROUND, MVT::f64, Expand);
783791
setOperationAction(ISD::FLOG , MVT::f128, Expand);
784792
setOperationAction(ISD::FLOG2, MVT::f128, Expand);
785793
setOperationAction(ISD::FLOG10, MVT::f128, Expand);
@@ -790,6 +798,7 @@ void TargetLoweringBase::initActions() {
790798
setOperationAction(ISD::FCEIL, MVT::f128, Expand);
791799
setOperationAction(ISD::FRINT, MVT::f128, Expand);
792800
setOperationAction(ISD::FTRUNC, MVT::f128, Expand);
801+
setOperationAction(ISD::FROUND, MVT::f128, Expand);
793802

794803
// Default ISD::TRAP to expand (which turns it into abort).
795804
setOperationAction(ISD::TRAP, MVT::Other, Expand);

0 commit comments

Comments
 (0)