x86ish *.S: Use `stalloc' consistently to allocate space on the stack.
authorMark Wooding <mdw@distorted.org.uk>
Wed, 30 Oct 2019 23:10:51 +0000 (23:10 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 9 May 2020 19:57:33 +0000 (20:57 +0100)
Also, prefer aligning afterwards, except where that won't work.

math/mpx-mul4-x86-sse2.S
symm/chacha-x86ish-sse2.S
symm/gcm-x86ish-pclmul.S
symm/salsa20-x86ish-sse2.S

index ba7ae6a..0e90541 100644 (file)
@@ -706,8 +706,8 @@ FUNC(mpx_umul4_x86_sse2)
        pushreg esi
        pushreg edi
        setfp
        pushreg esi
        pushreg edi
        setfp
+       stalloc 32
        and     SP, ~15
        and     SP, ~15
-       sub     SP, 32
   endprologue
 
        // Prepare for the first iteration.
   endprologue
 
        // Prepare for the first iteration.
@@ -821,8 +821,8 @@ FUNC(mpxmont_mul4_x86_sse2)
        pushreg esi
        pushreg edi
        setfp
        pushreg esi
        pushreg edi
        setfp
+       stalloc 112
        and     SP, ~15
        and     SP, ~15
-       sub     SP, 112
   endprologue
 
        // Establish the expanded operands.
   endprologue
 
        // Establish the expanded operands.
@@ -968,7 +968,7 @@ FUNC(mpxmont_redc4_x86_sse2)
        pushreg edi
        setfp
        and     SP, ~15
        pushreg edi
        setfp
        and     SP, ~15
-       sub     SP, 76
+       stalloc 76
   endprologue
 
        // Establish the expanded operands and the blocks-of-4 dv limit.
   endprologue
 
        // Establish the expanded operands and the blocks-of-4 dv limit.
@@ -1096,8 +1096,8 @@ ENDFUNC
        pushreg esi
        pushreg edi
        setfp
        pushreg esi
        pushreg edi
        setfp
+       stalloc 3*32 + 4*4
        and     SP, ~15
        and     SP, ~15
-       sub     SP, 3*32 + 4*4
   endprologue
        mov     eax, \n
        mov     [SP + 104], eax
   endprologue
        mov     eax, \n
        mov     [SP + 104], eax
index 33af65f..974ec5b 100644 (file)
@@ -70,7 +70,7 @@ FUNC(chacha_core_x86ish_sse2)
 
        pushreg BP
        setfp
 
        pushreg BP
        setfp
-       sub     SP, 16
+       stalloc 16
        mov     IN, [BP + 12]
        mov     OUT, [BP + 16]
        and     SP, ~15
        mov     IN, [BP + 12]
        mov     OUT, [BP + 16]
        and     SP, ~15
index 092242b..5edf56e 100644 (file)
@@ -974,8 +974,8 @@ SSEFUNC(gcm_mulk_256b_x86ish_pclmul)
        setfp
        mov     A, [SP + 8]
        mov     K, [SP + 12]
        setfp
        mov     A, [SP + 8]
        mov     K, [SP + 12]
+       stalloc 16
        and     SP, ~15
        and     SP, ~15
-       sub     SP, 16
 #endif
 #if CPUFAM_AMD64 && ABI_WIN
        stalloc 3*16 + 8
 #endif
 #if CPUFAM_AMD64 && ABI_WIN
        stalloc 3*16 + 8
@@ -1018,9 +1018,9 @@ SSEFUNC(gcm_mulk_256l_x86ish_pclmul)
        setfp
        mov     A, [SP + 8]
        mov     K, [SP + 12]
        setfp
        mov     A, [SP + 8]
        mov     K, [SP + 12]
-       and     SP, ~15
+       stalloc 16
        ldgot   ecx
        ldgot   ecx
-       sub     SP, 16
+       and     SP, ~15
 #endif
 #if CPUFAM_AMD64 && ABI_WIN
        stalloc 3*16 + 8
 #endif
 #if CPUFAM_AMD64 && ABI_WIN
        stalloc 3*16 + 8
index eb346af..26bab89 100644 (file)
@@ -70,7 +70,7 @@ FUNC(salsa20_core_x86ish_sse2)
 
        pushreg BP
        setfp
 
        pushreg BP
        setfp
-       sub     SP, 32
+       stalloc 32
        mov     IN, [BP + 12]
        mov     OUT, [BP + 16]
        and     SP, ~15
        mov     IN, [BP + 12]
        mov     OUT, [BP + 16]
        and     SP, ~15