Skip to content

Commit

Permalink
UNRATIFIED RISC-V: Add 'Zihintntl' extension tests
Browse files Browse the repository at this point in the history
[DO NOT MERGE]
Until 'Zihintntl' extension is ratified and final version number is
determined, this patch should not merged upstream.  This commit uses
unratified version 0.2 as in documentation (instead of possible 1.0
after ratification).

This commit adds testcases for 'Zihintntl' extension.

gas/ChangeLog:

	* testsuite/gas/riscv/zihintntl.s: New test for 4-byte hint
	instructions.
	* testsuite/gas/riscv/zihintntl.d: Likewise.
	* testsuite/gas/riscv/zihintntl-auto-c.d: Likewise but test auto
	compression to 2-byte instructions.
	* testsuite/gas/riscv/zihintntl-c.s: New test for 2-byte hint
	instructions.
	* testsuite/gas/riscv/zihintntl-c.d: Likewise.
	* testsuite/gas/riscv/zihintntl-c-noalias.d: Likewise but
	different output with -Mno-aliases.
	* testsuite/gas/riscv/zihintntl-base.s: New test for base
	instructions corresponding non-temporal locality hints.
	* testsuite/gas/riscv/zihintntl-base.d: Likewise.
	* testsuite/gas/riscv/zihintntl-base-noarch.d: Likewise but
	without 'Zihintntl' extension in -march.
  • Loading branch information
a4lg committed Aug 12, 2022
1 parent f7c504b commit a8fa749
Show file tree
Hide file tree
Showing 9 changed files with 153 additions and 0 deletions.
17 changes: 17 additions & 0 deletions gas/testsuite/gas/riscv/zihintntl-auto-c.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#as: -march=rv64ic_zihintntl
#source: zihintntl.s
#objdump: -dr

.*:[ ]+file format .*

Disassembly of section .text:

0+000 <target>:
[ ]+[0-9a-f]+:[ ]+900a[ ]+ntl\.p1
[ ]+[0-9a-f]+:[ ]+01b28023[ ]+sb[ ]+s11,0\(t0\)
[ ]+[0-9a-f]+:[ ]+900e[ ]+ntl\.pall
[ ]+[0-9a-f]+:[ ]+01b28123[ ]+sb[ ]+s11,2\(t0\)
[ ]+[0-9a-f]+:[ ]+9012[ ]+ntl\.s1
[ ]+[0-9a-f]+:[ ]+01b28223[ ]+sb[ ]+s11,4\(t0\)
[ ]+[0-9a-f]+:[ ]+9016[ ]+ntl\.all
[ ]+[0-9a-f]+:[ ]+01b28323[ ]+sb[ ]+s11,6\(t0\)
25 changes: 25 additions & 0 deletions gas/testsuite/gas/riscv/zihintntl-base-noarch.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#as: -march=rv64ic
#source: zihintntl-base.s
#objdump: -dr

.*:[ ]+file format .*

Disassembly of section .text:

0+000 <target>:
[ ]+[0-9a-f]+:[ ]+00200033[ ]+add[ ]+zero,zero,sp
[ ]+[0-9a-f]+:[ ]+01b28823[ ]+sb[ ]+s11,16\(t0\)
[ ]+[0-9a-f]+:[ ]+00300033[ ]+add[ ]+zero,zero,gp
[ ]+[0-9a-f]+:[ ]+01b28923[ ]+sb[ ]+s11,18\(t0\)
[ ]+[0-9a-f]+:[ ]+00400033[ ]+add[ ]+zero,zero,tp
[ ]+[0-9a-f]+:[ ]+01b28a23[ ]+sb[ ]+s11,20\(t0\)
[ ]+[0-9a-f]+:[ ]+00500033[ ]+add[ ]+zero,zero,t0
[ ]+[0-9a-f]+:[ ]+01b28b23[ ]+sb[ ]+s11,22\(t0\)
[ ]+[0-9a-f]+:[ ]+900a[ ]+c\.add[ ]+zero,sp
[ ]+[0-9a-f]+:[ ]+01b28c23[ ]+sb[ ]+s11,24\(t0\)
[ ]+[0-9a-f]+:[ ]+900e[ ]+c\.add[ ]+zero,gp
[ ]+[0-9a-f]+:[ ]+01b28d23[ ]+sb[ ]+s11,26\(t0\)
[ ]+[0-9a-f]+:[ ]+9012[ ]+c\.add[ ]+zero,tp
[ ]+[0-9a-f]+:[ ]+01b28e23[ ]+sb[ ]+s11,28\(t0\)
[ ]+[0-9a-f]+:[ ]+9016[ ]+c\.add[ ]+zero,t0
[ ]+[0-9a-f]+:[ ]+01b28f23[ ]+sb[ ]+s11,30\(t0\)
25 changes: 25 additions & 0 deletions gas/testsuite/gas/riscv/zihintntl-base.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#as: -march=rv64ic_zihintntl
#source: zihintntl-base.s
#objdump: -dr -Mno-aliases

.*:[ ]+file format .*

Disassembly of section .text:

0+000 <target>:
[ ]+[0-9a-f]+:[ ]+00200033[ ]+ntl\.p1
[ ]+[0-9a-f]+:[ ]+01b28823[ ]+sb[ ]+s11,16\(t0\)
[ ]+[0-9a-f]+:[ ]+00300033[ ]+ntl\.pall
[ ]+[0-9a-f]+:[ ]+01b28923[ ]+sb[ ]+s11,18\(t0\)
[ ]+[0-9a-f]+:[ ]+00400033[ ]+ntl\.s1
[ ]+[0-9a-f]+:[ ]+01b28a23[ ]+sb[ ]+s11,20\(t0\)
[ ]+[0-9a-f]+:[ ]+00500033[ ]+ntl\.all
[ ]+[0-9a-f]+:[ ]+01b28b23[ ]+sb[ ]+s11,22\(t0\)
[ ]+[0-9a-f]+:[ ]+900a[ ]+c\.ntl\.p1
[ ]+[0-9a-f]+:[ ]+01b28c23[ ]+sb[ ]+s11,24\(t0\)
[ ]+[0-9a-f]+:[ ]+900e[ ]+c\.ntl\.pall
[ ]+[0-9a-f]+:[ ]+01b28d23[ ]+sb[ ]+s11,26\(t0\)
[ ]+[0-9a-f]+:[ ]+9012[ ]+c\.ntl\.s1
[ ]+[0-9a-f]+:[ ]+01b28e23[ ]+sb[ ]+s11,28\(t0\)
[ ]+[0-9a-f]+:[ ]+9016[ ]+c\.ntl\.all
[ ]+[0-9a-f]+:[ ]+01b28f23[ ]+sb[ ]+s11,30\(t0\)
17 changes: 17 additions & 0 deletions gas/testsuite/gas/riscv/zihintntl-base.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
target:
add x0, x0, x2 # ntl.p1
sb s11, 2*0x8(t0)
add x0, x0, x3 # ntl.pall
sb s11, 2*0x9(t0)
add x0, x0, x4 # ntl.s1
sb s11, 2*0xa(t0)
add x0, x0, x5 # ntl.all
sb s11, 2*0xb(t0)
c.add x0, x2 # c.ntl.p1
sb s11, 2*0xc(t0)
c.add x0, x3 # c.ntl.pall
sb s11, 2*0xd(t0)
c.add x0, x4 # c.ntl.s1
sb s11, 2*0xe(t0)
c.add x0, x5 # c.ntl.all
sb s11, 2*0xf(t0)
17 changes: 17 additions & 0 deletions gas/testsuite/gas/riscv/zihintntl-c-noalias.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#as: -march=rv64ic_zihintntl
#source: zihintntl-c.s
#objdump: -dr -Mno-aliases

.*:[ ]+file format .*

Disassembly of section .text:

0+000 <target>:
[ ]+[0-9a-f]+:[ ]+900a[ ]+c\.ntl\.p1
[ ]+[0-9a-f]+:[ ]+01b28423[ ]+sb[ ]+s11,8\(t0\)
[ ]+[0-9a-f]+:[ ]+900e[ ]+c\.ntl\.pall
[ ]+[0-9a-f]+:[ ]+01b28523[ ]+sb[ ]+s11,10\(t0\)
[ ]+[0-9a-f]+:[ ]+9012[ ]+c\.ntl\.s1
[ ]+[0-9a-f]+:[ ]+01b28623[ ]+sb[ ]+s11,12\(t0\)
[ ]+[0-9a-f]+:[ ]+9016[ ]+c\.ntl\.all
[ ]+[0-9a-f]+:[ ]+01b28723[ ]+sb[ ]+s11,14\(t0\)
17 changes: 17 additions & 0 deletions gas/testsuite/gas/riscv/zihintntl-c.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#as: -march=rv64ic_zihintntl
#source: zihintntl-c.s
#objdump: -dr

.*:[ ]+file format .*

Disassembly of section .text:

0+000 <target>:
[ ]+[0-9a-f]+:[ ]+900a[ ]+ntl\.p1
[ ]+[0-9a-f]+:[ ]+01b28423[ ]+sb[ ]+s11,8\(t0\)
[ ]+[0-9a-f]+:[ ]+900e[ ]+ntl\.pall
[ ]+[0-9a-f]+:[ ]+01b28523[ ]+sb[ ]+s11,10\(t0\)
[ ]+[0-9a-f]+:[ ]+9012[ ]+ntl\.s1
[ ]+[0-9a-f]+:[ ]+01b28623[ ]+sb[ ]+s11,12\(t0\)
[ ]+[0-9a-f]+:[ ]+9016[ ]+ntl\.all
[ ]+[0-9a-f]+:[ ]+01b28723[ ]+sb[ ]+s11,14\(t0\)
9 changes: 9 additions & 0 deletions gas/testsuite/gas/riscv/zihintntl-c.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
target:
c.ntl.p1
sb s11, 2*0x4(t0)
c.ntl.pall
sb s11, 2*0x5(t0)
c.ntl.s1
sb s11, 2*0x6(t0)
c.ntl.all
sb s11, 2*0x7(t0)
17 changes: 17 additions & 0 deletions gas/testsuite/gas/riscv/zihintntl.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#as: -march=rv64i_zihintntl
#source: zihintntl.s
#objdump: -dr

.*:[ ]+file format .*

Disassembly of section .text:

0+000 <target>:
[ ]+[0-9a-f]+:[ ]+00200033[ ]+ntl\.p1
[ ]+[0-9a-f]+:[ ]+01b28023[ ]+sb[ ]+s11,0\(t0\)
[ ]+[0-9a-f]+:[ ]+00300033[ ]+ntl\.pall
[ ]+[0-9a-f]+:[ ]+01b28123[ ]+sb[ ]+s11,2\(t0\)
[ ]+[0-9a-f]+:[ ]+00400033[ ]+ntl\.s1
[ ]+[0-9a-f]+:[ ]+01b28223[ ]+sb[ ]+s11,4\(t0\)
[ ]+[0-9a-f]+:[ ]+00500033[ ]+ntl\.all
[ ]+[0-9a-f]+:[ ]+01b28323[ ]+sb[ ]+s11,6\(t0\)
9 changes: 9 additions & 0 deletions gas/testsuite/gas/riscv/zihintntl.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
target:
ntl.p1
sb s11, 2*0x0(t0)
ntl.pall
sb s11, 2*0x1(t0)
ntl.s1
sb s11, 2*0x2(t0)
ntl.all
sb s11, 2*0x3(t0)

0 comments on commit a8fa749

Please sign in to comment.