1// RUN: not llvm-mc -triple aarch64-none-linux-gnu -mattr=+v8.1a -show-encoding < %s 2> %t | FileCheck %s
2// RUN: FileCheck --check-prefix=CHECK-ERROR < %t %s
3  .text
4
5  //AdvSIMD RDMA vector
6  sqrdmlah v0.4h, v1.4h, v2.4h
7  sqrdmlsh v0.4h, v1.4h, v2.4h
8  sqrdmlah v0.2s, v1.2s, v2.2s
9  sqrdmlsh v0.2s, v1.2s, v2.2s
10  sqrdmlah v0.4s, v1.4s, v2.4s
11  sqrdmlsh v0.4s, v1.4s, v2.4s
12  sqrdmlah v0.8h, v1.8h, v2.8h
13  sqrdmlsh v0.8h, v1.8h, v2.8h
14// CHECK: sqrdmlah  v0.4h, v1.4h, v2.4h // encoding: [0x20,0x84,0x42,0x2e]
15// CHECK: sqrdmlsh  v0.4h, v1.4h, v2.4h // encoding: [0x20,0x8c,0x42,0x2e]
16// CHECK: sqrdmlah  v0.2s, v1.2s, v2.2s // encoding: [0x20,0x84,0x82,0x2e]
17// CHECK: sqrdmlsh  v0.2s, v1.2s, v2.2s // encoding: [0x20,0x8c,0x82,0x2e]
18// CHECK: sqrdmlah  v0.4s, v1.4s, v2.4s // encoding: [0x20,0x84,0x82,0x6e]
19// CHECK: sqrdmlsh  v0.4s, v1.4s, v2.4s // encoding: [0x20,0x8c,0x82,0x6e]
20// CHECK: sqrdmlah  v0.8h, v1.8h, v2.8h // encoding: [0x20,0x84,0x42,0x6e]
21// CHECK: sqrdmlsh  v0.8h, v1.8h, v2.8h // encoding: [0x20,0x8c,0x42,0x6e]
22
23  sqrdmlah v0.2h, v1.2h, v2.2h
24  sqrdmlsh v0.2h, v1.2h, v2.2h
25  sqrdmlah v0.8s, v1.8s, v2.8s
26  sqrdmlsh v0.8s, v1.8s, v2.8s
27  sqrdmlah v0.2s, v1.4h, v2.8h
28  sqrdmlsh v0.4s, v1.8h, v2.2s
29// CHECK-ERROR: error: invalid vector kind qualifier
30// CHECK-ERROR:   sqrdmlah v0.2h, v1.2h, v2.2h
31// CHECK-ERROR:            ^
32// CHECK-ERROR: error: invalid vector kind qualifier
33// CHECK-ERROR:   sqrdmlah v0.2h, v1.2h, v2.2h
34// CHECK-ERROR:                   ^
35// CHECK-ERROR: error: invalid vector kind qualifier
36// CHECK-ERROR:   sqrdmlah v0.2h, v1.2h, v2.2h
37// CHECK-ERROR:                          ^
38// CHECK-ERROR: error: invalid operand for instruction
39// CHECK-ERROR:   sqrdmlah v0.2h, v1.2h, v2.2h
40// CHECK-ERROR:            ^
41// CHECK-ERROR: error: invalid vector kind qualifier
42// CHECK-ERROR:   sqrdmlsh v0.2h, v1.2h, v2.2h
43// CHECK-ERROR:            ^
44// CHECK-ERROR: error: invalid vector kind qualifier
45// CHECK-ERROR:   sqrdmlsh v0.2h, v1.2h, v2.2h
46// CHECK-ERROR:                   ^
47// CHECK-ERROR: error: invalid vector kind qualifier
48// CHECK-ERROR:   sqrdmlsh v0.2h, v1.2h, v2.2h
49// CHECK-ERROR:                          ^
50// CHECK-ERROR: error: invalid operand for instruction
51// CHECK-ERROR:   sqrdmlsh v0.2h, v1.2h, v2.2h
52// CHECK-ERROR:            ^
53// CHECK-ERROR: error: invalid vector kind qualifier
54// CHECK-ERROR:   sqrdmlah v0.8s, v1.8s, v2.8s
55// CHECK-ERROR:            ^
56// CHECK-ERROR: error: invalid vector kind qualifier
57// CHECK-ERROR:   sqrdmlah v0.8s, v1.8s, v2.8s
58// CHECK-ERROR:                   ^
59// CHECK-ERROR: error: invalid vector kind qualifier
60// CHECK-ERROR:   sqrdmlah v0.8s, v1.8s, v2.8s
61// CHECK-ERROR:                          ^
62// CHECK-ERROR: error: invalid operand for instruction
63// CHECK-ERROR:   sqrdmlah v0.8s, v1.8s, v2.8s
64// CHECK-ERROR:            ^
65// CHECK-ERROR: error: invalid vector kind qualifier
66// CHECK-ERROR:   sqrdmlsh v0.8s, v1.8s, v2.8s
67// CHECK-ERROR:            ^
68// CHECK-ERROR: error: invalid vector kind qualifier
69// CHECK-ERROR:   sqrdmlsh v0.8s, v1.8s, v2.8s
70// CHECK-ERROR:                   ^
71// CHECK-ERROR: error: invalid vector kind qualifier
72// CHECK-ERROR:   sqrdmlsh v0.8s, v1.8s, v2.8s
73// CHECK-ERROR:                          ^
74// CHECK-ERROR: error: invalid operand for instruction
75// CHECK-ERROR:   sqrdmlsh v0.8s, v1.8s, v2.8s
76// CHECK-ERROR:            ^
77// CHECK-ERROR: error: invalid operand for instruction
78// CHECK-ERROR:   sqrdmlah v0.2s, v1.4h, v2.8h
79// CHECK-ERROR:                   ^
80// CHECK-ERROR: error: invalid operand for instruction
81// CHECK-ERROR:   sqrdmlsh v0.4s, v1.8h, v2.2s
82// CHECK-ERROR:                   ^
83
84  //AdvSIMD RDMA scalar
85  sqrdmlah h0, h1, h2
86  sqrdmlsh h0, h1, h2
87  sqrdmlah s0, s1, s2
88  sqrdmlsh s0, s1, s2
89// CHECK: sqrdmlah h0, h1, h2  // encoding: [0x20,0x84,0x42,0x7e]
90// CHECK: sqrdmlsh h0, h1, h2  // encoding: [0x20,0x8c,0x42,0x7e]
91// CHECK: sqrdmlah s0, s1, s2  // encoding: [0x20,0x84,0x82,0x7e]
92// CHECK: sqrdmlsh s0, s1, s2  // encoding: [0x20,0x8c,0x82,0x7e]
93
94  //AdvSIMD RDMA vector by-element
95  sqrdmlah v0.4h, v1.4h, v2.h[3]
96  sqrdmlsh v0.4h, v1.4h, v2.h[3]
97  sqrdmlah v0.2s, v1.2s, v2.s[1]
98  sqrdmlsh v0.2s, v1.2s, v2.s[1]
99  sqrdmlah v0.8h, v1.8h, v2.h[3]
100  sqrdmlsh v0.8h, v1.8h, v2.h[3]
101  sqrdmlah v0.4s, v1.4s, v2.s[3]
102  sqrdmlsh v0.4s, v1.4s, v2.s[3]
103// CHECK: sqrdmlah v0.4h, v1.4h, v2.h[3]  // encoding: [0x20,0xd0,0x72,0x2f]
104// CHECK: sqrdmlsh v0.4h, v1.4h, v2.h[3]  // encoding: [0x20,0xf0,0x72,0x2f]
105// CHECK: sqrdmlah v0.2s, v1.2s, v2.s[1]  // encoding: [0x20,0xd0,0xa2,0x2f]
106// CHECK: sqrdmlsh v0.2s, v1.2s, v2.s[1]  // encoding: [0x20,0xf0,0xa2,0x2f]
107// CHECK: sqrdmlah v0.8h, v1.8h, v2.h[3]  // encoding: [0x20,0xd0,0x72,0x6f]
108// CHECK: sqrdmlsh v0.8h, v1.8h, v2.h[3]  // encoding: [0x20,0xf0,0x72,0x6f]
109// CHECK: sqrdmlah v0.4s, v1.4s, v2.s[3]  // encoding: [0x20,0xd8,0xa2,0x6f]
110// CHECK: sqrdmlsh v0.4s, v1.4s, v2.s[3]  // encoding: [0x20,0xf8,0xa2,0x6f]
111
112  sqrdmlah v0.4s, v1.2s, v2.s[1]
113  sqrdmlsh v0.2s, v1.2d, v2.s[1]
114  sqrdmlah v0.8h, v1.8h, v2.s[3]
115  sqrdmlsh v0.8h, v1.8h, v2.h[8]
116// CHECK-ERROR: error: invalid operand for instruction
117// CHECK-ERROR:   sqrdmlah v0.4s, v1.2s, v2.s[1]
118// CHECK-ERROR:                   ^
119// CHECK-ERROR: error: invalid operand for instruction
120// CHECK-ERROR:   sqrdmlsh v0.2s, v1.2d, v2.s[1]
121// CHECK-ERROR:                   ^
122// CHECK-ERROR: error: invalid operand for instruction
123// CHECK-ERROR:   sqrdmlah v0.8h, v1.8h, v2.s[3]
124// CHECK-ERROR:                          ^
125// CHECK-ERROR: error: vector lane must be an integer in range [0, 7].
126// CHECK-ERROR:   sqrdmlsh v0.8h, v1.8h, v2.h[8]
127// CHECK-ERROR:                              ^
128
129  //AdvSIMD RDMA scalar by-element
130  sqrdmlah h0, h1, v2.h[3]
131  sqrdmlsh h0, h1, v2.h[3]
132  sqrdmlah s0, s1, v2.s[3]
133  sqrdmlsh s0, s1, v2.s[3]
134// CHECK: sqrdmlah h0, h1, v2.h[3]  // encoding: [0x20,0xd0,0x72,0x7f]
135// CHECK: sqrdmlsh h0, h1, v2.h[3]  // encoding: [0x20,0xf0,0x72,0x7f]
136// CHECK: sqrdmlah s0, s1, v2.s[3]  // encoding: [0x20,0xd8,0xa2,0x7f]
137// CHECK: sqrdmlsh s0, s1, v2.s[3]  // encoding: [0x20,0xf8,0xa2,0x7f]
138
139  sqrdmlah b0, h1, v2.h[3]
140  sqrdmlah s0, d1, v2.s[3]
141  sqrdmlsh h0, h1, v2.s[3]
142  sqrdmlsh s0, s1, v2.s[4]
143// CHECK-ERROR: error: invalid operand for instruction
144// CHECK-ERROR:   sqrdmlah b0, h1, v2.h[3]
145// CHECK-ERROR:            ^
146// CHECK-ERROR: error: invalid operand for instruction
147// CHECK-ERROR:   sqrdmlah s0, d1, v2.s[3]
148// CHECK-ERROR:                ^
149// CHECK-ERROR: error: invalid operand for instruction
150// CHECK-ERROR:   sqrdmlsh h0, h1, v2.s[3]
151// CHECK-ERROR:                    ^
152// CHECK-ERROR: error: vector lane must be an integer in range [0, 3].
153// CHECK-ERROR:   sqrdmlsh s0, s1, v2.s[4]
154// CHECK-ERROR:                        ^
155