From e374b3d4e6d2835488422d261efdf77a60a24dae Mon Sep 17 00:00:00 2001 From: pilinux Date: Fri, 18 Aug 2023 01:36:45 +0200 Subject: [PATCH] fix: invalid offset error, clobbering error fixed errors: ./blamka_amd64.s:203:1: [amd64] mixBlocksSSE2: invalid offset a+24(FP); expected a+8(FP) ./blamka_amd64.s:226:1: [amd64] xorBlocksSSE2: invalid offset a+24(FP); expected a+8(FP) ./blamka_amd64.s:204:1: frame pointer is clobbered before saving ./blamka_amd64.s:227:1: frame pointer is clobbered before saving --- blamka_amd64.s | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/blamka_amd64.s b/blamka_amd64.s index 1e4f70e..febc334 100644 --- a/blamka_amd64.s +++ b/blamka_amd64.s @@ -197,10 +197,12 @@ TEXT ·blamkaSSE4(SB), 4, $0-8 // func mixBlocksSSE2(out, a, b, c *block) TEXT ·mixBlocksSSE2(SB), 4, $0-32 + // Save the original BP value + MOVQ BP, CX MOVQ out+0(FP), DX MOVQ a+8(FP), AX MOVQ b+16(FP), BX - MOVQ a+24(FP), CX + MOVQ c+24(FP), CX MOVQ $128, BP loop: @@ -216,14 +218,18 @@ loop: ADDQ $16, DX SUBQ $2, BP JA loop + // Restore the original BP value + MOVQ CX, BP RET // func xorBlocksSSE2(out, a, b, c *block) TEXT ·xorBlocksSSE2(SB), 4, $0-32 + // Save the original BP value + MOVQ BP, CX MOVQ out+0(FP), DX MOVQ a+8(FP), AX MOVQ b+16(FP), BX - MOVQ a+24(FP), CX + MOVQ c+24(FP), CX MOVQ $128, BP loop: @@ -241,4 +247,6 @@ loop: ADDQ $16, DX SUBQ $2, BP JA loop - RET \ No newline at end of file + // Restore the original BP value + MOVQ CX, BP + RET