Skip to content

Commit

Permalink
RISC-V: Add Zcmp push/pop/popret[z] instructions testcases.
Browse files Browse the repository at this point in the history
  • Loading branch information
pz9115 authored and Mary Bennett committed Oct 2, 2023
1 parent 54ae5ff commit fbf584e
Show file tree
Hide file tree
Showing 40 changed files with 2,030 additions and 0 deletions.
3 changes: 3 additions & 0 deletions gas/testsuite/gas/riscv/zc-zcmp-pop-rv32-fail.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#as: -march=rv32i_zca_zcmp
#source: zc-zcmp-pop-rv32-fail.s
#error_output: zc-zcmp-pop-rv32-fail.l
63 changes: 63 additions & 0 deletions gas/testsuite/gas/riscv/zc-zcmp-pop-rv32-fail.l
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
.*: Assembler messages:
.*: Error: illegal operands `cm.pop \{zero\},64'
.*: Error: illegal operands `cm.pop \{sp,s0\},64'
.*: Error: illegal operands `cm.pop \{gp,s0-s1\},64'
.*: Error: illegal operands `cm.pop \{tp,s0-s2\},64'
.*: Error: illegal operands `cm.pop \{t1,s0-s8\},64'
.*: Error: illegal operands `cm.pop \{s1,s0-s11\},64'
.*: Error: illegal operands `cm.pop \{a9,s0-s5\},64'
.*: Error: illegal operands `cm.pop \{ra,zero\},64'
.*: Error: illegal operands `cm.pop \{ra,ra\},64'
.*: Error: illegal operands `cm.pop \{ra,sp\},64'
.*: Error: illegal operands `cm.pop \{ra,gp\},64'
.*: Error: illegal operands `cm.pop \{ra,tp\},64'
.*: Error: illegal operands `cm.pop \{ra,a0\},64'
.*: Error: illegal operands `cm.pop \{ra,t0\},64'
.*: Error: illegal operands `cm.pop \{ra,s1\},64'
.*: Error: illegal operands `cm.pop \{ra,a0-a2\},64'
.*: Error: illegal operands `cm.pop \{ra,t0-t6\},64'
.*: Error: illegal operands `cm.pop \{ra,s1-s11\},64'
.*: Error: illegal operands `cm.pop \{x0\},64'
.*: Error: illegal operands `cm.pop \{x2,x8\},64'
.*: Error: illegal operands `cm.pop \{x3,x8-x9\},64'
.*: Error: illegal operands `cm.pop \{x4,x8-x9,x18\},64'
.*: Error: illegal operands `cm.pop \{x7,x8-x9,x18-x24\},64'
.*: Error: illegal operands `cm.pop \{x9,x8-x9,x18-x20\},64'
.*: Error: illegal operands `cm.pop \{x17,x8-x9,x18-x24\},64'
.*: Error: illegal operands `cm.pop \{x31,x8-x9,x18-x27\},64'
.*: Error: illegal operands `cm.pop \{x1,x9\},64'
.*: Error: illegal operands `cm.pop \{x1,x7-x9\},64'
.*: Error: illegal operands `cm.pop \{x1,x8-x10,x18\},64'
.*: Error: illegal operands `cm.pop \{x1,x5-x7,x18-x24\},64'
.*: Error: illegal operands `cm.pop \{x1,x10-x17,x18-x27\},64'
.*: Error: illegal operands `cm.pop \{x1,x8-x9,x19\},64'
.*: Error: illegal operands `cm.pop \{x1,x8-x9,x17-x24\},64'
.*: Error: illegal operands `cm.pop \{x1,x8-x9,x18-x28\},64'
.*: Error: illegal operands `cm.pop \{ra\},0'
.*: Error: illegal operands `cm.pop \{ra\},80'
.*: Error: illegal operands `cm.pop \{ra\},15'
.*: Error: illegal operands `cm.pop \{ra\},65'
.*: Error: illegal operands `cm.pop \{ra,s0-s2\},0'
.*: Error: illegal operands `cm.pop \{ra,s0-s2\},80'
.*: Error: illegal operands `cm.pop \{ra,s0-s2\},15'
.*: Error: illegal operands `cm.pop \{ra,s0-s2\},65'
.*: Error: illegal operands `cm.pop \{ra,s0-s3\},16'
.*: Error: illegal operands `cm.pop \{ra,s0-s3\},96'
.*: Error: illegal operands `cm.pop \{ra,s0-s3\},31'
.*: Error: illegal operands `cm.pop \{ra,s0-s3\},81'
.*: Error: illegal operands `cm.pop \{ra,s0-s6\},16'
.*: Error: illegal operands `cm.pop \{ra,s0-s6\},96'
.*: Error: illegal operands `cm.pop \{ra,s0-s6\},31'
.*: Error: illegal operands `cm.pop \{ra,s0-s6\},81'
.*: Error: illegal operands `cm.pop \{ra,s0-s7\},32'
.*: Error: illegal operands `cm.pop \{ra,s0-s7\},112'
.*: Error: illegal operands `cm.pop \{ra,s0-s7\},47'
.*: Error: illegal operands `cm.pop \{ra,s0-s7\},97'
.*: Error: illegal operands `cm.pop \{ra,s0-s9\},32'
.*: Error: illegal operands `cm.pop \{ra,s0-s9\},112'
.*: Error: illegal operands `cm.pop \{ra,s0-s9\},47'
.*: Error: illegal operands `cm.pop \{ra,s0-s9\},97'
.*: Error: illegal operands `cm.pop \{ra,s0-s11\},48'
.*: Error: illegal operands `cm.pop \{ra,s0-s11\},128'
.*: Error: illegal operands `cm.pop \{ra,s0-s11\},63'
.*: Error: illegal operands `cm.pop \{ra,s0-s11\},113'
75 changes: 75 additions & 0 deletions gas/testsuite/gas/riscv/zc-zcmp-pop-rv32-fail.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
zcmp32:
# -march=rv32i_zca_zcmp
# abi names
cm.pop {zero}, 64
cm.pop {sp, s0}, 64
cm.pop {gp, s0-s1}, 64
cm.pop {tp, s0-s2}, 64
cm.pop {t1, s0-s8}, 64
cm.pop {s1, s0-s11}, 64
cm.pop {a9, s0-s5}, 64

cm.pop {ra, zero}, 64
cm.pop {ra, ra}, 64
cm.pop {ra, sp}, 64
cm.pop {ra, gp}, 64
cm.pop {ra, tp}, 64
cm.pop {ra, a0}, 64
cm.pop {ra, t0}, 64
cm.pop {ra, s1}, 64
cm.pop {ra, a0-a2}, 64
cm.pop {ra, t0-t6}, 64
cm.pop {ra, s1-s11}, 64

# numeric names
cm.pop {x0}, 64
cm.pop {x2, x8}, 64
cm.pop {x3, x8-x9}, 64
cm.pop {x4, x8-x9, x18}, 64
cm.pop {x7, x8-x9, x18-x24}, 64
cm.pop {x9, x8-x9, x18-x20}, 64
cm.pop {x17, x8-x9, x18-x24}, 64
cm.pop {x31, x8-x9, x18-x27}, 64

cm.pop {x1, x9}, 64
cm.pop {x1, x7-x9}, 64
cm.pop {x1, x8-x10, x18}, 64
cm.pop {x1, x5-x7, x18-x24}, 64
cm.pop {x1, x10-x17, x18-x27}, 64

cm.pop {x1, x8-x9, x19}, 64
cm.pop {x1, x8-x9, x17-x24}, 64
cm.pop {x1, x8-x9, x18-x28}, 64

# spimm
cm.pop {ra}, 0
cm.pop {ra}, 80
cm.pop {ra}, 15
cm.pop {ra}, 65
cm.pop {ra, s0-s2}, 0
cm.pop {ra, s0-s2}, 80
cm.pop {ra, s0-s2}, 15
cm.pop {ra, s0-s2}, 65

cm.pop {ra, s0-s3}, 16
cm.pop {ra, s0-s3}, 96
cm.pop {ra, s0-s3}, 31
cm.pop {ra, s0-s3}, 81
cm.pop {ra, s0-s6}, 16
cm.pop {ra, s0-s6}, 96
cm.pop {ra, s0-s6}, 31
cm.pop {ra, s0-s6}, 81

cm.pop {ra, s0-s7}, 32
cm.pop {ra, s0-s7}, 112
cm.pop {ra, s0-s7}, 47
cm.pop {ra, s0-s7}, 97
cm.pop {ra, s0-s9}, 32
cm.pop {ra, s0-s9}, 112
cm.pop {ra, s0-s9}, 47
cm.pop {ra, s0-s9}, 97

cm.pop {ra, s0-s11}, 48
cm.pop {ra, s0-s11}, 128
cm.pop {ra, s0-s11}, 63
cm.pop {ra, s0-s11}, 113
44 changes: 44 additions & 0 deletions gas/testsuite/gas/riscv/zc-zcmp-pop-rv32.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#as: -march=rv32i_zca_zcmp
#source: zc-zcmp-pop-rv32.s
#objdump: -dr -Mno-aliases

.*:[ ]+file format .*


Disassembly of section .text:

0+000 <zcmp32>:
[ ]*[0-9a-f]+:[ ]+ba4e[ ]+cm.pop[ ]+\{ra\},64
[ ]*[0-9a-f]+:[ ]+ba5e[ ]+cm.pop[ ]+\{ra,s0\},64
[ ]*[0-9a-f]+:[ ]+ba6e[ ]+cm.pop[ ]+\{ra,s0-s1\},64
[ ]*[0-9a-f]+:[ ]+ba7e[ ]+cm.pop[ ]+\{ra,s0-s2\},64
[ ]*[0-9a-f]+:[ ]+bad6[ ]+cm.pop[ ]+\{ra,s0-s8\},64
[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9a-f]+:[ ]+bac6[ ]+cm.pop[ ]+\{ra,s0-s7\},64
[ ]*[0-9a-f]+:[ ]+bace[ ]+cm.pop[ ]+\{ra,s0-s7\},96
[ ]*[0-9a-f]+:[ ]+bae2[ ]+cm.pop[ ]+\{ra,s0-s9\},48
[ ]*[0-9a-f]+:[ ]+bae6[ ]+cm.pop[ ]+\{ra,s0-s9\},64
[ ]*[0-9a-f]+:[ ]+baee[ ]+cm.pop[ ]+\{ra,s0-s9\},96
[ ]*[0-9a-f]+:[ ]+baf2[ ]+cm.pop[ ]+\{ra,s0-s11\},64
[ ]*[0-9a-f]+:[ ]+baf6[ ]+cm.pop[ ]+\{ra,s0-s11\},80
[ ]*[0-9a-f]+:[ ]+bafa[ ]+cm.pop[ ]+\{ra,s0-s11\},96
[ ]*[0-9a-f]+:[ ]+bafe[ ]+cm.pop[ ]+\{ra,s0-s11\},112
43 changes: 43 additions & 0 deletions gas/testsuite/gas/riscv/zc-zcmp-pop-rv32.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
zcmp32:
# abi names
cm.pop {ra}, 64
cm.pop {ra, s0}, 64
cm.pop {ra, s0-s1}, 64
cm.pop {ra, s0-s2}, 64
cm.pop {ra, s0-s8}, 64
cm.pop {ra, s0-s11}, 64

# numeric names
cm.pop {x1}, 64
cm.pop {x1, x8}, 64
cm.pop {x1, x8-x9}, 64
cm.pop {x1, x8-x9, x18}, 64
cm.pop {x1, x8-x9, x18-x24}, 64
cm.pop {x1, x8-x9, x18-x27}, 64

# spimm
cm.pop {ra}, 16
cm.pop {ra}, 32
cm.pop {ra}, 64
cm.pop {ra, s0-s2}, 16
cm.pop {ra, s0-s2}, 32
cm.pop {ra, s0-s2}, 64

cm.pop {ra, s0-s3}, 32
cm.pop {ra, s0-s3}, 64
cm.pop {ra, s0-s3}, 80
cm.pop {ra, s0-s6}, 32
cm.pop {ra, s0-s6}, 64
cm.pop {ra, s0-s6}, 80

cm.pop {ra, s0-s7}, 48
cm.pop {ra, s0-s7}, 64
cm.pop {ra, s0-s7}, 96
cm.pop {ra, s0-s9}, 48
cm.pop {ra, s0-s9}, 64
cm.pop {ra, s0-s9}, 96

cm.pop {ra, s0-s11}, 64
cm.pop {ra, s0-s11}, 80
cm.pop {ra, s0-s11}, 96
cm.pop {ra, s0-s11}, 112
3 changes: 3 additions & 0 deletions gas/testsuite/gas/riscv/zc-zcmp-pop-rv64-fail.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#as: -march=rv64i_zca_zcmp
#source: zc-zcmp-pop-rv64-fail.s
#error_output: zc-zcmp-pop-rv64-fail.l
83 changes: 83 additions & 0 deletions gas/testsuite/gas/riscv/zc-zcmp-pop-rv64-fail.l
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
.*: Assembler messages:
.*: Error: illegal operands `cm.pop \{zero\},64'
.*: Error: illegal operands `cm.pop \{sp\},64'
.*: Error: illegal operands `cm.pop \{gp\},64'
.*: Error: illegal operands `cm.pop \{tp\},64'
.*: Error: illegal operands `cm.pop \{t1\},64'
.*: Error: illegal operands `cm.pop \{s1\},64'
.*: Error: illegal operands `cm.pop \{a9\},64'
.*: Error: illegal operands `cm.pop \{ra,zero\},64'
.*: Error: illegal operands `cm.pop \{ra,ra\},64'
.*: Error: illegal operands `cm.pop \{ra,sp\},64'
.*: Error: illegal operands `cm.pop \{ra,gp\},64'
.*: Error: illegal operands `cm.pop \{ra,tp\},64'
.*: Error: illegal operands `cm.pop \{ra,a0\},64'
.*: Error: illegal operands `cm.pop \{ra,t0\},64'
.*: Error: illegal operands `cm.pop \{ra,s1\},64'
.*: Error: illegal operands `cm.pop \{ra,s1-s2\},64'
.*: Error: illegal operands `cm.pop \{ra,t0-t2\},64'
.*: Error: illegal operands `cm.pop \{ra,t0-s8\},112'
.*: Error: illegal operands `cm.pop \{ra,s0-s12\},112'
.*: Error: illegal operands `cm.pop \{x0\},64'
.*: Error: illegal operands `cm.pop \{x2\},64'
.*: Error: illegal operands `cm.pop \{x3\},64'
.*: Error: illegal operands `cm.pop \{x4\},64'
.*: Error: illegal operands `cm.pop \{x31\},64'
.*: Error: illegal operands `cm.pop \{x17\},64'
.*: Error: illegal operands `cm.pop \{x1,x7\},64'
.*: Error: illegal operands `cm.pop \{x1,x9\},64'
.*: Error: illegal operands `cm.pop \{x1,x7-x9\},64'
.*: Error: illegal operands `cm.pop \{x1,x8-x10,x18\},64'
.*: Error: illegal operands `cm.pop \{x1,x8-x9,x17\},64'
.*: Error: illegal operands `cm.pop \{x1,x8-x9,x19\},64'
.*: Error: illegal operands `cm.pop \{x1,x8-x9,x17-x24\},112'
.*: Error: illegal operands `cm.pop \{x1,x8-x9,x19-x25\},112'
.*: Error: illegal operands `cm.pop \{x1,x8-x9,x18-x28\},112'
.*: Error: illegal operands `cm.pop \{ra\},0'
.*: Error: illegal operands `cm.pop \{ra\},80'
.*: Error: illegal operands `cm.pop \{ra\},15'
.*: Error: illegal operands `cm.pop \{ra\},65'
.*: Error: illegal operands `cm.pop \{ra,s0\},0'
.*: Error: illegal operands `cm.pop \{ra,s0\},80'
.*: Error: illegal operands `cm.pop \{ra,s0\},15'
.*: Error: illegal operands `cm.pop \{ra,s0\},65'
.*: Error: illegal operands `cm.pop \{ra,s0-s1\},16'
.*: Error: illegal operands `cm.pop \{ra,s0-s1\},96'
.*: Error: illegal operands `cm.pop \{ra,s0-s1\},31'
.*: Error: illegal operands `cm.pop \{ra,s0-s1\},81'
.*: Error: illegal operands `cm.pop \{ra,s0-s2\},16'
.*: Error: illegal operands `cm.pop \{ra,s0-s2\},96'
.*: Error: illegal operands `cm.pop \{ra,s0-s2\},31'
.*: Error: illegal operands `cm.pop \{ra,s0-s2\},81'
.*: Error: illegal operands `cm.pop \{ra,s0-s3\},32'
.*: Error: illegal operands `cm.pop \{ra,s0-s3\},112'
.*: Error: illegal operands `cm.pop \{ra,s0-s3\},47'
.*: Error: illegal operands `cm.pop \{ra,s0-s3\},97'
.*: Error: illegal operands `cm.pop \{ra,s0-s4\},32'
.*: Error: illegal operands `cm.pop \{ra,s0-s4\},112'
.*: Error: illegal operands `cm.pop \{ra,s0-s4\},47'
.*: Error: illegal operands `cm.pop \{ra,s0-s4\},97'
.*: Error: illegal operands `cm.pop \{ra,s0-s5\},48'
.*: Error: illegal operands `cm.pop \{ra,s0-s5\},128'
.*: Error: illegal operands `cm.pop \{ra,s0-s5\},63'
.*: Error: illegal operands `cm.pop \{ra,s0-s5\},113'
.*: Error: illegal operands `cm.pop \{ra,s0-s6\},48'
.*: Error: illegal operands `cm.pop \{ra,s0-s6\},128'
.*: Error: illegal operands `cm.pop \{ra,s0-s6\},63'
.*: Error: illegal operands `cm.pop \{ra,s0-s6\},113'
.*: Error: illegal operands `cm.pop \{ra,s0-s7\},64'
.*: Error: illegal operands `cm.pop \{ra,s0-s7\},144'
.*: Error: illegal operands `cm.pop \{ra,s0-s7\},79'
.*: Error: illegal operands `cm.pop \{ra,s0-s7\},129'
.*: Error: illegal operands `cm.pop \{ra,s0-s8\},64'
.*: Error: illegal operands `cm.pop \{ra,s0-s8\},144'
.*: Error: illegal operands `cm.pop \{ra,s0-s8\},79'
.*: Error: illegal operands `cm.pop \{ra,s0-s8\},129'
.*: Error: illegal operands `cm.pop \{ra,s0-s9\},80'
.*: Error: illegal operands `cm.pop \{ra,s0-s9\},160'
.*: Error: illegal operands `cm.pop \{ra,s0-s9\},95'
.*: Error: illegal operands `cm.pop \{ra,s0-s9\},145'
.*: Error: illegal operands `cm.pop \{ra,s0-s11\},96'
.*: Error: illegal operands `cm.pop \{ra,s0-s11\},176'
.*: Error: illegal operands `cm.pop \{ra,s0-s11\},111'
.*: Error: illegal operands `cm.pop \{ra,s0-s11\},161'
Loading

0 comments on commit fbf584e

Please sign in to comment.