@@ -71,7 +71,7 @@ static void jl_init_intrinsic_functions_codegen(Module *m)
71
71
float_func[rint_llvm] = true ;
72
72
float_func[sqrt_llvm] = true ;
73
73
float_func[sqrt_llvm_fast] = true ;
74
- float_func[powi_llvm ] = true ;
74
+ float_func[powf_llvm ] = true ;
75
75
}
76
76
77
77
extern " C"
@@ -915,33 +915,6 @@ static jl_cgval_t emit_intrinsic(intrinsic f, jl_value_t **args, size_t nargs,
915
915
return mark_julia_type (ans, false , x.typ , ctx);
916
916
}
917
917
918
- case powi_llvm: {
919
- const jl_cgval_t &x = argv[0 ];
920
- const jl_cgval_t &y = argv[1 ];
921
- if (!jl_is_bitstype (x.typ ) || !jl_is_bitstype (y.typ ) || jl_datatype_size (y.typ ) != 4 )
922
- return emit_runtime_call (f, argv, nargs, ctx);
923
- Type *xt = FLOATT (bitstype_to_llvm (x.typ ));
924
- Type *yt = T_int32;
925
- if (!xt)
926
- return emit_runtime_call (f, argv, nargs, ctx);
927
-
928
- Value *xv = emit_unbox (xt, x, x.typ );
929
- Value *yv = emit_unbox (yt, y, y.typ );
930
- #if JL_LLVM_VERSION >= 30600
931
- Value *powi = Intrinsic::getDeclaration (jl_Module, Intrinsic::powi, makeArrayRef (xt));
932
- #if JL_LLVM_VERSION >= 30700
933
- Value *ans = builder.CreateCall (powi, {xv, yv});
934
- #else
935
- Value *ans = builder.CreateCall2 (powi, xv, yv);
936
- #endif
937
- #else
938
- // issue #6506
939
- Value *ans = builder.CreateCall2 (prepare_call (xt == T_float64 ? jlpow_func : jlpowf_func),
940
- xv, builder.CreateSIToFP (yv, xt));
941
- #endif
942
- return mark_julia_type (ans, false , x.typ , ctx);
943
- }
944
-
945
918
default : {
946
919
assert (nargs >= 1 && " invalid nargs for intrinsic call" );
947
920
const jl_cgval_t &xinfo = argv[0 ];
@@ -1296,6 +1269,14 @@ static Value *emit_untyped_intrinsic(intrinsic f, Value **argvalues, size_t narg
1296
1269
Value *sqrtintr = Intrinsic::getDeclaration (jl_Module, Intrinsic::sqrt, makeArrayRef (t));
1297
1270
return builder.CreateCall (sqrtintr, x);
1298
1271
}
1272
+ case powf_llvm: {
1273
+ Function *powf = (t == T_float64 ? jlpow_func : jlpowf_func);
1274
+ #if JL_LLVM_VERSION >= 30700
1275
+ return builder.CreateCall (prepare_call (powf), {x, y});
1276
+ #else
1277
+ return builder.CreateCall2 (prepare_call (powf), x, y);
1278
+ #endif
1279
+ }
1299
1280
1300
1281
default :
1301
1282
assert (0 && " invalid intrinsic" );
0 commit comments