-
Notifications
You must be signed in to change notification settings - Fork 18.3k
Closed
Labels
DocumentationIssues describing a change to documentation.Issues describing a change to documentation.FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.compiler/runtimeIssues related to the Go compiler and/or runtime.Issues related to the Go compiler and/or runtime.help wanted
Milestone
Description
The PCALIGN assembler directive is used to align instructions to a given boundary. On critical subroutines and critical innermost loops it can deliver a significant boost in performance.
Currently this pseudo instruction is available for ppc64, loong64, amd64, arm64 and soon for riscv64 once CL 541740 is merged. There is also ongoing work to optimize certain routines in #63678.
I propose adding a new section called "Instruction Alignment" to the https://go.dev/doc/asm that includes the following:
- Short introduction
- Supported architectures
- Usage
- Tradeoffs
- some cache space is lost to empty spaces before the aligned code entries
- can lead to spurious alignment issues if not done correctly
- Known places where adding it gets perf improvements (hot loops, critical sections)
- Known boundary sizes that work (e.g 16 bytes on amd64, 32 for AVX2)
- Tradeoffs
I'm happy to write such docs if we agree that it is relevant for the assembler documentation, preferably to be included in Go 1.22.
/cc @rsc @cherrymui @dmitshur
mdempsky and zhangfannie
Metadata
Metadata
Assignees
Labels
DocumentationIssues describing a change to documentation.Issues describing a change to documentation.FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.compiler/runtimeIssues related to the Go compiler and/or runtime.Issues related to the Go compiler and/or runtime.help wanted