Skip to content

Replace bitxor in float Neg impl with an intrinsic #32

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

Closed
thomcc opened this issue Oct 7, 2020 · 1 comment · Fixed by #89
Closed

Replace bitxor in float Neg impl with an intrinsic #32

thomcc opened this issue Oct 7, 2020 · 1 comment · Fixed by #89
Labels
I-slow Impact: Slowww

Comments

@thomcc
Copy link
Member

thomcc commented Oct 7, 2020

Issue #31 replaces/replaced a non-ieee754-compliant implementation of negate, but while it's more-or-less optimal on some platforms, on ARM it actually constructs a mask and does the XOR, even though there's a relevant instruction it should use.

In general this is all pretty hairy, and ideally rustc would just give us an intrinsic that will negate the float in optimal (but correct) way for the platform. This isn't urgent (the slowdown is minor) but isn't something we should just forget.

@Lokathor
Copy link
Contributor

Lokathor commented Oct 7, 2020

Additional note: llvm has an fneg operation we could be using that's just not exposed (even in nightly).

So the fix here is to add another platform intrinsic into the compiler, then to call that intrinsic in stdsimd.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-slow Impact: Slowww
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants