Bug 1274253. Properly test the cpuid bits.
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Thu, 19 May 2016 11:23:30 -0400
changeset 298175 fdbc5ad618facce8b3e8abc2c9f8f409934b2df2
parent 298174 937ab6cd1b4894a811bbe9199fde5de75f281b79
child 298176 a3eb07c249c423d3ff2ee258665be51480a404be
push id77060
push userjmuizelaar@mozilla.com
push dateThu, 19 May 2016 19:02:15 +0000
treeherdermozilla-inbound@fdbc5ad618fa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1274253
milestone49.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1274253. Properly test the cpuid bits. I fixed the other platforms to do this but failed to do so on GCC/clang
mozglue/build/SSE.cpp
--- a/mozglue/build/SSE.cpp
+++ b/mozglue/build/SSE.cpp
@@ -29,17 +29,17 @@ has_cpuid_bits(unsigned int level, CPUID
   unsigned max = __get_cpuid_max(0, NULL);
   if (level > max)
     return false;
   __cpuid_count(level, 0, eax, ebx, ecx, edx);
   regs[0] = eax;
   regs[1] = ebx;
   regs[2] = ecx;
   regs[3] = edx;
-  return regs[reg] & bits;
+  return (regs[reg] & bits) == bits;
 }
 
 static uint64_t xgetbv(uint32_t xcr) {
     uint32_t eax, edx;
     __asm__ ( ".byte 0x0f, 0x01, 0xd0" : "=a"(eax), "=d"(edx) : "c"(xcr));
     return (uint64_t)(edx) << 32 | eax;
 }