Issue metadata
Sign in to add a comment
|
CPUID detection for AVX2 seems incorrect
Reported by
tlip...@gmail.com,
Nov 21 2016
|
||||||||||||||||||||||
Issue descriptionUserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36 Steps to reproduce the problem: In base/cpu.cc, the call to __cpuid(cpu_info, 7) which is supposed to check for extended CPU features isn't zeroing ECX before the call. See https://en.wikipedia.org/wiki/CPUID#EAX.3D7.2C_ECX.3D0:_Extended_Features What is the expected behavior? What went wrong? If the function is called when ecx happens to be non-zero, it will return a set of all zero flags and disable features unnecessarily. Did this work before? N/A Chrome version: 53.0.2785.116 Channel: n/a OS Version: Flash Version: Shockwave Flash 23.0 r0
,
Nov 21 2016
Unfortunately I don't have a testcase/repro, since I'm using base/cpu.cc in an external project rather than as part of Chromium. But, I found that CPU().has_avx2() on my Haswell box was returning false. When I added this diff:
--- a/src/kudu/gutil/cpu.cc
+++ b/src/kudu/gutil/cpu.cc
@@ -68,7 +68,7 @@ void __cpuid(int cpu_info[4], int info_type) {
__asm__ volatile (
"cpuid\n"
: "=a"(cpu_info[0]), "=b"(cpu_info[1]), "=c"(cpu_info[2]), "=d"(cpu_info[3])
- : "a"(info_type)
+ : "a"(info_type), "c"(0)
);
}
it fixed the issue for me and properly reported has_avx2() as true on my box (matching the flags line in /proc/cpuinfo)
,
Nov 22 2016
This seems out of Scope from TE end, hence added TE-NeedsTriageHelp to get addressed further.
,
Nov 23 2016
,
Jan 3 2017
|
|||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||
Comment 1 by ligim...@chromium.org
, Nov 21 2016Labels: Needs-Triage-M54 M-54