Skip to content

Commit e762db8

Browse files
committed
[CCall] Don't ZExt half
1 parent 29ff1b7 commit e762db8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/ccall.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1053,7 +1053,7 @@ std::string generate_func_sig(const char *fname)
10531053
// see pull req #978. need to annotate signext/zeroext for
10541054
// small integer arguments.
10551055
jl_datatype_t *bt = (jl_datatype_t*)tti;
1056-
if (jl_datatype_size(bt) < 4) {
1056+
if (jl_datatype_size(bt) < 4 && bt != jl_float16_type) {
10571057
if (jl_signed_type && jl_subtype(tti, (jl_value_t*)jl_signed_type))
10581058
ab.addAttribute(Attribute::SExt);
10591059
else

test/llvmpasses/llvmcall.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ end
1313
@generated foo(x)=:(ccall("extern foo", llvmcall, $x, ($x,), x))
1414
bar(x) = ntuple(i -> VecElement{Float16}(x[i]), 2)
1515

16-
# CHECK: call half @foo(half zeroext %{{[0-9]+}})
16+
# CHECK: call half @foo(half %{{[0-9]+}})
1717
emit(foo, Float16)
1818

1919
# CHECK: call [2 x half] @foo([2 x half] %{{[0-9]+}})

0 commit comments

Comments
 (0)