Skip to content

Instantly share code, notes, and snippets.

@xen0n
Last active June 9, 2023 12:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xen0n/584c6b84ab3e7151a48fa476bca46c3e to your computer and use it in GitHub Desktop.
Save xen0n/584c6b84ab3e7151a48fa476bca46c3e to your computer and use it in GitHub Desktop.
GopherChina 2023: loong64 presentation

GOARCH=loong64: past, present and future

Who am I? What's LoongArch?

Me:

  • https://github.com/xen0n
  • Member of the Go loong64 porters team (@golang/loong64)
  • Tinkers with things for fun
    • Linux/LoongArch port reviewer
    • Contributor to LLVM/QEMU/binutils/glibc/...
    • Gentoo developer, Gentoo/LoongArch

LoongArch:

Past

Apparently Loongson took their inspirations from the mips64x port:

  • Asm syntax (I don't like xxxV)
  • Code organization and style (smell)

Unfortunately my take was a false start (lack of personal time & priorities), so these persisted into the eventual merge. Most (if not all) are implementation details so we could still progressively improve, though.

Present

Support among the ecosystem:

Popular apps that work:

  • frp
  • gitea
  • helm
  • hugo
  • kubectl
  • syncthing
  • more TBD

Popular apps that don't work yet:

  • Docker (? -- needs confirmation)
  • Kubernetes (need check)
  • more TBD

How does one port to loong64?

  • Ensure buildability with go1.19+
  • Ensure up-to-date x/sys and related modules
  • Watch out for particularly problematic deps

Community participation:

go1.20:

go1.21:

Thanks!

Current work of the loong64 team (to show up in go1.21):

Future

Upstream work:

  • loong64 asm backend overhaul
    • machine-generated insn description for maintainability
    • consistent asm grammar
    • some compatibility preserved (mainly for x/sys)
  • regabi support
    • another 10%~20% perf win
    • move g from fp to s8: enable frame pointers at all times for debuggability
  • internal link support

Possible ecosystem work:

  • Communication to make CNCF inroads smooth
  • TBD

See you in the bug trackers!

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