-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@asmcall should use llvmcall ABI #380
Labels
Comments
The workaround here is to split the using LLVM
using LLVM.Interop
function search(v, key)
low = 0
high = length(v)
@inbounds while low ≤ high
mid = (high + low)÷2
middle = v[mid]
if middle == key
return(mid)
end
new_low = mid
new_high = mid
low = @asmcall("cmp \$2, \$3; cmovae \$1, \$0;", "=r,r,r,r,0",
Int, Tuple{Int,Int,Int,Int}, low, new_low, middle, key)
high = @asmcall("cmp \$2, \$3; cmovb \$1, \$0;", "=r,r,r,r,0",
Int, Tuple{Int,Int,Int,Int}, high, new_high, middle, key)
end
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
MWE:
Note the
[2 x i64]
in there; LLVM expects{ i64, i64 }
, so we should be able to invokejulia_type_to_llvm
withllvmcall=true
(this is currently not exported).The text was updated successfully, but these errors were encountered: