]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
win64: Correctly read the fifth parameter from the stack if we've pushed xmm registers
authorMartin Storsjö <martin@martin.st>
Tue, 23 Apr 2013 14:55:00 +0000 (17:55 +0300)
committerNiels Möller <nisse@lysator.liu.se>
Tue, 23 Apr 2013 16:54:58 +0000 (18:54 +0200)
This fixes the umac test on win64.

ChangeLog
x86_64/machine.m4

index 4a1b169dc8432e8637d52da1edc231b067584605..096ae21f7f39bfd7126cb9ec1e02c39b19e8515e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,7 +7,9 @@
        within this subfunction.
        * x86_64/machine.m4 (W64_ENTRY): Use movdqu instead of movdqa for
        saving xmm registers, since the stack is not guaranteed to be
-       16-byte aligned on win64.
+       16-byte aligned on win64. Take pushed xmm registers into account
+       when reading the fifth parameter from the stack.
+
        * Makefile.in: Consistently use EXEEXT_FOR_BUILD.
 
 2013-04-21  Niels Möller  <nisse@lysator.liu.se>
index d5d5b37cc3a139fb36cff05371b5f3b91da4ff0d..b9556a27b26005629209097503e8dcfbf7f621de 100644 (file)
@@ -67,7 +67,7 @@ define(<XREG>,<ifelse(
 dnl W64_ENTRY(nargs, xmm_used)
 define(<W64_ENTRY>, <
   changequote([,])dnl
-  ifelse(<<<<<<<<<<<<<<< ignored; only for balancing)
+  ifelse(<<<<<<<<<<<<<<<< ignored; only for balancing)
   ifelse(W64_ABI,yes,[
     ifelse(eval($2 > 6), 1, [
       sub      [$]eval(8 + 16*($2 - 6)), %rsp
@@ -115,7 +115,11 @@ define(<W64_ENTRY>, <
       mov      %r9, %rcx
     ])
     ifelse(eval($1 >= 5), 1, [
-      mov      56(%rsp), %r8
+      ifelse(eval($2 > 6), 1, [
+        mov    eval(8 + 16*($2 - 6) + 56)(%rsp), %r8
+      ], [
+        mov    56(%rsp), %r8
+      ])
     ])
   ])
   changequote(<,>)dnl