Commit 3eefeaeb authored by Frank Barchard's avatar Frank Barchard

test xsave before calling xgetbv.

R=agl@chromium.org, harryjin@google.com
BUG=libyuv:497

Review URL: https://codereview.chromium.org/1382803002 .
parent 2cc1a2b2
Name: libyuv
URL: http://code.google.com/p/libyuv/
Version: 1496
Version: 1497
License: BSD
License File: LICENSE
......
......@@ -11,6 +11,6 @@
#ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT
#define INCLUDE_LIBYUV_VERSION_H_
#define LIBYUV_VERSION 1496
#define LIBYUV_VERSION 1497
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT
......@@ -216,9 +216,8 @@ 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
// AVX requires CPU has AVX, XSAVE and OSXSave for xgetbv
if ((cpu_info1[2] & 0x1c000000) == 0x1c000000 && // AVX and OSXSave
!TestEnv("LIBYUV_DISABLE_AVX") && TestOsSaveYmm()) { // Saves YMM.
cpu_info_ |= ((cpu_info7[1] & 0x00000020) ? kCpuHasAVX2 : 0) |
kCpuHasAVX;
......
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