]> Cypherpunks repositories - gostls13.git/commit
cmd/internal/obj/riscv: rework instruction encoding information
authorJoel Sing <joel@sing.id.au>
Wed, 14 Aug 2024 16:48:09 +0000 (02:48 +1000)
committerJoel Sing <joel@sing.id.au>
Thu, 21 Nov 2024 22:31:25 +0000 (22:31 +0000)
commitdc8ceb63a8413664c589059fca5806ff74486884
tree0a86d53999344cbef1ddb4d6b35f21c1798f36bb
parent83e6781cb75f9470430fd40c9751e846b998a49e
cmd/internal/obj/riscv: rework instruction encoding information

Currently, instruction encoding is a slice of encoding types, which
is indexed by a masked version of the riscv64 opcode. Additional
information about some instructions (for example, if an instruction
has a ternary form and if there is an immediate form for an instruction)
is manually specified in other parts of the assembler code.

Rework the instruction encoding information so that we use a table
driven form, providing additional data for each instruction where
relevant. This means that we can simplify other parts of the code
by simply looking up the instruction data and reusing minimal logic.

Change-Id: I7b3b6c61a4868647edf28bd7dbae2150e043ae00
Cq-Include-Trybots: luci.golang.try:gotip-linux-riscv64
Reviewed-on: https://go-review.googlesource.com/c/go/+/622535
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Meng Zhuo <mengzhuo1203@gmail.com>
Reviewed-by: Mark Ryan <markdryan@rivosinc.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
src/cmd/internal/obj/riscv/obj.go