Stabilize the avx512 target features by sayantn · Pull Request #138940 · rust-lang/rust (original) (raw)

I discovered a related mistake in LLVM. Basically

I have filed llvm/llvm-project#136209

For avx512f, this requirement is probably justified (see this comment). We just need to ensure that fma and f16c are required for avx512f in std_detect. I have sent a PR (rust-lang/stdarch#1781).

But we need to settle the avx512fp16 business.

This has the potential to generate invalid code (even in safe Rust, e.g https://godbolt.org/z/d3M674nY6 - here only avx512fp16 is enabled, but LLVM is generating vaddph.128, which is not available without avx512vl). Even if #140389 passes though, this invalid codegen will persist, as it is an LLVM issue. So essentially we have 2 options

I don't think we have to delay the stabilization of any other avx512 target feature.

cc @rust-lang/lang
cc @rust-lang/wg-llvm