Commit 76aee8ce authored by Frank Barchard's avatar Frank Barchard

Remove most clang-cl special cases from cpu_id.cc

They are not needed, and due to them there was a call to _xgetbv()
without a declaration of the function.  This used to work because we
implicitly included intrin.h in all translation units with clang-cl, but
we want to stop doing that.

BUG=chromium:592745
R=fbarchard@google.com

Review URL: https://codereview.chromium.org/1780473003 .
parent 46c3d42c
...@@ -10,12 +10,12 @@ ...@@ -10,12 +10,12 @@
#include "libyuv/cpu_id.h" #include "libyuv/cpu_id.h"
#if defined(_MSC_VER) && !defined(__clang__) #if defined(_MSC_VER)
#include <intrin.h> // For __cpuidex() #include <intrin.h> // For __cpuidex()
#endif #endif
#if !defined(__pnacl__) && !defined(__CLR_VER) && \ #if !defined(__pnacl__) && !defined(__CLR_VER) && \
!defined(__native_client__) && (defined(_M_IX86) || defined(_M_X64)) && \ !defined(__native_client__) && (defined(_M_IX86) || defined(_M_X64)) && \
defined(_MSC_VER) && !defined(__clang__) && (_MSC_FULL_VER >= 160040219) defined(_MSC_VER) && (_MSC_FULL_VER >= 160040219)
#include <immintrin.h> // For _xgetbv() #include <immintrin.h> // For _xgetbv()
#endif #endif
...@@ -48,7 +48,7 @@ extern "C" { ...@@ -48,7 +48,7 @@ extern "C" {
!defined(__pnacl__) && !defined(__CLR_VER) !defined(__pnacl__) && !defined(__CLR_VER)
LIBYUV_API LIBYUV_API
void CpuId(uint32 info_eax, uint32 info_ecx, uint32* cpu_info) { void CpuId(uint32 info_eax, uint32 info_ecx, uint32* cpu_info) {
#if defined(_MSC_VER) && !defined(__clang__) #if defined(_MSC_VER)
// Visual C version uses intrinsic or inline x86 assembly. // Visual C version uses intrinsic or inline x86 assembly.
#if (_MSC_FULL_VER >= 160040219) #if (_MSC_FULL_VER >= 160040219)
__cpuidex((int*)(cpu_info), info_eax, info_ecx); __cpuidex((int*)(cpu_info), info_eax, info_ecx);
...@@ -71,7 +71,7 @@ void CpuId(uint32 info_eax, uint32 info_ecx, uint32* cpu_info) { ...@@ -71,7 +71,7 @@ void CpuId(uint32 info_eax, uint32 info_ecx, uint32* cpu_info) {
} }
#endif #endif
// GCC version uses inline x86 assembly. // GCC version uses inline x86 assembly.
#else // defined(_MSC_VER) && !defined(__clang__) #else // defined(_MSC_VER)
uint32 info_ebx, info_edx; uint32 info_ebx, info_edx;
asm volatile ( asm volatile (
#if defined( __i386__) && defined(__PIC__) #if defined( __i386__) && defined(__PIC__)
...@@ -89,7 +89,7 @@ void CpuId(uint32 info_eax, uint32 info_ecx, uint32* cpu_info) { ...@@ -89,7 +89,7 @@ void CpuId(uint32 info_eax, uint32 info_ecx, uint32* cpu_info) {
cpu_info[1] = info_ebx; cpu_info[1] = info_ebx;
cpu_info[2] = info_ecx; cpu_info[2] = info_ecx;
cpu_info[3] = info_edx; cpu_info[3] = info_edx;
#endif // defined(_MSC_VER) && !defined(__clang__) #endif // defined(_MSC_VER)
} }
#else // (defined(_M_IX86) || defined(_M_X64) ... #else // (defined(_M_IX86) || defined(_M_X64) ...
LIBYUV_API LIBYUV_API
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment