Skip to content
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

feat: add SIMD float math functions (exp, exp2, log, log2, log10, sin… #400

Merged
merged 1 commit into from
Mar 3, 2024

Conversation

avhz
Copy link

@avhz avhz commented Mar 3, 2024

Hi,

In relation to #14, I've added some math functions to check with you if I'm on the right track.

I simply followed the implementation that was already there for sqrt, and for functions that I easily found were already in intrinsics.

Let me know if it's the right way to go :)

Cheers!

Edit: I manually checked the output values against R, and they were all correct.

@calebzulawski
Copy link
Member

Thank you! I'm now noticing how lacking our tests are in this area, but we can leave that for another day.

@calebzulawski calebzulawski merged commit eea6f77 into rust-lang:master Mar 3, 2024
66 checks passed
@avhz
Copy link
Author

avhz commented Mar 3, 2024

My pleasure :)

I did notice that too, and I didn't check any special values like T:MAX, infinity, etc.
But I can add tests for these.

In #14 you mentioned adding intrinsics to the compiler, is this completely done ?

@calebzulawski calebzulawski mentioned this pull request Mar 3, 2024
@calebzulawski
Copy link
Member

I actually thought the intrinsics you used here didn't exist yet. There might be some still missing, but none stand out to me right now. Also, I opened #401 to add the tests.

@calebzulawski
Copy link
Member

After a quick check, the intrinsics that seem to be missing are the pow/powi intrinsics

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

Successfully merging this pull request may close these issues.

2 participants