-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Odd difference in ccall'ing function from a parameterized method versus one with hardcoded types #29400
Comments
I'm not sure if this the parametric type one is intented to be supported since C function only have one type that does not depend on the caller. The For this particular case, all of the code are wrong, it should use |
You're right, the I think this
means that the behavior is not intended, there should have been thrown an error somewhere, but I must admit I don't fully understand why |
Yes, the behavior is clearly not intended. I'm just not sure if the intended behavior is 0.6 behavior or error. I think a consistent rule could be made to support this in an inference independent way though I also don't like making dispatch barrier affecting the semantics this much.... |
__ldexp_exp(f) requires the second argument to be an Int32, so we might as well hard-code that here. It also seems that the old specification is actually not valid, or might have unexpected results, so we should just go with Int32, see JuliaLang#29400 .
__ldexp_exp(f) requires the second argument to be an Int32, so we might as well hard-code that here. It also seems that the old specification is actually not valid, or might have unexpected results, so we should just go with Int32, see #29400 .
Strange. Codegen is supposed to reject this IR as malformed—I'm not sure why it's not getting properly detected. |
Validation correctly implemented by #40947 now
|
Sorry for the slightly weird title, but I have no idea what the problem is, so maybe we can change the title when someone more clever than I am stops by :)
See, I'm trying to create a Julia port of what is called here
julia/base/special/hyperbolic.jl
Line 15 in 46dcb35
_ldexp_exp
is defined here https://github.com/JuliaMath/openlibm/blob/cca41bc1abd01804afa4862bbd2c79cc9803171a/src/k_exp.c#L75The following thing might help people who know about this stuff decipher what's going on
Hardcoding
Int64
produces the same result astypeof(-1)
.If I'm somehow breaking the rules of
ccall
I just don't know why. If it's a bug, I don't know what's happening either, so... 🤷♂️The text was updated successfully, but these errors were encountered: