"Maximum" is technically correct here with regards to what the
bitpattern can represent, but it is not the numeric maximum value of the
exponent which has a relationship with the bias. So, replace the maximum
terminology with "saturated" to indicate it only means the full
bitpattern.
This change is more relevant to `libm` than `compiler-builtins`.
Change `SIGNIFICAND_*` to `SIG_*` and `EXPONENT_*` to `EXP_*`. This
makes things more consistent with `libm`, and terseness is convenient
here since there isn't anything to confuse.
`compiler_builtins` fails to compile to amdgpu if f128 is enabled.
The reason seems to be that compiler_builtins uses libcalls in the
implementation. I’m not really familiar with what libcalls are, but the
LLVM amdgpu backend explicitly does not support them.
Error message:
```
LLVM ERROR: unsupported libcall legalization
```
These implementations of `abs_diff` were added in c2ff1b3119
("Completely overhaul fuzz testing"), but the signed implementation is
wrong when |x| + |y| exceeds the integer's limits (e.g.
`(-128).abs_diff(1)` should be 128 but currently these return 127.
Resolve this by just using `std`'s implementation since that is stable
now. This isn't used anywhere critical, we probably just weren't hitting
the edge case.
This crate isn't meant for direct use, but having an easy way to see
what changed between versions would still be helpful when this crate is
updated in rust-lang/rust.
Disable `f161` for LoongArch64 due to incorrect code generation on LLVM 19,
which causes failures in `testcrate/tests/conv.rs`. This workaround will
remain in place until llvm/llvm-project#109093 is merged or we upgrade to
LLVM 20.
Currently, Cargo.toml specifies Apache-2.0 OR MIT, but LICENSE.txt
describes MIT OR NCSA. compiler-builtins is derived from LLVM's
compiler-rt. LICENSE.txt correctly reflects the state of compiler-rt
prior to relicensing on 2019-01-19, during which time software was
available for use under either MIT or the University of Illinois NCSA
license. After relicensing, however, compiler-rt is available for use
only under Apache-2.0 with the LLVM exception; this is not reflected
anywhere in the repository.
Update the SPDX license identifier to `MIT AND Apache-2.0 WITH
LLVM-exception AND (MIT OR Apache-2.0)`. Each AND portion covers
something specific:
* Apache-2.0 WITH LLVM-exception: this covers work that is derived from
the LLVM repository since after the LLVM relicensing.
* MIT: This covers work that is derived from LLVM before the LLVM
relicensing (under MIT OR NCSA), as well as the vendored `libm`
components.
* MIT AND Apache-2.0: This ensures that any contributions to this
repository, in addition to meeting the above required licenses, is
also released for use under the Rust-standard Apache-2.0 with no LLVM
exception.
See also the parallel license update in rust-lang/libm [1].
Fixes: https://github.com/rust-lang/compiler-builtins/issues/307
Closes: https://github.com/rust-lang/compiler-builtins/pull/511
Link: https://rust-lang.zulipchat.com/#narrow/channel/335408-foundation/topic/Request.20for.20legal.20team.20input.20on.20crate.20licensing
Link: https://github.com/rust-lang/libm/pull/317 [1]
`to_bits` and `from_bits` are builtin methods on float types. Rename
`repr` to `to_bits` and `from_repr` to `from_bits` so this is consistent
with usage that doesn't go through the trait.
Please, see this discussion for the full
context: https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/.5Bwasm32.5D.20Infinite.20recursion.20.60compiler-builtins.60.20.60__multi3.60
Signed-off-by: Enzo "raskyld" Nocera <enzo@nocera.eu>
We determined that some recursion problems on SPARC and WASM were due to
infinite recusion. This was introduced at 9c6fcb56e8 ("Split Int into
Int and MinInt") when moving the implementation of `widen_hi` from
something on each `impl` block to a default on the trait. The reasoning
is not fully understood, but undoing this portion of the change seems to
resolve the issue.
[ add the above context - Trevor ]
Signed-off-by: Trevor Gross <tmgross@umich.edu>
<https://github.com/rust-lang/rust/issues/126984> has been resolved.
Remove the workaround that was introduced to suppress it.
This reverts commit 254edbcad4cfd6a8af32e3297c1037d7984c3c49.