[llvm] [SystemZ] Add missing (dis-)assembly tests. (PR #88498)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 12 03:57:49 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-backend-systemz
Author: Dominik Steenken (dominik-steenken)
<details>
<summary>Changes</summary>
### Assembly Tests
This adds assembly tests for
```
lcdfr, lndfr, lpdfr
```
### Disassembly Tests
This also adds a number of disassembly tests for the following menmonics:
```
cgit, cgrt, cit, clfit, clgit, clgrt, clgt, clrt, clt, crt, lcdfr, lndfr, lpdfr
```
For `cutfu` / `cu12`, it also adds a check for bad register choice.
---
Full diff: https://github.com/llvm/llvm-project/pull/88498.diff
4 Files Affected:
- (modified) llvm/test/MC/Disassembler/SystemZ/insns-z14.txt (+9)
- (modified) llvm/test/MC/Disassembler/SystemZ/insns.txt (+96-12)
- (modified) llvm/test/MC/Disassembler/SystemZ/invalid-regs.txt (+7)
- (modified) llvm/test/MC/SystemZ/insn-good.s (+30)
``````````diff
diff --git a/llvm/test/MC/Disassembler/SystemZ/insns-z14.txt b/llvm/test/MC/Disassembler/SystemZ/insns-z14.txt
index c73b50c1c2fbdc..f27388fb16a8cf 100644
--- a/llvm/test/MC/Disassembler/SystemZ/insns-z14.txt
+++ b/llvm/test/MC/Disassembler/SystemZ/insns-z14.txt
@@ -407,6 +407,12 @@
# CHECK: msgrkc %r7, %r8, %r9
0xb9 0xed 0x90 0x78
+# CHECK: ppno %r0, %r2
+0xb9 0x3c 0x00 0x02
+
+# CHECK: ppno %r12, %r14
+0xb9 0x3c 0x00 0xce
+
# CHECK: sgh %r0, -524288
0xe3 0x00 0x00 0x00 0x80 0x39
@@ -989,6 +995,9 @@
# CHECK: vflcsb %v14, %v17
0xe7 0xe1 0x00 0x00 0x24 0xcc
+# CHECK: vflls %v0, %v1
+0xe7 0x01 0x00 0x00 0x20 0xc4
+
# CHECK: vflnsb %v0, %v0
0xe7 0x00 0x00 0x10 0x20 0xcc
diff --git a/llvm/test/MC/Disassembler/SystemZ/insns.txt b/llvm/test/MC/Disassembler/SystemZ/insns.txt
index f2f942ed5d36eb..2cf3fb512333ac 100644
--- a/llvm/test/MC/Disassembler/SystemZ/insns.txt
+++ b/llvm/test/MC/Disassembler/SystemZ/insns.txt
@@ -2956,6 +2956,12 @@
# CHECK: cgib %r0, 0, 15, 0
0xec 0x0f 0x00 0x00 0x00 0xfc
+# CHECK: cgit %r0, 0, 0
+0xec 0x00 0x00 0x00 0x00 0x70
+
+# CHECK: cgit %r0, 0, 15
+0xec 0x00 0x00 0x00 0xf0 0x70
+
# CHECK: cgith %r0, 0
0xec 0x00 0x00 0x00 0x20 0x70
@@ -3052,6 +3058,12 @@
# CHECK: cgrb %r0, %r0, 15, 0
0xec 0x00 0x00 0x00 0xf0 0xe4
+# CHECK: cgrt %r0, %r1, 0
+0xb9 0x60 0x00 0x01
+
+# CHECK: cgrt %r0, %r1, 15
+0xb9 0x60 0xf0 0x01
+
# CHECK: cgrth %r0, %r1
0xb9 0x60 0x20 0x01
@@ -3430,6 +3442,12 @@
# CHECK: cih %r15, 0
0xcc 0xfd 0x00 0x00 0x00 0x00
+# CHECK: cit %r0, 0, 0
+0xec 0x00 0x00 0x00 0x00 0x72
+
+# CHECK: cit %r0, 0, 15
+0xec 0x00 0x00 0x00 0xf0 0x72
+
# CHECK: cith %r0, 0
0xec 0x00 0x00 0x00 0x20 0x72
@@ -3862,6 +3880,12 @@
# CHECK: clfi %r15, 0
0xc2 0xff 0x00 0x00 0x00 0x00
+# CHECK: clfit %r0, 0, 0
+0xec 0x00 0x00 0x00 0x00 0x73
+
+# CHECK: clfit %r0, 0, 15
+0xec 0x00 0x00 0x00 0xf0 0x73
+
# CHECK: clfith %r0, 0
0xec 0x00 0x00 0x00 0x20 0x73
@@ -3910,6 +3934,12 @@
# CHECK: clg %r15, 0
0xe3 0xf0 0x00 0x00 0x00 0x21
+# CHECK: clgit %r0, 0, 0
+0xec 0x00 0x00 0x00 0x00 0x71
+
+# CHECK: clgit %r0, 0, 15
+0xec 0x00 0x00 0x00 0xf0 0x71
+
# CHECK: clgith %r0, 0
0xec 0x00 0x00 0x00 0x20 0x71
@@ -4447,6 +4477,12 @@
# CHECK: clrb %r0, %r0, 15, 0
0xec 0x00 0x00 0x00 0xf0 0xf7
+# CHECK: clgrt %r0, %r1, 0
+0xb9 0x61 0x00 0x01
+
+# CHECK: clgrt %r0, %r1, 15
+0xb9 0x61 0xf0 0x01
+
# CHECK: clgrth %r0, %r1
0xb9 0x61 0x20 0x01
@@ -4465,6 +4501,12 @@
# CHECK: clgrtle %r0, %r1
0xb9 0x61 0xc0 0x01
+# CHECK: clrt %r0, %r1, 0
+0xb9 0x73 0x00 0x01
+
+# CHECK: clrt %r0, %r1, 15
+0xb9 0x73 0xf0 0x01
+
# CHECK: clrth %r0, %r1
0xb9 0x73 0x20 0x01
@@ -4483,6 +4525,12 @@
# CHECK: clrtle %r0, %r1
0xb9 0x73 0xc0 0x01
+# CHECK: clt %r0, 0, -524288
+0xeb 0x00 0x00 0x00 0x80 0x23
+
+# CHECK: clt %r0, 15, 32768
+0xeb 0x0f 0x00 0x00 0x08 0x23
+
# CHECK: clth %r0, -524288
0xeb 0x02 0x00 0x00 0x80 0x23
@@ -4525,6 +4573,12 @@
# CHECK: cltle %r1, 0
0xeb 0x1c 0x00 0x00 0x00 0x23
+# CHECK: clgt %r0, 0, -524288
+0xeb 0x00 0x00 0x00 0x80 0x2b
+
+# CHECK: clgt %r0, 15, 32768
+0xeb 0x0f 0x00 0x00 0x08 0x2b
+
# CHECK: clgth %r0, -524288
0xeb 0x02 0x00 0x00 0x80 0x2b
@@ -4792,6 +4846,12 @@
# CHECK: crdte %r4, %r5, %r6, 7
0xb9 0x8f 0x57 0x46
+# CHECK: crt %r0, %r1, 0
+0xb9 0x72 0x00 0x01
+
+# CHECK: crt %r0, %r1, 15
+0xb9 0x72 0xf0 0x01
+
# CHECK: crth %r0, %r1
0xb9 0x72 0x20 0x01
@@ -7972,6 +8032,18 @@
# CHECK: lcdbr %f15, %f9
0xb3 0x13 0x00 0xf9
+# CHECK: lcdfr %f0, %f9
+0xb3 0x73 0x00 0x09
+
+# CHECK: lcdfr %f0, %f15
+0xb3 0x73 0x00 0x0f
+
+# CHECK: lcdfr %f15, %f0
+0xb3 0x73 0x00 0xf0
+
+# CHECK: lcdfr %f15, %f9
+0xb3 0x73 0x00 0xf9
+
# CHECK: lcdr %f0, %f9
0x23 0x09
@@ -9570,6 +9642,18 @@
# CHECK: lndbr %f15, %f9
0xb3 0x11 0x00 0xf9
+# CHECK: lndfr %f0, %f9
+0xb3 0x71 0x00 0x09
+
+# CHECK: lndfr %f0, %f15
+0xb3 0x71 0x00 0x0f
+
+# CHECK: lndfr %f15, %f0
+0xb3 0x71 0x00 0xf0
+
+# CHECK: lndfr %f15, %f9
+0xb3 0x71 0x00 0xf9
+
# CHECK: lndr %f0, %f9
0x21 0x09
@@ -9909,6 +9993,18 @@
# CHECK: lpdbr %f15, %f9
0xb3 0x10 0x00 0xf9
+# CHECK: lpdfr %f0, %f9
+0xb3 0x70 0x00 0x09
+
+# CHECK: lpdfr %f0, %f15
+0xb3 0x70 0x00 0x0f
+
+# CHECK: lpdfr %f15, %f0
+0xb3 0x70 0x00 0xf0
+
+# CHECK: lpdfr %f15, %f9
+0xb3 0x70 0x00 0xf9
+
# CHECK: lpdg %r0, 0, 0
0xc8 0x05 0x00 0x00 0x00 0x00
@@ -10656,18 +10752,6 @@
# CHECK: lxdbr %f13, %f15
0xb3 0x05 0x00 0xdf
-# CHECK: lxdr %f0, %f8
-0xb3 0x25 0x00 0x08
-
-# CHECK: lxdr %f0, %f13
-0xb3 0x25 0x00 0x0d
-
-# CHECK: lxdr %f13, %f0
-0xb3 0x25 0x00 0xd0
-
-# CHECK: lxdr %f13, %f15
-0xb3 0x25 0x00 0xdf
-
# CHECK: lxdtr %f0, %f0, 15
0xb3 0xdc 0x0f 0x00
diff --git a/llvm/test/MC/Disassembler/SystemZ/invalid-regs.txt b/llvm/test/MC/Disassembler/SystemZ/invalid-regs.txt
index 12440677ba34a1..0ce960d5ddcc37 100644
--- a/llvm/test/MC/Disassembler/SystemZ/invalid-regs.txt
+++ b/llvm/test/MC/Disassembler/SystemZ/invalid-regs.txt
@@ -20,3 +20,10 @@
# CHECK-NEXT: 0xb9 0x97 0x00 0x18
# CHECK-NEXT: ^
0xb9 0x97 0x00 0x18
+
+# This would be "cutfu %r1, %r2", but %r1 is invalid.
+#
+# CHECK-NEXT: warning: invalid instruction encoding
+# CHECK-NEXT: 0xb2 0xa7 0x00 0x12
+# CHECK-NEXT: ^
+0xb2 0xa7 0x00 0x12
diff --git a/llvm/test/MC/SystemZ/insn-good.s b/llvm/test/MC/SystemZ/insn-good.s
index 91120f7f97aa9d..f5dd672f9dd8cf 100644
--- a/llvm/test/MC/SystemZ/insn-good.s
+++ b/llvm/test/MC/SystemZ/insn-good.s
@@ -9038,6 +9038,36 @@
lcdbr %f15,%f0
lcdbr %f15,%f9
+#CHECK: lcdfr %f0, %f9 # encoding: [0xb3,0x73,0x00,0x09]
+#CHECK: lcdfr %f0, %f15 # encoding: [0xb3,0x73,0x00,0x0f]
+#CHECK: lcdfr %f15, %f0 # encoding: [0xb3,0x73,0x00,0xf0]
+#CHECK: lcdfr %f15, %f9 # encoding: [0xb3,0x73,0x00,0xf9]
+
+ lcdfr %f0,%f9
+ lcdfr %f0,%f15
+ lcdfr %f15,%f0
+ lcdfr %f15,%f9
+
+#CHECK: lndfr %f0, %f9 # encoding: [0xb3,0x71,0x00,0x09]
+#CHECK: lndfr %f0, %f15 # encoding: [0xb3,0x71,0x00,0x0f]
+#CHECK: lndfr %f15, %f0 # encoding: [0xb3,0x71,0x00,0xf0]
+#CHECK: lndfr %f15, %f9 # encoding: [0xb3,0x71,0x00,0xf9]
+
+ lndfr %f0,%f9
+ lndfr %f0,%f15
+ lndfr %f15,%f0
+ lndfr %f15,%f9
+
+#CHECK: lpdfr %f0, %f9 # encoding: [0xb3,0x70,0x00,0x09]
+#CHECK: lpdfr %f0, %f15 # encoding: [0xb3,0x70,0x00,0x0f]
+#CHECK: lpdfr %f15, %f0 # encoding: [0xb3,0x70,0x00,0xf0]
+#CHECK: lpdfr %f15, %f9 # encoding: [0xb3,0x70,0x00,0xf9]
+
+ lpdfr %f0,%f9
+ lpdfr %f0,%f15
+ lpdfr %f15,%f0
+ lpdfr %f15,%f9
+
#CHECK: lcdr %f0, %f9 # encoding: [0x23,0x09]
#CHECK: lcdr %f0, %f15 # encoding: [0x23,0x0f]
#CHECK: lcdr %f15, %f0 # encoding: [0x23,0xf0]
``````````
</details>
https://github.com/llvm/llvm-project/pull/88498
More information about the llvm-commits
mailing list