Skip to content

support Go1.27 regabi - #103

Merged
visualfc merged 1 commit into
goplus:mainfrom
visualfc:regabi_go127
Aug 21, 2026
Merged

support Go1.27 regabi#103
visualfc merged 1 commit into
goplus:mainfrom
visualfc:regabi_go127

Conversation

@visualfc

Copy link
Copy Markdown
Member

No description provided.

@visualfc
visualfc merged commit f0df198 into goplus:main Aug 21, 2026
21 checks passed

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: Go 1.27 support

Reviewed the hand-written changes; the ~240k lines of generated *_regabi_go127_*.s assembly were assessed at the mechanism level, not line-by-line.

Verified correct

  • float32reg_arch.go build tag (ppc64 || ppc64le || riscv64 || s390x) is the exact complement of float32reg_generic.go and pairs with the existing .s implementations — no arch double-declared or missing.
  • !go1.27 constraints added consistently across all icall size dirs (icall{512..20480}, internal/icall512, cmd/icall_gen/_data); each build dir has the full set of 5 new go127_* files with matching constraints.
  • The runtime·spillArgs/runtime·unspillArgs → local ·spillArgs/·unspillArgs rewrite pairs correctly with the appended helper bodies; MakeFunc call shape is unchanged (no per-call overhead).
  • .github/workflows/go.yml: 1.27.x present in all matrices, no leftover guards; actions pinned, no untrusted-input interpolation.
  • README.md version-range update is accurate; no dangling #build-linkname-mode anchor.

No security or performance concerns. One robustness note inline.

}
go127 := func(id, constraint, asm, helpers string) info {
if strings.HasPrefix(asm, "//go:build") {
asm = asm[strings.Index(asm, "\n\n")+2:]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fragile build-tag stripping — silent corruption on unexpected input.

asm = asm[strings.Index(asm, "\n\n")+2:] is guarded only by HasPrefix(asm, "//go:build"). It's correct for all 5 current templates, but fails silently otherwise:

  • If \n\n is absent, strings.Index returns -1 and +2 yields index 1, slicing off just the first byte instead of the header.
  • If a template's //go:build header isn't followed by a blank line, the first blank line inside the body is matched, truncating real assembly.

Both cases produce a subtly broken .s file while generation still "succeeds." Consider asserting the index is >= 0 and returning an error otherwise (or stripping only the contiguous leading comment/build-tag lines), plus a one-line comment documenting the required template format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant