-
Notifications
You must be signed in to change notification settings - Fork 139
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
Add rsqrt method to Float trait #1
Comments
This should probably be proposed for the standard library first. So far we don't have any arch-specific code -- I'd rather just have num's |
From @clarcharr on November 10, 2017 1:8 I agree; it makes sense to offer this in libstd. |
From @davll on November 10, 2017 3:10 Reasonable, I'll propose it in |
This appears to have been in libstd originally, then later removed. I don't think that anyone actually opened an issue for it, because I can't find it. |
rust-lang/rust#23549 added:
and then rust-lang/rust#24636 removed it. Neither PR mentioned If you propose it back to |
Looks like LLVM wouldn't optimize it automatically. Also it's probably worth following progress on fast math support in rust-lang/rust#21690, since LLVM may generate rsqrt when the corresponding code uses |
This should probably be added to the Real trait at the same time |
From @davll on November 9, 2017 8:48
rsqrt
is a widely used math function in game development, and is faster than combining the two functions:recip(sqrt(x))
thanks to x86 SSE instructionsRSQRTSS
,RSQRTPS
,RSQRTSD
, andRSQRTPD
. Should we consider addrsqrt
toFloat
trait?Copied from original issue: rust-num/num#343
The text was updated successfully, but these errors were encountered: