-
v0.30.0
StableTest / vet (push) Successful in 43sTest / test (push) Failing after 1m55sTest / build (push) SkippedRelease / build (amd64, linux) (push) Successful in 40sRelease / build (arm64, linux) (push) Successful in 37sRelease / build (loong64, linux) (push) Successful in 38sRelease / build (riscv64, linux) (push) Successful in 58sRelease / release (push) Successful in 22sreleased this
2026-08-13 16:34:20 +00:00 | 206 commits to main since this releaseThe LoongArch encoder (Phase 5) ships with ELF64 and GOOBJ emission, verified
byte-for-byte againstGOARCH=loong64 go tool asmand linked into a real
go build; the shared GOOBJ emitter now writes the per-function DWARF symbols
the linker's DWARF pass reads. The RISC-V encoder reaches byte-for-byte parity
withgo tool asm: the frame model, operand ordering, RVC compression,
large-immediate andMOV $immmaterialisation, branch/jump encodings, and
CALL sym(SB)(now aJALwith anR_RISCV_JALrelocation). The debugger
tracks four hardware watchpoint slots, and the toolkit is Linux-only.Added
- LoongArch encoder (Phase 5).
gasm asmcan now assemble_loong64.s
files: the full LoongArch64 instruction set with the dual-form arithmetic
mnemonics, the 16/21-bit branch families, the MOV pseudo-instruction and
its immediate-constant expansions, FP/SP frame mapping, SB/global symbol
references (pcalau12i pairs) and ELF64 emission
(gasm asm --format elf). Ground-truth verification against
GOARCH=loong64 go tool asmmatches byte-for-byte; GOOBJ emission
(gasm asm --format goobj) is proven end-to-end by linking the object
into a cross-compiledgo build. - GOOBJ DWARF symbols. The GOOBJ emitters now write the per-function
DWARF symbols the linker requires (the subprogram DIE and the.debug_line
program, byte-identical tocmd/asm's), and the pc-value table deltas are
in the architecture's MinLC units as the runtime expects — the amd64 link
test now genuinely substitutes the gasm object, and the amd64/loong64
end-to-end GOOBJ link tests pass. - RISC-V GOOBJ emission via the shared emitter. RISC-V GOOBJ output is
now written by the same shared emitter as amd64 and LoongArch, modelling
each AUIPC + second-instruction pair as a single R_RISCV_PCREL_ITYPE/STYPE
relocation (the layoutcmd/asmwrites, not the ELF HI20/LO12 pair), so the
object links into a cross-compiledgo buildforGOARCH=riscv64. An
end-to-end link test substitutes the gasm object and reads the symbol back
withgo tool nm; the rewrite also corrects the relocationafterfield.
Fixed
- RISC-V frame model and RVC encodings. The riscv64 frame layout now
matchesgo tool asm: the prologue/epilogue save and restore the link
register (LR) instead of S0, with the correct autosize (locals + 8) and the
RVC-compressed prologue/epilogue instructions;RETemits the uncompressed
JALR X0, 0(X1)the toolchain writes; theC.ADDI/C.LI/C.LUI/C.ADDIW
opcode bit and theC.ADDCR-type encoding are fixed; and theLR/TMP
register aliases now resolve to X1 and X31. The pcsp/pcfile/pcline tables
are populated from the recorded stack-adjustment and source-line data, and
a byte-exact ground-truth test compares framed and leaf functions against
GOARCH=riscv64 go tool asm. - RISC-V operand ordering and RVC compression. R-type instructions now
takers2, rs1, rdand I-type arithmetic instructions takeimm12, rs1, rd, matching the Go assembler's documented operand order (previously both
were reversed, so non-commutative R-type instructions such asSUBencoded
the wrong operation). The two-operand ternary forms (ADD rs2, rd,
ADDI $imm, rd,SLLI $shamt, rd) are now accepted. RVC compression is
completed forC.ADDI16SP,C.SLLI,C.SRLI,C.SRAI,C.ANDI,
C.NOP,C.EBREAK,C.MV(fromADDI/ADD) and the commutative
AND/OR/XORforms; the byte-exact ground-truth test now covers these. - RISC-V compressed loads/stores and word arithmetic. RVC compression
now also covers the register-relativeC.LW/C.SW/C.LD/C.SD/
C.FLD/C.FSDforms (in addition to the stack-relativeC.LWSP/C.SWSP/
C.LDSP/C.SDSP), plusC.ADDI4SPN,C.ADDWandC.SUBW. The
byte-exact ground-truth test exercises these againstGOARCH=riscv64 go tool asm. - RISC-V large-immediate materialisation.
ADDI/ANDI/ORI/XORI
with a 32-bit immediate that does not fit 12 bits now expand exactly as
cmd/asm: twoADDIs for the smallADDIsplit range, and
LUI+ADDIW+<op>otherwise, with theLUIandADDIWcompressed to
C.LUI/C.ADDIWwhen their immediate fits six signed bits. The
byte-exact ground-truth test covers positive, negative, and out-of-range
immediates againstGOARCH=riscv64 go tool asm. - RISC-V
MOV $imm, rdmaterialisation. The immediate-loading
pseudo-instruction now uses the toolchain'sSplit32BitImmediatesplit
(previously it rounded the upper 20 bits, producing wrong results for
negative and bit-11-set immediates) and compresses the emitted
ADDI/LUI/ADDIWtoC.LI/C.LUI/C.ADDIWwhen their immediate
fits six signed bits. A byte-exact ground-truth test covers zero, small,
negative, and 32-bit immediates againstGOARCH=riscv64 go tool asm. - RISC-V branch/jump compression.
JMP/JALwere being compressed to
C.JandBEQ/BNE(withX0) toC.BEQZ/C.BNEZ, butgo tool asm
never emits these compressed forms. They now emit the 32-bitJALand
branch encodings the toolchain writes; the deadC.J/C.BEQZ/C.BNEZ
encoders were removed, and theC.LUIdirect-instruction compression now
uses the correct six-bit signed range. A byte-exact ground-truth test
covers the branch family and jumps againstGOARCH=riscv64 go tool asm. - RISC-V
CALL sym(SB). The call pseudo-instruction now emits the
toolchain'sJAL X1, sym(SB)with a singleR_RISCV_JALrelocation
(previously it emitted anAUIPC+JALRpair against a local branch
label, a formgo tool asmrejects). The GOOBJ and ELF emitters now map
that relocation (Go objabi 59 / ELFR_RISCV_JAL17, a 4-byte field), and
relocation offsets are recorded relative to the function start (including
the prologue). A byte-exact ground-truth test covers a call against
GOARCH=riscv64 go tool asm. - Debugger watchpoint slots.
gasm debug'swatchcommand always used
hardware watchpoint slot 0, so a secondwatchcall silently overwrote
the first. Watchpoint slots are now tracked in theSession(DR0–DR3);
watchpicks the first free slot and reports an error if all four are in
use, andunwatch <slot>clears one (no argument clears all).
Changed
- Linux only. The toolkit, its CI and the released binaries are now
Linux-only; cross-compiled to linux/{amd64,arm64,riscv64,loong64}. - Phase 4 closed. README's "Remaining" list for the debugger is gone;
disassembly at PC, memory-write, watchpoints, and source-line mapping are
all shipped.
Downloads
- LoongArch encoder (Phase 5).