From 02cdbf61d3a6d824469f9373b68c26dea36b3bcc Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Tue, 21 May 2019 19:31:13 -0400 Subject: [PATCH] Rename ExtendedControlRegister to XGETBV --- cpu.cpp | 4 ++-- x64dll.asm | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cpu.cpp b/cpu.cpp index ed088c58..0705f21c 100644 --- a/cpu.cpp +++ b/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. #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 ANONYMOUS_NAMESPACE_BEGIN @@ -373,7 +373,7 @@ void DetectX86Features() // Visual Studio 2008 and below lack xgetbv #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; // Downlevel SunCC diff --git a/x64dll.asm b/x64dll.asm index 33fa6a17..a4a73e3f 100644 --- a/x64dll.asm +++ b/x64dll.asm @@ -1965,7 +1965,7 @@ ret SHA256_HashMultipleBlocks_SSE2 ENDP ALIGN 8 -ExtendedControlRegister PROC +XGETBV PROC ;; First paramter is RCX, and xgetbv expects the CTRL in ECX ;; http://www.agner.org/optimize/vectorclass/read.php?i=65 DB 0fh, 01h, 0d0h @@ -1974,7 +1974,7 @@ and rax, 0ffffffffh shl rdx, 32 or rax, rdx ret -ExtendedControlRegister ENDP +XGETBV ENDP _TEXT ENDS END