libm icon indicating copy to clipboard operation
libm copied to clipboard

remove force_eval! macro, prepare more const functions, fix clippy, and add clippy to CI

Open phip1611 opened this issue 1 year ago • 3 comments

This MR is intended to be a preparation for #262.

  • fix all clippy warnings (or properly ignore, where sensible)
  • add clippy to CI
  • remove the force_eval! macro with something more const friendly

Regarding the removal of the force_eval!-macro: Fomment from @Amanieu from the other PR:

I am generally in favor of the PR!

The volatile reads are a bit of a hack. I believe they were used for 2 purposes:

  • To set the appropriate FP status flags (overflow, underflow, etc) in the FP status register. We really shouldn't bother with this since we don't guarantee any particular value for flags.
  • To work around FP precision issues on 32-bit x86 which uses 80-bit float precision internally. This is unfortunately an unavoidable issue on x86 since it has pretty broken FP support.

phip1611 avatar Dec 18 '23 10:12 phip1611

ping @Amanieu - I'm not sure whether the CI error might be unrelated.

phip1611 avatar Dec 18 '23 10:12 phip1611

The test failures don't happen on master, this is definitely related to your changes.

Amanieu avatar Dec 19 '23 01:12 Amanieu

You can reproduce the test failures locally with cargo test --release.

Amanieu avatar Dec 19 '23 01:12 Amanieu

I'd love to have this, but I don't have the

phip1611 avatar Sep 04 '24 11:09 phip1611