X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb/blobdiff_plain/a13b573023a59dc1e2febef1142aa4b1d1af67b7..c90ce6bb395bac18afa5b189e4664151d4d8ea2c:/symm/chacha-x86ish-sse2.S diff --git a/symm/chacha-x86ish-sse2.S b/symm/chacha-x86ish-sse2.S index a7ff68b5..2dab283b 100644 --- a/symm/chacha-x86ish-sse2.S +++ b/symm/chacha-x86ish-sse2.S @@ -42,12 +42,12 @@ FUNC(chacha_core_x86ish_sse2) #if CPUFAM_X86 // Arguments come in on the stack, and will need to be collected. We - // we can get away with just the scratch registers for integer work, - // but we'll run out of XMM registers and will need some properly - // aligned space which we'll steal from the stack. I don't trust the - // stack pointer's alignment, so I'll have to mask the stack pointer, - // which in turn means I'll need to keep track of the old value. - // Hence I'm making a full i386-style stack frame here. + // can get away with just the scratch registers for integer work, but + // we'll run out of XMM registers and will need some properly aligned + // space which we'll steal from the stack. I don't trust the stack + // pointer's alignment, so I'll have to mask the stack pointer, which + // in turn means I'll need to keep track of the old value. Hence I'm + // making a full i386-style stack frame here. // // The Windows and SysV ABIs are sufficiently similar that we don't // need to worry about the differences here. @@ -60,8 +60,8 @@ FUNC(chacha_core_x86ish_sse2) # define SAVE2 xmm7 # define SAVE3 [esp] - push ebp - mov ebp, esp + pushreg ebp + setfp ebp sub esp, 16 mov IN, [ebp + 12] mov OUT, [ebp + 16] @@ -101,11 +101,11 @@ FUNC(chacha_core_x86ish_sse2) # define SAVE2 [rsp + 16] # define SAVE3 [rsp + 32] - sub rsp, 48 + 8 - .seh_stackalloc 48 + 8 - .seh_endprologue + stalloc 48 + 8 #endif + endprologue + // First job is to slurp the matrix into XMM registers. Be careful: // the input matrix isn't likely to be properly aligned. // @@ -239,11 +239,11 @@ FUNC(chacha_core_x86ish_sse2) // Tidy things up. #if CPUFAM_X86 - mov esp, ebp - pop ebp + dropfp + popreg ebp #endif #if CPUFAM_AMD64 && ABI_WIN - add rsp, 48 + 8 + stfree 48 + 8 #endif // And with that, we're done.