Skip to content

Disable f16 on Aarch64 without neon for llvm < 20.1.1 #143125

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tgross35
Copy link
Contributor

@tgross35 tgross35 commented Jun 28, 2025

This check was added unconditionally in c51b229 ("Disable f16 on Aarch64 without neon") and reverted in 4a8d357 ("Revert "Disable f16 on Aarch64 without neon"") since it did not fail in Rust's build. However, it is still possible to hit this crash if using LLVM 19 built with assertions, so disable the type conditionally based on version here.

Note that for these builds, a similar patch is needed in the build script for compiler-builtins since it does not yet use cfg(target_has_reliable_f16) (hopefully to be resolved in the near future).

Report: #139276 (comment)
Original LLVM issue: llvm/llvm-project#129394

r? @cuviper

@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 28, 2025
@tgross35 tgross35 force-pushed the aarch64-neon-llvm19-f16 branch from 4292cd7 to a6d4975 Compare June 28, 2025 01:37
@tgross35
Copy link
Contributor Author

Note that for Fedora, you will also need to add a similar patch here https://github.com/rust-lang/compiler-builtins/blob/674910e0fa6f0fb2cc055f4f7051ff0eb53c7735/compiler-builtins/configure.rs#L91 that checks target.features. This can't really be done in r-l/r since we don't have access to the LLVM version when building builtins. Now that builtins is a subtree I am planning to switch it to use cfg(target_has_eliable_f16), but that of course won't be in time for the version you are building.

if !sess.target_features.iter().any(|f| f.as_str() == "neon")
&& version < (20, 1, 1) =>
{
panic!("hi");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this is leftover from a local test?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙃 yup, was double checking the features filter and apparently forgot to save

@rust-log-analyzer

This comment has been minimized.

This check was added unconditionally in c51b229 ("Disable f16 on
Aarch64 without `neon`") and reverted in 4a8d357 ("Revert "Disable
`f16` on Aarch64 without `neon`"") since it did not fail in Rust's
build. However, it is still possible to hit this crash if using LLVM 19
built with assertions, so disable the type conditionally based on
version here.

Note that for these builds, a similar patch is needed in the build
script for `compiler-builtins` since it does not yet use
`cfg(target_has_reliable_f16)` (hopefully to be resolved in the near
future).

Report: https://www.github.com/rust-lang/rust/pull/139276#issuecomment-3014781652
Original LLVM issue: https://www.github.com/llvm/llvm-project/issues/129394
@tgross35 tgross35 force-pushed the aarch64-neon-llvm19-f16 branch from a6d4975 to 950b096 Compare June 28, 2025 01:46
@cuviper
Copy link
Member

cuviper commented Jun 28, 2025

Note that for Fedora, you will also need to add a similar patch here [...]

Ok, makes sense.

Now that builtins is a subtree I am planning to switch it to use cfg(target_has_eliable_f16), but that of course won't be in time for the version you are building.

Right, and so this PR won't be enough on its own for master either, but it may still make sense to land it in anticipation of that subtree change.

@rust-log-analyzer
Copy link
Collaborator

The job aarch64-gnu-llvm-19-2 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
              f64
note: required by a bound in `TestableFloat`
   --> coretests/tests/num/flt2dec/mod.rs:178:22
    |
178 | trait TestableFloat: DecodableFloat + fmt::Display {
    |                      ^^^^^^^^^^^^^^ required by this bound in `TestableFloat`

[RUSTC-TIMING] alloctests test:true 15.706
[RUSTC-TIMING] corebenches test:true 8.455
[RUSTC-TIMING] alloctests test:true 16.320
error[E0277]: the trait bound `f16: RawFloat` is not satisfied
##[error]  --> coretests/tests/num/dec2flt/decimal.rs:18:42
   |
18 |         let actual = dec.try_fast_path::<f16>();
   |                          -------------   ^^^ the trait `RawFloat` is not implemented for `f16`
   |                          |
   |                          required by a bound introduced by this call
   |
   = help: the following other types implement trait `RawFloat`:
             f32
             f64
note: required by a bound in `Decimal::try_fast_path`
  --> /checkout/library/core/src/num/dec2flt/decimal.rs:54:29
   |
54 |     pub fn try_fast_path<F: RawFloat>(&self) -> Option<F> {
   |                             ^^^^^^^^ required by this bound in `Decimal::try_fast_path`

error[E0599]: no method named `integer_decode` found for type `f16` in the current scope
##[error] --> coretests/tests/num/dec2flt/float.rs:7:33
  |
7 |     assert_eq!(3.14159265359f16.integer_decode(), (1608, -9, 1));
  |                                 ^^^^^^^^^^^^^^ method not found in `f16`

error[E0599]: no method named `integer_decode` found for type `f16` in the current scope
##[error] --> coretests/tests/num/dec2flt/float.rs:8:35
  |
8 |     assert_eq!((-8573.5918555f16).integer_decode(), (1072, 3, -1));
  |                                   ^^^^^^^^^^^^^^ method not found in `f16`

error[E0599]: no method named `integer_decode` found for type `f16` in the current scope
##[error]  --> coretests/tests/num/dec2flt/float.rs:10:32
   |
10 |     assert_eq!(2f16.powf(14.0).integer_decode(), (1 << 10, 4, 1));
   |                                ^^^^^^^^^^^^^^ method not found in `f16`

error[E0599]: no method named `integer_decode` found for type `f16` in the current scope
##[error]  --> coretests/tests/num/dec2flt/float.rs:11:21
   |
11 |     assert_eq!(0f16.integer_decode(), (0, -25, 1));
   |                     ^^^^^^^^^^^^^^ method not found in `f16`

error[E0599]: no method named `integer_decode` found for type `f16` in the current scope
##[error]  --> coretests/tests/num/dec2flt/float.rs:12:24
   |
12 |     assert_eq!((-0f16).integer_decode(), (0, -25, -1));
   |                        ^^^^^^^^^^^^^^ method not found in `f16`

error[E0599]: no method named `integer_decode` found for type `f16` in the current scope
##[error]  --> coretests/tests/num/dec2flt/float.rs:13:30
   |
13 |     assert_eq!(f16::INFINITY.integer_decode(), (1 << 10, 6, 1));
   |                              ^^^^^^^^^^^^^^ method not found in `f16`

error[E0599]: no method named `integer_decode` found for type `f16` in the current scope
##[error]  --> coretests/tests/num/dec2flt/float.rs:14:34
   |
14 |     assert_eq!(f16::NEG_INFINITY.integer_decode(), (1 << 10, 6, -1));
   |                                  ^^^^^^^^^^^^^^ method not found in `f16`

error[E0599]: no method named `integer_decode` found for type `f16` in the current scope
##[error]  --> coretests/tests/num/dec2flt/float.rs:18:43
   |
18 |     let (nan_m, nan_p, _nan_s) = f16::NAN.integer_decode();
   |                                           ^^^^^^^^^^^^^^ method not found in `f16`

error[E0277]: the trait bound `f16: RawFloat` is not satisfied
##[error]  --> coretests/tests/num/dec2flt/float.rs:62:17
   |
62 |     assert_eq!(<f16 as RawFloat>::INFINITY, f16::INFINITY);
   |                 ^^^ the trait `RawFloat` is not implemented for `f16`
   |
   = help: the following other types implement trait `RawFloat`:
             f32
             f64

error[E0277]: the trait bound `f16: RawFloat` is not satisfied
##[error]  --> coretests/tests/num/dec2flt/float.rs:63:17
   |
63 |     assert_eq!(<f16 as RawFloat>::NEG_INFINITY, -f16::INFINITY);
   |                 ^^^ the trait `RawFloat` is not implemented for `f16`
   |
   = help: the following other types implement trait `RawFloat`:
             f32
             f64

error[E0277]: the trait bound `f16: RawFloat` is not satisfied
##[error]  --> coretests/tests/num/dec2flt/float.rs:64:17
   |
64 |     assert_eq!(<f16 as RawFloat>::NAN.to_bits(), f16::NAN.to_bits());
   |                 ^^^ the trait `RawFloat` is not implemented for `f16`
   |
   = help: the following other types implement trait `RawFloat`:
             f32
             f64

error[E0277]: the trait bound `f16: RawFloat` is not satisfied
##[error]  --> coretests/tests/num/dec2flt/float.rs:65:17
   |
65 |     assert_eq!(<f16 as RawFloat>::NEG_NAN.to_bits(), (-f16::NAN).to_bits());
   |                 ^^^ the trait `RawFloat` is not implemented for `f16`
   |
   = help: the following other types implement trait `RawFloat`:
             f32
             f64

error[E0277]: the trait bound `f16: RawFloat` is not satisfied
##[error]  --> coretests/tests/num/dec2flt/float.rs:66:17
   |
66 |     assert_eq!(<f16 as RawFloat>::SIG_BITS, 10);
   |                 ^^^ the trait `RawFloat` is not implemented for `f16`
   |
   = help: the following other types implement trait `RawFloat`:
             f32
             f64

error[E0277]: the trait bound `f16: RawFloat` is not satisfied
##[error]  --> coretests/tests/num/dec2flt/float.rs:67:17
   |
67 |     assert_eq!(<f16 as RawFloat>::MIN_EXPONENT_ROUND_TO_EVEN, -22);
   |                 ^^^ the trait `RawFloat` is not implemented for `f16`
   |
   = help: the following other types implement trait `RawFloat`:
             f32
             f64

error[E0277]: the trait bound `f16: RawFloat` is not satisfied
##[error]  --> coretests/tests/num/dec2flt/float.rs:68:17
   |
68 |     assert_eq!(<f16 as RawFloat>::MAX_EXPONENT_ROUND_TO_EVEN, 5);
   |                 ^^^ the trait `RawFloat` is not implemented for `f16`
   |
   = help: the following other types implement trait `RawFloat`:
             f32
             f64

error[E0277]: the trait bound `f16: RawFloat` is not satisfied
##[error]  --> coretests/tests/num/dec2flt/float.rs:69:17
   |
69 |     assert_eq!(<f16 as RawFloat>::MIN_EXPONENT_FAST_PATH, -4);
   |                 ^^^ the trait `RawFloat` is not implemented for `f16`
   |
   = help: the following other types implement trait `RawFloat`:
             f32
             f64

error[E0277]: the trait bound `f16: RawFloat` is not satisfied
##[error]  --> coretests/tests/num/dec2flt/float.rs:70:17
   |
70 |     assert_eq!(<f16 as RawFloat>::MAX_EXPONENT_FAST_PATH, 4);
   |                 ^^^ the trait `RawFloat` is not implemented for `f16`
   |
   = help: the following other types implement trait `RawFloat`:
             f32
             f64

error[E0277]: the trait bound `f16: RawFloat` is not satisfied
##[error]  --> coretests/tests/num/dec2flt/float.rs:71:17
   |
71 |     assert_eq!(<f16 as RawFloat>::MAX_EXPONENT_DISGUISED_FAST_PATH, 7);
   |                 ^^^ the trait `RawFloat` is not implemented for `f16`
   |
   = help: the following other types implement trait `RawFloat`:
             f32
             f64

error[E0277]: the trait bound `f16: RawFloat` is not satisfied
##[error]  --> coretests/tests/num/dec2flt/float.rs:72:17
   |
72 |     assert_eq!(<f16 as RawFloat>::EXP_MIN, -14);
   |                 ^^^ the trait `RawFloat` is not implemented for `f16`
   |
   = help: the following other types implement trait `RawFloat`:
             f32
             f64

error[E0277]: the trait bound `f16: RawFloat` is not satisfied
##[error]  --> coretests/tests/num/dec2flt/float.rs:73:17
   |
73 |     assert_eq!(<f16 as RawFloat>::EXP_SAT, 0x1f);
   |                 ^^^ the trait `RawFloat` is not implemented for `f16`
   |
   = help: the following other types implement trait `RawFloat`:
             f32
             f64

error[E0277]: the trait bound `f16: RawFloat` is not satisfied
##[error]  --> coretests/tests/num/dec2flt/float.rs:74:17
   |
74 |     assert_eq!(<f16 as RawFloat>::SMALLEST_POWER_OF_TEN, -27);
   |                 ^^^ the trait `RawFloat` is not implemented for `f16`
   |
   = help: the following other types implement trait `RawFloat`:
             f32
             f64

error[E0277]: the trait bound `f16: RawFloat` is not satisfied
##[error]  --> coretests/tests/num/dec2flt/float.rs:75:17
   |
75 |     assert_eq!(<f16 as RawFloat>::LARGEST_POWER_OF_TEN, 4);
   |                 ^^^ the trait `RawFloat` is not implemented for `f16`
   |
   = help: the following other types implement trait `RawFloat`:
             f32
             f64

error[E0277]: the trait bound `f16: RawFloat` is not satisfied
##[error]  --> coretests/tests/num/dec2flt/float.rs:76:17
   |
76 |     assert_eq!(<f16 as RawFloat>::MAX_MANTISSA_FAST_PATH, 2048);
   |                 ^^^ the trait `RawFloat` is not implemented for `f16`
   |
   = help: the following other types implement trait `RawFloat`:
             f32
             f64

error[E0277]: the trait bound `f16: RawFloat` is not satisfied
##[error]  --> coretests/tests/num/dec2flt/lemire.rs:6:30
   |
6  |     let fp = compute_float::<f16>(q, w);
   |                              ^^^ the trait `RawFloat` is not implemented for `f16`
   |
   = help: the following other types implement trait `RawFloat`:
             f32
             f64
note: required by a bound in `compute_float`
  --> /checkout/library/core/src/num/dec2flt/lemire.rs:27:25
   |
27 | pub fn compute_float<F: RawFloat>(q: i64, mut w: u64) -> BiasedFp {
   |                         ^^^^^^^^ required by this bound in `compute_float`

error[E0599]: no associated item named `INFINITE_POWER` found for type `f16` in the current scope
##[error]  --> coretests/tests/num/dec2flt/lemire.rs:53:45
   |
53 |     assert_eq!(compute_float16(4, 6), (f16::INFINITE_POWER - 1, 851));
   |                                             ^^^^^^^^^^^^^^ associated item not found in `f16`
   |
help: there is an associated constant `INFINITY` with a similar name
   |
53 -     assert_eq!(compute_float16(4, 6), (f16::INFINITE_POWER - 1, 851));
53 +     assert_eq!(compute_float16(4, 6), (f16::INFINITY - 1, 851));
   |

error[E0599]: no associated item named `INFINITE_POWER` found for type `f16` in the current scope
##[error]  --> coretests/tests/num/dec2flt/lemire.rs:54:45
   |
54 |     assert_eq!(compute_float16(4, 7), (f16::INFINITE_POWER, 0)); // infinity
   |                                             ^^^^^^^^^^^^^^ associated item not found in `f16`
   |
help: there is an associated constant `INFINITY` with a similar name
   |
54 -     assert_eq!(compute_float16(4, 7), (f16::INFINITE_POWER, 0)); // infinity
54 +     assert_eq!(compute_float16(4, 7), (f16::INFINITY, 0)); // infinity
   |

error[E0599]: no associated item named `INFINITE_POWER` found for type `f16` in the current scope
##[error]  --> coretests/tests/num/dec2flt/lemire.rs:55:47
   |
55 |     assert_eq!(compute_float16(2, 655), (f16::INFINITE_POWER - 1, 1023));
   |                                               ^^^^^^^^^^^^^^ associated item not found in `f16`
   |
help: there is an associated constant `INFINITY` with a similar name
   |
55 -     assert_eq!(compute_float16(2, 655), (f16::INFINITE_POWER - 1, 1023));
55 +     assert_eq!(compute_float16(2, 655), (f16::INFINITY - 1, 1023));
   |

error[E0277]: the trait bound `f16: RawFloat` is not satisfied
##[error]   --> coretests/tests/num/dec2flt/parse.rs:14:30
    |
14  |         assert_eq!(dec2flt::<f16>(s), Err(pfe_invalid()));
    |                              ^^^ the trait `RawFloat` is not implemented for `f16`
    |
    = help: the following other types implement trait `RawFloat`:
              f32
              f64
note: required by a bound in `dec2flt`
   --> /checkout/library/core/src/num/dec2flt/mod.rs:259:19
    |
259 | pub fn dec2flt<F: RawFloat>(s: &str) -> Result<F, ParseFloatError> {
    |                   ^^^^^^^^ required by this bound in `dec2flt`

error[E0277]: the trait bound `f16: RawFloat` is not satisfied
##[error]   --> coretests/tests/num/dec2flt/parse.rs:34:31
    |
34  |                     dec2flt::<f16>(&input),
    |                               ^^^ the trait `RawFloat` is not implemented for `f16`
    |
    = help: the following other types implement trait `RawFloat`:
              f32
              f64
note: required by a bound in `dec2flt`
   --> /checkout/library/core/src/num/dec2flt/mod.rs:259:19
    |
259 | pub fn dec2flt<F: RawFloat>(s: &str) -> Result<F, ParseFloatError> {
    |                   ^^^^^^^^ required by this bound in `dec2flt`

error[E0277]: the trait bound `f16: DecodableFloat` is not satisfied
##[error]  --> coretests/tests/num/flt2dec/random.rs:92:23
   |
92 |         decode_finite(x)
---
             f64
note: required by a bound in `num::flt2dec::random::decode_finite`
  --> coretests/tests/num/flt2dec/random.rs:10:25
   |
10 | pub fn decode_finite<T: DecodableFloat>(v: T) -> Decoded {
   |                         ^^^^^^^^^^^^^^ required by this bound in `decode_finite`

error[E0277]: the trait bound `f16: DecodableFloat` is not satisfied
##[error]   --> coretests/tests/num/flt2dec/random.rs:135:27
    |
135 |             decode_finite(x)
---
              f64
note: required by a bound in `num::flt2dec::random::decode_finite`
   --> coretests/tests/num/flt2dec/random.rs:10:25
    |
10  | pub fn decode_finite<T: DecodableFloat>(v: T) -> Decoded {
    |                         ^^^^^^^^^^^^^^ required by this bound in `decode_finite`

error[E0277]: the trait bound `f16: DecodableFloat` is not satisfied
##[error]   --> coretests/tests/num/flt2dec/mod.rs:250:23
    |
38  |         let (buf, k) = $f(&decode_finite($v), &mut buf);
    |                            ------------- required by a bound introduced by this call
...
250 |     check_shortest!(f(0.1f16) => b"1", 0);
    |                       ^^^^^^ the trait `DecodableFloat` is not implemented for `f16`
    |
    = help: the following other types implement trait `DecodableFloat`:
              f32
              f64
note: required by a bound in `num::flt2dec::decode_finite`
   --> coretests/tests/num/flt2dec/mod.rs:16:25
    |
16  | pub fn decode_finite<T: DecodableFloat>(v: T) -> Decoded {
    |                         ^^^^^^^^^^^^^^ required by this bound in `decode_finite`

error[E0277]: the trait bound `f16: DecodableFloat` is not satisfied
##[error]   --> coretests/tests/num/flt2dec/mod.rs:255:23
    |
38  |         let (buf, k) = $f(&decode_finite($v), &mut buf);
    |                            ------------- required by a bound introduced by this call
...
255 |     check_shortest!(f(1.0f16/3.0) => b"3333", 0);
    |                       ^^^^^^^^^^ the trait `DecodableFloat` is not implemented for `f16`
    |
    = help: the following other types implement trait `DecodableFloat`:
              f32
              f64
note: required by a bound in `num::flt2dec::decode_finite`
   --> coretests/tests/num/flt2dec/mod.rs:16:25
    |
16  | pub fn decode_finite<T: DecodableFloat>(v: T) -> Decoded {
    |                         ^^^^^^^^^^^^^^ required by this bound in `decode_finite`

error[E0277]: the trait bound `f16: DecodableFloat` is not satisfied
##[error]   --> coretests/tests/num/flt2dec/mod.rs:260:23
    |
38  |         let (buf, k) = $f(&decode_finite($v), &mut buf);
    |                            ------------- required by a bound introduced by this call
...
260 |     check_shortest!(f(3.14f16) => b"314", 1);
    |                       ^^^^^^^ the trait `DecodableFloat` is not implemented for `f16`
    |
    = help: the following other types implement trait `DecodableFloat`:
              f32
              f64
note: required by a bound in `num::flt2dec::decode_finite`
   --> coretests/tests/num/flt2dec/mod.rs:16:25
    |
16  | pub fn decode_finite<T: DecodableFloat>(v: T) -> Decoded {
    |                         ^^^^^^^^^^^^^^ required by this bound in `decode_finite`

error[E0277]: the trait bound `f16: DecodableFloat` is not satisfied
##[error]   --> coretests/tests/num/flt2dec/mod.rs:265:23
    |
38  |         let (buf, k) = $f(&decode_finite($v), &mut buf);
    |                            ------------- required by a bound introduced by this call
...
265 |     check_shortest!(f(3.1415e4f16) => b"3141", 5);
    |                       ^^^^^^^^^^^ the trait `DecodableFloat` is not implemented for `f16`
    |
    = help: the following other types implement trait `DecodableFloat`:
              f32
              f64
note: required by a bound in `num::flt2dec::decode_finite`
   --> coretests/tests/num/flt2dec/mod.rs:16:25
    |
16  | pub fn decode_finite<T: DecodableFloat>(v: T) -> Decoded {
    |                         ^^^^^^^^^^^^^^ required by this bound in `decode_finite`

error[E0277]: the trait bound `f16: DecodableFloat` is not satisfied
##[error]   --> coretests/tests/num/flt2dec/mod.rs:271:23
    |
38  |         let (buf, k) = $f(&decode_finite($v), &mut buf);
    |                            ------------- required by a bound introduced by this call
...
271 |     check_shortest!(f(ldexp_f16(1.0, 5)) => b"32", 2);
    |                       ^^^^^^^^^^^^^^^^^ the trait `DecodableFloat` is not implemented for `f16`
    |
    = help: the following other types implement trait `DecodableFloat`:
              f32
              f64
note: required by a bound in `num::flt2dec::decode_finite`
   --> coretests/tests/num/flt2dec/mod.rs:16:25
    |
16  | pub fn decode_finite<T: DecodableFloat>(v: T) -> Decoded {
    |                         ^^^^^^^^^^^^^^ required by this bound in `decode_finite`

error[E0277]: the trait bound `f16: DecodableFloat` is not satisfied
##[error]   --> coretests/tests/num/flt2dec/mod.rs:276:23
    |
38  |         let (buf, k) = $f(&decode_finite($v), &mut buf);
    |                            ------------- required by a bound introduced by this call
...
276 |     check_shortest!(f(f16::MAX) => b"655", 5);
    |                       ^^^^^^^^ the trait `DecodableFloat` is not implemented for `f16`
    |
    = help: the following other types implement trait `DecodableFloat`:
              f32
              f64
note: required by a bound in `num::flt2dec::decode_finite`
   --> coretests/tests/num/flt2dec/mod.rs:16:25
    |
16  | pub fn decode_finite<T: DecodableFloat>(v: T) -> Decoded {
    |                         ^^^^^^^^^^^^^^ required by this bound in `decode_finite`

error[E0277]: the trait bound `f16: DecodableFloat` is not satisfied
##[error]   --> coretests/tests/num/flt2dec/mod.rs:281:23
    |
38  |         let (buf, k) = $f(&decode_finite($v), &mut buf);
    |                            ------------- required by a bound introduced by this call
...
281 |     check_shortest!(f(f16::MIN_POSITIVE) => b"6104", -4);
    |                       ^^^^^^^^^^^^^^^^^ the trait `DecodableFloat` is not implemented for `f16`
    |
    = help: the following other types implement trait `DecodableFloat`:
              f32
              f64
note: required by a bound in `num::flt2dec::decode_finite`
   --> coretests/tests/num/flt2dec/mod.rs:16:25
    |
16  | pub fn decode_finite<T: DecodableFloat>(v: T) -> Decoded {
    |                         ^^^^^^^^^^^^^^ required by this bound in `decode_finite`

error[E0277]: the trait bound `f16: DecodableFloat` is not satisfied
##[error]   --> coretests/tests/num/flt2dec/mod.rs:287:23
    |
38  |         let (buf, k) = $f(&decode_finite($v), &mut buf);
    |                            ------------- required by a bound introduced by this call
...
287 |     check_shortest!(f(minf16) => b"6", -7);
    |                       ^^^^^^ the trait `DecodableFloat` is not implemented for `f16`
    |
    = help: the following other types implement trait `DecodableFloat`:
              f32
              f64
note: required by a bound in `num::flt2dec::decode_finite`
   --> coretests/tests/num/flt2dec/mod.rs:16:25
    |
16  | pub fn decode_finite<T: DecodableFloat>(v: T) -> Decoded {
    |                         ^^^^^^^^^^^^^^ required by this bound in `decode_finite`

error[E0277]: the trait bound `f16: DecodableFloat` is not satisfied
##[error]   --> coretests/tests/num/flt2dec/mod.rs:297:20
    |
223 |         check_exact(|d, b, k| $f(d, b, k), $v, stringify!($v), $buf, $exp)
    |         ----------- required by a bound introduced by this call
...
297 |     check_exact!(f(0.1f16)            => b"999755859375     ", -1);
    |                    ^^^^^^ the trait `DecodableFloat` is not implemented for `f16`
    |
    = help: the following other types implement trait `DecodableFloat`:
              f32
              f64
note: required by a bound in `check_exact`
   --> coretests/tests/num/flt2dec/mod.rs:98:8
    |
96  | fn check_exact<F, T>(mut f: F, v: T, vstr: &str, expected: &[u8], expectedk: i16)
    |    ----------- required by a bound in this function
97  | where
98  |     T: DecodableFloat,
    |        ^^^^^^^^^^^^^^ required by this bound in `check_exact`

error[E0277]: the trait bound `f16: DecodableFloat` is not satisfied
##[error]   --> coretests/tests/num/flt2dec/mod.rs:298:20
    |
223 |         check_exact(|d, b, k| $f(d, b, k), $v, stringify!($v), $buf, $exp)
    |         ----------- required by a bound introduced by this call
...
298 |     check_exact!(f(0.5f16)            => b"5                ", 0);
    |                    ^^^^^^ the trait `DecodableFloat` is not implemented for `f16`
    |
    = help: the following other types implement trait `DecodableFloat`:
              f32
              f64
note: required by a bound in `check_exact`
   --> coretests/tests/num/flt2dec/mod.rs:98:8
    |
96  | fn check_exact<F, T>(mut f: F, v: T, vstr: &str, expected: &[u8], expectedk: i16)
    |    ----------- required by a bound in this function
97  | where
98  |     T: DecodableFloat,
    |        ^^^^^^^^^^^^^^ required by this bound in `check_exact`

error[E0277]: the trait bound `f16: DecodableFloat` is not satisfied
##[error]   --> coretests/tests/num/flt2dec/mod.rs:299:20
    |
223 |         check_exact(|d, b, k| $f(d, b, k), $v, stringify!($v), $buf, $exp)
    |         ----------- required by a bound introduced by this call
...
299 |     check_exact!(f(1.0f16/3.0)        => b"333251953125     ", 0);
    |                    ^^^^^^^^^^ the trait `DecodableFloat` is not implemented for `f16`
    |
    = help: the following other types implement trait `DecodableFloat`:
              f32
              f64
note: required by a bound in `check_exact`
   --> coretests/tests/num/flt2dec/mod.rs:98:8
    |
96  | fn check_exact<F, T>(mut f: F, v: T, vstr: &str, expected: &[u8], expectedk: i16)
    |    ----------- required by a bound in this function
97  | where
98  |     T: DecodableFloat,
    |        ^^^^^^^^^^^^^^ required by this bound in `check_exact`

error[E0277]: the trait bound `f16: DecodableFloat` is not satisfied
##[error]   --> coretests/tests/num/flt2dec/mod.rs:300:20
    |
223 |         check_exact(|d, b, k| $f(d, b, k), $v, stringify!($v), $buf, $exp)
    |         ----------- required by a bound introduced by this call
...
300 |     check_exact!(f(3.141f16)          => b"3140625          ", 1);
    |                    ^^^^^^^^ the trait `DecodableFloat` is not implemented for `f16`
    |
    = help: the following other types implement trait `DecodableFloat`:
              f32
              f64
note: required by a bound in `check_exact`
   --> coretests/tests/num/flt2dec/mod.rs:98:8
    |
96  | fn check_exact<F, T>(mut f: F, v: T, vstr: &str, expected: &[u8], expectedk: i16)
    |    ----------- required by a bound in this function
97  | where
98  |     T: DecodableFloat,
    |        ^^^^^^^^^^^^^^ required by this bound in `check_exact`

error[E0277]: the trait bound `f16: DecodableFloat` is not satisfied
##[error]   --> coretests/tests/num/flt2dec/mod.rs:301:20
    |
223 |         check_exact(|d, b, k| $f(d, b, k), $v, stringify!($v), $buf, $exp)
    |         ----------- required by a bound introduced by this call
...
301 |     check_exact!(f(3.141e4f16)        => b"31408            ", 5);
    |                    ^^^^^^^^^^ the trait `DecodableFloat` is not implemented for `f16`
    |
    = help: the following other types implement trait `DecodableFloat`:
              f32
              f64
note: required by a bound in `check_exact`
   --> coretests/tests/num/flt2dec/mod.rs:98:8
    |
96  | fn check_exact<F, T>(mut f: F, v: T, vstr: &str, expected: &[u8], expectedk: i16)
    |    ----------- required by a bound in this function
97  | where
98  |     T: DecodableFloat,
    |        ^^^^^^^^^^^^^^ required by this bound in `check_exact`

error[E0277]: the trait bound `f16: DecodableFloat` is not satisfied
##[error]   --> coretests/tests/num/flt2dec/mod.rs:302:20
    |
223 |         check_exact(|d, b, k| $f(d, b, k), $v, stringify!($v), $buf, $exp)
    |         ----------- required by a bound introduced by this call
...
302 |     check_exact!(f(f16::MAX)          => b"65504            ", 5);
    |                    ^^^^^^^^ the trait `DecodableFloat` is not implemented for `f16`
    |
    = help: the following other types implement trait `DecodableFloat`:
              f32
              f64
note: required by a bound in `check_exact`
   --> coretests/tests/num/flt2dec/mod.rs:98:8
    |
96  | fn check_exact<F, T>(mut f: F, v: T, vstr: &str, expected: &[u8], expectedk: i16)
    |    ----------- required by a bound in this function
97  | where
98  |     T: DecodableFloat,
    |        ^^^^^^^^^^^^^^ required by this bound in `check_exact`

error[E0277]: the trait bound `f16: DecodableFloat` is not satisfied
##[error]   --> coretests/tests/num/flt2dec/mod.rs:303:20
    |
223 |         check_exact(|d, b, k| $f(d, b, k), $v, stringify!($v), $buf, $exp)
    |         ----------- required by a bound introduced by this call
...
303 |     check_exact!(f(f16::MIN_POSITIVE) => b"6103515625       ", -4);
    |                    ^^^^^^^^^^^^^^^^^ the trait `DecodableFloat` is not implemented for `f16`
    |
    = help: the following other types implement trait `DecodableFloat`:
              f32
              f64
note: required by a bound in `check_exact`
   --> coretests/tests/num/flt2dec/mod.rs:98:8
    |
96  | fn check_exact<F, T>(mut f: F, v: T, vstr: &str, expected: &[u8], expectedk: i16)
    |    ----------- required by a bound in this function
97  | where
98  |     T: DecodableFloat,
    |        ^^^^^^^^^^^^^^ required by this bound in `check_exact`

error[E0277]: the trait bound `f16: DecodableFloat` is not satisfied
##[error]   --> coretests/tests/num/flt2dec/mod.rs:304:20
    |
223 |         check_exact(|d, b, k| $f(d, b, k), $v, stringify!($v), $buf, $exp)
    |         ----------- required by a bound introduced by this call
...
304 |     check_exact!(f(minf16)            => b"59604644775390625", -7);
    |                    ^^^^^^ the trait `DecodableFloat` is not implemented for `f16`
    |
    = help: the following other types implement trait `DecodableFloat`:
              f32
              f64
note: required by a bound in `check_exact`
   --> coretests/tests/num/flt2dec/mod.rs:98:8
    |
96  | fn check_exact<F, T>(mut f: F, v: T, vstr: &str, expected: &[u8], expectedk: i16)
    |    ----------- required by a bound in this function
97  | where
98  |     T: DecodableFloat,
    |        ^^^^^^^^^^^^^^ required by this bound in `check_exact`

error[E0277]: the trait bound `f16: DecodableFloat` is not satisfied
##[error]   --> coretests/tests/num/flt2dec/mod.rs:641:33
    |
641 |         assert_eq!(to_string(f, f16::MAX, Minus, 0), "65500");
    |                    ---------    ^^^^^^^^ the trait `DecodableFloat` is not implemented for `f16`
    |                    |
    |                    required by a bound introduced by this call
    |
    = help: the following other types implement trait `DecodableFloat`:
              f32
              f64
note: required by a bound in `num::flt2dec::to_shortest_str_test::to_string`
   --> coretests/tests/num/flt2dec/mod.rs:585:12
    |
583 |     fn to_string<T, F>(f: &mut F, v: T, sign: Sign, frac_digits: usize) -> String
    |        --------- required by a bound in this function
584 |     where
585 |         T: DecodableFloat,
    |            ^^^^^^^^^^^^^^ required by this bound in `to_string`

error[E0277]: the trait bound `f16: DecodableFloat` is not satisfied
##[error]   --> coretests/tests/num/flt2dec/mod.rs:642:33
    |
642 |         assert_eq!(to_string(f, f16::MAX, Minus, 1), "65500.0");
    |                    ---------    ^^^^^^^^ the trait `DecodableFloat` is not implemented for `f16`
    |                    |
    |                    required by a bound introduced by this call
    |
    = help: the following other types implement trait `DecodableFloat`:
              f32
              f64
note: required by a bound in `num::flt2dec::to_shortest_str_test::to_string`
   --> coretests/tests/num/flt2dec/mod.rs:585:12
    |
583 |     fn to_string<T, F>(f: &mut F, v: T, sign: Sign, frac_digits: usize) -> String
    |        --------- required by a bound in this function
584 |     where
585 |         T: DecodableFloat,
    |            ^^^^^^^^^^^^^^ required by this bound in `to_string`

error[E0277]: the trait bound `f16: DecodableFloat` is not satisfied
##[error]   --> coretests/tests/num/flt2dec/mod.rs:643:33
    |
643 |         assert_eq!(to_string(f, f16::MAX, Minus, 8), "65500.00000000");
    |                    ---------    ^^^^^^^^ the trait `DecodableFloat` is not implemented for `f16`
    |                    |
    |                    required by a bound introduced by this call
    |
    = help: the following other types implement trait `DecodableFloat`:
              f32
              f64
note: required by a bound in `num::flt2dec::to_shortest_str_test::to_string`
   --> coretests/tests/num/flt2dec/mod.rs:585:12
    |
583 |     fn to_string<T, F>(f: &mut F, v: T, sign: Sign, frac_digits: usize) -> String
    |        --------- required by a bound in this function
584 |     where
585 |         T: DecodableFloat,
    |            ^^^^^^^^^^^^^^ required by this bound in `to_string`

error[E0277]: the trait bound `f16: DecodableFloat` is not satisfied
##[error]   --> coretests/tests/num/flt2dec/mod.rs:646:33
    |
646 |         assert_eq!(to_string(f, minf16, Minus, 0), "0.00000006");
    |                    ---------    ^^^^^^ the trait `DecodableFloat` is not implemented for `f16`
    |                    |
    |                    required by a bound introduced by this call
    |
    = help: the following other types implement trait `DecodableFloat`:
              f32
              f64
note: required by a bound in `num::flt2dec::to_shortest_str_test::to_string`
   --> coretests/tests/num/flt2dec/mod.rs:585:12
    |
583 |     fn to_string<T, F>(f: &mut F, v: T, sign: Sign, frac_digits: usize) -> String
    |        --------- required by a bound in this function
584 |     where
585 |         T: DecodableFloat,
    |            ^^^^^^^^^^^^^^ required by this bound in `to_string`

error[E0277]: the trait bound `f16: DecodableFloat` is not satisfied
##[error]   --> coretests/tests/num/flt2dec/mod.rs:647:33
    |
647 |         assert_eq!(to_string(f, minf16, Minus, 8), "0.00000006");
    |                    ---------    ^^^^^^ the trait `DecodableFloat` is not implemented for `f16`
    |                    |
    |                    required by a bound introduced by this call
    |
    = help: the following other types implement trait `DecodableFloat`:
              f32
              f64
note: required by a bound in `num::flt2dec::to_shortest_str_test::to_string`
   --> coretests/tests/num/flt2dec/mod.rs:585:12
    |
583 |     fn to_string<T, F>(f: &mut F, v: T, sign: Sign, frac_digits: usize) -> String
    |        --------- required by a bound in this function
584 |     where
585 |         T: DecodableFloat,
    |            ^^^^^^^^^^^^^^ required by this bound in `to_string`

error[E0277]: the trait bound `f16: DecodableFloat` is not satisfied
##[error]   --> coretests/tests/num/flt2dec/mod.rs:648:33
    |
648 |         assert_eq!(to_string(f, minf16, Minus, 9), "0.000000060");
    |                    ---------    ^^^^^^ the trait `DecodableFloat` is not implemented for `f16`
    |                    |
    |                    required by a bound introduced by this call
    |
    = help: the following other types implement trait `DecodableFloat`:
              f32
              f64
note: required by a bound in `num::flt2dec::to_shortest_str_test::to_string`
   --> coretests/tests/num/flt2dec/mod.rs:585:12
    |
583 |     fn to_string<T, F>(f: &mut F, v: T, sign: Sign, frac_digits: usize) -> String
    |        --------- required by a bound in this function
584 |     where
585 |         T: DecodableFloat,
    |            ^^^^^^^^^^^^^^ required by this bound in `to_string`

error[E0277]: the trait bound `f16: DecodableFloat` is not satisfied
##[error]   --> coretests/tests/num/flt2dec/mod.rs:765:33
    |
765 |         assert_eq!(to_string(f, f16::MAX, Minus, (-2, 2), false), "6.55e4");
    |                    ---------    ^^^^^^^^ the trait `DecodableFloat` is not implemented for `f16`
    |                    |
    |                    required by a bound introduced by this call
    |
    = help: the following other types implement trait `DecodableFloat`:
              f32
              f64
note: required by a bound in `num::flt2dec::to_shortest_exp_str_test::to_string`
   --> coretests/tests/num/flt2dec/mod.rs:695:12
    |
693 |     fn to_string<T, F>(f: &mut F, v: T, sign: Sign, exp_bounds: (i16, i16), upper: bool) -> String
    |        --------- required by a bound in this function
694 |     where
695 |         T: DecodableFloat,
    |            ^^^^^^^^^^^^^^ required by this bound in `to_string`

error[E0277]: the trait bound `f16: DecodableFloat` is not satisfied
##[error]   --> coretests/tests/num/flt2dec/mod.rs:766:33
    |
766 |         assert_eq!(to_string(f, f16::MAX, Minus, (-4, 4), false), "6.55e4");
    |                    ---------    ^^^^^^^^ the trait `DecodableFloat` is not implemented for `f16`
    |                    |
    |                    required by a bound introduced by this call
    |
    = help: the following other types implement trait `DecodableFloat`:
              f32
              f64
note: required by a bound in `num::flt2dec::to_shortest_exp_str_test::to_string`
   --> coretests/tests/num/flt2dec/mod.rs:695:12
    |
693 |     fn to_string<T, F>(f: &mut F, v: T, sign: Sign, exp_bounds: (i16, i16), upper: bool) -> String
    |        --------- required by a bound in this function
694 |     where
695 |         T: DecodableFloat,
    |            ^^^^^^^^^^^^^^ required by this bound in `to_string`

error[E0277]: the trait bound `f16: DecodableFloat` is not satisfied
##[error]   --> coretests/tests/num/flt2dec/mod.rs:767:33
    |
767 |         assert_eq!(to_string(f, f16::MAX, Minus, (-5, 5), false), "65500");
    |                    ---------    ^^^^^^^^ the trait `DecodableFloat` is not implemented for `f16`
    |                    |
    |                    required by a bound introduced by this call
    |
    = help: the following other types implement trait `DecodableFloat`:
              f32
              f64
note: required by a bound in `num::flt2dec::to_shortest_exp_str_test::to_string`
   --> coretests/tests/num/flt2dec/mod.rs:695:12
    |
693 |     fn to_string<T, F>(f: &mut F, v: T, sign: Sign, exp_bounds: (i16, i16), upper: bool) -> String
    |        --------- required by a bound in this function
694 |     where
695 |         T: DecodableFloat,
    |            ^^^^^^^^^^^^^^ required by this bound in `to_string`

error[E0277]: the trait bound `f16: DecodableFloat` is not satisfied

@tgross35
Copy link
Contributor Author

Oh, that's interesting; Cranelift now supports these types even though LLVM 19 doesn't. The situation here looks kind of weird; IIUC cranelift is building coretests but must be running it against LLVM-built core?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants