style: put the repository assembly in gasm fmt canonical form

Assisted-by: GLM 5.3 Flash
This commit is contained in:
2026-09-17 20:33:18 +02:00
parent 0b42ce7952
commit 03d6d4da54
26 changed files with 583 additions and 542 deletions
+1
View File
@@ -16,6 +16,7 @@ cas_retry:
ADDI X0, $1, X15
MOV X15, ret+24(FP)
RET
cas_fail:
MOV X0, ret+24(FP)
RET
+1
View File
@@ -35,6 +35,7 @@ vec1:
VPSUBD Y1, Y2, Y3
ADDQ $32, SI
JMP vec1
vec1done:
MOVQ AX, partSum+56(FP)
+1 -1
View File
@@ -47,7 +47,7 @@ wc_have_n:
VMOVDQU (SI), Y0
VMOVDQU Y0, (DI)
VMOVDQU -32(SI)(BX*1), Y0
VMOVDQU Y0, -32(DI)(BX*1)
VMOVDQU Y0,-32(DI)(BX*1)
VZEROUPPER
RET
+3
View File
@@ -31,11 +31,14 @@ TEXT ·branch(SB), NOSPLIT, $0-0
BLT done
BGT done
BLE done
skip:
B loop
loop:
ADD R4, R5
RET
done:
RET
+3
View File
@@ -45,10 +45,13 @@ TEXT ·branch(SB), NOSPLIT, $0-0
BGE R10, R11, done
BLTU R12, R13, done
BGEU R14, R15, done
skip:
JMP loop
loop:
JAL skip
RET
done:
RET
+3
View File
@@ -19,9 +19,12 @@ TEXT ·branch(SB), NOSPLIT, $0-0
BVC done
BHI done
BLS done
skip:
B loop
loop:
ADD R4, R5
done:
RET
+8
View File
@@ -7,29 +7,37 @@ TEXT ·branches(SB), NOSPLIT, $0
ADDI $1, X10, X10
BEQ X10, X11, beq_done
ADDI $2, X10, X10
beq_done:
BNE X10, X11, bne_done
ADDI $3, X10, X10
bne_done:
BLT X10, X11, blt_done
ADDI $4, X10, X10
blt_done:
BGE X10, X11, bge_done
ADDI $5, X10, X10
bge_done:
BLTU X10, X11, bltu_done
ADDI $6, X10, X10
bltu_done:
BGEU X10, X11, bgeu_done
ADDI $7, X10, X10
bgeu_done:
RET
TEXT ·jumps(SB), NOSPLIT, $0
JMP done
ADDI $1, X10, X10
done:
JAL X11, skip
ADDI $2, X10, X10
skip:
RET
+16
View File
@@ -78,24 +78,34 @@ TEXT ·branches21(SB), NOSPLIT, $0-0
BLEZ R10, l7
BGTZ R11, l8
JMP l9
l1:
JMP l10
l2:
JMP l11
l3:
JMP l12
l4:
JMP l13
l5:
JMP l14
l6:
JMP l15
l7:
JMP l16
l8:
JMP l16
l9:
MOVV R1, R2
l10:
LL (R12), R13
LLV (R14), R15
@@ -105,26 +115,32 @@ l10:
SYSCALL
DBAR
RET
l11:
JAL (R30)
RET
l12:
BSTRINSV $7, R4, $0, R5
BSTRPICKV $63, R6, $32, R7
ALSLV $2, R8, R9, R10
ADDV16 $65536, R11, R12
RET
l13:
MOVV $0xffffffffffffffff, R13
RET
l14:
CPUCFG R14, R14
RET
l15:
NOR R15, R16, R17
ORN R18, R19, R20
ANDN R21, R24, R25
RET
l16:
MOVB R26, (R27)
MOVB (R28), R29
+5 -5
View File
@@ -38,11 +38,11 @@ TEXT ·enterJITChecked(SB), NOSPLIT, $0-16
MOVQ stack+8(FP), SP // switch to prepared stack
JMP AX
// leaveJITCheckedRaw is the raw return trampoline. It has NO Go function
// declaration, so no ABIInternal wrapper is generated; the JIT function's
// RET lands here directly, seeing BP and R14 exactly as the function left
// them. It checks the sentinels, records violations in abiResult, then
// restores the Go stack and returns.
// leaveJITCheckedRaw is the raw return trampoline. It has NO Go function
// declaration, so no ABIInternal wrapper is generated; the JIT function's
// RET lands here directly, seeing BP and R14 exactly as the function left
// them. It checks the sentinels, records violations in abiResult, then
// restores the Go stack and returns.
TEXT ·leaveJITCheckedRaw(SB), NOSPLIT, $0-0
// Check BP against the sentinel.
MOVQ $SENTINEL_BP, CX
+8 -5
View File
@@ -47,11 +47,11 @@ TEXT ·enterJITChecked(SB), NOSPLIT, $0-16
// reads its first argument at SP+8
JMP (R0) // branch to JIT function
// leaveJITCheckedRaw is the raw return trampoline. It has NO Go function
// declaration, so no ABIInternal wrapper is generated; the JIT function's
// RET lands here directly, seeing R29 and g exactly as the function left
// them. It checks the sentinels, records violations in abiResult, then
// restores the Go stack and returns.
// leaveJITCheckedRaw is the raw return trampoline. It has NO Go function
// declaration, so no ABIInternal wrapper is generated; the JIT function's
// RET lands here directly, seeing R29 and g exactly as the function left
// them. It checks the sentinels, records violations in abiResult, then
// restores the Go stack and returns.
TEXT ·leaveJITCheckedRaw(SB), NOSPLIT, $0-0
MOVD $0, R4 // accumulated violation bits
@@ -61,6 +61,7 @@ TEXT ·leaveJITCheckedRaw(SB), NOSPLIT, $0-0
BEQ fp_ok
MOVD $1, R5
ORR R5, R4, R4
fp_ok:
// Check g against the sentinel.
MOVD $SENTINEL_G, R3
@@ -68,6 +69,7 @@ fp_ok:
BEQ g_ok
MOVD $2, R5
ORR R5, R4, R4
g_ok:
CBZ R4, restore
MOVD R4, ·abiResult(SB)
@@ -86,4 +88,5 @@ restore:
// checked trampoline saves the caller's frame pointer for vet's sake and
// never restores it, and this file mirrors that.
GLOBL savedFP(SB), NOPTR, $8
GLOBL savedG(SB), NOPTR, $8
+5 -5
View File
@@ -41,11 +41,11 @@ TEXT ·enterJITChecked(SB), NOSPLIT, $0-16
// reads its first argument at SP+8
JIRL R0, R4, 0 // jump to JIT function
// leaveJITCheckedRaw is the raw return trampoline. It has NO Go function
// declaration, so no ABIInternal wrapper is generated; the JIT function's
// RET lands here directly, seeing g exactly as the function left it. It
// checks the sentinel, records violations in abiResult, then restores the
// Go stack and returns.
// leaveJITCheckedRaw is the raw return trampoline. It has NO Go function
// declaration, so no ABIInternal wrapper is generated; the JIT function's
// RET lands here directly, seeing g exactly as the function left it. It
// checks the sentinel, records violations in abiResult, then restores the
// Go stack and returns.
TEXT ·leaveJITCheckedRaw(SB), NOSPLIT, $0-0
// Check g against the sentinel.
MOVV $SENTINEL_G, R5
+5 -5
View File
@@ -41,11 +41,11 @@ TEXT ·enterJITChecked(SB), NOSPLIT, $0-16
// reads its first argument at SP+8
JALR X0, 0(X5) // jump to JIT function
// leaveJITCheckedRaw is the raw return trampoline. It has NO Go function
// declaration, so no ABIInternal wrapper is generated; the JIT function's
// RET lands here directly, seeing g exactly as the function left it. It
// checks the sentinel, records violations in abiResult, then restores the
// Go stack and returns.
// leaveJITCheckedRaw is the raw return trampoline. It has NO Go function
// declaration, so no ABIInternal wrapper is generated; the JIT function's
// RET lands here directly, seeing g exactly as the function left it. It
// checks the sentinel, records violations in abiResult, then restores the
// Go stack and returns.
TEXT ·leaveJITCheckedRaw(SB), NOSPLIT, $0-0
// Check g against the sentinel.
MOV $SENTINEL_G, X6
+2 -2
View File
@@ -23,8 +23,8 @@ TEXT ·enterJIT(SB), NOSPLIT, $0-16
MOVQ stack+8(FP), SP // switch to the prepared stack
JMP AX
// func leaveJIT()
// Restores the Go stack pointer and returns to enterJIT's caller.
// func leaveJIT()
// Restores the Go stack pointer and returns to enterJIT's caller.
TEXT ·leaveJIT(SB), NOSPLIT, $0-0
MOVQ ·savedSP(SB), SP
RET
+2 -1
View File
@@ -27,7 +27,7 @@ TEXT ·enterJIT(SB), NOSPLIT, $0-16
// same way)
JMP (R0) // branch to JIT function
// func leaveJIT()
// func leaveJIT()
TEXT ·leaveJIT(SB), NOSPLIT, $0-0
MOVD savedSP(SB), R3 // restore Go stack pointer
MOVD R3, RSP
@@ -43,4 +43,5 @@ DATA ·leaveRawAddr(SB)/8, $·leaveJIT(SB)
// Package-level storage for saved registers.
GLOBL savedLR(SB), NOPTR, $8
GLOBL savedSP(SB), NOPTR, $8
+2 -1
View File
@@ -21,7 +21,7 @@ TEXT ·enterJIT(SB), NOSPLIT, $0-16
// first argument at SP+8
JIRL R0, R4, 0 // jump to JIT function
// func leaveJIT()
// func leaveJIT()
TEXT ·leaveJIT(SB), NOSPLIT, $0-0
MOVV savedSP(SB), R5 // restore Go stack pointer
MOVV R5, R3 // restore SP
@@ -29,4 +29,5 @@ TEXT ·leaveJIT(SB), NOSPLIT, $0-0
JIRL R0, R1, 0 // return to Go caller
GLOBL savedRA(SB), NOPTR, $8
GLOBL savedSP(SB), NOPTR, $8
+2 -1
View File
@@ -21,7 +21,7 @@ TEXT ·enterJIT(SB), NOSPLIT, $0-16
// first argument at SP+8
JALR X0, 0(X5) // jump to JIT function
// func leaveJIT()
// func leaveJIT()
TEXT ·leaveJIT(SB), NOSPLIT, $0-0
MOV savedSP(SB), X6 // restore Go stack pointer
MOV X6, X2 // restore SP
@@ -29,4 +29,5 @@ TEXT ·leaveJIT(SB), NOSPLIT, $0-0
JALR X0, 0(X1) // return to Go caller
GLOBL savedRA(SB), NOPTR, $8
GLOBL savedSP(SB), NOPTR, $8