]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/internal/obj/riscv: fix the encoding for REV8 and ORCB
authorMark Ryan <markdryan@rivosinc.com>
Wed, 11 Dec 2024 17:09:32 +0000 (18:09 +0100)
committerMeng Zhuo <mengzhuo1203@gmail.com>
Fri, 21 Mar 2025 04:24:28 +0000 (21:24 -0700)
The instructions are currently encoded and validated using an
iIIEncoding which is incorrect as these instructions do not
take an immediate operand.  Encode them instead using an
rIIEncoding as is done for the other two register argument bitmanip
instructions.

Change-Id: Ia4d9c6f6ebd2dfc381935ebc11afa8fc3664232b
Reviewed-on: https://go-review.googlesource.com/c/go/+/637317
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Joel Sing <joel@sing.id.au>
Reviewed-by: Meng Zhuo <mengzhuo1203@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
src/cmd/internal/obj/riscv/obj.go

index f9ae5fe677f27a22e09e311131560fa692b80572..d3b6857a753e4395ac09452d2f06b0d069a7cb1f 100644 (file)
@@ -2094,8 +2094,8 @@ var instructions = [ALAST & obj.AMask]instructionData{
        ARORI & obj.AMask:  {enc: iIIEncoding, ternary: true},
        ARORIW & obj.AMask: {enc: iIIEncoding, ternary: true},
        ARORW & obj.AMask:  {enc: rIIIEncoding, immForm: ARORIW, ternary: true},
-       AORCB & obj.AMask:  {enc: iIIEncoding},
-       AREV8 & obj.AMask:  {enc: iIIEncoding},
+       AORCB & obj.AMask:  {enc: rIIEncoding},
+       AREV8 & obj.AMask:  {enc: rIIEncoding},
 
        // 28.4.4: Single-bit Instructions (Zbs)
        ABCLR & obj.AMask:  {enc: rIIIEncoding, immForm: ABCLRI, ternary: true},