Skip to content

Commit 1bd20ce

Browse files
committed
Codegen: don't pun float func arguments
1 parent 4eb0368 commit 1bd20ce

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/intrinsics.cpp

+6-3
Original file line numberDiff line numberDiff line change
@@ -1434,10 +1434,13 @@ static jl_cgval_t emit_intrinsic(jl_codectx_t &ctx, intrinsic f, jl_value_t **ar
14341434
if (!jl_is_primitivetype(xinfo.typ))
14351435
return emit_runtime_call(ctx, f, argv, nargs);
14361436
Type *xtyp = bitstype_to_llvm(xinfo.typ, ctx.builder.getContext(), true);
1437-
if (float_func()[f])
1438-
xtyp = FLOATT(xtyp);
1439-
else
1437+
if (float_func()[f]) {
1438+
if (!xtyp->isFloatingPointTy())
1439+
return emit_runtime_call(ctx, f, argv, nargs);
1440+
}
1441+
else {
14401442
xtyp = INTT(xtyp, DL);
1443+
}
14411444
if (!xtyp)
14421445
return emit_runtime_call(ctx, f, argv, nargs);
14431446
////Bool are required to be in the range [0,1]

0 commit comments

Comments
 (0)