Skip to content

tests: Update f16b codegen test for LoongArch and RISC-V - #163146

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
heiher:ignore-f16b-la-rv
Sep 23, 2026
Merged

rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
heiher:ignore-f16b-la-rv

Conversation

@heiher

@heiher heiher commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #163145

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 22, 2026
@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Sep 22, 2026
@rustbot

rustbot commented Sep 22, 2026

Copy link
Copy Markdown
Collaborator

r? @fee1-dead

rustbot has assigned @fee1-dead.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 77 candidates
  • Random selection from 19 candidates

Comment thread tests/codegen-llvm/float/f16b.rs Outdated
@@ -1,4 +1,8 @@
//@ compile-flags: -Copt-level=3
//@ ignore-loongarch32

@lqd lqd Sep 22, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you add a fixme like "FIXME: ignored on LoongArch and RISC-V until we can use llvm/llvm-project#224867" or similar?

View changes since the review

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sure. Thanks!

@lqd

lqd commented Sep 22, 2026

Copy link
Copy Markdown
Member

r? me

@rustbot rustbot assigned lqd and unassigned fee1-dead Sep 22, 2026
Comment thread tests/codegen-llvm/float/f16b.rs Outdated
@@ -1,4 +1,9 @@
//@ compile-flags: -Copt-level=3
// FIXME: ignored on LoongArch and RISC-V until we can use llvm/llvm-project#224867

@lqd lqd Sep 22, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this should use the full link, so we can click it in editors, copy paste it, etc

Suggested change
// FIXME: ignored on LoongArch and RISC-V until we can use llvm/llvm-project#224867
// FIXME: ignored on LoongArch and RISC-V until we can use https://github.com/llvm/llvm-project/pull/224867

View changes since the review

@beetrees

beetrees commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

I don't think this is related to llvm/llvm-project#224867. This is instead caused by the RISC-V and Loongarch ABIs always using PassMode::Cast for floating-point arguments with a size <= flen. Reg doesn't differentiate between f16b and f16, so the LLVM backend uses half to represent 16-bit floating point CastTargets. The current behaviour isn't incorrect (both RISC-V and Loongarch pass f16 and f16b identically AFAICT), so the test failure could be solved by updating the test to have separate revisions for RISC-V/Loongarch and other targets. Alternatively, the ABI implementations could be updated to not PassMode::Cast primitive floating-point arguments, or RegKind::Float could be improved to allow differentiating between LLVM half and bfloat (a bit like the existing hint_vector_elem for RegKind::Vector, or as a separate RegKind variant - although I don't know if we could call the difference between half and bfloat a "hint" as I don't know if LLVM gives them different ABIs on some architectures).

@lqd

lqd commented Sep 22, 2026

Copy link
Copy Markdown
Member

cc @Jamesbarford who mentioned this PR to me

@lqd

lqd commented Sep 22, 2026

Copy link
Copy Markdown
Member

Let's just add the ignores without explanations then.

@folkertdev folkertdev added the F-f16b `#![feature(f16b)]` label Sep 22, 2026
Add target-specific revisions to the `f16b` codegen test to account for
LoongArch and RISC-V lowering `f16b` to LLVM `half` rather than `bfloat`.
@heiher
heiher force-pushed the ignore-f16b-la-rv branch 2 times, most recently from db3bc15 to 41ae947 Compare September 22, 2026 17:04
@heiher heiher changed the title Ignore f16b test for LoongArch and Risc-V tests: Update f16b codegen test for LoongArch and RISC-V Sep 22, 2026
@heiher

heiher commented Sep 22, 2026

Copy link
Copy Markdown
Contributor Author

Thanks! I went with target-specific revisions so that the test still runs on all supported targets.

@lqd

lqd commented Sep 22, 2026

Copy link
Copy Markdown
Member

Thanks!

@bors r+ rollup

@rust-bors

rust-bors Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 41ae947 has been approved by lqd

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 Sep 22, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Sep 22, 2026
tests: Update `f16b` codegen test for LoongArch and RISC-V

Fixes rust-lang#163145
rust-bors Bot pushed a commit that referenced this pull request Sep 22, 2026
…uwer

Rollup of 13 pull requests

Successful merges:

 - #156949 (Detect missing else in let statement)
 - #160436 (stabilize `Box::take`)
 - #160570 (macro_metavar_expr_concat: support concatenating into string literals)
 - #162837 (Dedicated Display type for CStr::display)
 - #163099 (Use wrapping arithmetic in `from_str_radix`)
 - #163166 (Tiny cleanups to deferred liveness)
 - #161667 (Add `f16` inline ASM support for `nvptx64-nvidia-cuda`)
 - #163063 (Restore `Send` and `Sync` for `BorrowedCursor`)
 - #163097 (OpenBSD/sparc64 has switched from GCC to Clang)
 - #163126 (Skip redundant storage-conflict updates during coroutine layout)
 - #163135 (librustdoc: remove stale dep on base64)
 - #163146 (tests: Update `f16b` codegen test for LoongArch and RISC-V)
 - #163159 (treat inductive cycles as ambig)
@rust-bors
rust-bors Bot merged commit 4ae1ff3 into rust-lang:main Sep 23, 2026
13 checks passed
@rustbot rustbot added this to the 1.100.0 milestone Sep 23, 2026
rust-bors Bot pushed a commit that referenced this pull request Sep 23, 2026
Rollup merge of #163146 - heiher:ignore-f16b-la-rv, r=lqd

tests: Update `f16b` codegen test for LoongArch and RISC-V

Fixes #163145
@heiher
heiher deleted the ignore-f16b-la-rv branch September 23, 2026 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

F-f16b `#![feature(f16b)]` 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.

f16b.rs fails on LoongArch

6 participants