aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/asm
diff options
context:
space:
mode:
authorXueqi Luo <1824368278@qq.com>2025-11-27 06:37:04 +0000
committerMeng Zhuo <mengzhuo1203@gmail.com>2026-03-26 19:11:49 -0700
commit91d1a883768b8b38fe79eefd820063b2b593f23a (patch)
tree7bd4d26297825e0580049427093a8cc581cdcd11 /src/cmd/asm
parent87fae3622dacca9cfa5026c712df40af694a4e6a (diff)
downloadgo-91d1a883768b8b38fe79eefd820063b2b593f23a.tar.xz
cmd/internal/obj/riscv: add assembly support of Zbc extension
The Zbc extension adds carry-less multiplication instructions for polynomial arithmetic over GF(2), which is used in cryptographic algorithms and error-correcting codes. The instructions included are: clmul, clmulh, and clmulr. Change-Id: I77a40add1a795c7b90b478dc65835c689e82167a GitHub-Last-Rev: 53790f0aafa46af2ed24183f58292df7f9fb224a GitHub-Pull-Request: golang/go#76301 Reviewed-on: https://go-review.googlesource.com/c/go/+/720520 Reviewed-by: Carlos Amedee <carlos@golang.org> Reviewed-by: Joel Sing <joel@sing.id.au> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/cmd/asm')
-rw-r--r--src/cmd/asm/internal/asm/testdata/riscv64.s8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/cmd/asm/internal/asm/testdata/riscv64.s b/src/cmd/asm/internal/asm/testdata/riscv64.s
index 1b23680e26..94d1476a6d 100644
--- a/src/cmd/asm/internal/asm/testdata/riscv64.s
+++ b/src/cmd/asm/internal/asm/testdata/riscv64.s
@@ -509,6 +509,14 @@ start:
ORCB X5, X6 // 13d37228
REV8 X7, X8 // 13d4836b
+ // 28.4.3: Carry-less multiplication (Zbc)
+ CLMUL X5, X6, X7 // b313530a
+ CLMUL X5, X6 // 3313530a
+ CLMULH X5, X6, X7 // b333530a
+ CLMULH X5, X6 // 3333530a
+ CLMULR X5, X6, X7 // b323530a
+ CLMULR X5, X6 // 3323530a
+
// 28.4.4: Single-bit Instructions (Zbs)
BCLR X23, X24, X25 // b31c7c49
BCLR $63, X24 // 131cfc4b