summaryrefslogtreecommitdiff
path: root/x64dll.asm
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2018-08-19 10:19:29 -0400
committerJeffrey Walton <noloader@gmail.com>2018-08-19 10:19:29 -0400
commit082ad86132ddda2552f10640e176b321a76397a1 (patch)
tree0953a34a438befcd89489f081a2039af994bad9a /x64dll.asm
parentd41b3c82119ea16588ab28ca24b5fb07515de60e (diff)
downloadcryptopp-git-082ad86132ddda2552f10640e176b321a76397a1.tar.gz
Fix missing _xgetbv for Visual Studio 2008 and below
Diffstat (limited to 'x64dll.asm')
-rw-r--r--x64dll.asm14
1 files changed, 14 insertions, 0 deletions
diff --git a/x64dll.asm b/x64dll.asm
index 6f90239c..7857f5f1 100644
--- a/x64dll.asm
+++ b/x64dll.asm
@@ -1964,5 +1964,19 @@ pop rsi
ret
SHA256_HashMultipleBlocks_SSE2 ENDP
+ ALIGN 8
+ExtendedControlRegister PROC
+;; First paramter is RCX, and xgetbv expects the CTR in ECX
+;; http://www.agner.org/optimize/vectorclass/read.php?i=65
+DB 0fh
+DB 01h
+DB 0d0h
+;; xcr = (EDX << 32) | EAX
+and rax, 0ffffffffh
+shl rdx, 32
+or rax, rdx
+ret
+ExtendedControlRegister ENDP
+
_TEXT ENDS
END