1// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve < %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=+sve < %s \ 6// RUN: | llvm-objdump -d -mattr=+sve - | FileCheck %s --check-prefix=CHECK-INST 7// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve < %s \ 8// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN 9 10// ---------------------------------------------------------------------------// 11// Test vector form and aliases. 12// ---------------------------------------------------------------------------// 13 14inch z0.h 15// CHECK-INST: inch z0.h 16// CHECK-ENCODING: [0xe0,0xc3,0x70,0x04] 17// CHECK-ERROR: instruction requires: sve 18// CHECK-UNKNOWN: e0 c3 70 04 <unknown> 19 20inch z0.h, all 21// CHECK-INST: inch z0.h 22// CHECK-ENCODING: [0xe0,0xc3,0x70,0x04] 23// CHECK-ERROR: instruction requires: sve 24// CHECK-UNKNOWN: e0 c3 70 04 <unknown> 25 26inch z0.h, all, mul #1 27// CHECK-INST: inch z0.h 28// CHECK-ENCODING: [0xe0,0xc3,0x70,0x04] 29// CHECK-ERROR: instruction requires: sve 30// CHECK-UNKNOWN: e0 c3 70 04 <unknown> 31 32inch z0.h, all, mul #16 33// CHECK-INST: inch z0.h, all, mul #16 34// CHECK-ENCODING: [0xe0,0xc3,0x7f,0x04] 35// CHECK-ERROR: instruction requires: sve 36// CHECK-UNKNOWN: e0 c3 7f 04 <unknown> 37 38 39// ---------------------------------------------------------------------------// 40// Test scalar form and aliases. 41// ---------------------------------------------------------------------------// 42 43inch x0 44// CHECK-INST: inch x0 45// CHECK-ENCODING: [0xe0,0xe3,0x70,0x04] 46// CHECK-ERROR: instruction requires: sve 47// CHECK-UNKNOWN: e0 e3 70 04 <unknown> 48 49inch x0, all 50// CHECK-INST: inch x0 51// CHECK-ENCODING: [0xe0,0xe3,0x70,0x04] 52// CHECK-ERROR: instruction requires: sve 53// CHECK-UNKNOWN: e0 e3 70 04 <unknown> 54 55inch x0, all, mul #1 56// CHECK-INST: inch x0 57// CHECK-ENCODING: [0xe0,0xe3,0x70,0x04] 58// CHECK-ERROR: instruction requires: sve 59// CHECK-UNKNOWN: e0 e3 70 04 <unknown> 60 61inch x0, all, mul #16 62// CHECK-INST: inch x0, all, mul #16 63// CHECK-ENCODING: [0xe0,0xe3,0x7f,0x04] 64// CHECK-ERROR: instruction requires: sve 65// CHECK-UNKNOWN: e0 e3 7f 04 <unknown> 66 67 68// ---------------------------------------------------------------------------// 69// Test predicate patterns 70// ---------------------------------------------------------------------------// 71 72inch x0, pow2 73// CHECK-INST: inch x0, pow2 74// CHECK-ENCODING: [0x00,0xe0,0x70,0x04] 75// CHECK-ERROR: instruction requires: sve 76// CHECK-UNKNOWN: 00 e0 70 04 <unknown> 77 78inch x0, vl1 79// CHECK-INST: inch x0, vl1 80// CHECK-ENCODING: [0x20,0xe0,0x70,0x04] 81// CHECK-ERROR: instruction requires: sve 82// CHECK-UNKNOWN: 20 e0 70 04 <unknown> 83 84inch x0, vl2 85// CHECK-INST: inch x0, vl2 86// CHECK-ENCODING: [0x40,0xe0,0x70,0x04] 87// CHECK-ERROR: instruction requires: sve 88// CHECK-UNKNOWN: 40 e0 70 04 <unknown> 89 90inch x0, vl3 91// CHECK-INST: inch x0, vl3 92// CHECK-ENCODING: [0x60,0xe0,0x70,0x04] 93// CHECK-ERROR: instruction requires: sve 94// CHECK-UNKNOWN: 60 e0 70 04 <unknown> 95 96inch x0, vl4 97// CHECK-INST: inch x0, vl4 98// CHECK-ENCODING: [0x80,0xe0,0x70,0x04] 99// CHECK-ERROR: instruction requires: sve 100// CHECK-UNKNOWN: 80 e0 70 04 <unknown> 101 102inch x0, vl5 103// CHECK-INST: inch x0, vl5 104// CHECK-ENCODING: [0xa0,0xe0,0x70,0x04] 105// CHECK-ERROR: instruction requires: sve 106// CHECK-UNKNOWN: a0 e0 70 04 <unknown> 107 108inch x0, vl6 109// CHECK-INST: inch x0, vl6 110// CHECK-ENCODING: [0xc0,0xe0,0x70,0x04] 111// CHECK-ERROR: instruction requires: sve 112// CHECK-UNKNOWN: c0 e0 70 04 <unknown> 113 114inch x0, vl7 115// CHECK-INST: inch x0, vl7 116// CHECK-ENCODING: [0xe0,0xe0,0x70,0x04] 117// CHECK-ERROR: instruction requires: sve 118// CHECK-UNKNOWN: e0 e0 70 04 <unknown> 119 120inch x0, vl8 121// CHECK-INST: inch x0, vl8 122// CHECK-ENCODING: [0x00,0xe1,0x70,0x04] 123// CHECK-ERROR: instruction requires: sve 124// CHECK-UNKNOWN: 00 e1 70 04 <unknown> 125 126inch x0, vl16 127// CHECK-INST: inch x0, vl16 128// CHECK-ENCODING: [0x20,0xe1,0x70,0x04] 129// CHECK-ERROR: instruction requires: sve 130// CHECK-UNKNOWN: 20 e1 70 04 <unknown> 131 132inch x0, vl32 133// CHECK-INST: inch x0, vl32 134// CHECK-ENCODING: [0x40,0xe1,0x70,0x04] 135// CHECK-ERROR: instruction requires: sve 136// CHECK-UNKNOWN: 40 e1 70 04 <unknown> 137 138inch x0, vl64 139// CHECK-INST: inch x0, vl64 140// CHECK-ENCODING: [0x60,0xe1,0x70,0x04] 141// CHECK-ERROR: instruction requires: sve 142// CHECK-UNKNOWN: 60 e1 70 04 <unknown> 143 144inch x0, vl128 145// CHECK-INST: inch x0, vl128 146// CHECK-ENCODING: [0x80,0xe1,0x70,0x04] 147// CHECK-ERROR: instruction requires: sve 148// CHECK-UNKNOWN: 80 e1 70 04 <unknown> 149 150inch x0, vl256 151// CHECK-INST: inch x0, vl256 152// CHECK-ENCODING: [0xa0,0xe1,0x70,0x04] 153// CHECK-ERROR: instruction requires: sve 154// CHECK-UNKNOWN: a0 e1 70 04 <unknown> 155 156inch x0, #14 157// CHECK-INST: inch x0, #14 158// CHECK-ENCODING: [0xc0,0xe1,0x70,0x04] 159// CHECK-ERROR: instruction requires: sve 160// CHECK-UNKNOWN: c0 e1 70 04 <unknown> 161 162inch x0, #28 163// CHECK-INST: inch x0, #28 164// CHECK-ENCODING: [0x80,0xe3,0x70,0x04] 165// CHECK-ERROR: instruction requires: sve 166// CHECK-UNKNOWN: 80 e3 70 04 <unknown> 167 168 169// --------------------------------------------------------------------------// 170// Test compatibility with MOVPRFX instruction. 171 172movprfx z0, z7 173// CHECK-INST: movprfx z0, z7 174// CHECK-ENCODING: [0xe0,0xbc,0x20,0x04] 175// CHECK-ERROR: instruction requires: sve 176// CHECK-UNKNOWN: e0 bc 20 04 <unknown> 177 178inch z0.h 179// CHECK-INST: inch z0.h 180// CHECK-ENCODING: [0xe0,0xc3,0x70,0x04] 181// CHECK-ERROR: instruction requires: sve 182// CHECK-UNKNOWN: e0 c3 70 04 <unknown> 183 184movprfx z0, z7 185// CHECK-INST: movprfx z0, z7 186// CHECK-ENCODING: [0xe0,0xbc,0x20,0x04] 187// CHECK-ERROR: instruction requires: sve 188// CHECK-UNKNOWN: e0 bc 20 04 <unknown> 189 190inch z0.h, all, mul #16 191// CHECK-INST: inch z0.h, all, mul #16 192// CHECK-ENCODING: [0xe0,0xc3,0x7f,0x04] 193// CHECK-ERROR: instruction requires: sve 194// CHECK-UNKNOWN: e0 c3 7f 04 <unknown> 195 196movprfx z0, z7 197// CHECK-INST: movprfx z0, z7 198// CHECK-ENCODING: [0xe0,0xbc,0x20,0x04] 199// CHECK-ERROR: instruction requires: sve 200// CHECK-UNKNOWN: e0 bc 20 04 <unknown> 201 202inch z0.h, all 203// CHECK-INST: inch z0.h 204// CHECK-ENCODING: [0xe0,0xc3,0x70,0x04] 205// CHECK-ERROR: instruction requires: sve 206// CHECK-UNKNOWN: e0 c3 70 04 <unknown> 207