Info about GCC support for znver4...
https://www.phoronix.com/news/AMD-Zen-4-Znver4-GCC-EnableSo what this amounts to at this point is getting -march=native working for Zen 4, honoring -march=znver4, and then over the Znver3 target just flipping on AVX512F, AVX512DQ, AVX512IFMA, AVX512CD, AVX512BW, AVX512VL, AVX512BF16, AVX512VBMI, AVX512VBMI2, GFNI, AVX512VNNI, AVX512BITALG, and AVX512VPOPCNTDQ.
The current advice for compiling is to use znver3 and add the AVX512 extensions manually. For the binary Windows builds avx512-sha-vaes will provide near optimum performance.