Skip to content

simd_reduce_min/max: remove float support#155189

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
RalfJung:reduce-minmax-float
Apr 30, 2026
Merged

simd_reduce_min/max: remove float support#155189
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
RalfJung:reduce-minmax-float

Conversation

@RalfJung
Copy link
Copy Markdown
Member

@RalfJung RalfJung commented Apr 12, 2026

View all comments

LLVM currently doesn't have an intrinsic with the right semantics here (see llvm/llvm-project#185827). The only remaining user of this intrinsic with float types is portable-simd and it's easier to implement a fallback there than here, so I opted for making the intrinsic int-only. I kept around the float support in cranelift and Miri because there it already has the desired semantics (matching scalar min/max).

Fixes #153395
Blocked on rust-lang/portable-simd#515

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 12, 2026

Some changes occurred in compiler/rustc_codegen_gcc

cc @antoyo, @GuillaumeGomez

Some changes occurred to the platform-builtins intrinsics. Make sure the
LLVM backend as well as portable-simd gets adapted for the changes.

cc @antoyo, @GuillaumeGomez, @bjorn3, @calebzulawski, @programmerjake

Some changes occurred to the intrinsics. Make sure the CTFE / Miri interpreter
gets adapted for the changes, if necessary.

cc @rust-lang/miri, @oli-obk, @lcnr

@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. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Apr 12, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 12, 2026

r? @chenyukang

rustbot has assigned @chenyukang.
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 69 candidates
  • Random selection from 12 candidates

Comment thread compiler/rustc_codegen_gcc/src/builder.rs
Comment thread library/core/src/intrinsics/simd/mod.rs
@rust-log-analyzer

This comment has been minimized.

@chenyukang
Copy link
Copy Markdown
Member

@chenyukang
Copy link
Copy Markdown
Member

need more reviewers from the domain
@rustbot reroll

@rustbot rustbot assigned petrochenkov and unassigned chenyukang Apr 12, 2026
@RalfJung
Copy link
Copy Markdown
Member Author

@RalfJung RalfJung force-pushed the reduce-minmax-float branch 2 times, most recently from 1df099e to c77f465 Compare April 12, 2026 10:20
@rust-log-analyzer

This comment has been minimized.

@petrochenkov petrochenkov added S-blocked Status: Blocked on something else such as an RFC or other implementation work. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 13, 2026
@RalfJung
Copy link
Copy Markdown
Member Author

@calebzulawski any chance we could get a portable-simd sync so that this PR can make progress? :)

@RalfJung
Copy link
Copy Markdown
Member Author

Or maybe @folkertdev you could help us out with a sync here? Looks like you've done one before. :)

@folkertdev
Copy link
Copy Markdown
Contributor

I opened rust-lang/portable-simd#525, but we'll need someone to merge it.

Unless you meant a sync the other way? But that doesn't do anything currently.

@RalfJung
Copy link
Copy Markdown
Member Author

RalfJung commented Apr 28, 2026

Yes I meant a sync the other way. That should sync rust-lang/portable-simd#515, which was not part of the previous sync. So it should definitely do something.

@calebzulawski
Copy link
Copy Markdown
Member

Sorry, I've been swamped with some other things. If you can open the sync the other way I can review it, otherwise I should be able to get around to it in the next few days

@folkertdev
Copy link
Copy Markdown
Contributor

The sync script is very sensitive to the current state of your local branches, turns out. Anyhow:

#155930

@RalfJung RalfJung force-pushed the reduce-minmax-float branch from c77f465 to ad7ddbc Compare April 29, 2026 11:48
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 29, 2026

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@RalfJung
Copy link
Copy Markdown
Member Author

@petrochenkov this is unblocked now. :)
@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-blocked Status: Blocked on something else such as an RFC or other implementation work. labels Apr 29, 2026
@petrochenkov
Copy link
Copy Markdown
Contributor

@bors r+

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 29, 2026

📌 Commit ad7ddbc has been approved by petrochenkov

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 Apr 29, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Apr 29, 2026
…trochenkov

simd_reduce_min/max: remove float support

LLVM currently doesn't have an intrinsic with the right semantics here (see llvm/llvm-project#185827). The only remaining user of this intrinsic with float types is portable-simd and it's easier to implement a fallback there than here, so I opted for making the intrinsic int-only. I kept around the float support in cranelift and Miri because there it already has the desired semantics (matching scalar min/max).

Fixes rust-lang#153395
~~Blocked on rust-lang/portable-simd#515
rust-bors Bot pushed a commit that referenced this pull request Apr 29, 2026
…uwer

Rollup of 12 pull requests

Successful merges:

 - #155189 (simd_reduce_min/max: remove float support)
 - #155721 (When archive format is wrong produce an error instead of ICE)
 - #155794 (privacy: share effective visibility initialization)
 - #155856 (std_detect: support detecting more features on aarch64 Windows)
 - #155861 (Suggest `[const] Trait` bounds in more places)
 - #155899 (`dlltool`: Set the working directory to workaround `--temp-prefix` bug)
 - #155916 (Update with new LLVM 22 target for `wasm32-wali-linux-musl` target)
 - #155935 (remap OUT_DIR paths to fix build script path leakage in crate metadata. )
 - #155950 (use the new `//@ needs-asm-mnemonic: ret` more)
 - #155958 (ci(free-disk-space): remove more tools and fix warnings)
 - #155949 (Update `opt_ast_lowering_delayed_lints` query to allow "stealing" lints, allowing to use `FnOnce` instead of `Fn`)
 - #155951 (Make `FlatMapInPlaceVec` an unsafe trait.)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Apr 29, 2026
…trochenkov

simd_reduce_min/max: remove float support

LLVM currently doesn't have an intrinsic with the right semantics here (see llvm/llvm-project#185827). The only remaining user of this intrinsic with float types is portable-simd and it's easier to implement a fallback there than here, so I opted for making the intrinsic int-only. I kept around the float support in cranelift and Miri because there it already has the desired semantics (matching scalar min/max).

Fixes rust-lang#153395
~~Blocked on rust-lang/portable-simd#515
rust-bors Bot pushed a commit that referenced this pull request Apr 29, 2026
…uwer

Rollup of 22 pull requests

Successful merges:

 - #154149 (resolve: Extend `ambiguous_import_visibilities` deprecation lint to glob-vs-glob ambiguities)
 - #155189 (simd_reduce_min/max: remove float support)
 - #155453 (apply Cortex-A53 errata 843419 mitigation to the AArch64 Linux targets)
 - #155562 (Add a missing `GenericTypeVisitable`, and avoid having interner traits for `FnSigKind` and `Abi`)
 - #155608 (rustc_middle: Implement the `partial_cmp` operation for `DefId`s)
 - #155721 (When archive format is wrong produce an error instead of ICE)
 - #155794 (privacy: share effective visibility initialization)
 - #155832 (c-variadic: more precise compatibility check in const-eval)
 - #155856 (std_detect: support detecting more features on aarch64 Windows)
 - #155861 (Suggest `[const] Trait` bounds in more places)
 - #155899 (`dlltool`: Set the working directory to workaround `--temp-prefix` bug)
 - #155916 (Update with new LLVM 22 target for `wasm32-wali-linux-musl` target)
 - #155935 (remap OUT_DIR paths to fix build script path leakage in crate metadata. )
 - #155950 (use the new `//@ needs-asm-mnemonic: ret` more)
 - #155958 (ci(free-disk-space): remove more tools and fix warnings)
 - #155966 (miri subtree update)
 - #155711 (bump curl-sys and openssl-sys to support OpenSSL 4.0.x)
 - #155831 (Add `AcceptContext::expect_key_value`)
 - #155877 (Avoid misleading return-type note for foreign `Fn` callees)
 - #155949 (Update `opt_ast_lowering_delayed_lints` query to allow "stealing" lints, allowing to use `FnOnce` instead of `Fn`)
 - #155951 (Make `FlatMapInPlaceVec` an unsafe trait.)
 - #155967 (Fix `doc_cfg` feature for extern items)
rust-bors Bot pushed a commit that referenced this pull request Apr 29, 2026
…uwer

Rollup of 21 pull requests

Successful merges:

 - #155966 (miri subtree update)
 - #154149 (resolve: Extend `ambiguous_import_visibilities` deprecation lint to glob-vs-glob ambiguities)
 - #155189 (simd_reduce_min/max: remove float support)
 - #155562 (Add a missing `GenericTypeVisitable`, and avoid having interner traits for `FnSigKind` and `Abi`)
 - #155608 (rustc_middle: Implement the `partial_cmp` operation for `DefId`s)
 - #155721 (When archive format is wrong produce an error instead of ICE)
 - #155794 (privacy: share effective visibility initialization)
 - #155832 (c-variadic: more precise compatibility check in const-eval)
 - #155856 (std_detect: support detecting more features on aarch64 Windows)
 - #155861 (Suggest `[const] Trait` bounds in more places)
 - #155899 (`dlltool`: Set the working directory to workaround `--temp-prefix` bug)
 - #155916 (Update with new LLVM 22 target for `wasm32-wali-linux-musl` target)
 - #155935 (remap OUT_DIR paths to fix build script path leakage in crate metadata. )
 - #155950 (use the new `//@ needs-asm-mnemonic: ret` more)
 - #155958 (ci(free-disk-space): remove more tools and fix warnings)
 - #155711 (bump curl-sys and openssl-sys to support OpenSSL 4.0.x)
 - #155831 (Add `AcceptContext::expect_key_value`)
 - #155877 (Avoid misleading return-type note for foreign `Fn` callees)
 - #155949 (Update `opt_ast_lowering_delayed_lints` query to allow "stealing" lints, allowing to use `FnOnce` instead of `Fn`)
 - #155951 (Make `FlatMapInPlaceVec` an unsafe trait.)
 - #155967 (Fix `doc_cfg` feature for extern items)
@rust-bors rust-bors Bot merged commit cda4395 into rust-lang:main Apr 30, 2026
11 checks passed
@rustbot rustbot added this to the 1.97.0 milestone Apr 30, 2026
rust-timer added a commit that referenced this pull request Apr 30, 2026
Rollup merge of #155189 - RalfJung:reduce-minmax-float, r=petrochenkov

simd_reduce_min/max: remove float support

LLVM currently doesn't have an intrinsic with the right semantics here (see llvm/llvm-project#185827). The only remaining user of this intrinsic with float types is portable-simd and it's easier to implement a fallback there than here, so I opted for making the intrinsic int-only. I kept around the float support in cranelift and Miri because there it already has the desired semantics (matching scalar min/max).

Fixes #153395
~~Blocked on rust-lang/portable-simd#515
pull Bot pushed a commit to LeeeeeeM/miri that referenced this pull request Apr 30, 2026
…uwer

Rollup of 21 pull requests

Successful merges:

 - rust-lang/rust#155966 (miri subtree update)
 - rust-lang/rust#154149 (resolve: Extend `ambiguous_import_visibilities` deprecation lint to glob-vs-glob ambiguities)
 - rust-lang/rust#155189 (simd_reduce_min/max: remove float support)
 - rust-lang/rust#155562 (Add a missing `GenericTypeVisitable`, and avoid having interner traits for `FnSigKind` and `Abi`)
 - rust-lang/rust#155608 (rustc_middle: Implement the `partial_cmp` operation for `DefId`s)
 - rust-lang/rust#155721 (When archive format is wrong produce an error instead of ICE)
 - rust-lang/rust#155794 (privacy: share effective visibility initialization)
 - rust-lang/rust#155832 (c-variadic: more precise compatibility check in const-eval)
 - rust-lang/rust#155856 (std_detect: support detecting more features on aarch64 Windows)
 - rust-lang/rust#155861 (Suggest `[const] Trait` bounds in more places)
 - rust-lang/rust#155899 (`dlltool`: Set the working directory to workaround `--temp-prefix` bug)
 - rust-lang/rust#155916 (Update with new LLVM 22 target for `wasm32-wali-linux-musl` target)
 - rust-lang/rust#155935 (remap OUT_DIR paths to fix build script path leakage in crate metadata. )
 - rust-lang/rust#155950 (use the new `//@ needs-asm-mnemonic: ret` more)
 - rust-lang/rust#155958 (ci(free-disk-space): remove more tools and fix warnings)
 - rust-lang/rust#155711 (bump curl-sys and openssl-sys to support OpenSSL 4.0.x)
 - rust-lang/rust#155831 (Add `AcceptContext::expect_key_value`)
 - rust-lang/rust#155877 (Avoid misleading return-type note for foreign `Fn` callees)
 - rust-lang/rust#155949 (Update `opt_ast_lowering_delayed_lints` query to allow "stealing" lints, allowing to use `FnOnce` instead of `Fn`)
 - rust-lang/rust#155951 (Make `FlatMapInPlaceVec` an unsafe trait.)
 - rust-lang/rust#155967 (Fix `doc_cfg` feature for extern items)
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-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. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

What are the intended semantics for simd_fmin/fmax and simd_reduce_min/max vs signaling NaN?

8 participants