From a8fa749c30e710ce65fd63245212c47c1fa15fe1 Mon Sep 17 00:00:00 2001 From: Tsukasa OI Date: Tue, 18 Jan 2022 19:02:00 +0900 Subject: [PATCH] UNRATIFIED RISC-V: Add 'Zihintntl' extension tests [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. --- gas/testsuite/gas/riscv/zihintntl-auto-c.d | 17 +++++++++++++ .../gas/riscv/zihintntl-base-noarch.d | 25 +++++++++++++++++++ gas/testsuite/gas/riscv/zihintntl-base.d | 25 +++++++++++++++++++ gas/testsuite/gas/riscv/zihintntl-base.s | 17 +++++++++++++ gas/testsuite/gas/riscv/zihintntl-c-noalias.d | 17 +++++++++++++ gas/testsuite/gas/riscv/zihintntl-c.d | 17 +++++++++++++ gas/testsuite/gas/riscv/zihintntl-c.s | 9 +++++++ gas/testsuite/gas/riscv/zihintntl.d | 17 +++++++++++++ gas/testsuite/gas/riscv/zihintntl.s | 9 +++++++ 9 files changed, 153 insertions(+) create mode 100644 gas/testsuite/gas/riscv/zihintntl-auto-c.d create mode 100644 gas/testsuite/gas/riscv/zihintntl-base-noarch.d create mode 100644 gas/testsuite/gas/riscv/zihintntl-base.d create mode 100644 gas/testsuite/gas/riscv/zihintntl-base.s create mode 100644 gas/testsuite/gas/riscv/zihintntl-c-noalias.d create mode 100644 gas/testsuite/gas/riscv/zihintntl-c.d create mode 100644 gas/testsuite/gas/riscv/zihintntl-c.s create mode 100644 gas/testsuite/gas/riscv/zihintntl.d create mode 100644 gas/testsuite/gas/riscv/zihintntl.s diff --git a/gas/testsuite/gas/riscv/zihintntl-auto-c.d b/gas/testsuite/gas/riscv/zihintntl-auto-c.d new file mode 100644 index 00000000000..1e849d685e8 --- /dev/null +++ b/gas/testsuite/gas/riscv/zihintntl-auto-c.d @@ -0,0 +1,17 @@ +#as: -march=rv64ic_zihintntl +#source: zihintntl.s +#objdump: -dr + +.*:[ ]+file format .* + +Disassembly of section .text: + +0+000 : +[ ]+[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\) diff --git a/gas/testsuite/gas/riscv/zihintntl-base-noarch.d b/gas/testsuite/gas/riscv/zihintntl-base-noarch.d new file mode 100644 index 00000000000..5d3111cc3ec --- /dev/null +++ b/gas/testsuite/gas/riscv/zihintntl-base-noarch.d @@ -0,0 +1,25 @@ +#as: -march=rv64ic +#source: zihintntl-base.s +#objdump: -dr + +.*:[ ]+file format .* + +Disassembly of section .text: + +0+000 : +[ ]+[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\) diff --git a/gas/testsuite/gas/riscv/zihintntl-base.d b/gas/testsuite/gas/riscv/zihintntl-base.d new file mode 100644 index 00000000000..ae98de5b3d0 --- /dev/null +++ b/gas/testsuite/gas/riscv/zihintntl-base.d @@ -0,0 +1,25 @@ +#as: -march=rv64ic_zihintntl +#source: zihintntl-base.s +#objdump: -dr -Mno-aliases + +.*:[ ]+file format .* + +Disassembly of section .text: + +0+000 : +[ ]+[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\) diff --git a/gas/testsuite/gas/riscv/zihintntl-base.s b/gas/testsuite/gas/riscv/zihintntl-base.s new file mode 100644 index 00000000000..6678fc9c2b8 --- /dev/null +++ b/gas/testsuite/gas/riscv/zihintntl-base.s @@ -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) diff --git a/gas/testsuite/gas/riscv/zihintntl-c-noalias.d b/gas/testsuite/gas/riscv/zihintntl-c-noalias.d new file mode 100644 index 00000000000..cd4897a1eef --- /dev/null +++ b/gas/testsuite/gas/riscv/zihintntl-c-noalias.d @@ -0,0 +1,17 @@ +#as: -march=rv64ic_zihintntl +#source: zihintntl-c.s +#objdump: -dr -Mno-aliases + +.*:[ ]+file format .* + +Disassembly of section .text: + +0+000 : +[ ]+[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\) diff --git a/gas/testsuite/gas/riscv/zihintntl-c.d b/gas/testsuite/gas/riscv/zihintntl-c.d new file mode 100644 index 00000000000..0e71029d5ac --- /dev/null +++ b/gas/testsuite/gas/riscv/zihintntl-c.d @@ -0,0 +1,17 @@ +#as: -march=rv64ic_zihintntl +#source: zihintntl-c.s +#objdump: -dr + +.*:[ ]+file format .* + +Disassembly of section .text: + +0+000 : +[ ]+[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\) diff --git a/gas/testsuite/gas/riscv/zihintntl-c.s b/gas/testsuite/gas/riscv/zihintntl-c.s new file mode 100644 index 00000000000..3f140d4f31b --- /dev/null +++ b/gas/testsuite/gas/riscv/zihintntl-c.s @@ -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) diff --git a/gas/testsuite/gas/riscv/zihintntl.d b/gas/testsuite/gas/riscv/zihintntl.d new file mode 100644 index 00000000000..e7ff6fc322a --- /dev/null +++ b/gas/testsuite/gas/riscv/zihintntl.d @@ -0,0 +1,17 @@ +#as: -march=rv64i_zihintntl +#source: zihintntl.s +#objdump: -dr + +.*:[ ]+file format .* + +Disassembly of section .text: + +0+000 : +[ ]+[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\) diff --git a/gas/testsuite/gas/riscv/zihintntl.s b/gas/testsuite/gas/riscv/zihintntl.s new file mode 100644 index 00000000000..0e7660ea361 --- /dev/null +++ b/gas/testsuite/gas/riscv/zihintntl.s @@ -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)