feat(asm): the immediate multiply and arm64 indirect branches GOROOT writes

Assisted-by: GLM 5.3 Flash
This commit is contained in:
2026-09-21 21:50:11 +02:00
parent 7246b0e002
commit 82ef289d3a
3 changed files with 66 additions and 23 deletions
+7 -3
View File
@@ -19,12 +19,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
access pair assembles as the toolchain's one-instruction form (the
bare `MOVQ TLS, r` load nops out and `off(r)(TLS*1)` folds to the
segment-prefixed absolute whose disp32 carries the R_TLSLE
relocation, per-GOOS); and `gasm asm` predefines the `GOARCH_<arch>`
relocation, per-GOOS); arm64 accepts the bare-register indirect branch
(`BL R9` beside `BL (R9)`, both BLR) and the zero-immediate store
(`MOVD $0, mem` through the zero register, rejecting non-zero immediates
as the toolchain does); and `gasm asm` predefines the `GOARCH_<arch>`
and `GOOS_<goos>` macros the go command passes to `go tool asm`, so
GOROOT headers' `#ifdef GOARCH_amd64` platform blocks (`go_tls.h`'s
`get_tls` and friends) select as intended. The GOROOT corpus measure
moves to 267 of 353 files assembling for every target architecture
(75.6 %), 89.4 % of the real-code corpus, from 70.8 % and 82.2 %.
moves to 276 of 353 files assembling for every target architecture
(78.2 %), 91.4 % of the real-code corpus (280 of 303), from 70.8 %
and 82.2 %.
### Added