Skip to content

Commit

Permalink
[CCall] Don't ZExt half
Browse files Browse the repository at this point in the history
  • Loading branch information
vchuravy committed Jan 18, 2021
1 parent 29ff1b7 commit e762db8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/ccall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1053,7 +1053,7 @@ std::string generate_func_sig(const char *fname)
// see pull req #978. need to annotate signext/zeroext for
// small integer arguments.
jl_datatype_t *bt = (jl_datatype_t*)tti;
if (jl_datatype_size(bt) < 4) {
if (jl_datatype_size(bt) < 4 && bt != jl_float16_type) {
if (jl_signed_type && jl_subtype(tti, (jl_value_t*)jl_signed_type))
ab.addAttribute(Attribute::SExt);
else
Expand Down
2 changes: 1 addition & 1 deletion test/llvmpasses/llvmcall.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ end
@generated foo(x)=:(ccall("extern foo", llvmcall, $x, ($x,), x))
bar(x) = ntuple(i -> VecElement{Float16}(x[i]), 2)

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

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

0 comments on commit e762db8

Please sign in to comment.