1// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 < %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=+sve2 < %s \
6// RUN:        | llvm-objdump -d --mattr=+sve2 - | FileCheck %s --check-prefix=CHECK-INST
7// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2 < %s \
8// RUN:        | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN
9
10sqshl z0.b, p0/m, z0.b, z1.b
11// CHECK-INST: sqshl z0.b, p0/m, z0.b, z1.b
12// CHECK-ENCODING: [0x20,0x80,0x08,0x44]
13// CHECK-ERROR: instruction requires: sve2
14// CHECK-UNKNOWN: 20 80 08 44 <unknown>
15
16sqshl z0.h, p0/m, z0.h, z1.h
17// CHECK-INST: sqshl z0.h, p0/m, z0.h, z1.h
18// CHECK-ENCODING: [0x20,0x80,0x48,0x44]
19// CHECK-ERROR: instruction requires: sve2
20// CHECK-UNKNOWN: 20 80 48 44 <unknown>
21
22sqshl z29.s, p7/m, z29.s, z30.s
23// CHECK-INST: sqshl z29.s, p7/m, z29.s, z30.s
24// CHECK-ENCODING: [0xdd,0x9f,0x88,0x44]
25// CHECK-ERROR: instruction requires: sve2
26// CHECK-UNKNOWN: dd 9f 88 44 <unknown>
27
28sqshl z31.d, p7/m, z31.d, z30.d
29// CHECK-INST: sqshl z31.d, p7/m, z31.d, z30.d
30// CHECK-ENCODING: [0xdf,0x9f,0xc8,0x44]
31// CHECK-ERROR: instruction requires: sve2
32// CHECK-UNKNOWN: df 9f c8 44 <unknown>
33
34sqshl z0.b, p0/m, z0.b, #0
35// CHECK-INST: sqshl z0.b, p0/m, z0.b, #0
36// CHECK-ENCODING: [0x00,0x81,0x06,0x04]
37// CHECK-ERROR: instruction requires: sve2
38// CHECK-UNKNOWN: 00 81 06 04 <unknown>
39
40sqshl z31.b, p0/m, z31.b, #7
41// CHECK-INST: sqshl z31.b, p0/m, z31.b, #7
42// CHECK-ENCODING: [0xff,0x81,0x06,0x04]
43// CHECK-ERROR: instruction requires: sve2
44// CHECK-UNKNOWN: ff 81 06 04 <unknown>
45
46sqshl z0.h, p0/m, z0.h, #0
47// CHECK-INST: sqshl z0.h, p0/m, z0.h, #0
48// CHECK-ENCODING: [0x00,0x82,0x06,0x04]
49// CHECK-ERROR: instruction requires: sve2
50// CHECK-UNKNOWN: 00 82 06 04 <unknown>
51
52sqshl z31.h, p0/m, z31.h, #15
53// CHECK-INST: sqshl z31.h, p0/m, z31.h, #15
54// CHECK-ENCODING: [0xff,0x83,0x06,0x04]
55// CHECK-ERROR: instruction requires: sve2
56// CHECK-UNKNOWN: ff 83 06 04 <unknown>
57
58sqshl z0.s, p0/m, z0.s, #0
59// CHECK-INST: sqshl z0.s, p0/m, z0.s, #0
60// CHECK-ENCODING: [0x00,0x80,0x46,0x04]
61// CHECK-ERROR: instruction requires: sve2
62// CHECK-UNKNOWN: 00 80 46 04 <unknown>
63
64sqshl z31.s, p0/m, z31.s, #31
65// CHECK-INST: sqshl z31.s, p0/m, z31.s, #31
66// CHECK-ENCODING: [0xff,0x83,0x46,0x04]
67// CHECK-ERROR: instruction requires: sve2
68// CHECK-UNKNOWN: ff 83 46 04 <unknown>
69
70sqshl z0.d, p0/m, z0.d, #0
71// CHECK-INST: sqshl z0.d, p0/m, z0.d, #0
72// CHECK-ENCODING: [0x00,0x80,0x86,0x04]
73// CHECK-ERROR: instruction requires: sve2
74// CHECK-UNKNOWN: 00 80 86 04 <unknown>
75
76sqshl z31.d, p0/m, z31.d, #63
77// CHECK-INST: sqshl z31.d, p0/m, z31.d, #63
78// CHECK-ENCODING: [0xff,0x83,0xc6,0x04]
79// CHECK-ERROR: instruction requires: sve2
80// CHECK-UNKNOWN: ff 83 c6 04 <unknown>
81
82// --------------------------------------------------------------------------//
83// Test compatibility with MOVPRFX instruction.
84
85movprfx z31.d, p0/z, z6.d
86// CHECK-INST: movprfx z31.d, p0/z, z6.d
87// CHECK-ENCODING: [0xdf,0x20,0xd0,0x04]
88// CHECK-ERROR: instruction requires: sve
89// CHECK-UNKNOWN: df 20 d0 04 <unknown>
90
91sqshl z31.d, p0/m, z31.d, z30.d
92// CHECK-INST: sqshl z31.d, p0/m, z31.d, z30.d
93// CHECK-ENCODING: [0xdf,0x83,0xc8,0x44]
94// CHECK-ERROR: instruction requires: sve2
95// CHECK-UNKNOWN: df 83 c8 44 <unknown>
96
97movprfx z31, z6
98// CHECK-INST: movprfx z31, z6
99// CHECK-ENCODING: [0xdf,0xbc,0x20,0x04]
100// CHECK-ERROR: instruction requires: sve
101// CHECK-UNKNOWN: df bc 20 04 <unknown>
102
103sqshl z31.d, p7/m, z31.d, z30.d
104// CHECK-INST: sqshl z31.d, p7/m, z31.d, z30.d
105// CHECK-ENCODING: [0xdf,0x9f,0xc8,0x44]
106// CHECK-ERROR: instruction requires: sve2
107// CHECK-UNKNOWN: df 9f c8 44 <unknown>
108
109movprfx z31.d, p0/z, z6.d
110// CHECK-INST: movprfx z31.d, p0/z, z6.d
111// CHECK-ENCODING: [0xdf,0x20,0xd0,0x04]
112// CHECK-ERROR: instruction requires: sve
113// CHECK-UNKNOWN: df 20 d0 04 <unknown>
114
115sqshl z31.d, p0/m, z31.d, #63
116// CHECK-INST: sqshl z31.d, p0/m, z31.d, #63
117// CHECK-ENCODING: [0xff,0x83,0xc6,0x04]
118// CHECK-ERROR: instruction requires: sve2
119// CHECK-UNKNOWN: ff 83 c6 04 <unknown>
120
121movprfx z31, z6
122// CHECK-INST: movprfx z31, z6
123// CHECK-ENCODING: [0xdf,0xbc,0x20,0x04]
124// CHECK-ERROR: instruction requires: sve
125// CHECK-UNKNOWN: df bc 20 04 <unknown>
126
127sqshl z31.d, p0/m, z31.d, #63
128// CHECK-INST: sqshl z31.d, p0/m, z31.d, #63
129// CHECK-ENCODING: [0xff,0x83,0xc6,0x04]
130// CHECK-ERROR: instruction requires: sve2
131// CHECK-UNKNOWN: ff 83 c6 04 <unknown>
132