chiark / gitweb /
symm/rijndael-x86ish-aesni.S: Fix conflict in 32-bit register allocation.
authorMark Wooding <mdw@distorted.org.uk>
Thu, 11 Aug 2016 09:02:56 +0000 (10:02 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Thu, 11 Aug 2016 09:02:56 +0000 (10:02 +0100)
Since 28321c9..., the context pointer in ECX was overwritten with the
GOT pointer, used to find the end-swapping table, resulting in an abort.
Reallocate so that the round count, which is loaded /after/ the endswap
pointer, ends up in ECX, and the context pointer goes in EAX, which
doesn't get clobbered.

This doesn't affect 64-bit targets.

symm/rijndael-x86ish-aesni.S

index 2f6430b370aceb2ae08bf0c8f0813290879b0141..c22d23a8aa6456a9109beff4c0594661dcc54279 100644 (file)
@@ -390,10 +390,10 @@ ENDFUNC
        // Arguments come in on the stack, and need to be collected.  We
        // don't have a shortage of registers.
 
-#  define K ecx
+#  define K eax
 #  define SRC edx
 #  define DST edx
-#  define NR eax
+#  define NR ecx
 
        mov     K, [esp + 4]
        mov     SRC, [esp + 8]