Skip to content

Add _mm_clflushopt intrinsic#2141

Open
jlpetz wants to merge 1 commit into
rust-lang:mainfrom
jlpetz:clflushopt-intrinsic
Open

Add _mm_clflushopt intrinsic#2141
jlpetz wants to merge 1 commit into
rust-lang:mainfrom
jlpetz:clflushopt-intrinsic

Conversation

@jlpetz
Copy link
Copy Markdown

@jlpetz jlpetz commented May 29, 2026

Implements #1456: adds the _mm_clflushopt intrinsic for the
CLFLUSHOPT instruction (weakly-ordered cache-line flush). Until now stdarch
exposed only the SSE2 _mm_clflush, so there was no way to emit clflushopt
from an intrinsic.

Gated on the clflushopt target feature added in rust-lang/rust#157098
(tracking issue rust-lang/rust#157096). CI will be red until that compiler
change merges and syncs into the pinned toolchain here
— the
#[target_feature(enable = "clflushopt")] won't be recognized before then.

Modeled on the existing _mm_clflush / adx intrinsics: links
llvm.x86.clflushopt, assert_instr(clflushopt) codegen test, and a
simd_test runtime test. The Intel-verification false-match exemption for
_mm_clflush is extended to cover _mm_clflushopt (both take *const u8).

Adds the `_mm_clflushopt` intrinsic for the CLFLUSHOPT instruction
(weakly-ordered cache-line flush). Until now stdarch exposed only the
SSE2 `_mm_clflush`, so there was no way to emit `clflushopt` from an
intrinsic.

Gated on the new `clflushopt` target feature. See the PR description for
the related compiler PR and tracking issue.

Modeled on the existing `_mm_clflush` / `adx` intrinsics: links
`llvm.x86.clflushopt`, assert_instr + simd_test coverage.
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 29, 2026

r? @folkertdev

rustbot has assigned @folkertdev.
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: @Amanieu, @adamgemmell, @davidtwco, @folkertdev, @sayantn
  • @Amanieu, @adamgemmell, @davidtwco, @folkertdev, @sayantn expanded to Amanieu, adamgemmell, davidtwco, folkertdev, sayantn
  • Random selection from Amanieu, adamgemmell, davidtwco, folkertdev, sayantn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants