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

bad result of float to int casting #27

Open
mrk-its opened this issue Feb 17, 2024 · 0 comments
Open

bad result of float to int casting #27

mrk-its opened this issue Feb 17, 2024 · 0 comments
Labels
bug Something isn't working rust_178

Comments

@mrk-its
Copy link
Owner

mrk-its commented Feb 17, 2024

following rust program https://github.com/mrk-its/aoc2022/blob/new_rust/pi/src/main.rs

produces bad result:

$ cargo run -p pi --release

100 pi: -2147450880
47611328 cycles

changing casting to to_int_unchecked produces proper result:

$ cargo run -p pi --release --features to_int_unchecked

100 pi: 314
47474448 cycles

This is probably because of some flaw in implementation of intrinsic(@llvm.fptosi.sat) llvm-mos/llvm-mos-sdk#299 (llvm-mos/llvm-mos@2372941 llvm-mos/llvm-mos-sdk#303)

@mrk-its mrk-its added bug Something isn't working rust_178 labels Feb 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working rust_178
Projects
None yet
Development

No branches or pull requests

1 participant