allow xgetbv to be disabled for drmemory testing

R=harryjin@google.com
BUG=none

Review URL: https://webrtc-codereview.appspot.com/56649004.
This commit is contained in:
Frank Barchard 2015-08-04 15:00:39 -07:00
parent e40384b6d9
commit 6e7ef3fddc
3 changed files with 5 additions and 6 deletions

View File

@ -1,6 +1,6 @@
Name: libyuv
URL: http://code.google.com/p/libyuv/
Version: 1459
Version: 1460
License: BSD
License File: LICENSE

View File

@ -11,6 +11,6 @@
#ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT
#define INCLUDE_LIBYUV_VERSION_H_
#define LIBYUV_VERSION 1459
#define LIBYUV_VERSION 1460
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT

View File

@ -216,8 +216,10 @@ int InitCpuFlags(void) {
kCpuHasX86;
#ifdef HAS_XGETBV
// Avoid call to xgetbv if AVX disabled for drmemory.
// TODO(fbarchard): check xsave before calling xgetbv.
if ((cpu_info1[2] & 0x18000000) == 0x18000000 && // AVX and OSSave
TestOsSaveYmm()) { // Saves YMM.
!TestEnv("LIBYUV_DISABLE_AVX") && TestOsSaveYmm()) { // Saves YMM.
cpu_info_ |= ((cpu_info7[1] & 0x00000020) ? kCpuHasAVX2 : 0) |
kCpuHasAVX;
}
@ -238,9 +240,6 @@ int InitCpuFlags(void) {
if (TestEnv("LIBYUV_DISABLE_SSE42")) {
cpu_info_ &= ~kCpuHasSSE42;
}
if (TestEnv("LIBYUV_DISABLE_AVX")) {
cpu_info_ &= ~kCpuHasAVX;
}
if (TestEnv("LIBYUV_DISABLE_AVX2")) {
cpu_info_ &= ~kCpuHasAVX2;
}