<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/library/compiler-builtins/libm/src/math, branch stable</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=stable</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=stable'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2025-07-17T08:59:25+00:00</updated>
<entry>
<title>Allow a new lint failure in nightly</title>
<updated>2025-07-17T08:59:25+00:00</updated>
<author>
<name>Trevor Gross</name>
<email>tmgross@umich.edu</email>
</author>
<published>2025-07-17T08:58:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=5157aa1a0f4d9a7a5f90bff59a7f9f7ca39ca1e9'/>
<id>urn:sha1:5157aa1a0f4d9a7a5f90bff59a7f9f7ca39ca1e9</id>
<content type='text'>
```text
warning: function `f32_to_bits` is never used
   --&gt; libm/src/math/support/float_traits.rs:367:14
    |
367 | pub const fn f32_to_bits(x: f32) -&gt; u32 {
    |              ^^^^^^^^^^^
    |
    = note: `#[warn(dead_code)]` on by default

warning: function `f64_to_bits` is never used
   --&gt; libm/src/math/support/float_traits.rs:381:14
    |
381 | pub const fn f64_to_bits(x: f64) -&gt; u64 {
    |              ^^^^^^^^^^^

warning: `libm` (lib) generated 2 warnings
```

This is a false positive, see RUST-144060.
</content>
</entry>
<entry>
<title>libm: Improved integer utilities, implement shifts and bug fixes for i256 and u256</title>
<updated>2025-07-01T08:07:48+00:00</updated>
<author>
<name>quaternic</name>
<email>57393910+quaternic@users.noreply.github.com</email>
</author>
<published>2025-07-01T08:07:48+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=6c4221818e00828ecf54b395475477f49d0ea716'/>
<id>urn:sha1:6c4221818e00828ecf54b395475477f49d0ea716</id>
<content type='text'>
`i256` and `u256`
- operators now use the same overflow convention as primitives
- implement `&lt;&lt;` and `-` (previously just `&gt;&gt;` and `+`)
- implement `Ord` correctly (the previous `PartialOrd` was broken)
- correct `i256::SIGNED` to `true`

The `Int`-trait is extended with `trailing_zeros`, `carrying_add`, and
`borrowing_sub`.</content>
</entry>
<entry>
<title>fmaximum,fminimum: Fix incorrect result and add tests</title>
<updated>2025-06-13T15:36:58+00:00</updated>
<author>
<name>Trevor Gross</name>
<email>tmgross@umich.edu</email>
</author>
<published>2025-06-02T17:20:22+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=10ba25f7ce4b98ec0958ad7ce52bc2585f6fbb55'/>
<id>urn:sha1:10ba25f7ce4b98ec0958ad7ce52bc2585f6fbb55</id>
<content type='text'>
After adding tests, the current implementation for fminimum fails when
provided a negative zero and NaN as inputs:

    ---- math::fminimum_fmaximum_num::tests::fmaximum_num_spec_tests_f64 stdout ----

    thread 'math::fminimum_fmaximum_num::tests::fmaximum_num_spec_tests_f64' panicked at libm/src/math/fminimum_fmaximum_num.rs:240:13:
    fmaximum_num(-0x0p+0, NaN)
    l: NaN (0x7ff8000000000000)
    r: -0.0 (0x8000000000000000)

    ---- math::fminimum_fmaximum_num::tests::fmaximum_num_spec_tests_f32 stdout ----

    thread 'math::fminimum_fmaximum_num::tests::fmaximum_num_spec_tests_f32' panicked at libm/src/math/fminimum_fmaximum_num.rs:240:13:
    fmaximum_num(-0x0p+0, NaN)
    l: NaN (0x7fc00000)
    r: -0.0 (0x80000000)

Add more thorough spec tests for these functions and correct the
implementations.

Canonicalization is also moved to a trait method to centralize
documentation about what it does and doesn't do.
</content>
</entry>
<entry>
<title>libm-test: Fix unintentional skips in `binop_common`</title>
<updated>2025-06-02T22:47:15+00:00</updated>
<author>
<name>Trevor Gross</name>
<email>tmgross@umich.edu</email>
</author>
<published>2025-06-02T20:20:23+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=57786431746f495f4205e26ee1badd142a380fff'/>
<id>urn:sha1:57786431746f495f4205e26ee1badd142a380fff</id>
<content type='text'>
`binop_common` emits a `SKIP` that is intended to apply only to
`copysign`, but is instead applying to all binary operators. Correct the
general case but leave the currently-failing `maximum_num` tests as a
FIXME, to be resolved separately in [1].

Also simplify skip logic and NaN checking, and add a few more `copysign`
checks.

[1]: https://github.com/rust-lang/compiler-builtins/pull/939
</content>
</entry>
<entry>
<title>cleanup: Use `x.biteq(y)` rather than `x.to_bits() == y.to_bits()`</title>
<updated>2025-06-02T16:10:49+00:00</updated>
<author>
<name>Trevor Gross</name>
<email>tmgross@umich.edu</email>
</author>
<published>2025-06-02T16:10:49+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=e83ca863412a950f19fbc4e8fc632f19107dd0a2'/>
<id>urn:sha1:e83ca863412a950f19fbc4e8fc632f19107dd0a2</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Fix new `dead_code` warnings from recent nightlies</title>
<updated>2025-06-01T19:54:30+00:00</updated>
<author>
<name>Trevor Gross</name>
<email>tmgross@umich.edu</email>
</author>
<published>2025-06-01T19:41:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=c6df6a72d8f2463985b6b130673536e6d4cc7cbf'/>
<id>urn:sha1:c6df6a72d8f2463985b6b130673536e6d4cc7cbf</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Reuse `libm`'s `Caat` and `CastFrom` in `compiler-builtins`</title>
<updated>2025-05-29T03:56:08+00:00</updated>
<author>
<name>Trevor Gross</name>
<email>tmgross@umich.edu</email>
</author>
<published>2025-05-29T03:51:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=877feef541542972f1bfeefe14624a17f23cef8d'/>
<id>urn:sha1:877feef541542972f1bfeefe14624a17f23cef8d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>cleanup: Reuse `MinInt` and `Int` from `libm` in `compiler-builtins`</title>
<updated>2025-05-29T03:04:59+00:00</updated>
<author>
<name>Trevor Gross</name>
<email>tmgross@umich.edu</email>
</author>
<published>2025-04-21T09:35:55+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=851aa05aa0addf41507967952f1ac2d183751682'/>
<id>urn:sha1:851aa05aa0addf41507967952f1ac2d183751682</id>
<content type='text'>
Since the two crates are now in the same repo, it is easier to share
code. Begin some deduplication with the integer traits.
</content>
</entry>
<entry>
<title>aarch64: Add a note saying why we use `frintx` rather than `frintn`</title>
<updated>2025-05-28T21:10:28+00:00</updated>
<author>
<name>Trevor Gross</name>
<email>tmgross@umich.edu</email>
</author>
<published>2025-05-28T21:08:41+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=5978b8b875f6c53af9ca4c72f4ea5fcf74d55c84'/>
<id>urn:sha1:5978b8b875f6c53af9ca4c72f4ea5fcf74d55c84</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Update `CmpResult` to use a pointer-sized return type</title>
<updated>2025-05-28T06:58:42+00:00</updated>
<author>
<name>Trevor Gross</name>
<email>tmgross@umich.edu</email>
</author>
<published>2025-05-23T17:26:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=4c264c96ae30e45c503fbb24e452ea948c5229af'/>
<id>urn:sha1:4c264c96ae30e45c503fbb24e452ea948c5229af</id>
<content type='text'>
As seen at [1], LLVM uses `long long` on LLP64 (to get a 64-bit integer
matching pointer size) and `long` on everything else, with exceptions
for AArch64 and AVR. Our current logic always uses an `i32`. This
happens to work because LLVM uses 32-bit instructions to check the
output on x86-64, but the GCC checks the full 64-bit register so garbage
in the upper half leads to incorrect results.

Update our return type to be `isize`, with exceptions for AArch64 and
AVR.

Fixes: https://github.com/rust-lang/compiler-builtins/issues/919

[1]: https://github.com/llvm/llvm-project/blob/0cf3c437c18ed27d9663d87804a9a15ff6874af2/compiler-rt/lib/builtins/fp_compare_impl.inc#L11-L27
</content>
</entry>
</feed>
