fix(arm64): store-exclusive operand order and large-frame parity

Assisted-by: GLM 5.3
This commit is contained in:
2026-09-20 00:38:24 +02:00
parent a6f3828c02
commit d315a998ce
6 changed files with 382 additions and 48 deletions
+69
View File
@@ -0,0 +1,69 @@
// Copyright (c) 2026 Petr Balvín <opensource@petrbalvin.org> (https://petrbalvin.org)
// SPDX-License-Identifier: BSD-3-Clause
// Large frames across every immediate band of the prologue SUB and the RET
// epilogue, byte-parity-checked against go tool asm:
//
// $5000 autosize 5024 one 16-bit chunk, materialised into REGTMP
// $65664 autosize 65680 split into two imm12 instructions
// $70000 autosize 70016 split into two imm12 instructions
// $65520 autosize 65536 one shifted imm12 in the prologue, a logical
// immediate (ORR) in the non-leaf epilogue
// $16777232 autosize 16777248 wider than 24 bits, MOVZ/MOVK into REGTMP
#include "textflag.h"
TEXT ·leaf5000(SB), NOSPLIT, $5000-0
MOVD R0, R1
MOVD R1, R2
RET
TEXT ·leaf65664(SB), NOSPLIT, $65664-0
MOVD R0, R1
MOVD R1, R2
RET
TEXT ·leaf70000(SB), NOSPLIT, $70000-0
MOVD R0, R1
MOVD R1, R2
RET
TEXT ·leaf65520(SB), NOSPLIT, $65520-0
MOVD R0, R1
MOVD R1, R2
MOVD R2, R3
MOVD R3, R4
RET
TEXT ·nl5000(SB), NOSPLIT, $5000-0
MOVD R0, R1
MOVD R1, R2
CALL ·other(SB)
RET
TEXT ·nl65664(SB), NOSPLIT, $65664-0
MOVD R0, R1
CALL ·other(SB)
RET
TEXT ·nl70000(SB), NOSPLIT, $70000-0
MOVD R0, R1
CALL ·other(SB)
RET
TEXT ·nl65520(SB), NOSPLIT, $65520-0
MOVD R0, R1
MOVD R1, R2
MOVD R2, R3
CALL ·other(SB)
RET
TEXT ·nlhuge(SB), NOSPLIT, $16777232-0
CALL ·other(SB)
RET
TEXT ·other(SB), NOSPLIT, $0-0
MOVD R0, R1
MOVD R1, R2
MOVD R2, R3
RET