Closed lucatrv closed 2 months ago
What does /proc/cpuinfo
list?
Also please try if it works at runtime, e.g.:
$ git clone -q https://github.com/noloader/SHA-Intrinsics
$ cd SHA-Intrinsics
$ gcc sha1-x86.c -DTEST_MAIN -march=westmere -msha
$ ./a.out
SHA1 hash of empty message: DA39A3EE5E6B4B0D...
Success!
What does
/proc/cpuinfo
list?
/proc/cpuinfo
shows 13th Gen Intel(R) Core(TM) i7-1370P
, which is my host CPU. However I'm running QEMU with -cpu Westmere
, so my guest CPU is Westmere
instead.
If I run:
gcc -v -E -x c /dev/null -o /dev/null -march=native 2>&1 | grep /cc1 | grep mtune
as suggested here I get -mtune=westmere
, so GCC detects my guest CPU correctly.
Also please try if it works at runtime, e.g.:
$ git clone -q https://github.com/noloader/SHA-Intrinsics $ cd SHA-Intrinsics $ gcc sha1-x86.c -DTEST_MAIN -march=westmere -msha $ ./a.out SHA1 hash of empty message: DA39A3EE5E6B4B0D... Success!
It works. Now I'm confused...
What does
/proc/cpuinfo
list?
/proc/cpuinfo
shows13th Gen Intel(R) Core(TM) i7-1370P
, which is my host CPU. However I'm running QEMU with-cpu Westmere
, so my guest CPU isWestmere
instead.
I'm asking which feature flags it reports.
You could also try if -cpu Westmere,-sha-ni
changes anything.
I now tried to run QEM without -cpu
flag, the above gcc -v -E ...
command correctly reports -mtune=nocona
, /proc/cpuinfo
still shows 13th Gen Intel(R) Core(TM) i7-1370P
, while cpuid2cpuflags
shows CPU_FLAGS_X86: avx2 mmx mmxext sha sse sse2 sse3 vpclmulqdq
(again avx2
, sha
, and vpclmulqdq
look wrong to me).
Now sha1-x86.c
does not compile.
Please provide the requested information and error logs for "does not compile".
Sorry I cannot answer anymore because I uninstalled QEMU and moved back to VMware, please feel free to close this issue.
I'm running Gentoo Linux as a QEMU 9.0 guest on a Windows 10 host, with
-cpu Westmere
.cpuid2cpuflags
shows the following output:but
avx2
,sha
, andvpclmulqdq
look wrong to me.I do not have a real Westmere system to compare.