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

Implement f64 method polyfills with intrinsics support #21

Merged
merged 7 commits into from
Feb 22, 2024

Conversation

pantsman0
Copy link
Contributor

This PR implements a f64 math polyfill to support no_std environments.

If std is used, the functions refer to their standard library implementations.
If std is removed, the functions use libm's portable software implementation.
If std is removed and the nightly feature is enabled, rust's unstable access to the math intrisics is restore which should be identical to std's implementation.

@pantsman0 pantsman0 mentioned this pull request Dec 4, 2023
@al8n
Copy link
Owner

al8n commented Dec 4, 2023

Thank you very much!

@pantsman0
Copy link
Contributor Author

This obviously need a bit of extra work at the moment, as it seems that the msvc toolchain on windows does not provide the implementations for the intrinsics. I'll make another revision.

I'll have to see if I can track down why the use_hash_once is causing issues in CI, but not on my local machine.

The intrinsics can be added back with more restrictive cfg attrs when they can be validated for availability.
This removes the feature flag for intrinsics, as I removed their use in `polyfill.rs`.

Fixed type ambiguity errors in `wtinylfu_caches.rs` benchmark file.

Fixed clippy warning for renamed check.
@pantsman0
Copy link
Contributor Author

@al8n I have pulled out the use of intrinsics, as they appear to have some errors even with the feature gate enabled on nightly.

I've also added some fixes for the benches and clippy warnings, as mentioned in the notes for the most recent commit.

@al8n al8n merged commit bd2816c into al8n:main Feb 22, 2024
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