about summary refs log tree commit diff
path: root/tests/codegen/patchable-function-entry/patchable-function-entry-one-flag.rs
diff options
context:
space:
mode:
authorTrevor Gross <tmgross@umich.edu>2025-02-10 09:17:54 +0000
committerTrevor Gross <tmgross@umich.edu>2025-02-10 12:29:59 +0000
commit105cd79578c5ad4326d83afa6ff1c962745d8d8a (patch)
treef4926a802487c6a521cda8987ad675a0f471cb8c /tests/codegen/patchable-function-entry/patchable-function-entry-one-flag.rs
parent35f5731d62049ab8dfb3686bd0328ee796e9f8c5 (diff)
downloadrust-105cd79578c5ad4326d83afa6ff1c962745d8d8a.tar.gz
rust-105cd79578c5ad4326d83afa6ff1c962745d8d8a.zip
Migrate away from nonfunctional `fenv` stubs
Many routines have some form of handling for rounding mode and floating
point exceptions, which are implemented via a combination of stubs and
`force_eval!` use. This is suboptimal, however, because:

1. Rust does not interact with the floating point environment, so most
   of this code does nothing.
2. The parts of the code that are not dead are not testable.
3. `force_eval!` blocks optimizations, which is unnecessary because we
   do not rely on its side effects.

We cannot ensure correct rounding and exception handling in all cases
without some form of arithmetic operations that are aware of this
behavior. However, the cases where rounding mode is explicitly handled
or exceptions are explicitly raised are testable. Make this possible
here for functions that depend on `math::fenv` by moving the
implementation to a nonpublic function that takes a `Round` and returns
a `Status`.

Link: https://github.com/rust-lang/libm/issues/480
Diffstat (limited to 'tests/codegen/patchable-function-entry/patchable-function-entry-one-flag.rs')
0 files changed, 0 insertions, 0 deletions