diff options
author | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-10 05:23:56 +0000 |
---|---|---|
committer | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-10 05:23:56 +0000 |
commit | 7fd92c664628d197997988f8f24b224b0b93458a (patch) | |
tree | cc708771c53672e8d85e29c5b0a8d3c40559d0cd /base/cpu.cc | |
parent | 194da3e3e10498f5a40f581c532a122df52a19dd (diff) | |
download | chromium_src-7fd92c664628d197997988f8f24b224b0b93458a.zip chromium_src-7fd92c664628d197997988f8f24b224b0b93458a.tar.gz chromium_src-7fd92c664628d197997988f8f24b224b0b93458a.tar.bz2 |
Revert 216795 "Adding check for OS support to AVX"
Lots of tree breakages on Windows bots.
> Adding check for OS support to AVX
>
> AVX support requires OS level support, this patch adds the relevant
> checks to ensure AVX is truly supported on a given cpu.
>
> It also fixes a missing initializer for has_avx_.
>
> This is a takeover of https://codereview.chromium.org/12511002/ from
> whunt@ who no longer works on the Chrome team.
>
> BUG=171824
> TEST=none
> TBR=brettw,apatrick_chromium,whunt
>
> Review URL: https://chromiumcodereview.appspot.com/22354004
TBR=dalecurtis@chromium.org
Review URL: https://codereview.chromium.org/22604007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@216807 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/cpu.cc')
-rw-r--r-- | base/cpu.cc | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/base/cpu.cc b/base/cpu.cc index 7ea212e..1761529 100644 --- a/base/cpu.cc +++ b/base/cpu.cc @@ -33,7 +33,6 @@ CPU::CPU() has_ssse3_(false), has_sse41_(false), has_sse42_(false), - has_avx_(false), has_non_stop_time_stamp_counter_(false), cpu_vendor_("unknown") { Initialize(); @@ -83,17 +82,6 @@ void __cpuidex(int cpu_info[4], int info_type, int info_index) { } #endif - -unsigned long long _xgetbv(unsigned int xcr) { - unsigned int eax, edx; - __asm__ volatile ( - ".byte 0x0f, 0x01, 0xd0" - : "=a"(eax), "=d"(edx) - : "c" (xcr) - ); - return static_cast<unsigned long long>(eax) ^ - static_cast<unsigned long long>(edx) << 32; -} #endif // _MSC_VER #endif // ARCH_CPU_X86_FAMILY @@ -132,7 +120,7 @@ void CPU::Initialize() { has_ssse3_ = (cpu_info[2] & 0x00000200) != 0; has_sse41_ = (cpu_info[2] & 0x00080000) != 0; has_sse42_ = (cpu_info[2] & 0x00100000) != 0; - has_avx_ = (cpu_info[2] & 0x10000000) != 0 && (_xgetbv(0) & 6) == 6; + has_avx_ = (cpu_info[2] & 0x10000000) != 0; } // Get the brand string of the cpu. |