Skip to content

Is there a clever reason why __floatdisf and __floatundisf are unimplemented? #216

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
ketsuban opened this issue Dec 9, 2017 · 4 comments

Comments

@ketsuban
Copy link
Contributor

ketsuban commented Dec 9, 2017

Looking at the code it seems like they should be really easy - all the functions in this group use a dead-simple macro. Is it just that nobody got around to doing it, or are these functions special somehow (e.g. problems a la rust-lang/rust#10184)?

@kevinaboos
Copy link

I also need these functions, specifically __floatundisf. I'm happy to contribute them to this crate for x86_64, but currently I have no idea where to begin. If someone can point me in the right direction as to how to implement them, I can get started.

@alexcrichton
Copy link
Member

Sure yeah! Currently we mostly just port the implementations from C in the compiler-rt project directly to Rust (then add some tests and such). You can find the compiler-rt intrinsics in compiler-rt/lib/builtins typically, and I normally grep around for the symbol name to find where it's defined

@ketsuban
Copy link
Contributor Author

Back when I first created this issue I forked the repo and added these two intrinsics using __floatdidf and __floatundidf as a template, purely to address my personal need. I didn't make a pull request because I was cognizant of the fact I was engaging in cargo-cult programming, but now there's eyes on this issue I'll make sure everyone knows about it even if only so someone can tell me I was doing it wrong and should feel bad.

@alexcrichton
Copy link
Member

Oh we'd love a PR! Right now the tests hopefully cover enough cases to ensure that it's implemented correctly, and otherwise cargo-culting from compiler-rt is par for the course :)

@ketsuban ketsuban closed this as completed Apr 5, 2018
tgross35 pushed a commit to tgross35/compiler-builtins that referenced this issue Feb 23, 2025
Improve sqrt/sqrtf if stable intrinsics allow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants