Skip to content

No longer auto-inline f16 and f128 on well-supported platforms - #162883

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
tgross35:f16-f128-autoinline
Sep 26, 2026
Merged

rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
tgross35:f16-f128-autoinline

Conversation

@tgross35

@tgross35 tgross35 commented Sep 17, 2026 •

Copy link
Copy Markdown
Member

In 5d81891 ("Always inline functions signatures containing f16 or f128"), these types were changed to automatically inline so codegen wouldn't crash on poorly-supported platforms. We have since gained a cfg to reflect the type's codegen reliability. Update so we only check and auto-inline based on type if this config is set, which makes f16 and f128 act more like any other type on most platforms.

We still can't remove this entirely since a lot of API in std wouldn't get inlined and would crash the few remaining poorly-supported backend+target combinations.

Followup to #133050.

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 17, 2026
In 5d81891 ("Always inline functions signatures containing `f16` or
`f128`"), these types were changed to automatically inline so codegen
wouldn't crash on poorly-supported platforms. We have since gained a cfg
to reflect the type's codegen reliability. Update so we only check and
auto-inline based on type if this config is set, which makes `f16` and
`f128` act more like any other type on most platforms.

We still can't remove this entirely since a lot of API in `std` wouldn't
get inlined and would crash the few remaining poorly-supported
backend+target combinations.
@tgross35 tgross35 added the F-f16_and_f128 `#![feature(f16)]`, `#![feature(f128)]` label Sep 17, 2026
@tgross35

Copy link
Copy Markdown
Member Author

PR CI covers well-supported targets, checking some that still have broken f16/f128

@bors try jobs=llvm-21,dist-powerpc-linux,test-x86_64-mingw*

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Sep 17, 2026
No longer auto-inline `f16` and `f128` on well-supported platforms


try-job: *llvm-21*
try-job: dist-powerpc-linux
try-job: test-x86_64-mingw*
@tgross35
tgross35 marked this pull request as ready for review September 17, 2026 05:25
@rustbot

rustbot commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 17, 2026
@rustbot

rustbot commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator

r? @adwinwhite

rustbot has assigned @adwinwhite.
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 76 candidates
  • Random selection from 22 candidates

@tgross35

Copy link
Copy Markdown
Member Author

Assuming CI reflects my local tests,
r? @saethlin
since you reviewed the original two years ago

@rustbot rustbot assigned saethlin and unassigned adwinwhite Sep 17, 2026
@rust-bors

rust-bors Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: ecad3bf (ecad3bfd7270db19306e78af81adf430220634aa)
Base parent: 923c95c (923c95cdf5ba65cea505aa2ea829f578e1506ed8)

@saethlin

Copy link
Copy Markdown
Member

That if is pretty awkward, but I think this is right.

@bors r+

@rust-bors

rust-bors Bot commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 66f69fc has been approved by saethlin

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 26, 2026
rust-bors Bot pushed a commit that referenced this pull request Sep 26, 2026
Rollup of 13 pull requests

Successful merges:

 - #160695 (Detect bad number of generics caused by bad derive)
 - #162883 (No longer auto-inline `f16` and `f128` on well-supported platforms)
 - #163133 ([rustdoc] Fix invalid jump to def link when `#[rustc_allow_incoherent_impl]` is involved)
 - #163215 (Fix suggestion for Option to bool with proper precedence handling)
 - #163266 (More deferred liveness cleanups)
 - #163274 (Support -Z merge-functions with gcc and add stack-protector asm tests)
 - #163290 (Merge `ForceWarning`/`Allow`/`Expect` into `Warning`)
 - #163298 (Don't emit sugg for pub-reexport extern std)
 - #163312 (Add rustdoc regression test for glob import of a crate that re-exports)
 - #163357 (Borrowck cleanups part trois)
 - #161710 (Stabilize `mem::conjure_zst`)
 - #163332 (Add some docs to `Global`)
 - #163362 (simplify ndk compiler test)
@rust-bors
rust-bors Bot merged commit f28dc24 into rust-lang:main Sep 26, 2026
14 checks passed
@rustbot rustbot added this to the 1.100.0 milestone Sep 26, 2026
rust-bors Bot pushed a commit that referenced this pull request Sep 26, 2026
Rollup merge of #162883 - tgross35:f16-f128-autoinline, r=saethlin

No longer auto-inline `f16` and `f128` on well-supported platforms

In 5d81891 ("Always inline functions signatures containing `f16` or `f128`"), these types were changed to automatically inline so codegen wouldn't crash on poorly-supported platforms. We have since gained a cfg to reflect the type's codegen reliability. Update so we only check and auto-inline based on type if this config is set, which makes `f16` and `f128` act more like any other type on most platforms.

We still can't remove this entirely since a lot of API in `std` wouldn't get inlined and would crash the few remaining poorly-supported backend+target combinations.

Followup to #133050.
pull Bot pushed a commit to LeeeeeeM/miri that referenced this pull request Sep 27, 2026
Rollup of 13 pull requests

Successful merges:

 - rust-lang/rust#160695 (Detect bad number of generics caused by bad derive)
 - rust-lang/rust#162883 (No longer auto-inline `f16` and `f128` on well-supported platforms)
 - rust-lang/rust#163133 ([rustdoc] Fix invalid jump to def link when `#[rustc_allow_incoherent_impl]` is involved)
 - rust-lang/rust#163215 (Fix suggestion for Option to bool with proper precedence handling)
 - rust-lang/rust#163266 (More deferred liveness cleanups)
 - rust-lang/rust#163274 (Support -Z merge-functions with gcc and add stack-protector asm tests)
 - rust-lang/rust#163290 (Merge `ForceWarning`/`Allow`/`Expect` into `Warning`)
 - rust-lang/rust#163298 (Don't emit sugg for pub-reexport extern std)
 - rust-lang/rust#163312 (Add rustdoc regression test for glob import of a crate that re-exports)
 - rust-lang/rust#163357 (Borrowck cleanups part trois)
 - rust-lang/rust#161710 (Stabilize `mem::conjure_zst`)
 - rust-lang/rust#163332 (Add some docs to `Global`)
 - rust-lang/rust#163362 (simplify ndk compiler test)
@tgross35
tgross35 deleted the f16-f128-autoinline branch September 28, 2026 07:27
tgross35 added a commit to tgross35/compiler-builtins that referenced this pull request Sep 28, 2026
`f16 and `f128` are no longer automatically inlined as of recent
nightlies. This means `CastInto` methods may not be inlined, which is
happening on Windows and causing an error from missing `__floattihf`.

Mark them inline, which is probably good for performance too if this
isn't happening automatically. 

Link: rust-lang/rust#162883
tgross35 added a commit to tgross35/compiler-builtins that referenced this pull request Sep 28, 2026
`f16 and `f128` are no longer automatically inlined as of recent
nightlies. This means `CastInto` methods may not be inlined, which is
happening on Windows and causing an error from missing `__floattihf`.

Mark them inline, which is probably good for performance too if this
isn't happening automatically. 

Link: rust-lang/rust#162883
tgross35 added a commit to rust-lang/compiler-builtins that referenced this pull request Sep 28, 2026
`f16 and `f128` are no longer automatically inlined as of recent
nightlies. This means `CastInto` methods may not be inlined, which is
happening on Windows and causing an error from missing `__floattihf`.

Mark them inline, which is probably good for performance too if this
isn't happening automatically. 

Link: rust-lang/rust#162883
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.

4 participants