diff mbox series

[21/21,crypto] : add testcases for Zbkx

Message ID 20211031094820.1415139-1-siyu@isrc.iscas.ac.cn
State New
Headers show
Series RISC-V: add gcc support for Scalar Cryptography v1.0.0-rc5 | expand

Commit Message

siyu@isrc.iscas.ac.cn Oct. 31, 2021, 9:48 a.m. UTC
From: SiYu Wu <siyu@isrc.iscas.ac.cn>

---
 gcc/testsuite/gcc.target/riscv/Zbkx.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 gcc/testsuite/gcc.target/riscv/Zbkx.c
diff mbox series

Patch

diff --git a/gcc/testsuite/gcc.target/riscv/Zbkx.c b/gcc/testsuite/gcc.target/riscv/Zbkx.c
new file mode 100644
index 00000000000..9bd0d6f0dea
--- /dev/null
+++ b/gcc/testsuite/gcc.target/riscv/Zbkx.c
@@ -0,0 +1,17 @@ 
+/* { dg-do compile } */
+/* { dg-options "-march=rv64i_zbkx -mabi=lp64 -O2" } */
+
+long foo1(long rs1, long rs2)
+{
+    return __builtin_riscv_xperm8(rs1, rs2);
+}
+
+long foo2(long rs1, long rs2)
+{
+    return __builtin_riscv_xperm4(rs1, rs2);
+}
+
+
+
+/* { dg-final { scan-assembler-times "xperm8" 1 } } */
+/* { dg-final { scan-assembler-times "xperm4" 1 } } */
\ No newline at end of file