From 42c44b27cf735c8862f89e61f0ec522a0e0d0964 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Mon, 2 Sep 2019 12:51:05 +0100 Subject: [PATCH] base/asm-common.h: Provide default frame pointer registers. And use the default in the obvious places. --- base/asm-common.h | 6 +++--- math/mpx-mul4-x86-sse2.S | 8 ++++---- symm/chacha-x86ish-sse2.S | 2 +- symm/salsa20-x86ish-sse2.S | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/base/asm-common.h b/base/asm-common.h index 3560ec55..1dfb6338 100644 --- a/base/asm-common.h +++ b/base/asm-common.h @@ -453,7 +453,7 @@ name: #define WHOLE(reg) _REGFORM(reg, r) // Stack management and unwinding. -.macro setfp fp, offset=0 +.macro setfp fp=R_bp(r), offset=0 .if \offset == 0 mov \fp, R_sp(r) #if __ELF__ @@ -989,7 +989,7 @@ name: #define QQ(qlo, qhi) D0(qlo)-D1(qhi) // Stack management and unwinding. -.macro setfp fp, offset=0 +.macro setfp fp=r11, offset=0 .if \offset == 0 mov \fp, sp .setfp \fp, sp @@ -1074,7 +1074,7 @@ name: .endm // Stack management and unwinding. -.macro setfp fp, offset=0 +.macro setfp fp=x29, offset=0 // If you're just going through the motions with a fixed-size stack frame, // then you want to say `add x29, sp, #OFFSET' directly, which will avoid // pointlessly restoring sp later. diff --git a/math/mpx-mul4-x86-sse2.S b/math/mpx-mul4-x86-sse2.S index 5265a64f..9d664b44 100644 --- a/math/mpx-mul4-x86-sse2.S +++ b/math/mpx-mul4-x86-sse2.S @@ -705,7 +705,7 @@ FUNC(mpx_umul4_x86_sse2) pushreg ebx pushreg esi pushreg edi - setfp ebp + setfp and esp, ~15 sub esp, 32 endprologue @@ -820,7 +820,7 @@ FUNC(mpxmont_mul4_x86_sse2) pushreg ebx pushreg esi pushreg edi - setfp ebp + setfp and esp, ~15 sub esp, 112 endprologue @@ -966,7 +966,7 @@ FUNC(mpxmont_redc4_x86_sse2) pushreg ebx pushreg esi pushreg edi - setfp ebp + setfp and esp, ~15 sub esp, 76 endprologue @@ -1095,7 +1095,7 @@ ENDFUNC pushreg ebx pushreg esi pushreg edi - setfp ebp + setfp and esp, ~15 sub esp, 3*32 + 4*4 endprologue diff --git a/symm/chacha-x86ish-sse2.S b/symm/chacha-x86ish-sse2.S index 3b009633..3fb623af 100644 --- a/symm/chacha-x86ish-sse2.S +++ b/symm/chacha-x86ish-sse2.S @@ -69,7 +69,7 @@ FUNC(chacha_core_x86ish_sse2) # define SAVE3 [esp] pushreg ebp - setfp ebp + setfp sub esp, 16 mov IN, [ebp + 12] mov OUT, [ebp + 16] diff --git a/symm/salsa20-x86ish-sse2.S b/symm/salsa20-x86ish-sse2.S index 56746e56..5dc9c17c 100644 --- a/symm/salsa20-x86ish-sse2.S +++ b/symm/salsa20-x86ish-sse2.S @@ -69,7 +69,7 @@ FUNC(salsa20_core_x86ish_sse2) # define SAVE3 [esp + 16] pushreg ebp - setfp ebp + setfp sub esp, 32 mov IN, [ebp + 12] mov OUT, [ebp + 16] -- 2.11.0