From: Mark Ryan Date: Wed, 11 Dec 2024 17:09:32 +0000 (+0100) Subject: cmd/internal/obj/riscv: fix the encoding for REV8 and ORCB X-Git-Tag: go1.25rc1~637 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=c386ed107e65f495acb6aacb0efcaade27da6a15;p=gostls13.git cmd/internal/obj/riscv: fix the encoding for REV8 and ORCB 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 Reviewed-by: Joel Sing Reviewed-by: Meng Zhuo LUCI-TryBot-Result: Go LUCI Reviewed-by: Cherry Mui --- diff --git a/src/cmd/internal/obj/riscv/obj.go b/src/cmd/internal/obj/riscv/obj.go index f9ae5fe677..d3b6857a75 100644 --- a/src/cmd/internal/obj/riscv/obj.go +++ b/src/cmd/internal/obj/riscv/obj.go @@ -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},