summaryrefslogtreecommitdiff
path: root/x64dll.asm
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2020-02-08 03:26:01 -0500
committerJeffrey Walton <noloader@gmail.com>2020-02-08 03:26:01 -0500
commit1af59f4a7500e02296ef2a8237f87d070c6f4a77 (patch)
tree7165f54d15dd7f5a43fbe88a97113f500321e8e9 /x64dll.asm
parent1ccf9d5ab352dbff67d3f4b093f7d15f7d4ef48c (diff)
downloadcryptopp-git-1af59f4a7500e02296ef2a8237f87d070c6f4a77.tar.gz
Whitespace check-in
Diffstat (limited to 'x64dll.asm')
-rw-r--r--x64dll.asm69
1 files changed, 36 insertions, 33 deletions
diff --git a/x64dll.asm b/x64dll.asm
index f77525ed..c1eecdea 100644
--- a/x64dll.asm
+++ b/x64dll.asm
@@ -1,3 +1,14 @@
+;; https://docs.microsoft.com/en-us/cpp/build/x64-calling-convention
+;; The first four integer arguments are passed in registers.
+;; Integer values are passed in left-to-right order in RCX,
+;; RDX, R8, and R9, respectively. Arguments five and higher
+;; are passed on the stack.
+
+;; The registers RAX, RCX, RDX, R8, R9, R10, R11, XMM0-5,
+;; and the upper portions of YMM0-15 and ZMM0-15 are
+;; considered volatile and must be considered destroyed on
+;; function calls.
+
include ksamd64.inc
EXTERNDEF ?Te@rdtable@CryptoPP@@3PA_KA:FAR
EXTERNDEF ?g_cacheLineSize@CryptoPP@@3IA:FAR
@@ -1964,29 +1975,19 @@ pop rsi
ret
SHA256_HashMultipleBlocks_SSE2 ENDP
-;; https://docs.microsoft.com/en-us/cpp/build/x64-calling-convention
-;; The first four integer arguments are passed in registers.
-;; Integer values are passed in left-to-right order in RCX,
-;; RDX, R8, and R9, respectively. Arguments five and higher
-;; are passed on the stack.
-
-;; The registers RAX, RCX, RDX, R8, R9, R10, R11, XMM0-5,
-;; and the upper portions of YMM0-15 and ZMM0-15 are
-;; considered volatile and must be considered destroyed on
-;; function calls
-
;; http://www.agner.org/optimize/vectorclass/read.php?i=65
;; word64 Xgetbv(word32 ctrl)
;; ctrl = rcx
ALIGN 8
XGETBV64 PROC
-DB 0fh, 01h, 0d0h
-;; xcr = (EDX << 32) | EAX
-and rax, 0ffffffffh
-shl rdx, 32
-or rax, rdx
-ret
+ ;; query
+ DB 0fh, 01h, 0d0h
+ ;; xcr = (EDX << 32) | EAX
+ and rax, 0ffffffffh
+ shl rdx, 32
+ or rax, rdx
+ ret
XGETBV64 ENDP
;; word64 CpuId(word32 func, word32 subfunc, word32 output[4])
@@ -1996,22 +1997,24 @@ XGETBV64 ENDP
ALIGN 8
CPUID64 PROC
-;; must be preserved
-push rbx
-;; eax = func
-mov rax, rcx
-;; ecx = subfunc
-mov rcx, rdx
-cpuid
-mov [r8+0], eax
-mov [r8+4], ebx
-mov [r8+8], ecx
-mov [r8+12], edx
-;; restore
-pop rbx
-;; return
-mov rax, 1
-ret
+ ;; preserve per ABI
+ push rbx
+ ;; eax = func
+ mov rax, rcx
+ ;; ecx = subfunc
+ mov rcx, rdx
+ ;; query
+ cpuid
+ ;; save
+ mov [r8+0], eax
+ mov [r8+4], ebx
+ mov [r8+8], ecx
+ mov [r8+12], edx
+ ;; restore
+ pop rbx
+ ;; return
+ mov rax, 1
+ ret
CPUID64 ENDP
_TEXT ENDS