]> Cypherpunks repositories - gostls13.git/commit
cmd/link, cmd/internal/obj/loong64: support the PCALIGN directive
authorWANG Xuerui <git@xen0n.name>
Tue, 28 Mar 2023 11:30:04 +0000 (19:30 +0800)
committerGopher Robot <gobot@golang.org>
Fri, 7 Apr 2023 20:20:25 +0000 (20:20 +0000)
commit47b22b6548822d7b51ba3dca3c8c5fe669bfdd59
tree9b6da1b8d7f5adc895f441720889e7acc60ccc2f
parent10c079a0ad2283be3761a47eda6e41bde38fd16b
cmd/link, cmd/internal/obj/loong64: support the PCALIGN directive

Allow writing `PCALIGN $imm` where imm is a power-of-2 between 8 and
2048 (inclusive), for ensuring that the following instruction is
placed at an imm-byte boundary relative to the beginning of the
function. If the PC is not sufficiently aligned, NOOPs will be
inserted to make it so, otherwise the directive will do nothing.

This could be useful for both asm performance hand-tuning, and future
scenarios where a certain bigger alignment might be required.

Change-Id: Iad6244669a3d5adea88eceb0dc7be1af4f0d4fc9
Reviewed-on: https://go-review.googlesource.com/c/go/+/479815
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Run-TryBot: WANG Xuerui <git@xen0n.name>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: abner chenc <chenguoqi@loongson.cn>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
src/cmd/internal/obj/loong64/asm.go
src/cmd/link/link_test.go