stdarch icon indicating copy to clipboard operation
stdarch copied to clipboard

Allow internal use of stdsimd from detect_feature

Open tmiasko opened this issue 3 years ago • 3 comments

This allows using feature detection macros, without placing a requirement of enabled stdsimd feature gate from end users.

A follow-up to changes from #1311, which introduced the new macro.

Noticed while preparing a bump of stdarch submodule in the standard library.

tmiasko avatar Aug 13 '22 08:08 tmiasko

r? @Amanieu

(rust-highfive has picked a reviewer for you, use r? to override)

rust-highfive avatar Aug 13 '22 08:08 rust-highfive

What exactly is this enabling? I'm concerned about accidentally stabilizing something we don't want to stabilize here.

Amanieu avatar Aug 20 '22 20:08 Amanieu

This allows the macro to internally use stdsimd feature, without requiring end users to enable it. This is necessary to use already stable macros, without requiring stdsimd feature gate.

Note that this implementation strategy is in place since #1303, and this pull request merely extends the existing approach to a new macro. I presumed this implementation strategy was already "blessed".

This change surfaces the same stability concerns as #1303. It makes stdsimd feature gate ineffective from within macros. The only reason this seems fine to me, is that things happen to be organized such that the generated macro itself requires stdsimd feature gate whenever more fine grained target features require it.

tmiasko avatar Aug 21 '22 12:08 tmiasko