llvm.org GIT mirror llvm / 2bb1e3e
Add libcalls for the new rounding opcodes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55133 91177308-0d34-0410-b5e6-96231b3b80d8 Dan Gohman 11 years ago
3 changed file(s) with 95 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
9696 POW_F64,
9797 POW_F80,
9898 POW_PPCF128,
99 CEIL_F32,
100 CEIL_F64,
101 CEIL_F80,
102 CEIL_PPCF128,
103 TRUNC_F32,
104 TRUNC_F64,
105 TRUNC_F80,
106 TRUNC_PPCF128,
107 RINT_F32,
108 RINT_F64,
109 RINT_F80,
110 RINT_PPCF128,
111 NEARBYINT_F32,
112 NEARBYINT_F64,
113 NEARBYINT_F80,
114 NEARBYINT_PPCF128,
115 FLOOR_F32,
116 FLOOR_F64,
117 FLOOR_F80,
118 FLOOR_PPCF128,
99119
100120 // CONVERSION
101121 FPEXT_F32_F64,
35283528 Result = DAG.getNode(ISD::SELECT, VT, Tmp2, Tmp1, Tmp3);
35293529 break;
35303530 }
3531 case ISD::FTRUNC:
3532 case ISD::FFLOOR:
3533 case ISD::FCEIL:
3534 case ISD::FRINT:
3535 case ISD::FNEARBYINT:
35313536 case ISD::FSQRT:
35323537 case ISD::FSIN:
35333538 case ISD::FCOS: {
35523557 case ISD::FCOS:
35533558 LC = GetFPLibCall(VT, RTLIB::COS_F32, RTLIB::COS_F64,
35543559 RTLIB::COS_F80, RTLIB::COS_PPCF128);
3560 break;
3561 case ISD::FTRUNC:
3562 LC = GetFPLibCall(VT, RTLIB::TRUNC_F32, RTLIB::TRUNC_F64,
3563 RTLIB::TRUNC_F80, RTLIB::TRUNC_PPCF128);
3564 break;
3565 case ISD::FFLOOR:
3566 LC = GetFPLibCall(VT, RTLIB::FLOOR_F32, RTLIB::FLOOR_F64,
3567 RTLIB::FLOOR_F80, RTLIB::FLOOR_PPCF128);
3568 break;
3569 case ISD::FCEIL:
3570 LC = GetFPLibCall(VT, RTLIB::CEIL_F32, RTLIB::CEIL_F64,
3571 RTLIB::CEIL_F80, RTLIB::CEIL_PPCF128);
3572 break;
3573 case ISD::FRINT:
3574 LC = GetFPLibCall(VT, RTLIB::RINT_F32, RTLIB::RINT_F64,
3575 RTLIB::RINT_F80, RTLIB::RINT_PPCF128);
3576 break;
3577 case ISD::FNEARBYINT:
3578 LC = GetFPLibCall(VT, RTLIB::NEARBYINT_F32, RTLIB::NEARBYINT_F64,
3579 RTLIB::NEARBYINT_F80, RTLIB::NEARBYINT_PPCF128);
35553580 break;
35563581 default: assert(0 && "Unreachable!");
35573582 }
41434168 case ISD::FSQRT:
41444169 case ISD::FSIN:
41454170 case ISD::FCOS:
4171 case ISD::FTRUNC:
4172 case ISD::FFLOOR:
4173 case ISD::FCEIL:
4174 case ISD::FRINT:
4175 case ISD::FNEARBYINT:
41464176 Tmp1 = PromoteOp(Node->getOperand(0));
41474177 assert(Tmp1.getValueType() == NVT);
41484178 Result = DAG.getNode(Node->getOpcode(), NVT, Tmp1);
65066536 RTLIB::POWI_PPCF128),
65076537 Node, false, Hi);
65086538 break;
6539 case ISD::FTRUNC:
6540 case ISD::FFLOOR:
6541 case ISD::FCEIL:
6542 case ISD::FRINT:
6543 case ISD::FNEARBYINT:
65096544 case ISD::FSQRT:
65106545 case ISD::FSIN:
65116546 case ISD::FCOS: {
65226557 case ISD::FCOS:
65236558 LC = GetFPLibCall(VT, RTLIB::COS_F32, RTLIB::COS_F64,
65246559 RTLIB::COS_F80, RTLIB::COS_PPCF128);
6560 break;
6561 case ISD::FTRUNC:
6562 LC = GetFPLibCall(VT, RTLIB::TRUNC_F32, RTLIB::TRUNC_F64,
6563 RTLIB::TRUNC_F80, RTLIB::TRUNC_PPCF128);
6564 break;
6565 case ISD::FFLOOR:
6566 LC = GetFPLibCall(VT, RTLIB::FLOOR_F32, RTLIB::FLOOR_F64,
6567 RTLIB::FLOOR_F80, RTLIB::FLOOR_PPCF128);
6568 break;
6569 case ISD::FCEIL:
6570 LC = GetFPLibCall(VT, RTLIB::CEIL_F32, RTLIB::CEIL_F64,
6571 RTLIB::CEIL_F80, RTLIB::CEIL_PPCF128);
6572 break;
6573 case ISD::FRINT:
6574 LC = GetFPLibCall(VT, RTLIB::RINT_F32, RTLIB::RINT_F64,
6575 RTLIB::RINT_F80, RTLIB::RINT_PPCF128);
6576 break;
6577 case ISD::FNEARBYINT:
6578 LC = GetFPLibCall(VT, RTLIB::NEARBYINT_F32, RTLIB::NEARBYINT_F64,
6579 RTLIB::NEARBYINT_F80, RTLIB::NEARBYINT_PPCF128);
65256580 break;
65266581 default: assert(0 && "Unreachable!");
65276582 }
9494 Names[RTLIB::POW_F64] = "pow";
9595 Names[RTLIB::POW_F80] = "powl";
9696 Names[RTLIB::POW_PPCF128] = "powl";
97 Names[RTLIB::CEIL_F32] = "ceilf";
98 Names[RTLIB::CEIL_F64] = "ceil";
99 Names[RTLIB::CEIL_F80] = "ceill";
100 Names[RTLIB::CEIL_PPCF128] = "ceill";
101 Names[RTLIB::TRUNC_F32] = "truncf";
102 Names[RTLIB::TRUNC_F64] = "trunc";
103 Names[RTLIB::TRUNC_F80] = "truncl";
104 Names[RTLIB::TRUNC_PPCF128] = "truncl";
105 Names[RTLIB::RINT_F32] = "rintf";
106 Names[RTLIB::RINT_F64] = "rint";
107 Names[RTLIB::RINT_F80] = "rintl";
108 Names[RTLIB::RINT_PPCF128] = "rintl";
109 Names[RTLIB::NEARBYINT_F32] = "nearbyintf";
110 Names[RTLIB::NEARBYINT_F64] = "nearbyint";
111 Names[RTLIB::NEARBYINT_F80] = "nearbyintl";
112 Names[RTLIB::NEARBYINT_PPCF128] = "nearbyintl";
113 Names[RTLIB::FLOOR_F32] = "floorf";
114 Names[RTLIB::FLOOR_F64] = "floor";
115 Names[RTLIB::FLOOR_F80] = "floorl";
116 Names[RTLIB::FLOOR_PPCF128] = "floorl";
97117 Names[RTLIB::FPEXT_F32_F64] = "__extendsfdf2";
98118 Names[RTLIB::FPROUND_F64_F32] = "__truncdfsf2";
99119 Names[RTLIB::FPROUND_F80_F32] = "__truncxfsf2";