OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/cpu.h" | 5 #include "base/cpu.h" |
6 #include "build/build_config.h" | 6 #include "build/build_config.h" |
7 | 7 |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/googletest/include/gtest/gtest.h" |
9 | 9 |
10 #if _MSC_VER >= 1700 | 10 #if _MSC_VER >= 1700 |
11 // C4752: found Intel(R) Advanced Vector Extensions; consider using /arch:AVX. | 11 // C4752: found Intel(R) Advanced Vector Extensions; consider using /arch:AVX. |
12 #pragma warning(disable: 4752) | 12 #pragma warning(disable: 4752) |
13 #endif | 13 #endif |
14 | 14 |
15 // Tests whether we can run extended instructions represented by the CPU | 15 // Tests whether we can run extended instructions represented by the CPU |
16 // information. This test actually executes some extended instructions (such as | 16 // information. This test actually executes some extended instructions (such as |
17 // MMX, SSE, etc.) supported by the CPU and sees we can run them without | 17 // MMX, SSE, etc.) supported by the CPU and sees we can run them without |
18 // "undefined instruction" exceptions. That is, this test succeeds when this | 18 // "undefined instruction" exceptions. That is, this test succeeds when this |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 } | 108 } |
109 | 109 |
110 if (cpu.has_avx2()) { | 110 if (cpu.has_avx2()) { |
111 // Execute an AVX 2 instruction. | 111 // Execute an AVX 2 instruction. |
112 __asm vpunpcklbw ymm0, ymm0, ymm0 | 112 __asm vpunpcklbw ymm0, ymm0, ymm0 |
113 } | 113 } |
114 #endif // _MSC_VER >= 1700 | 114 #endif // _MSC_VER >= 1700 |
115 #endif // defined(COMPILER_GCC) | 115 #endif // defined(COMPILER_GCC) |
116 #endif // defined(ARCH_CPU_X86_FAMILY) | 116 #endif // defined(ARCH_CPU_X86_FAMILY) |
117 } | 117 } |
OLD | NEW |