Re: 13.2-BETA2: xz: illegal instruction

From: Jamie Landeg-Jones <jamie_at_catflap.org>
Date: Thu, 23 Feb 2023 22:14:13 UTC
Peter <pmc@citylink.dinoex.sub.org> wrote:

>  -target-cpu westmere
>
> But when building with CPTYPE?=native, the code works!

That's weird!

I notice the only difference between those 2 is that the "native" one
specifically sets (-target-feature +...) or unsets (-target-feature -...)
the features to use.

Presumably there is something enabled by default that shouldn't be
(for westmere), but the extra flags added with "native" fix that.

This is more a question for the clang folks, but if you're really 
interested, you could try (on your -march=westmere build)
disabling them in ever decreasing group sizes until you narrow
down the culprit!

This is what your native enables:

+64bit +cmov +crc32 +cx16 +cx8 +fxsr +mmx +popcnt +sahf +sse +sse2 +sse3 +sse4.1 +sse4.2 +ssse3

And this is what it disables:

-adx -aes -amx-bf16 -amx-int8 -amx-tile -avx -avx2 -avx512bf16 -avx512bitalg -avx512bw -avx512cd -avx512dq -avx512er -avx512f -avx512fp16 -avx512ifma -avx512pf -avx512vbmi -avx512vbmi2 -avx512vl -avx512vnni -avx512vp2intersect -avx512vpopcntdq -avxvnni -bmi -bmi2 -cldemote -clflushopt -clwb -clzero -enqcmd -f16c -fma -fma4 -fsgsbase -gfni -hreset -invpcid -kl -lwp -lzcnt -movbe -movdir64b -movdiri -mwaitx -pclmul -pconfig -pku -prefetchwt1 -prfchw -ptwrite -rdpid -rdrnd -rdseed -rtm -serialize -sgx -sha -shstk -sse4a -tbm -tsxldtrk -uintr -vaes -vpclmulqdq -waitpkg -wbnoinvd -widekl -xop -xsave -xsavec -xsaveopt -xsaves

Cheers, Jamie