mirror of
https://chromium.googlesource.com/libyuv/libyuv
synced 2026-02-16 23:29:52 +08:00
Use emit for xgetbv for compatibility with vs2005, vs2008 and vs2010 without sp1.
BUG=none TEST=none R=nfullagar@google.com, tpsiaki@google.com Review URL: https://webrtc-codereview.appspot.com/3089005 git-svn-id: http://libyuv.googlecode.com/svn/trunk@833 16f28f9a-4ce2-e073-06de-1de4eb20be90
This commit is contained in:
parent
21796c94aa
commit
15df877b64
@ -1,6 +1,6 @@
|
|||||||
Name: libyuv
|
Name: libyuv
|
||||||
URL: http://code.google.com/p/libyuv/
|
URL: http://code.google.com/p/libyuv/
|
||||||
Version: 832
|
Version: 833
|
||||||
License: BSD
|
License: BSD
|
||||||
License File: LICENSE
|
License File: LICENSE
|
||||||
|
|
||||||
|
|||||||
@ -72,6 +72,7 @@ int YUY2ToI422(const uint8* src_yuy2, int src_stride_yuy2,
|
|||||||
int width, int height);
|
int width, int height);
|
||||||
|
|
||||||
// Convert UYVY to I422.
|
// Convert UYVY to I422.
|
||||||
|
LIBYUV_API
|
||||||
int UYVYToI422(const uint8* src_uyvy, int src_stride_uyvy,
|
int UYVYToI422(const uint8* src_uyvy, int src_stride_uyvy,
|
||||||
uint8* dst_y, int dst_stride_y,
|
uint8* dst_y, int dst_stride_y,
|
||||||
uint8* dst_u, int dst_stride_u,
|
uint8* dst_u, int dst_stride_u,
|
||||||
|
|||||||
@ -11,6 +11,6 @@
|
|||||||
#ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT
|
#ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT
|
||||||
#define INCLUDE_LIBYUV_VERSION_H_
|
#define INCLUDE_LIBYUV_VERSION_H_
|
||||||
|
|
||||||
#define LIBYUV_VERSION 832
|
#define LIBYUV_VERSION 833
|
||||||
|
|
||||||
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT
|
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT
|
||||||
|
|||||||
@ -60,15 +60,22 @@ void CpuId(uint32 eax, uint32 ecx, uint32* cpu_info) {
|
|||||||
cpu_info[3] = edx;
|
cpu_info[3] = edx;
|
||||||
#endif // defined(_MSC_VER)
|
#endif // defined(_MSC_VER)
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(__native_client__)
|
#if !defined(__native_client__)
|
||||||
#define HAS_XGETBV
|
#define HAS_XGETBV
|
||||||
// X86 CPUs have xgetbv to detect OS saves high parts of ymm registers.
|
// X86 CPUs have xgetbv to detect OS saves high parts of ymm registers.
|
||||||
int TestOsSaveYmm() {
|
int TestOsSaveYmm() {
|
||||||
uint32 xcr0;
|
uint32 xcr0 = 0u;
|
||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER) && (_MSC_FULL_VER >= 160040219)
|
||||||
xcr0 = static_cast<uint32>(_xgetbv(0)); // VS2010 SP1 required.
|
xcr0 = static_cast<uint32>(_xgetbv(0)); // VS2010 SP1 required.
|
||||||
#else
|
#elif defined(_M_IX86)
|
||||||
asm volatile ("xgetbv" : "=a" (xcr0) : "c" (0) : "%edx" ); // NOLINT
|
__asm {
|
||||||
|
xor ecx, ecx // xcr 0
|
||||||
|
_asm _emit 0x0f _asm _emit 0x01 _asm _emit 0xd0 // For VS2010 and earlier.
|
||||||
|
mov xcr0, eax
|
||||||
|
}
|
||||||
|
#elif defined(__i386__) || defined(__x86_64__)
|
||||||
|
asm volatile (".byte 0x0f, 0x01, 0xd0" : "=a" (xcr0) : "c" (0) : "%edx" );
|
||||||
#endif // defined(_MSC_VER)
|
#endif // defined(_MSC_VER)
|
||||||
return((xcr0 & 6) == 6); // Is ymm saved?
|
return((xcr0 & 6) == 6); // Is ymm saved?
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user