Rename ExtendedControlRegister to XGETBV
parent
cf85d768b4
commit
02cdbf61d3
4
cpu.cpp
4
cpu.cpp
|
|
@ -58,7 +58,7 @@ unsigned long int getauxval(unsigned long int) { return 0; }
|
||||||
|
|
||||||
// Visual Studio 2008 and below is missing _xgetbv. See x64dll.asm for the body.
|
// Visual Studio 2008 and below is missing _xgetbv. See x64dll.asm for the body.
|
||||||
#if defined(_MSC_VER) && _MSC_VER <= 1500 && defined(_M_X64)
|
#if defined(_MSC_VER) && _MSC_VER <= 1500 && defined(_M_X64)
|
||||||
extern "C" unsigned long long __fastcall ExtendedControlRegister(unsigned int);
|
extern "C" unsigned long long __fastcall XGETBV(unsigned int);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ANONYMOUS_NAMESPACE_BEGIN
|
ANONYMOUS_NAMESPACE_BEGIN
|
||||||
|
|
@ -373,7 +373,7 @@ void DetectX86Features()
|
||||||
|
|
||||||
// Visual Studio 2008 and below lack xgetbv
|
// Visual Studio 2008 and below lack xgetbv
|
||||||
#elif defined(_MSC_VER) && _MSC_VER <= 1500 && defined(_M_X64)
|
#elif defined(_MSC_VER) && _MSC_VER <= 1500 && defined(_M_X64)
|
||||||
word64 xcr0 = ExtendedControlRegister(0);
|
word64 xcr0 = XGETBV(0);
|
||||||
g_hasAVX = (xcr0 & YMM_FLAG) == YMM_FLAG;
|
g_hasAVX = (xcr0 & YMM_FLAG) == YMM_FLAG;
|
||||||
|
|
||||||
// Downlevel SunCC
|
// Downlevel SunCC
|
||||||
|
|
|
||||||
|
|
@ -1965,7 +1965,7 @@ ret
|
||||||
SHA256_HashMultipleBlocks_SSE2 ENDP
|
SHA256_HashMultipleBlocks_SSE2 ENDP
|
||||||
|
|
||||||
ALIGN 8
|
ALIGN 8
|
||||||
ExtendedControlRegister PROC
|
XGETBV PROC
|
||||||
;; First paramter is RCX, and xgetbv expects the CTRL in ECX
|
;; First paramter is RCX, and xgetbv expects the CTRL in ECX
|
||||||
;; http://www.agner.org/optimize/vectorclass/read.php?i=65
|
;; http://www.agner.org/optimize/vectorclass/read.php?i=65
|
||||||
DB 0fh, 01h, 0d0h
|
DB 0fh, 01h, 0d0h
|
||||||
|
|
@ -1974,7 +1974,7 @@ and rax, 0ffffffffh
|
||||||
shl rdx, 32
|
shl rdx, 32
|
||||||
or rax, rdx
|
or rax, rdx
|
||||||
ret
|
ret
|
||||||
ExtendedControlRegister ENDP
|
XGETBV ENDP
|
||||||
|
|
||||||
_TEXT ENDS
|
_TEXT ENDS
|
||||||
END
|
END
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue