llvm.org GIT mirror llvm / 7794f2a
Add intrinsics for log, log2, log10, exp, exp2. No functional change (and no FE change to generate them). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55753 91177308-0d34-0410-b5e6-96231b3b80d8 Dale Johannesen 11 years ago
14 changed file(s) with 438 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
8484 SQRT_F64,
8585 SQRT_F80,
8686 SQRT_PPCF128,
87 LOG_F32,
88 LOG_F64,
89 LOG_F80,
90 LOG_PPCF128,
91 LOG2_F32,
92 LOG2_F64,
93 LOG2_F80,
94 LOG2_PPCF128,
95 LOG10_F32,
96 LOG10_F64,
97 LOG10_F80,
98 LOG10_PPCF128,
99 EXP_F32,
100 EXP_F64,
101 EXP_F80,
102 EXP_PPCF128,
103 EXP2_F32,
104 EXP2_F64,
105 EXP2_F80,
106 EXP2_PPCF128,
87107 SIN_F32,
88108 SIN_F64,
89109 SIN_F80,
425425 BIT_CONVERT,
426426
427427 // FNEG, FABS, FSQRT, FSIN, FCOS, FPOWI, FPOW,
428 // FLOG, FLOG2, FLOG10, FEXP, FEXP2,
428429 // FCEIL, FTRUNC, FRINT, FNEARBYINT, FFLOOR - Perform various unary floating
429430 // point operations. These are inspired by libm.
430431 FNEG, FABS, FSQRT, FSIN, FCOS, FPOWI, FPOW,
432 FLOG, FLOG2, FLOG10, FEXP, FEXP2,
431433 FCEIL, FTRUNC, FRINT, FNEARBYINT, FFLOOR,
432434
433435 // LOAD and STORE have token chains as their first operand, then the same
198198 def int_sin : Intrinsic<[llvm_anyfloat_ty, LLVMMatchType<0>]>;
199199 def int_cos : Intrinsic<[llvm_anyfloat_ty, LLVMMatchType<0>]>;
200200 def int_pow : Intrinsic<[llvm_anyfloat_ty,
201 LLVMMatchType<0>, LLVMMatchType<0>]>;
201 LLVMMatchType<0>, LLVMMatchType<0>]>;
202 def int_log : Intrinsic<[llvm_anyfloat_ty, LLVMMatchType<0>]>;
203 def int_log10: Intrinsic<[llvm_anyfloat_ty, LLVMMatchType<0>]>;
204 def int_log2 : Intrinsic<[llvm_anyfloat_ty, LLVMMatchType<0>]>;
205 def int_exp : Intrinsic<[llvm_anyfloat_ty, LLVMMatchType<0>]>;
206 def int_exp2 : Intrinsic<[llvm_anyfloat_ty, LLVMMatchType<0>]>;
202207 }
203208
204209 // NOTE: these are internal interfaces.
156156 case Type::FP128TyID:
157157 case Type::PPC_FP128TyID:
158158 EnsureFunctionExists(M, "powl", I->arg_begin(), I->arg_end(),
159 I->arg_begin()->getType());
160 }
161 break;
162 case Intrinsic::log:
163 switch((int)I->arg_begin()->getType()->getTypeID()) {
164 case Type::FloatTyID:
165 EnsureFunctionExists(M, "logf", I->arg_begin(), I->arg_end(),
166 Type::FloatTy);
167 case Type::DoubleTyID:
168 EnsureFunctionExists(M, "log", I->arg_begin(), I->arg_end(),
169 Type::DoubleTy);
170 case Type::X86_FP80TyID:
171 case Type::FP128TyID:
172 case Type::PPC_FP128TyID:
173 EnsureFunctionExists(M, "logl", I->arg_begin(), I->arg_end(),
174 I->arg_begin()->getType());
175 }
176 break;
177 case Intrinsic::log2:
178 switch((int)I->arg_begin()->getType()->getTypeID()) {
179 case Type::FloatTyID:
180 EnsureFunctionExists(M, "log2f", I->arg_begin(), I->arg_end(),
181 Type::FloatTy);
182 case Type::DoubleTyID:
183 EnsureFunctionExists(M, "log2", I->arg_begin(), I->arg_end(),
184 Type::DoubleTy);
185 case Type::X86_FP80TyID:
186 case Type::FP128TyID:
187 case Type::PPC_FP128TyID:
188 EnsureFunctionExists(M, "log2l", I->arg_begin(), I->arg_end(),
189 I->arg_begin()->getType());
190 }
191 break;
192 case Intrinsic::log10:
193 switch((int)I->arg_begin()->getType()->getTypeID()) {
194 case Type::FloatTyID:
195 EnsureFunctionExists(M, "log10f", I->arg_begin(), I->arg_end(),
196 Type::FloatTy);
197 case Type::DoubleTyID:
198 EnsureFunctionExists(M, "log10", I->arg_begin(), I->arg_end(),
199 Type::DoubleTy);
200 case Type::X86_FP80TyID:
201 case Type::FP128TyID:
202 case Type::PPC_FP128TyID:
203 EnsureFunctionExists(M, "log10l", I->arg_begin(), I->arg_end(),
204 I->arg_begin()->getType());
205 }
206 break;
207 case Intrinsic::exp:
208 switch((int)I->arg_begin()->getType()->getTypeID()) {
209 case Type::FloatTyID:
210 EnsureFunctionExists(M, "expf", I->arg_begin(), I->arg_end(),
211 Type::FloatTy);
212 case Type::DoubleTyID:
213 EnsureFunctionExists(M, "exp", I->arg_begin(), I->arg_end(),
214 Type::DoubleTy);
215 case Type::X86_FP80TyID:
216 case Type::FP128TyID:
217 case Type::PPC_FP128TyID:
218 EnsureFunctionExists(M, "expl", I->arg_begin(), I->arg_end(),
219 I->arg_begin()->getType());
220 }
221 break;
222 case Intrinsic::exp2:
223 switch((int)I->arg_begin()->getType()->getTypeID()) {
224 case Type::FloatTyID:
225 EnsureFunctionExists(M, "exp2f", I->arg_begin(), I->arg_end(),
226 Type::FloatTy);
227 case Type::DoubleTyID:
228 EnsureFunctionExists(M, "exp2", I->arg_begin(), I->arg_end(),
229 Type::DoubleTy);
230 case Type::X86_FP80TyID:
231 case Type::FP128TyID:
232 case Type::PPC_FP128TyID:
233 EnsureFunctionExists(M, "exp2l", I->arg_begin(), I->arg_end(),
159234 I->arg_begin()->getType());
160235 }
161236 break;
856931 }
857932 break;
858933 }
934 case Intrinsic::log: {
935 static Constant *logfFCache = 0;
936 static Constant *logFCache = 0;
937 static Constant *logLDCache = 0;
938 switch (CI->getOperand(1)->getType()->getTypeID()) {
939 default: assert(0 && "Invalid type in log"); abort();
940 case Type::FloatTyID:
941 ReplaceCallWith("logf", CI, CI->op_begin()+1, CI->op_end(),
942 Type::FloatTy, logfFCache);
943 break;
944 case Type::DoubleTyID:
945 ReplaceCallWith("log", CI, CI->op_begin()+1, CI->op_end(),
946 Type::DoubleTy, logFCache);
947 break;
948 case Type::X86_FP80TyID:
949 case Type::FP128TyID:
950 case Type::PPC_FP128TyID:
951 ReplaceCallWith("logl", CI, CI->op_begin()+1, CI->op_end(),
952 CI->getOperand(1)->getType(), logLDCache);
953 break;
954 }
955 break;
956 }
957 case Intrinsic::log2: {
958 static Constant *log2fFCache = 0;
959 static Constant *log2FCache = 0;
960 static Constant *log2LDCache = 0;
961 switch (CI->getOperand(1)->getType()->getTypeID()) {
962 default: assert(0 && "Invalid type in log2"); abort();
963 case Type::FloatTyID:
964 ReplaceCallWith("log2f", CI, CI->op_begin()+1, CI->op_end(),
965 Type::FloatTy, log2fFCache);
966 break;
967 case Type::DoubleTyID:
968 ReplaceCallWith("log2", CI, CI->op_begin()+1, CI->op_end(),
969 Type::DoubleTy, log2FCache);
970 break;
971 case Type::X86_FP80TyID:
972 case Type::FP128TyID:
973 case Type::PPC_FP128TyID:
974 ReplaceCallWith("log2l", CI, CI->op_begin()+1, CI->op_end(),
975 CI->getOperand(1)->getType(), log2LDCache);
976 break;
977 }
978 break;
979 }
980 case Intrinsic::log10: {
981 static Constant *log10fFCache = 0;
982 static Constant *log10FCache = 0;
983 static Constant *log10LDCache = 0;
984 switch (CI->getOperand(1)->getType()->getTypeID()) {
985 default: assert(0 && "Invalid type in log10"); abort();
986 case Type::FloatTyID:
987 ReplaceCallWith("log10f", CI, CI->op_begin()+1, CI->op_end(),
988 Type::FloatTy, log10fFCache);
989 break;
990 case Type::DoubleTyID:
991 ReplaceCallWith("log10", CI, CI->op_begin()+1, CI->op_end(),
992 Type::DoubleTy, log10FCache);
993 break;
994 case Type::X86_FP80TyID:
995 case Type::FP128TyID:
996 case Type::PPC_FP128TyID:
997 ReplaceCallWith("log10l", CI, CI->op_begin()+1, CI->op_end(),
998 CI->getOperand(1)->getType(), log10LDCache);
999 break;
1000 }
1001 break;
1002 }
1003 case Intrinsic::exp: {
1004 static Constant *expfFCache = 0;
1005 static Constant *expFCache = 0;
1006 static Constant *expLDCache = 0;
1007 switch (CI->getOperand(1)->getType()->getTypeID()) {
1008 default: assert(0 && "Invalid type in exp"); abort();
1009 case Type::FloatTyID:
1010 ReplaceCallWith("expf", CI, CI->op_begin()+1, CI->op_end(),
1011 Type::FloatTy, expfFCache);
1012 break;
1013 case Type::DoubleTyID:
1014 ReplaceCallWith("exp", CI, CI->op_begin()+1, CI->op_end(),
1015 Type::DoubleTy, expFCache);
1016 break;
1017 case Type::X86_FP80TyID:
1018 case Type::FP128TyID:
1019 case Type::PPC_FP128TyID:
1020 ReplaceCallWith("expl", CI, CI->op_begin()+1, CI->op_end(),
1021 CI->getOperand(1)->getType(), expLDCache);
1022 break;
1023 }
1024 break;
1025 }
1026 case Intrinsic::exp2: {
1027 static Constant *exp2fFCache = 0;
1028 static Constant *exp2FCache = 0;
1029 static Constant *exp2LDCache = 0;
1030 switch (CI->getOperand(1)->getType()->getTypeID()) {
1031 default: assert(0 && "Invalid type in exp2"); abort();
1032 case Type::FloatTyID:
1033 ReplaceCallWith("exp2f", CI, CI->op_begin()+1, CI->op_end(),
1034 Type::FloatTy, exp2fFCache);
1035 break;
1036 case Type::DoubleTyID:
1037 ReplaceCallWith("exp2", CI, CI->op_begin()+1, CI->op_end(),
1038 Type::DoubleTy, exp2FCache);
1039 break;
1040 case Type::X86_FP80TyID:
1041 case Type::FP128TyID:
1042 case Type::PPC_FP128TyID:
1043 ReplaceCallWith("exp2l", CI, CI->op_begin()+1, CI->op_end(),
1044 CI->getOperand(1)->getType(), exp2LDCache);
1045 break;
1046 }
1047 break;
1048 }
1049 case Intrinsic::pow: {
1050 static Constant *powfFCache = 0;
1051 static Constant *powFCache = 0;
1052 static Constant *powLDCache = 0;
1053 switch (CI->getOperand(1)->getType()->getTypeID()) {
1054 default: assert(0 && "Invalid type in pow"); abort();
1055 case Type::FloatTyID:
1056 ReplaceCallWith("powf", CI, CI->op_begin()+1, CI->op_end(),
1057 Type::FloatTy, powfFCache);
1058 break;
1059 case Type::DoubleTyID:
1060 ReplaceCallWith("pow", CI, CI->op_begin()+1, CI->op_end(),
1061 Type::DoubleTy, powFCache);
1062 break;
1063 case Type::X86_FP80TyID:
1064 case Type::FP128TyID:
1065 case Type::PPC_FP128TyID:
1066 ReplaceCallWith("powl", CI, CI->op_begin()+1, CI->op_end(),
1067 CI->getOperand(1)->getType(), powLDCache);
1068 break;
1069 }
1070 break;
1071 }
8591072 case Intrinsic::flt_rounds:
8601073 // Lower to "round to the nearest"
8611074 if (CI->getType() != Type::VoidTy)
34893489 case ISD::FSQRT:
34903490 case ISD::FSIN:
34913491 case ISD::FCOS:
3492 case ISD::FLOG:
3493 case ISD::FLOG2:
3494 case ISD::FLOG10:
3495 case ISD::FEXP:
3496 case ISD::FEXP2:
34923497 case ISD::FTRUNC:
34933498 case ISD::FFLOOR:
34943499 case ISD::FCEIL:
35253530 Result = DAG.getNode(ISD::SELECT, VT, Tmp2, Tmp1, Tmp3);
35263531 break;
35273532 }
3533 case ISD::FLOG:
3534 case ISD::FLOG2:
3535 case ISD::FLOG10:
3536 case ISD::FEXP:
3537 case ISD::FEXP2:
35283538 case ISD::FTRUNC:
35293539 case ISD::FFLOOR:
35303540 case ISD::FCEIL:
35543564 case ISD::FCOS:
35553565 LC = GetFPLibCall(VT, RTLIB::COS_F32, RTLIB::COS_F64,
35563566 RTLIB::COS_F80, RTLIB::COS_PPCF128);
3567 break;
3568 case ISD::FLOG:
3569 LC = GetFPLibCall(VT, RTLIB::LOG_F32, RTLIB::LOG_F64,
3570 RTLIB::LOG_F80, RTLIB::LOG_PPCF128);
3571 break;
3572 case ISD::FLOG2:
3573 LC = GetFPLibCall(VT, RTLIB::LOG2_F32, RTLIB::LOG2_F64,
3574 RTLIB::LOG2_F80, RTLIB::LOG2_PPCF128);
3575 break;
3576 case ISD::FLOG10:
3577 LC = GetFPLibCall(VT, RTLIB::LOG10_F32, RTLIB::LOG10_F64,
3578 RTLIB::LOG10_F80, RTLIB::LOG10_PPCF128);
3579 break;
3580 case ISD::FEXP:
3581 LC = GetFPLibCall(VT, RTLIB::EXP_F32, RTLIB::EXP_F64,
3582 RTLIB::EXP_F80, RTLIB::EXP_PPCF128);
3583 break;
3584 case ISD::FEXP2:
3585 LC = GetFPLibCall(VT, RTLIB::EXP2_F32, RTLIB::EXP2_F64,
3586 RTLIB::EXP2_F80, RTLIB::EXP2_PPCF128);
35573587 break;
35583588 case ISD::FTRUNC:
35593589 LC = GetFPLibCall(VT, RTLIB::TRUNC_F32, RTLIB::TRUNC_F64,
41624192 // precision, and these operations don't modify precision at all.
41634193 break;
41644194
4195 case ISD::FLOG:
4196 case ISD::FLOG2:
4197 case ISD::FLOG10:
4198 case ISD::FEXP:
4199 case ISD::FEXP2:
41654200 case ISD::FSQRT:
41664201 case ISD::FSIN:
41674202 case ISD::FCOS:
65736608 RTLIB::POWI_PPCF128),
65746609 Node, false, Hi);
65756610 break;
6611 case ISD::FLOG:
6612 case ISD::FLOG2:
6613 case ISD::FLOG10:
6614 case ISD::FEXP:
6615 case ISD::FEXP2:
65766616 case ISD::FTRUNC:
65776617 case ISD::FFLOOR:
65786618 case ISD::FCEIL:
65946634 case ISD::FCOS:
65956635 LC = GetFPLibCall(VT, RTLIB::COS_F32, RTLIB::COS_F64,
65966636 RTLIB::COS_F80, RTLIB::COS_PPCF128);
6637 break;
6638 case ISD::FLOG:
6639 LC = GetFPLibCall(VT, RTLIB::LOG_F32, RTLIB::LOG_F64,
6640 RTLIB::LOG_F80, RTLIB::LOG_PPCF128);
6641 break;
6642 case ISD::FLOG2:
6643 LC = GetFPLibCall(VT, RTLIB::LOG2_F32, RTLIB::LOG2_F64,
6644 RTLIB::LOG2_F80, RTLIB::LOG2_PPCF128);
6645 break;
6646 case ISD::FLOG10:
6647 LC = GetFPLibCall(VT, RTLIB::LOG10_F32, RTLIB::LOG10_F64,
6648 RTLIB::LOG10_F80, RTLIB::LOG10_PPCF128);
6649 break;
6650 case ISD::FEXP:
6651 LC = GetFPLibCall(VT, RTLIB::EXP_F32, RTLIB::EXP_F64,
6652 RTLIB::EXP_F80, RTLIB::EXP_PPCF128);
6653 break;
6654 case ISD::FEXP2:
6655 LC = GetFPLibCall(VT, RTLIB::EXP2_F32, RTLIB::EXP2_F64,
6656 RTLIB::EXP2_F80, RTLIB::EXP2_PPCF128);
65976657 break;
65986658 case ISD::FTRUNC:
65996659 LC = GetFPLibCall(VT, RTLIB::TRUNC_F32, RTLIB::TRUNC_F64,
69657025 case ISD::FSQRT:
69667026 case ISD::FSIN:
69677027 case ISD::FCOS:
7028 case ISD::FLOG:
7029 case ISD::FLOG2:
7030 case ISD::FLOG10:
7031 case ISD::FEXP:
7032 case ISD::FEXP2:
69687033 case ISD::FP_TO_SINT:
69697034 case ISD::FP_TO_UINT:
69707035 case ISD::SINT_TO_FP:
71017166 case ISD::FSQRT:
71027167 case ISD::FSIN:
71037168 case ISD::FCOS:
7169 case ISD::FLOG:
7170 case ISD::FLOG2:
7171 case ISD::FLOG10:
7172 case ISD::FEXP:
7173 case ISD::FEXP2:
71047174 case ISD::FP_TO_SINT:
71057175 case ISD::FP_TO_UINT:
71067176 case ISD::SINT_TO_FP:
30143014 getValue(I.getOperand(1)).getValueType(),
30153015 getValue(I.getOperand(1))));
30163016 return 0;
3017 case Intrinsic::log:
3018 setValue(&I, DAG.getNode(ISD::FLOG,
3019 getValue(I.getOperand(1)).getValueType(),
3020 getValue(I.getOperand(1))));
3021 return 0;
3022 case Intrinsic::log2:
3023 setValue(&I, DAG.getNode(ISD::FLOG2,
3024 getValue(I.getOperand(1)).getValueType(),
3025 getValue(I.getOperand(1))));
3026 return 0;
3027 case Intrinsic::log10:
3028 setValue(&I, DAG.getNode(ISD::FLOG10,
3029 getValue(I.getOperand(1)).getValueType(),
3030 getValue(I.getOperand(1))));
3031 return 0;
3032 case Intrinsic::exp:
3033 setValue(&I, DAG.getNode(ISD::FEXP,
3034 getValue(I.getOperand(1)).getValueType(),
3035 getValue(I.getOperand(1))));
3036 return 0;
3037 case Intrinsic::exp2:
3038 setValue(&I, DAG.getNode(ISD::FEXP2,
3039 getValue(I.getOperand(1)).getValueType(),
3040 getValue(I.getOperand(1))));
3041 return 0;
30173042 case Intrinsic::pow:
30183043 setValue(&I, DAG.getNode(ISD::FPOW,
30193044 getValue(I.getOperand(1)).getValueType(),
8282 Names[RTLIB::SQRT_F64] = "sqrt";
8383 Names[RTLIB::SQRT_F80] = "sqrtl";
8484 Names[RTLIB::SQRT_PPCF128] = "sqrtl";
85 Names[RTLIB::LOG_F32] = "logf";
86 Names[RTLIB::LOG_F64] = "log";
87 Names[RTLIB::LOG_F80] = "logl";
88 Names[RTLIB::LOG_PPCF128] = "logl";
89 Names[RTLIB::LOG2_F32] = "log2f";
90 Names[RTLIB::LOG2_F64] = "log2";
91 Names[RTLIB::LOG2_F80] = "log2l";
92 Names[RTLIB::LOG2_PPCF128] = "log2l";
93 Names[RTLIB::LOG10_F32] = "log10f";
94 Names[RTLIB::LOG10_F64] = "log10";
95 Names[RTLIB::LOG10_F80] = "log10l";
96 Names[RTLIB::LOG10_PPCF128] = "log10l";
97 Names[RTLIB::EXP_F32] = "expf";
98 Names[RTLIB::EXP_F64] = "exp";
99 Names[RTLIB::EXP_F80] = "expl";
100 Names[RTLIB::EXP_PPCF128] = "expl";
101 Names[RTLIB::EXP2_F32] = "exp2f";
102 Names[RTLIB::EXP2_F64] = "exp2";
103 Names[RTLIB::EXP2_F80] = "exp2l";
104 Names[RTLIB::EXP2_PPCF128] = "exp2l";
85105 Names[RTLIB::SIN_F32] = "sinf";
86106 Names[RTLIB::SIN_F64] = "sin";
87107 Names[RTLIB::SIN_F80] = "sinl";
242242 setOperationAction(ISD::FCOS , MVT::f64, Expand);
243243 setOperationAction(ISD::FREM , MVT::f64, Expand);
244244 setOperationAction(ISD::FREM , MVT::f32, Expand);
245 setOperationAction(ISD::FLOG , MVT::f64, Expand);
246 setOperationAction(ISD::FLOG , MVT::f32, Expand);
247 setOperationAction(ISD::FLOG2 , MVT::f64, Expand);
248 setOperationAction(ISD::FLOG2 , MVT::f32, Expand);
249 setOperationAction(ISD::FLOG10 , MVT::f64, Expand);
250 setOperationAction(ISD::FLOG10 , MVT::f32, Expand);
251 setOperationAction(ISD::FEXP , MVT::f64, Expand);
252 setOperationAction(ISD::FEXP , MVT::f32, Expand);
253 setOperationAction(ISD::FEXP2 , MVT::f64, Expand);
254 setOperationAction(ISD::FEXP2 , MVT::f32, Expand);
245255 if (!UseSoftFloat && Subtarget->hasVFP2() && !Subtarget->isThumb()) {
246256 setOperationAction(ISD::FCOPYSIGN, MVT::f64, Custom);
247257 setOperationAction(ISD::FCOPYSIGN, MVT::f32, Custom);
9797
9898 setOperationAction(ISD::FPOW , MVT::f32, Expand);
9999 setOperationAction(ISD::FPOW , MVT::f64, Expand);
100
101 setOperationAction(ISD::FLOG, MVT::f32, Expand);
102 setOperationAction(ISD::FLOG, MVT::f64, Expand);
103 setOperationAction(ISD::FLOG2, MVT::f32, Expand);
104 setOperationAction(ISD::FLOG2, MVT::f64, Expand);
105 setOperationAction(ISD::FLOG10, MVT::f32, Expand);
106 setOperationAction(ISD::FLOG10, MVT::f64, Expand);
107 setOperationAction(ISD::FEXP, MVT::f32, Expand);
108 setOperationAction(ISD::FEXP, MVT::f64, Expand);
109 setOperationAction(ISD::FEXP2, MVT::f32, Expand);
110 setOperationAction(ISD::FEXP2, MVT::f64, Expand);
100111
101112 setOperationAction(ISD::SETCC, MVT::f32, Promote);
102113
188188 setOperationAction(ISD::FSIN , MVT::f64, Expand);
189189 setOperationAction(ISD::FCOS , MVT::f64, Expand);
190190 setOperationAction(ISD::FREM , MVT::f64, Expand);
191 setOperationAction(ISD::FLOG , MVT::f64, Expand);
192 setOperationAction(ISD::FLOG2, MVT::f64, Expand);
193 setOperationAction(ISD::FLOG10,MVT::f64, Expand);
194 setOperationAction(ISD::FEXP , MVT::f64, Expand);
195 setOperationAction(ISD::FEXP2, MVT::f64, Expand);
191196 setOperationAction(ISD::FSIN , MVT::f32, Expand);
192197 setOperationAction(ISD::FCOS , MVT::f32, Expand);
193198 setOperationAction(ISD::FREM , MVT::f32, Expand);
199 setOperationAction(ISD::FLOG , MVT::f32, Expand);
200 setOperationAction(ISD::FLOG2, MVT::f32, Expand);
201 setOperationAction(ISD::FLOG10,MVT::f32, Expand);
202 setOperationAction(ISD::FEXP , MVT::f32, Expand);
203 setOperationAction(ISD::FEXP2, MVT::f32, Expand);
194204
195205 // If we're enabling GP optimizations, use hardware square root
196206 setOperationAction(ISD::FSQRT, MVT::f64, Expand);
7474 setOperationAction(ISD::FCOS , MVT::f64, Expand);
7575 setOperationAction(ISD::FSQRT, MVT::f64, Expand);
7676 setOperationAction(ISD::FPOW , MVT::f64, Expand);
77 setOperationAction(ISD::FLOG , MVT::f64, Expand);
78 setOperationAction(ISD::FLOG2, MVT::f64, Expand);
79 setOperationAction(ISD::FLOG10,MVT::f64, Expand);
80 setOperationAction(ISD::FEXP , MVT::f64, Expand);
81 setOperationAction(ISD::FEXP2, MVT::f64, Expand);
7782 setOperationAction(ISD::FSIN , MVT::f32, Expand);
7883 setOperationAction(ISD::FCOS , MVT::f32, Expand);
7984 setOperationAction(ISD::FSQRT, MVT::f32, Expand);
8085 setOperationAction(ISD::FPOW , MVT::f32, Expand);
86 setOperationAction(ISD::FLOG , MVT::f32, Expand);
87 setOperationAction(ISD::FLOG2, MVT::f32, Expand);
88 setOperationAction(ISD::FLOG10,MVT::f32, Expand);
89 setOperationAction(ISD::FEXP , MVT::f32, Expand);
90 setOperationAction(ISD::FEXP2, MVT::f32, Expand);
8191
8292 setOperationAction(ISD::SIGN_EXTEND_INREG, MVT::i1 , Expand);
8393
9898 setOperationAction(ISD::FCOS , MVT::f64, Expand);
9999 setOperationAction(ISD::FREM , MVT::f64, Expand);
100100 setOperationAction(ISD::FPOW , MVT::f64, Expand);
101 setOperationAction(ISD::FLOG , MVT::f64, Expand);
102 setOperationAction(ISD::FLOG2, MVT::f64, Expand);
103 setOperationAction(ISD::FLOG10,MVT::f64, Expand);
104 setOperationAction(ISD::FEXP ,MVT::f64, Expand);
105 setOperationAction(ISD::FEXP2 ,MVT::f64, Expand);
101106 setOperationAction(ISD::FSIN , MVT::f32, Expand);
102107 setOperationAction(ISD::FCOS , MVT::f32, Expand);
103108 setOperationAction(ISD::FREM , MVT::f32, Expand);
104109 setOperationAction(ISD::FPOW , MVT::f32, Expand);
110 setOperationAction(ISD::FLOG , MVT::f32, Expand);
111 setOperationAction(ISD::FLOG2 ,MVT::f32, Expand);
112 setOperationAction(ISD::FLOG10,MVT::f32, Expand);
113 setOperationAction(ISD::FEXP ,MVT::f32, Expand);
114 setOperationAction(ISD::FEXP2 ,MVT::f32, Expand);
105115
106116 setOperationAction(ISD::FLT_ROUNDS_, MVT::i32, Custom);
107117
349359 setLibcallName(RTLIB::REM_PPCF128, "fmodl$LDBL128");
350360 setLibcallName(RTLIB::SIN_PPCF128, "sinl$LDBL128");
351361 setLibcallName(RTLIB::SQRT_PPCF128, "sqrtl$LDBL128");
362 setLibcallName(RTLIB::LOG_PPCF128, "logl$LDBL128");
363 setLibcallName(RTLIB::LOG2_PPCF128, "log2l$LDBL128");
364 setLibcallName(RTLIB::LOG10_PPCF128, "log10l$LDBL128");
365 setLibcallName(RTLIB::EXP_PPCF128, "expl$LDBL128");
366 setLibcallName(RTLIB::EXP2_PPCF128, "exp2l$LDBL128");
352367 }
353368
354369 computeRegisterProperties();
585585 setOperationAction(ISD::FCOPYSIGN, MVT::f32, Expand);
586586 setOperationAction(ISD::FPOW , MVT::f64, Expand);
587587 setOperationAction(ISD::FPOW , MVT::f32, Expand);
588 setOperationAction(ISD::FLOG , MVT::f64, Expand);
589 setOperationAction(ISD::FLOG , MVT::f32, Expand);
590 setOperationAction(ISD::FLOG2, MVT::f64, Expand);
591 setOperationAction(ISD::FLOG2, MVT::f32, Expand);
592 setOperationAction(ISD::FLOG10, MVT::f64, Expand);
593 setOperationAction(ISD::FLOG10, MVT::f32, Expand);
594 setOperationAction(ISD::FEXP , MVT::f64, Expand);
595 setOperationAction(ISD::FEXP , MVT::f32, Expand);
596 setOperationAction(ISD::FEXP2, MVT::f64, Expand);
597 setOperationAction(ISD::FEXP2, MVT::f32, Expand);
588598
589599 setOperationAction(ISD::SHL_PARTS, MVT::i32, Expand);
590600 setOperationAction(ISD::SRA_PARTS, MVT::i32, Expand);
492492 setOperationAction(ISD::FPOW , MVT::f32 , Expand);
493493 setOperationAction(ISD::FPOW , MVT::f64 , Expand);
494494 setOperationAction(ISD::FPOW , MVT::f80 , Expand);
495
496 setOperationAction(ISD::FLOG, MVT::f32, Expand);
497 setOperationAction(ISD::FLOG, MVT::f64, Expand);
498 setOperationAction(ISD::FLOG, MVT::f80, Expand);
499 setOperationAction(ISD::FLOG2, MVT::f32, Expand);
500 setOperationAction(ISD::FLOG2, MVT::f64, Expand);
501 setOperationAction(ISD::FLOG2, MVT::f80, Expand);
502 setOperationAction(ISD::FLOG10, MVT::f32, Expand);
503 setOperationAction(ISD::FLOG10, MVT::f64, Expand);
504 setOperationAction(ISD::FLOG10, MVT::f80, Expand);
505 setOperationAction(ISD::FEXP, MVT::f32, Expand);
506 setOperationAction(ISD::FEXP, MVT::f64, Expand);
507 setOperationAction(ISD::FEXP, MVT::f80, Expand);
508 setOperationAction(ISD::FEXP2, MVT::f32, Expand);
509 setOperationAction(ISD::FEXP2, MVT::f64, Expand);
510 setOperationAction(ISD::FEXP2, MVT::f80, Expand);
495511
496512 // First set operation action for all vector types to expand. Then we
497513 // will selectively turn on ones that can be effectively codegen'd.