-
Notifications
You must be signed in to change notification settings - Fork 222
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
Implement floatunsisf (WIP) #106
Conversation
Another question:
Like this? But I guess this will not work since LLVM expects a symbol. |
I managed to test locally and now I understand the testing system better :D For the target Test resuls Currently I guess there is something wrong with the calling convention. The result is arbitrary (but constant on repeated runs with the same source code) #[test]
fn test_floatunsisf_libcompilerrt() {
let compiler_rt_fn = ::compiler_rt::get("__floatunsisf");
let compiler_rt_fn : extern fn(u32) -> f32 = unsafe { mem::transmute(compiler_rt_fn) };
println!("1231515 {:?}", compiler_rt_fn);
let ans = compiler_rt_fn(0);
println!("{:?}", ans);
assert!(ans.eq_repr(0.0f32));
} gives
And the same code without the
I guess either the calling convention is wrong or the linker does something bad (it removes the __aeabi_ui2f symbol at least). |
Also we haven't found a perfect way to do function aliases yet (if one even exists), so having a wrapper function is what we do for now. Those should probably be marked as inline always like you've done. |
Ugh, this target keeps causing problems. Perhaps, we could conditionally not compile some intrinsics for this target until we figure out what the problem is. That way we can continue landing changes without being blocked by this issue. @alexcrichton what do you think? Reminder for @mattico: please re-send PR #48 when you get the chance 😄 |
So on arm there are 3 different floating point ABIs:
It appears that libgcc is built for |
@japaric seems reasonable to me yeah! |
I think all this PR needs is to be updated to use quickcheck and to disable tests on the failing targets. See: If you're short on time I can update this PR once #111 lands. |
☔ The latest upstream changes (presumably #111) made this pull request unmergeable. Please resolve the merge conflicts. |
A more complete version of this PR landed in #147. Sorry that it took so long to get this done :-/. |
106: implement fmaf r=japaric a=erikdesjardins closes rust-lang#20 Co-authored-by: Erik <[email protected]>
PR for review and travis.
I will delete the comments if you say that the approach is correct.
I'll do fmul and f2uiz too, because my project is complaining^^