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

Start removing force_eval uses #292

Closed
wants to merge 2 commits into from

Conversation

saethlin
Copy link
Member

@saethlin saethlin commented Apr 2, 2024

I'm starting here by deleting all the force_eval uses that are for raising floating-point exceptions.

@programmerjake is interested in some breadcrumbs for the non-default rounding modes uses, so I'm going to do something different for those.

@saethlin saethlin force-pushed the less-force-eval branch 2 times, most recently from c7c3a2f to 9d3ca76 Compare April 2, 2024 16:38
@saethlin
Copy link
Member Author

saethlin commented Apr 2, 2024

force_eval!(0.0 / 0.0) appears to not do anything at all:
https://play.rust-lang.org/?version=nightly&mode=release&edition=2021&gist=2621c439604f11b4ef53462f228f8c33

fn main() {
    unsafe {
        println!("{:032b}", _mm_getcsr());
        force_eval!(0.0 / 0.0);
        println!("{:032b}", _mm_getcsr());
    }
}

prints the same value twice.

@saethlin
Copy link
Member Author

saethlin commented Apr 2, 2024

Oh neat, this bug was directly ported from musl.

@saethlin saethlin force-pushed the less-force-eval branch 2 times, most recently from 705f9e9 to 4366e89 Compare April 19, 2024 23:26
@saethlin
Copy link
Member Author

Since there's now effort port new implementations from musl, I'm more against changes like this that would cause implementation divergence.

@saethlin saethlin closed this Aug 10, 2024
@saethlin saethlin deleted the less-force-eval branch August 10, 2024 00:03
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.

1 participant