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 - | 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
14
15ldr     za[w12, 0], [x0]
16// CHECK-INST: ldr     za[w12, 0], [x0]
17// CHECK-ENCODING: [0x00,0x00,0x00,0xe1]
18// CHECK-ERROR: instruction requires: sme
19// CHECK-UNKNOWN: 00 00 00 e1 <unknown>
20
21ldr     za[w14, 5], [x10, #5, mul vl]
22// CHECK-INST: ldr     za[w14, 5], [x10, #5, mul vl]
23// CHECK-ENCODING: [0x45,0x41,0x00,0xe1]
24// CHECK-ERROR: instruction requires: sme
25// CHECK-UNKNOWN: 45 41 00 e1 <unknown>
26
27ldr     za[w15, 7], [x13, #7, mul vl]
28// CHECK-INST: ldr     za[w15, 7], [x13, #7, mul vl]
29// CHECK-ENCODING: [0xa7,0x61,0x00,0xe1]
30// CHECK-ERROR: instruction requires: sme
31// CHECK-UNKNOWN: a7 61 00 e1 <unknown>
32
33ldr     za[w15, 15], [sp, #15, mul vl]
34// CHECK-INST: ldr     za[w15, 15], [sp, #15, mul vl]
35// CHECK-ENCODING: [0xef,0x63,0x00,0xe1]
36// CHECK-ERROR: instruction requires: sme
37// CHECK-UNKNOWN: ef 63 00 e1 <unknown>
38
39ldr     za[w12, 5], [x17, #5, mul vl]
40// CHECK-INST: ldr     za[w12, 5], [x17, #5, mul vl]
41// CHECK-ENCODING: [0x25,0x02,0x00,0xe1]
42// CHECK-ERROR: instruction requires: sme
43// CHECK-UNKNOWN: 25 02 00 e1 <unknown>
44
45ldr     za[w12, 1], [x1, #1, mul vl]
46// CHECK-INST: ldr     za[w12, 1], [x1, #1, mul vl]
47// CHECK-ENCODING: [0x21,0x00,0x00,0xe1]
48// CHECK-ERROR: instruction requires: sme
49// CHECK-UNKNOWN: 21 00 00 e1 <unknown>
50
51ldr     za[w14, 8], [x19, #8, mul vl]
52// CHECK-INST: ldr     za[w14, 8], [x19, #8, mul vl]
53// CHECK-ENCODING: [0x68,0x42,0x00,0xe1]
54// CHECK-ERROR: instruction requires: sme
55// CHECK-UNKNOWN: 68 42 00 e1 <unknown>
56
57ldr     za[w12, 0], [x12]
58// CHECK-INST: ldr     za[w12, 0], [x12]
59// CHECK-ENCODING: [0x80,0x01,0x00,0xe1]
60// CHECK-ERROR: instruction requires: sme
61// CHECK-UNKNOWN: 80 01 00 e1 <unknown>
62
63ldr     za[w14, 1], [x1, #1, mul vl]
64// CHECK-INST: ldr     za[w14, 1], [x1, #1, mul vl]
65// CHECK-ENCODING: [0x21,0x40,0x00,0xe1]
66// CHECK-ERROR: instruction requires: sme
67// CHECK-UNKNOWN: 21 40 00 e1 <unknown>
68
69ldr     za[w12, 13], [x22, #13, mul vl]
70// CHECK-INST: ldr     za[w12, 13], [x22, #13, mul vl]
71// CHECK-ENCODING: [0xcd,0x02,0x00,0xe1]
72// CHECK-ERROR: instruction requires: sme
73// CHECK-UNKNOWN: cd 02 00 e1 <unknown>
74
75ldr     za[w15, 2], [x9, #2, mul vl]
76// CHECK-INST: ldr     za[w15, 2], [x9, #2, mul vl]
77// CHECK-ENCODING: [0x22,0x61,0x00,0xe1]
78// CHECK-ERROR: instruction requires: sme
79// CHECK-UNKNOWN: 22 61 00 e1 <unknown>
80
81ldr     za[w13, 7], [x12, #7, mul vl]
82// CHECK-INST: ldr     za[w13, 7], [x12, #7, mul vl]
83// CHECK-ENCODING: [0x87,0x21,0x00,0xe1]
84// CHECK-ERROR: instruction requires: sme
85// CHECK-UNKNOWN: 87 21 00 e1 <unknown>
86