summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-03-26 16:32:13 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2013-03-26 16:32:13 +0000
commite63390df52117e1d3ca9d23a736e9995bc734765 (patch)
tree4601687a1e983452098d2cfc5e82b1b6107e47bd
parent1d6f4078c1e405749ff688058ef76c287ab36201 (diff)
sna: Add extra '()' around bitwise &/&& for CPU feature detection
By popular demand. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_cpu.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/sna/sna_cpu.c b/src/sna/sna_cpu.c
index ff83ba57..489bf6c8 100644
--- a/src/sna/sna_cpu.c
+++ b/src/sna/sna_cpu.c
@@ -72,7 +72,7 @@ unsigned sna_cpu_detect(void)
extra |= has_YMM;
}
- if (extra & has_YMM && ecx & bit_AVX)
+ if ((extra & has_YMM) && (ecx & bit_AVX))
features |= AVX;
if (edx & bit_MMX)
@@ -87,7 +87,7 @@ unsigned sna_cpu_detect(void)
if (max >= 7) {
__cpuid_count(7, 0, eax, ebx, ecx, edx);
- if (extra & has_YMM && ebx & bit_AVX2)
+ if ((extra & has_YMM) && (ebx & bit_AVX2))
features |= AVX2;
}