Closed daxpedda closed 1 month ago
r? @Amanieu
rustbot has assigned @Amanieu. 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
I believe these were intentionally omitted to allow using SIMD type constructors in a const context.
And in the end, just using the SIMD types doesn't require the feature to be available, the compiler will just fall back to treating it as an array of scalars.
Ah yes at the time this wasn't possible due to the usage of const
, but if the compiler now allows #[target_feature]
on const
functions I think this is ok to land. I also agree with @Amanieu though that these should be optional and not required.
I also agree with @Amanieu though that these should be optional and not required.
Does #[target_feature(enable = "simd128")]
cause LLVM to generate SIMD128 instructions here even without using -Ctarget-feature=simd128
?
Right yeah, the -C
flag applies to all functions within a crate and #[target_feature]
only applies to a single function, and LLVM only needs it enabled for the function-at-hand.
I see, thanks! Will go ahead and close this then.
I believe that adding these was missed in #874 and adding this now should not be a breaking change.
Cc @alexcrichton.