This repository has been archived by the owner on May 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 274
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Shihua Liao <[email protected]> Co-authored-by: Jiawei Chen <[email protected]>
- Loading branch information
1 parent
f4ff3f3
commit 605a775
Showing
16 changed files
with
280 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* { dg-do compile } */ | ||
/* { dg-options "-march=rv32gc_zknd -mabi=ilp32 -O2" } */ | ||
|
||
int foo1(int rs1) | ||
{ | ||
return __builtin_riscv_aes32dsi(rs1, 1); | ||
} | ||
|
||
int foo2(int rs1) | ||
{ | ||
return __builtin_riscv_aes32dsmi(rs1, 0); | ||
} | ||
|
||
/* { dg-final { scan-assembler-times "aes32dsi" 1 } } */ | ||
/* { dg-final { scan-assembler-times "aes32dsmi" 1 } } */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* { dg-do compile } */ | ||
/* { dg-options "-march=rv64gc_zknd -mabi=lp64 -O2" } */ | ||
|
||
long foo1(long rs1, long rs2) | ||
{ | ||
return __builtin_riscv_aes64ds(rs1, rs2); | ||
} | ||
|
||
long foo2(long rs1, long rs2) | ||
{ | ||
return __builtin_riscv_aes64dsm(rs1, rs2); | ||
} | ||
|
||
long foo3(long rs1) | ||
{ | ||
return __builtin_riscv_aes64im(rs1); | ||
} | ||
|
||
/* { dg-final { scan-assembler-times "aes64ds" 2 } } */ | ||
/* { dg-final { scan-assembler-times "aes64dsm" 1 } } */ | ||
/* { dg-final { scan-assembler-times "aes64im" 1 } } */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* { dg-do compile } */ | ||
/* { dg-options "-march=rv32gc_zkne -mabi=ilp32 -O2" } */ | ||
|
||
int foo1(int rs1) | ||
{ | ||
return __builtin_riscv_aes32esi(rs1, 1); | ||
} | ||
|
||
int foo2(int rs1) | ||
{ | ||
return __builtin_riscv_aes32esmi(rs1, 1); | ||
} | ||
|
||
/* { dg-final { scan-assembler-times "aes32esi" 1 } } */ | ||
/* { dg-final { scan-assembler-times "aes32esmi" 1 } } */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* { dg-do compile } */ | ||
/* { dg-options "-march=rv64gc_zkne -mabi=lp64 -O2" } */ | ||
|
||
long foo1(long rs1, long rs2) | ||
{ | ||
return __builtin_riscv_aes64es(rs1, rs2); | ||
} | ||
|
||
long foo2(long rs1, long rs2) | ||
{ | ||
return __builtin_riscv_aes64esm(rs1, rs2); | ||
} | ||
|
||
long foo3(long rs1) | ||
{ | ||
return __builtin_riscv_aes64ks1i(rs1, 1); | ||
} | ||
|
||
long foo4(long rs1, long rs2) | ||
{ | ||
return __builtin_riscv_aes64ks2(rs1, rs2); | ||
} | ||
|
||
/* { dg-final { scan-assembler-times "aes64es" 2 } } */ | ||
/* { dg-final { scan-assembler-times "aes64esm" 1 } } */ | ||
/* { dg-final { scan-assembler-times "aes64ks1i" 1 } } */ | ||
/* { dg-final { scan-assembler-times "aes64ks2" 1 } } */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* { dg-do compile { target { riscv64*-*-* } } } */ | ||
/* { dg-options "-march=rv64gc_zknh -mabi=lp64 -O2" } */ | ||
|
||
long foo1(long rs1) | ||
{ | ||
return __builtin_riscv_sha256sig0(rs1); | ||
} | ||
|
||
long foo2(long rs1) | ||
{ | ||
return __builtin_riscv_sha256sig1(rs1); | ||
} | ||
|
||
long foo3(long rs1) | ||
{ | ||
return __builtin_riscv_sha256sum0(rs1); | ||
} | ||
|
||
long foo4(long rs1) | ||
{ | ||
return __builtin_riscv_sha256sum1(rs1); | ||
} | ||
|
||
/* { dg-final { scan-assembler-times "sha256sig0" 1 } } */ | ||
/* { dg-final { scan-assembler-times "sha256sig1" 1 } } */ | ||
/* { dg-final { scan-assembler-times "sha256sum0" 1 } } */ | ||
/* { dg-final { scan-assembler-times "sha256sum1" 1 } } */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* { dg-do compile } */ | ||
/* { dg-options "-march=rv32gc_zknh -mabi=ilp32 -O2" } */ | ||
|
||
int foo1(int rs1, int rs2) | ||
{ | ||
return __builtin_riscv_sha512sig0h(rs1, rs2); | ||
} | ||
|
||
int foo2(int rs1, int rs2) | ||
{ | ||
return __builtin_riscv_sha512sig0l(rs1, rs2); | ||
} | ||
|
||
int foo3(int rs1, int rs2) | ||
{ | ||
return __builtin_riscv_sha512sig1h(rs1, rs2); | ||
} | ||
|
||
int foo4(int rs1, int rs2) | ||
{ | ||
return __builtin_riscv_sha512sig1l(rs1, rs2); | ||
} | ||
|
||
int foo5(int rs1, int rs2) | ||
{ | ||
return __builtin_riscv_sha512sum0r(rs1, rs2); | ||
} | ||
|
||
int foo6(int rs1, int rs2) | ||
{ | ||
return __builtin_riscv_sha512sum1r(rs1, rs2); | ||
} | ||
|
||
/* { dg-final { scan-assembler-times "sha512sig0h" 1 } } */ | ||
/* { dg-final { scan-assembler-times "sha512sig0l" 1 } } */ | ||
/* { dg-final { scan-assembler-times "sha512sig1h" 1 } } */ | ||
/* { dg-final { scan-assembler-times "sha512sig1l" 1 } } */ | ||
/* { dg-final { scan-assembler-times "sha512sum0r" 1 } } */ | ||
/* { dg-final { scan-assembler-times "sha512sum1r" 1 } } */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* { dg-do compile } */ | ||
/* { dg-options "-march=rv64i_zknh -mabi=lp64 -O2" } */ | ||
|
||
long foo1(long rs1) | ||
{ | ||
return __builtin_riscv_sha512sig0(rs1); | ||
} | ||
|
||
long foo2(long rs1) | ||
{ | ||
return __builtin_riscv_sha512sig1(rs1); | ||
} | ||
|
||
|
||
long foo3(long rs1) | ||
{ | ||
return __builtin_riscv_sha512sum0(rs1); | ||
} | ||
|
||
long foo4(long rs1) | ||
{ | ||
return __builtin_riscv_sha512sum1(rs1); | ||
} | ||
|
||
/* { dg-final { scan-assembler-times "sha512sig0" 1 } } */ | ||
/* { dg-final { scan-assembler-times "sha512sig1" 1 } } */ | ||
/* { dg-final { scan-assembler-times "sha512sum0" 1 } } */ | ||
/* { dg-final { scan-assembler-times "sha512sum1" 1 } } */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* { dg-do compile } */ | ||
/* { dg-options "-march=rv64gc_zkr -mabi=lp64 -O2" } */ | ||
|
||
long foo1() | ||
{ | ||
return __builtin_riscv_pollentropy(); | ||
} | ||
|
||
long foo2() | ||
{ | ||
return __builtin_riscv_getnoise(); | ||
} | ||
|
||
/* { dg-final { scan-assembler-times "pollentropy" 2 } } */ | ||
/* { dg-final { scan-assembler-times "getnoise" 1 } } */ |
Oops, something went wrong.