Skip to content

test classify-runtime-const for f16#153884

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
folkertdev:f16-classify-runtime-const
Mar 17, 2026
Merged

test classify-runtime-const for f16#153884
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
folkertdev:f16-classify-runtime-const

Conversation

@folkertdev
Copy link
Contributor

@folkertdev folkertdev commented Mar 14, 2026

View all comments

tracking issue: #116909

r? tgross35

@folkertdev folkertdev added the F-f16_and_f128 `#![feature(f16)]`, `#![feature(f128)]` label Mar 14, 2026
@rustbot rustbot added 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 Mar 14, 2026
@rustbot
Copy link
Collaborator

rustbot commented Mar 14, 2026

tgross35 is currently at their maximum review capacity.
They may take a while to respond.

Copy link
Contributor

@tgross35 tgross35 left a comment

Choose a reason for hiding this comment

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

Tbh I feel like this and similar tests should be folded up into https://github.com/rust-lang/rust/blob/d27207d3d64a1399f90344d6ef3c5743204b3fd3/library/coretests/tests/floats/mod.rs, and we should run that specific file both with and without optimizations. But no reason to exclude f16 here for now.

@bors r+ rollup

View changes since this review

@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 15, 2026

📌 Commit c716a5c has been approved by tgross35

It is now in the queue for this repository.

@rust-bors rust-bors bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 15, 2026
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Mar 15, 2026
…nst, r=tgross35

test `classify-runtime-const` for `f16`

tracking issue: rust-lang#116909

r? tgross35
rust-bors bot pushed a commit that referenced this pull request Mar 15, 2026
Rollup of 6 pull requests

Successful merges:

 - #153639 (Remove `QueryInfo`.)
 - #153570 (MaybeUninit: mention common mistakes in assume_init docs; link to validity invariant docs)
 - #153793 (Add overview documentation for `std::mem`.)
 - #153884 (test `classify-runtime-const` for `f16`)
 - #153922 (rustc_mir_build only depends on rustc_lint_defs, not rustc_lint)
 - #153928 (remove several redundant tests)
@Zalathar
Copy link
Member

Failed in rollup: #153932 (comment)

@bors r-

@rust-bors rust-bors bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 16, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 16, 2026

This pull request was unapproved.

This PR was contained in a rollup (#153932), which was unapproved.

@folkertdev folkertdev force-pushed the f16-classify-runtime-const branch from c716a5c to cff33b4 Compare March 16, 2026 09:35
@folkertdev
Copy link
Contributor Author

Maybe this is an LLVM issue? Otherwise mingw is apparently buggy

https://triage.rust-lang.org/gha-logs/rust-lang/rust/67158354905

@bors try jobs=x86_64-mingw-1

@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Mar 16, 2026
test `classify-runtime-const` for `f16`


try-job: x86_64-mingw-1
@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 16, 2026

💔 Test for 3201c11 failed: CI. Failed job:

@rust-log-analyzer

This comment has been minimized.

@folkertdev
Copy link
Contributor Author

Well, that is unfortunate, LLVM miscompiles. With wine I can reproduce this

#![feature(f16)]

use std::hint::black_box;

fn main() {
    dbg!(black_box(0.0f16) / black_box(0.0f16));
    dbg!(0.0f16 / 0.0f16);
}

emits

[src/main.rs:6:5] black_box(0.0f16) / black_box(0.0f16) = 0x0000
[src/main.rs:7:5] 0.0f16 / 0.0f16 = 0x7e00

I believe this is an ABI problem, e.g. in https://godbolt.org/z/8xGePaqPn the argument to __extendhfsf2 is passed via xmm, but looking at the disassembly of that method it appears to expect the argument via a GPR:

dissassembly of `__extendhfsf2` ``` 000000014009f200 <__extendhfsf2>: 14009f200: 53 push %rbx 14009f201: 48 83 ec 30 sub $0x30,%rsp 14009f205: 0f ae 5c 24 2c stmxcsr 0x2c(%rsp) 14009f20a: 0f b7 c1 movzwl %cx,%eax 14009f20d: 66 81 e1 ff 03 and $0x3ff,%cx 14009f212: 89 c2 mov %eax,%edx 14009f214: c1 e8 0f shr $0xf,%eax 14009f217: c1 ea 0a shr $0xa,%edx 14009f21a: 41 89 c0 mov %eax,%r8d 14009f21d: 83 e2 1f and $0x1f,%edx 14009f220: 41 83 e0 01 and $0x1,%r8d 14009f224: 48 8d 42 01 lea 0x1(%rdx),%rax 14009f228: a8 1e test $0x1e,%al 14009f22a: 74 24 je 14009f250 <__extendhfsf2+0x50> 14009f22c: 48 8d 5a 70 lea 0x70(%rdx),%rbx 14009f230: 81 e1 ff 03 00 00 and $0x3ff,%ecx 14009f236: 41 c1 e0 1f shl $0x1f,%r8d 14009f23a: c1 e3 17 shl $0x17,%ebx 14009f23d: c1 e1 0d shl $0xd,%ecx 14009f240: 09 cb or %ecx,%ebx 14009f242: 44 09 c3 or %r8d,%ebx 14009f245: 66 0f 6e c3 movd %ebx,%xmm0 14009f249: 48 83 c4 30 add $0x30,%rsp 14009f24d: 5b pop %rbx 14009f24e: c3 ret 14009f24f: 90 nop 14009f250: 0f b7 c1 movzwl %cx,%eax 14009f253: 48 85 d2 test %rdx,%rdx 14009f256: 75 48 jne 14009f2a0 <__extendhfsf2+0xa0> 14009f258: 48 85 c0 test %rax,%rax 14009f25b: 74 73 je 14009f2d0 <__extendhfsf2+0xd0> 14009f25d: 4c 0f bd c8 bsr %rax,%r9 14009f261: ba a6 00 00 00 mov $0xa6,%edx 14009f266: 44 89 c3 mov %r8d,%ebx 14009f269: 49 83 f1 3f xor $0x3f,%r9 14009f26d: c1 e3 1f shl $0x1f,%ebx 14009f270: 41 8d 49 d8 lea -0x28(%r9),%ecx 14009f274: 44 29 ca sub %r9d,%edx 14009f277: 48 d3 e0 shl %cl,%rax 14009f27a: c1 e2 17 shl $0x17,%edx 14009f27d: b9 02 00 00 00 mov $0x2,%ecx 14009f282: 25 ff ff 7f 00 and $0x7fffff,%eax 14009f287: 09 d0 or %edx,%eax 14009f289: 09 c3 or %eax,%ebx 14009f28b: e8 30 07 00 00 call 14009f9c0 <__sfp_handle_exceptions> 14009f290: 66 0f 6e c3 movd %ebx,%xmm0 14009f294: 48 83 c4 30 add $0x30,%rsp 14009f298: 5b pop %rbx 14009f299: c3 ret 14009f29a: 66 0f 1f 44 00 00 nopw 0x0(%rax,%rax,1) 14009f2a0: 48 85 c0 test %rax,%rax 14009f2a3: 74 43 je 14009f2e8 <__extendhfsf2+0xe8> 14009f2a5: 48 c1 e0 0d shl $0xd,%rax 14009f2a9: 41 c1 e0 1f shl $0x1f,%r8d 14009f2ad: 48 89 c3 mov %rax,%rbx 14009f2b0: 81 cb 00 00 c0 7f or $0x7fc00000,%ebx 14009f2b6: 44 09 c3 or %r8d,%ebx 14009f2b9: 66 81 f9 ff 01 cmp $0x1ff,%cx 14009f2be: 77 85 ja 14009f245 <__extendhfsf2+0x45> 14009f2c0: b9 01 00 00 00 mov $0x1,%ecx 14009f2c5: eb c4 jmp 14009f28b <__extendhfsf2+0x8b> 14009f2c7: 66 0f 1f 84 00 00 00 nopw 0x0(%rax,%rax,1) 14009f2ce: 00 00 14009f2d0: 44 89 c0 mov %r8d,%eax 14009f2d3: c1 e0 1f shl $0x1f,%eax 14009f2d6: 89 c3 mov %eax,%ebx 14009f2d8: 66 0f 6e c3 movd %ebx,%xmm0 14009f2dc: 48 83 c4 30 add $0x30,%rsp 14009f2e0: 5b pop %rbx 14009f2e1: c3 ret 14009f2e2: 66 0f 1f 44 00 00 nopw 0x0(%rax,%rax,1) 14009f2e8: 44 89 c3 mov %r8d,%ebx 14009f2eb: c1 e3 1f shl $0x1f,%ebx 14009f2ee: 81 cb 00 00 80 7f or $0x7f800000,%ebx 14009f2f4: 66 0f 6e c3 movd %ebx,%xmm0 14009f2f8: 48 83 c4 30 add $0x30,%rsp 14009f2fc: 5b pop %rbx 14009f2fd: c3 ret 14009f2fe: 90 nop 14009f2ff: 90 nop ```

This seems like it's an LLVM issue? Though I'm honestly not sure how any of our tests pass on windows at all with this being broken.

@folkertdev
Copy link
Contributor Author

I guess this is just gcc-mirror/gcc@8b6a18e missing actually. Should we just skip windows altogether? Or use target_has_reliable_f16?

@tgross35
Copy link
Contributor

Ah yeah, the f16 parts should probably be gated by target_has_reliable_f16.

@folkertdev folkertdev force-pushed the f16-classify-runtime-const branch from cff33b4 to cbbe0c0 Compare March 16, 2026 21:18
@folkertdev
Copy link
Contributor Author

@bors try jobs=x86_64-mingw-1

@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Mar 16, 2026
test `classify-runtime-const` for `f16`


try-job: x86_64-mingw-1
@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 16, 2026

💔 Test for 0aa6729 failed: CI. Failed job:

@rust-log-analyzer

This comment has been minimized.

@folkertdev folkertdev force-pushed the f16-classify-runtime-const branch from cbbe0c0 to 19e9ec7 Compare March 16, 2026 23:52
@folkertdev
Copy link
Contributor Author

@bors try jobs=x86_64-mingw-1

@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Mar 17, 2026
test `classify-runtime-const` for `f16`


try-job: x86_64-mingw-1
@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 17, 2026

☀️ Try build successful (CI)
Build commit: 8e51988 (8e5198828147a496f8152ad2db49afecb8cbbaf5, parent: 6bdc342ddb05b520a1f741aabf002319b44d2475)

@folkertdev
Copy link
Contributor Author

@bors r=tgross35

@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 17, 2026

📌 Commit 19e9ec7 has been approved by tgross35

It is now in the queue for this repository.

@rust-bors rust-bors bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 17, 2026
Zalathar added a commit to Zalathar/rust that referenced this pull request Mar 17, 2026
…nst, r=tgross35

test `classify-runtime-const` for `f16`

tracking issue: rust-lang#116909

r? tgross35
rust-bors bot pushed a commit that referenced this pull request Mar 17, 2026
Rollup of 7 pull requests

Successful merges:

 - #153801 (Add the option to run UI tests with the parallel frontend)
 - #153967 (Tweak wording of failed predicate in inference error)
 - #152968 (Flip "region lattice" in RegionKind doc comment)
 - #153531 (Fix LegacyKeyValueFormat report from docker build: various)
 - #153709 (Fix hypothetical ICE in `variances_of`)
 - #153884 (test `classify-runtime-const` for `f16`)
 - #153946 (dissolve `tests/ui/cross`)
rust-bors bot pushed a commit that referenced this pull request Mar 17, 2026
…uwer

Rollup of 14 pull requests

Successful merges:

 - #153972 (stdarch subtree update)
 - #153801 (Add the option to run UI tests with the parallel frontend)
 - #153959 (Fix non-module `parent_module` in stripped cfg diagnostics)
 - #153967 (Tweak wording of failed predicate in inference error)
 - #152968 (Flip "region lattice" in RegionKind doc comment)
 - #153531 (Fix LegacyKeyValueFormat report from docker build: various)
 - #153622 (remove concept of soft-unstable features)
 - #153709 (Fix hypothetical ICE in `variances_of`)
 - #153884 (test `classify-runtime-const` for `f16`)
 - #153894 (Point at unit structs on foreign crates in type errors when they are the pattern of a binding)
 - #153920 (improve `#[track_caller]` invalid ABI error)
 - #153946 (dissolve `tests/ui/cross`)
 - #153965 (Fix minor kasan bugs)
 - #153991 (Small report_cycle refactor)
@rust-bors rust-bors bot merged commit cbebd5b into rust-lang:main Mar 17, 2026
12 checks passed
@rustbot rustbot added this to the 1.96.0 milestone Mar 17, 2026
github-actions bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request Mar 18, 2026
…uwer

Rollup of 14 pull requests

Successful merges:

 - rust-lang/rust#153972 (stdarch subtree update)
 - rust-lang/rust#153801 (Add the option to run UI tests with the parallel frontend)
 - rust-lang/rust#153959 (Fix non-module `parent_module` in stripped cfg diagnostics)
 - rust-lang/rust#153967 (Tweak wording of failed predicate in inference error)
 - rust-lang/rust#152968 (Flip "region lattice" in RegionKind doc comment)
 - rust-lang/rust#153531 (Fix LegacyKeyValueFormat report from docker build: various)
 - rust-lang/rust#153622 (remove concept of soft-unstable features)
 - rust-lang/rust#153709 (Fix hypothetical ICE in `variances_of`)
 - rust-lang/rust#153884 (test `classify-runtime-const` for `f16`)
 - rust-lang/rust#153894 (Point at unit structs on foreign crates in type errors when they are the pattern of a binding)
 - rust-lang/rust#153920 (improve `#[track_caller]` invalid ABI error)
 - rust-lang/rust#153946 (dissolve `tests/ui/cross`)
 - rust-lang/rust#153965 (Fix minor kasan bugs)
 - rust-lang/rust#153991 (Small report_cycle refactor)
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Mar 18, 2026
…uwer

Rollup of 14 pull requests

Successful merges:

 - rust-lang/rust#153972 (stdarch subtree update)
 - rust-lang/rust#153801 (Add the option to run UI tests with the parallel frontend)
 - rust-lang/rust#153959 (Fix non-module `parent_module` in stripped cfg diagnostics)
 - rust-lang/rust#153967 (Tweak wording of failed predicate in inference error)
 - rust-lang/rust#152968 (Flip "region lattice" in RegionKind doc comment)
 - rust-lang/rust#153531 (Fix LegacyKeyValueFormat report from docker build: various)
 - rust-lang/rust#153622 (remove concept of soft-unstable features)
 - rust-lang/rust#153709 (Fix hypothetical ICE in `variances_of`)
 - rust-lang/rust#153884 (test `classify-runtime-const` for `f16`)
 - rust-lang/rust#153894 (Point at unit structs on foreign crates in type errors when they are the pattern of a binding)
 - rust-lang/rust#153920 (improve `#[track_caller]` invalid ABI error)
 - rust-lang/rust#153946 (dissolve `tests/ui/cross`)
 - rust-lang/rust#153965 (Fix minor kasan bugs)
 - rust-lang/rust#153991 (Small report_cycle refactor)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

F-f16_and_f128 `#![feature(f16)]`, `#![feature(f128)]` S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

5 participants