Skip to content

Commit fc5c1c2

Browse files
pz9115Nelson Chu
authored andcommitted
RISC-V: Scalar crypto instruction and entropy source CSR testcases.
Add testcases for Scalar Crypto extension, with total testcase contain all instructions in k-ext/k-ext-64 and sub-extension testcase for zbk* zk*. Also add testcase for new CSR name 'seed' which is the Entropy Source in zkr. In fact these whole testcases can be combined into one file, after we have supported the .option arch +-= directives. gas/ * testsuite/gas/riscv/k-ext-64.d: New testcase for crypto instructions. * testsuite/gas/riscv/k-ext-64.s: Likewise. * testsuite/gas/riscv/k-ext.d: Likewise. * testsuite/gas/riscv/k-ext.s: Likewise. * testsuite/gas/riscv/zbkb-32.d: Likewise. * testsuite/gas/riscv/zbkb-32.s: Likewise. * testsuite/gas/riscv/zbkb-64.d: Likewise. * testsuite/gas/riscv/zbkb-64.s: Likewise. * testsuite/gas/riscv/zbkc-32.d: Likewise. * testsuite/gas/riscv/zbkc-64.d: Likewise. * testsuite/gas/riscv/zbkc.s: Likewise. * testsuite/gas/riscv/zbkx-32.d: Likewise. * testsuite/gas/riscv/zbkx-64.d: Likewise. * testsuite/gas/riscv/zbkx.s: Likewise. * testsuite/gas/riscv/zknd-32.d: Likewise. * testsuite/gas/riscv/zknd-32.s: Likewise. * testsuite/gas/riscv/zknd-64.d: Likewise. * testsuite/gas/riscv/zknd-64.s: Likewise. * testsuite/gas/riscv/zkne-32.d: Likewise. * testsuite/gas/riscv/zkne-32.s: Likewise. * testsuite/gas/riscv/zkne-64.d: Likewise. * testsuite/gas/riscv/zkne-64.s: Likewise. * testsuite/gas/riscv/zknh-32.d: Likewise. * testsuite/gas/riscv/zknh-32.s: Likewise. * testsuite/gas/riscv/zknh-64.d: Likewise. * testsuite/gas/riscv/zknh-64.s: Likewise. * testsuite/gas/riscv/zksed-32.d: Likewise. * testsuite/gas/riscv/zksed-64.d: Likewise. * testsuite/gas/riscv/zksed.s: Likewise. * testsuite/gas/riscv/zksh-32.d: Likewise. * testsuite/gas/riscv/zksh-64.d: Likewise. * testsuite/gas/riscv/zksh.s: Likewise. * testsuite/gas/riscv/priv-reg-fail-zkr.d: New testcase for zkr csr check. * testsuite/gas/riscv/priv-reg-fail-zkr.l: Likewise. * testsuite/gas/riscv/priv-reg-fail-version-1p10.d: Updated march to rv32if_zkr. * testsuite/gas/riscv/priv-reg-fail-version-1p11.d: Likewise. * testsuite/gas/riscv/priv-reg-fail-version-1p9p1.d: Likewise. * testsuite/gas/riscv/priv-reg-version-1p10.d: Added Crypto seed csr. * testsuite/gas/riscv/priv-reg-version-1p11.d: Likewise. * testsuite/gas/riscv/priv-reg-version-1p9p1.d: Likewise. * testsuite/gas/riscv/priv-reg.s: Likewise.
1 parent 3d1cafa commit fc5c1c2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+490
-3
lines changed

gas/testsuite/gas/riscv/k-ext-64.d

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#as: -march=rv64i_zbkb_zbkc_zbkx_zknd_zkne_zknh_zkr_zksed_zksh_zkt
2+
#source: k-ext-64.s
3+
#objdump: -d
4+
5+
.*:[ ]+file format .*
6+
7+
8+
Disassembly of section .text:
9+
10+
0+000 <target>:
11+
[ ]+.*:[ ]+.*[ ]+ror[ ]+a0,a1,a2
12+
[ ]+.*:[ ]+.*[ ]+rol[ ]+a0,a1,a2
13+
[ ]+.*:[ ]+.*[ ]+rori[ ]+a0,a1,0x2
14+
[ ]+.*:[ ]+.*[ ]+rorw[ ]+a0,a1,a2
15+
[ ]+.*:[ ]+.*[ ]+rolw[ ]+a0,a1,a2
16+
[ ]+.*:[ ]+.*[ ]+roriw[ ]+a0,a1,0x2
17+
[ ]+.*:[ ]+.*[ ]+andn[ ]+a0,a1,a2
18+
[ ]+.*:[ ]+.*[ ]+orn[ ]+a0,a1,a2
19+
[ ]+.*:[ ]+.*[ ]+xnor[ ]+a0,a1,a2
20+
[ ]+.*:[ ]+.*[ ]+pack[ ]+a0,a1,a2
21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 ]+.*:[ ]+.*[ ]+sm3p0[ ]+a0,a0
47+
[ ]+.*:[ ]+.*[ ]+sm3p1[ ]+a0,a0

gas/testsuite/gas/riscv/k-ext-64.s

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
target:
2+
ror a0, a1, a2
3+
rol a0, a1, a2
4+
rori a0, a1, 2
5+
rorw a0, a1, a2
6+
rolw a0, a1, a2
7+
roriw a0, a1, 2
8+
andn a0, a1, a2
9+
orn a0, a1, a2
10+
xnor a0, a1, a2
11+
pack a0, a1, a2
12+
packh a0, a1, a2
13+
packw a0, a1, a2
14+
brev8 a0, a0
15+
rev8 a0, a0
16+
clmul a0, a1, a2
17+
clmulh a0, a1, a2
18+
xperm4 a0, a1, a2
19+
xperm8 a0, a1, a2
20+
aes64ds a0, a1, a2
21+
aes64dsm a0, a1, a2
22+
aes64im a0, a0
23+
aes64ks1i a0, a1, 4
24+
aes64ks2 a0, a1, a2
25+
aes64es a0, a1, a2
26+
aes64esm a0, a1, a2
27+
sha256sig0 a0, a0
28+
sha256sig1 a0, a0
29+
sha256sum0 a0, a0
30+
sha256sum1 a0, a0
31+
sha512sig0 a0, a0
32+
sha512sig1 a0, a0
33+
sha512sum0 a0, a0
34+
sha512sum1 a0, a0
35+
sm4ed a0, a1, a2, 2
36+
sm4ks a0, a1, a2, 2
37+
sm3p0 a0, a0
38+
sm3p1 a0, a0

gas/testsuite/gas/riscv/k-ext.d

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#as: -march=rv32i_zbkb_zbkc_zbkx_zknd_zkne_zknh_zkr_zksed_zksh_zkt
2+
#source: k-ext.s
3+
#objdump: -d
4+
5+
.*:[ ]+file format .*
6+
7+
8+
Disassembly of section .text:
9+
10+
0+000 <target>:
11+
[ ]+.*:[ ]+.*[ ]+ror[ ]+a0,a1,a2
12+
[ ]+.*:[ ]+.*[ ]+rol[ ]+a0,a1,a2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a2
38+
[ ]+.*:[ ]+.*[ ]+sha512sig1l[ ]+a0,a1,a2
39+
[ ]+.*:[ ]+.*[ ]+sha512sum0r[ ]+a0,a1,a2
40+
[ ]+.*:[ ]+.*[ ]+sha512sum1r[ ]+a0,a1,a2
41+
[ ]+.*:[ ]+.*[ ]+sm4ed[ ]+a0,a1,a2,0x2
42+
[ ]+.*:[ ]+.*[ ]+sm4ks[ ]+a0,a1,a2,0x2
43+
[ ]+.*:[ ]+.*[ ]+sm3p0[ ]+a0,a0
44+
[ ]+.*:[ ]+.*[ ]+sm3p1[ ]+a0,a0

gas/testsuite/gas/riscv/k-ext.s

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
target:
2+
ror a0, a1, a2
3+
rol a0, a1, a2
4+
rori a0, a1, 2
5+
andn a0, a1, a2
6+
orn a0, a1, a2
7+
xnor a0, a1, a2
8+
pack a0, a1, a2
9+
packh a0, a1, a2
10+
brev8 a0, a0
11+
rev8 a0, a0
12+
zip a0, a0
13+
unzip a0, a0
14+
clmul a0, a1, a2
15+
clmulh a0, a1, a2
16+
xperm4 a0, a1, a2
17+
xperm8 a0, a1, a2
18+
aes32dsi a0, a1, a2, 2
19+
aes32dsmi a0, a1, a2, 2
20+
aes32esi a0, a1, a2, 2
21+
aes32esmi a0, a1, a2, 2
22+
sha256sig0 a0, a0
23+
sha256sig1 a0, a0
24+
sha256sum0 a0, a0
25+
sha256sum1 a0, a0
26+
sha512sig0h a0, a1, a2
27+
sha512sig0l a0, a1, a2
28+
sha512sig1h a0, a1, a2
29+
sha512sig1l a0, a1, a2
30+
sha512sum0r a0, a1, a2
31+
sha512sum1r a0, a1, a2
32+
sm4ed a0, a1, a2, 2
33+
sm4ks a0, a1, a2, 2
34+
sm3p0 a0, a0
35+
sm3p1 a0, a0

gas/testsuite/gas/riscv/priv-reg-fail-version-1p10.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#as: -march=rv32if -mcsr-check -mpriv-spec=1.10 -march-attr
1+
#as: -march=rv32if_zkr -mcsr-check -mpriv-spec=1.10 -march-attr
22
#source: priv-reg.s
33
#warning_output: priv-reg-fail-version-1p10.l
44
#readelf: -A

gas/testsuite/gas/riscv/priv-reg-fail-version-1p11.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#as: -march=rv32if -mcsr-check -mpriv-spec=1.11 -march-attr
1+
#as: -march=rv32if_zkr -mcsr-check -mpriv-spec=1.11 -march-attr
22
#source: priv-reg.s
33
#warning_output: priv-reg-fail-version-1p11.l
44
#readelf: -A

gas/testsuite/gas/riscv/priv-reg-fail-version-1p9p1.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#as: -march=rv32if -mcsr-check -mpriv-spec=1.9.1 -march-attr
1+
#as: -march=rv32if_zkr -mcsr-check -mpriv-spec=1.9.1 -march-attr
22
#source: priv-reg.s
33
#warning_output: priv-reg-fail-version-1p9p1.l
44
#readelf: -A
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#as: -march=rv32if -mcsr-check
2+
#source: priv-reg.s
3+
#warning_output: priv-reg-fail-zkr.l
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.*Assembler messages:
2+
#...
3+
.*Warning: invalid CSR `seed' for the current ISA
4+
#...

gas/testsuite/gas/riscv/priv-reg-version-1p10.d

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,3 +265,4 @@ Disassembly of section .text:
265265
[ ]+[0-9a-f]+:[ ]+7a102573[ ]+csrr[ ]+a0,tdata1
266266
[ ]+[0-9a-f]+:[ ]+7a302573[ ]+csrr[ ]+a0,tdata3
267267
[ ]+[0-9a-f]+:[ ]+7a302573[ ]+csrr[ ]+a0,tdata3
268+
[ ]+[0-9a-f]+:[ ]+01502573[ ]+csrr[ ]+a0,seed

0 commit comments

Comments
 (0)