Faster float conversion operations by m-ou-se · Pull Request #464 · rust-lang/co...
source link: https://github.com/rust-lang/compiler-builtins/pull/464
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Faster float conversion operations #464
Conversation
Member
m-ou-se commented 13 days ago
Member
Author
m-ou-se commented 13 days ago
Currently, I'm a bit confused by that. If The version in this PR does not have those special cases. I can put them back if someone thinks they are actually useful. |
Contributor
bjorn3 commented 13 days ago
I think it should be put back. |
Yes.. That's what I said. The special case is for a platform that does have a native version, which means this function wouldn't be called when someone does
Why? When would it be used on x86_64? |
Contributor
bjorn3 commented 13 days ago
Looks like it is also used in case of +soft-float. I guess that special case wouldn't be valid then though. |
Member
Amanieu left a comment
LGTM apart from a few style nits.
Outdated Show resolved
pub extern "C" fn __floatdidf(i: i64) -> f64 { |
||
// On x86_64 LLVM will use native instructions for this conversion, we |
||
// can just do it directly |
||
if cfg!(target_arch = "x86_64") { |
Removing this is fine, I'm not even sure why this hack was here in the first place. If LLVM generates a native instruction then this function is never called anyways. Except in the case of soft-float, in which case you specifically don't want to use the built-in instruction.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK