diff mbox series

[14/21,crypto] : add testcases for Zksh

Message ID 20211031093445.1414518-15-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:34 a.m. UTC
From: SiYu Wu <siyu@isrc.iscas.ac.cn>

Co-authored-by: Shihua Liao <shihua@iscas.ac.cn>
---
 gcc/testsuite/gcc.target/riscv/Zksh-sm3.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
 create mode 100644 gcc/testsuite/gcc.target/riscv/Zksh-sm3.c

Comments

Christoph Muellner Nov. 3, 2021, 10:54 p.m. UTC | #1
On Sun, Oct 31, 2021 at 10:34 AM <siyu@isrc.iscas.ac.cn> wrote:
>
> From: SiYu Wu <siyu@isrc.iscas.ac.cn>

You forgot the commit message.
Please have a read at the GCC Coding Conventions for the requirements:
https://gcc.gnu.org/codingconventions.html
Note that GCC commit messages require ChangeLog entries (a template
can be generated with ./contrib/mklog.py).

>
> Co-authored-by: Shihua Liao <shihua@iscas.ac.cn>
> ---
>  gcc/testsuite/gcc.target/riscv/Zksh-sm3.c | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
>  create mode 100644 gcc/testsuite/gcc.target/riscv/Zksh-sm3.c
>
> diff --git a/gcc/testsuite/gcc.target/riscv/Zksh-sm3.c b/gcc/testsuite/gcc.target/riscv/Zksh-sm3.c
> new file mode 100644
> index 00000000000..88ef5a55816
> --- /dev/null
> +++ b/gcc/testsuite/gcc.target/riscv/Zksh-sm3.c
> @@ -0,0 +1,15 @@
> +/* { dg-do compile } */
> +/* { dg-options "-march=rv64gc_zksh -mabi=lp64 -O2" } */
> +
> +long foo1(long rs1)
> +{
> +    return __builtin_riscv_sm3p0(rs1);
> +}
> +
> +long foo2(long rs1)
> +{
> +    return __builtin_riscv_sm3p1(rs1);
> +}
> +
> +/* { dg-final { scan-assembler-times "sm3p0" 1 } } */
> +/* { dg-final { scan-assembler-times "sm3p1" 1 } } */
> \ No newline at end of file
> --
> 2.25.1
>
diff mbox series

Patch

diff --git a/gcc/testsuite/gcc.target/riscv/Zksh-sm3.c b/gcc/testsuite/gcc.target/riscv/Zksh-sm3.c
new file mode 100644
index 00000000000..88ef5a55816
--- /dev/null
+++ b/gcc/testsuite/gcc.target/riscv/Zksh-sm3.c
@@ -0,0 +1,15 @@ 
+/* { dg-do compile } */
+/* { dg-options "-march=rv64gc_zksh -mabi=lp64 -O2" } */
+
+long foo1(long rs1)
+{
+    return __builtin_riscv_sm3p0(rs1);
+}
+
+long foo2(long rs1)
+{
+    return __builtin_riscv_sm3p1(rs1);
+}
+
+/* { dg-final { scan-assembler-times "sm3p0" 1 } } */
+/* { dg-final { scan-assembler-times "sm3p1" 1 } } */
\ No newline at end of file