Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / llvm / test / MC / AArch64 / SME / uclamp.s
blob5b10d7d26b5b990cee18ed8726a5f7dc05228a82
1 // RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sme < %s \
2 // RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
3 // RUN: not llvm-mc -triple=aarch64 -show-encoding < %s 2>&1 \
4 // RUN: | FileCheck %s --check-prefix=CHECK-ERROR
5 // RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sme < %s \
6 // RUN: | llvm-objdump -d --mattr=+sme - | FileCheck %s --check-prefix=CHECK-INST
7 // RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sme < %s \
8 // RUN: | llvm-objdump -d --mattr=-sme - | FileCheck %s --check-prefix=CHECK-UNKNOWN
9 // Disassemble encoding and check the re-encoding (-show-encoding) matches.
10 // RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sme < %s \
11 // RUN: | sed '/.text/d' | sed 's/.*encoding: //g' \
12 // RUN: | llvm-mc -triple=aarch64 -mattr=+sme -disassemble -show-encoding \
13 // RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
15 // --------------------------------------------------------------------------//
16 // 8-bit
18 uclamp z0.b, z0.b, z0.b
19 // CHECK-INST: uclamp z0.b, z0.b, z0.b
20 // CHECK-ENCODING: [0x00,0xc4,0x00,0x44]
21 // CHECK-ERROR: instruction requires: sme
22 // CHECK-UNKNOWN: 4400c400 <unknown>
24 uclamp z21.b, z10.b, z21.b
25 // CHECK-INST: uclamp z21.b, z10.b, z21.b
26 // CHECK-ENCODING: [0x55,0xc5,0x15,0x44]
27 // CHECK-ERROR: instruction requires: sme
28 // CHECK-UNKNOWN: 4415c555 <unknown>
30 uclamp z23.b, z13.b, z8.b
31 // CHECK-INST: uclamp z23.b, z13.b, z8.b
32 // CHECK-ENCODING: [0xb7,0xc5,0x08,0x44]
33 // CHECK-ERROR: instruction requires: sme
34 // CHECK-UNKNOWN: 4408c5b7 <unknown>
36 uclamp z31.b, z31.b, z31.b
37 // CHECK-INST: uclamp z31.b, z31.b, z31.b
38 // CHECK-ENCODING: [0xff,0xc7,0x1f,0x44]
39 // CHECK-ERROR: instruction requires: sme
40 // CHECK-UNKNOWN: 441fc7ff <unknown>
42 // --------------------------------------------------------------------------//
43 // 16-bit
45 uclamp z0.h, z0.h, z0.h
46 // CHECK-INST: uclamp z0.h, z0.h, z0.h
47 // CHECK-ENCODING: [0x00,0xc4,0x40,0x44]
48 // CHECK-ERROR: instruction requires: sme
49 // CHECK-UNKNOWN: 4440c400 <unknown>
51 uclamp z21.h, z10.h, z21.h
52 // CHECK-INST: uclamp z21.h, z10.h, z21.h
53 // CHECK-ENCODING: [0x55,0xc5,0x55,0x44]
54 // CHECK-ERROR: instruction requires: sme
55 // CHECK-UNKNOWN: 4455c555 <unknown>
57 uclamp z23.h, z13.h, z8.h
58 // CHECK-INST: uclamp z23.h, z13.h, z8.h
59 // CHECK-ENCODING: [0xb7,0xc5,0x48,0x44]
60 // CHECK-ERROR: instruction requires: sme
61 // CHECK-UNKNOWN: 4448c5b7 <unknown>
63 uclamp z31.h, z31.h, z31.h
64 // CHECK-INST: uclamp z31.h, z31.h, z31.h
65 // CHECK-ENCODING: [0xff,0xc7,0x5f,0x44]
66 // CHECK-ERROR: instruction requires: sme
67 // CHECK-UNKNOWN: 445fc7ff <unknown>
69 // --------------------------------------------------------------------------//
70 // 32-bit
72 uclamp z0.s, z0.s, z0.s
73 // CHECK-INST: uclamp z0.s, z0.s, z0.s
74 // CHECK-ENCODING: [0x00,0xc4,0x80,0x44]
75 // CHECK-ERROR: instruction requires: sme
76 // CHECK-UNKNOWN: 4480c400 <unknown>
78 uclamp z21.s, z10.s, z21.s
79 // CHECK-INST: uclamp z21.s, z10.s, z21.s
80 // CHECK-ENCODING: [0x55,0xc5,0x95,0x44]
81 // CHECK-ERROR: instruction requires: sme
82 // CHECK-UNKNOWN: 4495c555 <unknown>
84 uclamp z23.s, z13.s, z8.s
85 // CHECK-INST: uclamp z23.s, z13.s, z8.s
86 // CHECK-ENCODING: [0xb7,0xc5,0x88,0x44]
87 // CHECK-ERROR: instruction requires: sme
88 // CHECK-UNKNOWN: 4488c5b7 <unknown>
90 uclamp z31.s, z31.s, z31.s
91 // CHECK-INST: uclamp z31.s, z31.s, z31.s
92 // CHECK-ENCODING: [0xff,0xc7,0x9f,0x44]
93 // CHECK-ERROR: instruction requires: sme
94 // CHECK-UNKNOWN: 449fc7ff <unknown>
96 // --------------------------------------------------------------------------//
97 // 64-bit
99 uclamp z0.d, z0.d, z0.d
100 // CHECK-INST: uclamp z0.d, z0.d, z0.d
101 // CHECK-ENCODING: [0x00,0xc4,0xc0,0x44]
102 // CHECK-ERROR: instruction requires: sme
103 // CHECK-UNKNOWN: 44c0c400 <unknown>
105 uclamp z21.d, z10.d, z21.d
106 // CHECK-INST: uclamp z21.d, z10.d, z21.d
107 // CHECK-ENCODING: [0x55,0xc5,0xd5,0x44]
108 // CHECK-ERROR: instruction requires: sme
109 // CHECK-UNKNOWN: 44d5c555 <unknown>
111 uclamp z23.d, z13.d, z8.d
112 // CHECK-INST: uclamp z23.d, z13.d, z8.d
113 // CHECK-ENCODING: [0xb7,0xc5,0xc8,0x44]
114 // CHECK-ERROR: instruction requires: sme
115 // CHECK-UNKNOWN: 44c8c5b7 <unknown>
117 uclamp z31.d, z31.d, z31.d
118 // CHECK-INST: uclamp z31.d, z31.d, z31.d
119 // CHECK-ENCODING: [0xff,0xc7,0xdf,0x44]
120 // CHECK-ERROR: instruction requires: sme
121 // CHECK-UNKNOWN: 44dfc7ff <unknown>
123 // --------------------------------------------------------------------------//
124 // Test compatibility with MOVPRFX instruction.
126 movprfx z23, z27
127 // CHECK-INST: movprfx z23, z27
128 // CHECK-ENCODING: [0x77,0xbf,0x20,0x04]
129 // CHECK-ERROR: instruction requires: sve or sme
130 // CHECK-UNKNOWN: 0420bf77 <unknown>
132 uclamp z23.b, z13.b, z8.b
133 // CHECK-INST: uclamp z23.b, z13.b, z8.b
134 // CHECK-ENCODING: [0xb7,0xc5,0x08,0x44]
135 // CHECK-ERROR: instruction requires: sme
136 // CHECK-UNKNOWN: 4408c5b7 <unknown>
138 movprfx z23, z27
139 // CHECK-INST: movprfx z23, z27
140 // CHECK-ENCODING: [0x77,0xbf,0x20,0x04]
141 // CHECK-ERROR: instruction requires: sve or sme
142 // CHECK-UNKNOWN: 0420bf77 <unknown>
144 uclamp z23.h, z13.h, z8.h
145 // CHECK-INST: uclamp z23.h, z13.h, z8.h
146 // CHECK-ENCODING: [0xb7,0xc5,0x48,0x44]
147 // CHECK-ERROR: instruction requires: sme
148 // CHECK-UNKNOWN: 4448c5b7 <unknown>
150 movprfx z23, z27
151 // CHECK-INST: movprfx z23, z27
152 // CHECK-ENCODING: [0x77,0xbf,0x20,0x04]
153 // CHECK-ERROR: instruction requires: sve or sme
154 // CHECK-UNKNOWN: 0420bf77 <unknown>
156 uclamp z23.s, z13.s, z8.s
157 // CHECK-INST: uclamp z23.s, z13.s, z8.s
158 // CHECK-ENCODING: [0xb7,0xc5,0x88,0x44]
159 // CHECK-ERROR: instruction requires: sme
160 // CHECK-UNKNOWN: 4488c5b7 <unknown>
162 movprfx z23, z27
163 // CHECK-INST: movprfx z23, z27
164 // CHECK-ENCODING: [0x77,0xbf,0x20,0x04]
165 // CHECK-ERROR: instruction requires: sve or sme
166 // CHECK-UNKNOWN: 0420bf77 <unknown>
168 uclamp z23.d, z13.d, z8.d
169 // CHECK-INST: uclamp z23.d, z13.d, z8.d
170 // CHECK-ENCODING: [0xb7,0xc5,0xc8,0x44]
171 // CHECK-ERROR: instruction requires: sme
172 // CHECK-UNKNOWN: 44c8c5b7 <unknown>