Commit aa64b6b1 authored by fbarchard@google.com's avatar fbarchard@google.com

movbe instruction detect

BUG=none
TEST=cpu unittest
Review URL: https://webrtc-codereview.appspot.com/1027005

git-svn-id: http://libyuv.googlecode.com/svn/trunk@527 16f28f9a-4ce2-e073-06de-1de4eb20be90
parent bae8b852
Name: libyuv
URL: http://code.google.com/p/libyuv/
Version: 526
Version: 527
License: BSD
License File: LICENSE
......
......@@ -34,6 +34,7 @@ static const int kCpuHasSSE41 = 0x80;
static const int kCpuHasSSE42 = 0x100;
static const int kCpuHasAVX = 0x200;
static const int kCpuHasAVX2 = 0x400;
static const int kCpuHasMOVBE = 0x800; // For test purposes.
// These flags are only valid on MIPS processors.
static const int kCpuHasMIPS = 0x1000;
......
......@@ -11,6 +11,6 @@
#ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT
#define INCLUDE_LIBYUV_VERSION_H_
#define LIBYUV_VERSION 526
#define LIBYUV_VERSION 527
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT
......@@ -162,6 +162,7 @@ int InitCpuFlags(void) {
((cpu_info[2] & 0x00000200) ? kCpuHasSSSE3 : 0) |
((cpu_info[2] & 0x00080000) ? kCpuHasSSE41 : 0) |
((cpu_info[2] & 0x00100000) ? kCpuHasSSE42 : 0) |
((cpu_info[2] & 0x00400000) ? kCpuHasMOVBE : 0) |
(((cpu_info[2] & 0x18000000) == 0x18000000) ? kCpuHasAVX : 0) |
kCpuHasX86;
#ifdef HAS_XGETBV
......@@ -189,6 +190,9 @@ int InitCpuFlags(void) {
if (TestEnv("LIBYUV_DISABLE_SSE42")) {
cpu_info_ &= ~kCpuHasSSE42;
}
if (TestEnv("LIBYUV_DISABLE_MOVBE")) {
cpu_info_ &= ~kCpuHasMOVBE;
}
if (TestEnv("LIBYUV_DISABLE_AVX")) {
cpu_info_ &= ~kCpuHasAVX;
}
......
......@@ -35,6 +35,8 @@ TEST_F(libyuvTest, TestCpuHas) {
printf("Has SSE4.1 %x\n", has_sse41);
int has_sse42 = TestCpuFlag(kCpuHasSSE42);
printf("Has SSE4.2 %x\n", has_sse42);
int has_movbe = TestCpuFlag(kCpuHasMOVBE);
printf("Has MOVBE %x\n", has_movbe);
int has_avx = TestCpuFlag(kCpuHasAVX);
printf("Has AVX %x\n", has_avx);
int has_avx2 = TestCpuFlag(kCpuHasAVX2);
......
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