]> Cypherpunks repositories - gostls13.git/commit
cmd/asm,cmd/internal/obj/riscv: implement vector configuration setting instructions
authorJoel Sing <joel@sing.id.au>
Sun, 24 Nov 2024 01:39:20 +0000 (12:39 +1100)
committerJoel Sing <joel@sing.id.au>
Fri, 14 Feb 2025 15:13:11 +0000 (07:13 -0800)
commitc8545439b596ffc88d09b9f6970fefdf69fcfc5d
treea3ec5f07be452bfc110f9e577d908d47efd740b1
parentb16c04f43993436f24b1e4155a4652193eb1b90c
cmd/asm,cmd/internal/obj/riscv: implement vector configuration setting instructions

Implement vector configuration setting instructions (VSETVLI,
VSETIVLI, VSETL).  These allow the vector length (vl) and vector
type (vtype) CSRs to be configured via a single instruction.
Unfortunately each instruction has its own dedicated encoding.

In the case of VSETVLI/VSETIVLI, the vector type is specified via
a series of special operands, which specify the selected element
width (E8, E16, E32, E64), the vector register group multiplier
(M1, M2, M4, M8, MF2, MF4, MF8), the vector tail policy (TU, TA)
and vector mask policy (MU, MA). Note that the order of these
special operands matches non-Go assemblers.

Partially based on work by Pengcheng Wang <wangpengcheng.pp@bytedance.com>.

Cq-Include-Trybots: luci.golang.try:gotip-linux-riscv64
Change-Id: I431f59c1e048a3e84754f0643a963da473a741fe
Reviewed-on: https://go-review.googlesource.com/c/go/+/631936
Reviewed-by: Mark Ryan <markdryan@rivosinc.com>
Reviewed-by: Meng Zhuo <mengzhuo1203@gmail.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
12 files changed:
src/cmd/asm/internal/arch/arm64.go
src/cmd/asm/internal/arch/riscv64.go
src/cmd/asm/internal/asm/asm.go
src/cmd/asm/internal/asm/parse.go
src/cmd/asm/internal/asm/testdata/riscv64.s
src/cmd/asm/internal/asm/testdata/riscv64error.s
src/cmd/internal/obj/arm64/a.out.go
src/cmd/internal/obj/link.go
src/cmd/internal/obj/riscv/cpu.go
src/cmd/internal/obj/riscv/list.go
src/cmd/internal/obj/riscv/obj.go
src/cmd/internal/obj/util.go