Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simd_fpow and simd_fpowi intrinsics are not exposed in intrinsics::simd #137555

Open
folkertdev opened this issue Feb 24, 2025 · 7 comments
Open
Labels
A-SIMD Area: SIMD (Single Instruction Multiple Data) F-core_intrinsics Issue in the "core intrinsics" for internal usage only. needs-triage This issue may need triage. Remove it if it has been sufficiently triaged.

Comments

@folkertdev
Copy link
Contributor

folkertdev commented Feb 24, 2025

As a result, to test/use these intrinsics they must be redeclared outside of core, which is at best inelegant and at worst could lead to subtle bugs.

I think there are two options:

  • this is an oversight, and we should define and expose these intrinsics
  • there is an undocumented reason that these intrinsics are not exposed in the standard way
  • edit: secret third thing: these intrinsics are not useful and should be removed

cc @calebzulawski it looks like you touched this last 5 years ago 07db2bf. Long time, but maybe you remember something?

@rustbot label +A-simd +F-core_intrinsics

@rustbot rustbot added needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. A-SIMD Area: SIMD (Single Instruction Multiple Data) F-core_intrinsics Issue in the "core intrinsics" for internal usage only. labels Feb 24, 2025
@RalfJung
Copy link
Member

As far as I can see, neither stdarch nor portable-simd use these intrinsics. So... should we just remove them? Or is there a reason for them to exist?

Cc @workingjubilee @calebzulawski @Amanieu

@folkertdev
Copy link
Contributor Author

None of the targets/instruction sets I could think of seem to do anything smart

https://godbolt.org/z/KP1K66nhP

they just seem to spill to the stack and use the standard scalar pow functions. A strong argument for removing these intrinsics.

@workingjubilee
Copy link
Member

workingjubilee commented Feb 24, 2025

then I'm pro-yeet, assuming there isn't something special I don't remember

@calebzulawski
Copy link
Member

Odd that they don't do much at all. Seems ok to remove them to me, we can re-add (working) intrinsics if we try to expose a function that needs it

@RalfJung
Copy link
Member

@folkertdev are you planning to make a PR that removes them? :)

@folkertdev
Copy link
Contributor Author

Yes

@folkertdev
Copy link
Contributor Author

folkertdev commented Feb 25, 2025

I opened #137595

fmease added a commit to fmease/rust that referenced this issue Feb 25, 2025
…=RalfJung

remove `simd_fpow` and `simd_fpowi`

Discussed in rust-lang#137555

These functions are not exposed from `std::intrinsics::simd`, and not used anywhere outside of the compiler. They also don't lower to particularly good code at least on the major ISAs (I checked x86_64, aarch64, s390x, powerpc), where the vector is just spilled to the stack and scalar functions are used for the actual logic.

r? `@RalfJung`
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Feb 25, 2025
Rollup merge of rust-lang#137595 - folkertdev:remove-simd-pow-powi, r=RalfJung

remove `simd_fpow` and `simd_fpowi`

Discussed in rust-lang#137555

These functions are not exposed from `std::intrinsics::simd`, and not used anywhere outside of the compiler. They also don't lower to particularly good code at least on the major ISAs (I checked x86_64, aarch64, s390x, powerpc), where the vector is just spilled to the stack and scalar functions are used for the actual logic.

r? `@RalfJung`
bjorn3 pushed a commit to rust-lang/rustc_codegen_cranelift that referenced this issue Feb 26, 2025
remove `simd_fpow` and `simd_fpowi`

Discussed in rust-lang/rust#137555

These functions are not exposed from `std::intrinsics::simd`, and not used anywhere outside of the compiler. They also don't lower to particularly good code at least on the major ISAs (I checked x86_64, aarch64, s390x, powerpc), where the vector is just spilled to the stack and scalar functions are used for the actual logic.

r? `@RalfJung`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-SIMD Area: SIMD (Single Instruction Multiple Data) F-core_intrinsics Issue in the "core intrinsics" for internal usage only. needs-triage This issue may need triage. Remove it if it has been sufficiently triaged.
Projects
None yet
Development

No branches or pull requests

5 participants