X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb/blobdiff_plain/2cb17e021884f46af033c31a4deb5f60714c3997..1a517bb3785891ff6940c73af7c5a136d0250ebf:/symm/rijndael-x86ish-aesni.S diff --git a/symm/rijndael-x86ish-aesni.S b/symm/rijndael-x86ish-aesni.S index 8090bca6..b0b880a4 100644 --- a/symm/rijndael-x86ish-aesni.S +++ b/symm/rijndael-x86ish-aesni.S @@ -332,10 +332,15 @@ FUNC(rijndael_setup_x86ish_aesni) #endif ret - .align 16 -endswap_block: +ENDFUNC + +INTFUNC(endswap_block) // End-swap NKW words starting at SI. The end-swapping table is // already loaded into XMM5; and it's OK to work in 16-byte chunks. +#if CPUFAM_AMD64 && ABI_WIN + .seh_endprologue +#endif + mov ecx, NKW 0: movdqu xmm1, [SI] pshufb xmm1, xmm5 @@ -343,8 +348,11 @@ endswap_block: add SI, 16 sub ecx, 4 ja 0b + ret +ENDFUNC + #undef CTX #undef BLKSZ #undef SI @@ -356,8 +364,6 @@ endswap_block: #undef LRK #undef BLKOFF -ENDFUNC - ///-------------------------------------------------------------------------- /// Encrypting and decrypting blocks. @@ -509,17 +515,23 @@ ENDFUNC ///-------------------------------------------------------------------------- /// Random utilities. - .align 16 +INTFUNC(bogus) // Abort the process because of a programming error. Indirecting // through this point serves several purposes: (a) by CALLing, rather // than branching to, `abort', we can save the return address, which // might at least provide a hint as to what went wrong; (b) we don't // have conditional CALLs (and they'd be big anyway); and (c) we can // write a HLT here as a backstop against `abort' being mad. -bogus: callext F(abort) +#if CPUFAM_AMD64 && ABI_WIN + .seh_endprologue +#endif + + callext F(abort) 0: hlt jmp 0b +ENDFUNC + ///-------------------------------------------------------------------------- /// Data tables.