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 10add z31.s, z31.s, z31.s 11// CHECK-INST: add z31.s, z31.s, z31.s 12// CHECK-ENCODING: [0xff,0x03,0xbf,0x04] 13// CHECK-ERROR: instruction requires: sve 14// CHECK-UNKNOWN: ff 03 bf 04 <unknown> 15 16add z23.d, z13.d, z8.d 17// CHECK-INST: add z23.d, z13.d, z8.d 18// CHECK-ENCODING: [0xb7,0x01,0xe8,0x04] 19// CHECK-ERROR: instruction requires: sve 20// CHECK-UNKNOWN: b7 01 e8 04 <unknown> 21 22add z23.b, p3/m, z23.b, z13.b 23// CHECK-INST: add z23.b, p3/m, z23.b, z13.b 24// CHECK-ENCODING: [0xb7,0x0d,0x00,0x04] 25// CHECK-ERROR: instruction requires: sve 26// CHECK-UNKNOWN: b7 0d 00 04 <unknown> 27 28add z0.s, z0.s, z0.s 29// CHECK-INST: add z0.s, z0.s, z0.s 30// CHECK-ENCODING: [0x00,0x00,0xa0,0x04] 31// CHECK-ERROR: instruction requires: sve 32// CHECK-UNKNOWN: 00 00 a0 04 <unknown> 33 34add z31.d, z31.d, z31.d 35// CHECK-INST: add z31.d, z31.d, z31.d 36// CHECK-ENCODING: [0xff,0x03,0xff,0x04] 37// CHECK-ERROR: instruction requires: sve 38// CHECK-UNKNOWN: ff 03 ff 04 <unknown> 39 40add z21.b, z10.b, z21.b 41// CHECK-INST: add z21.b, z10.b, z21.b 42// CHECK-ENCODING: [0x55,0x01,0x35,0x04] 43// CHECK-ERROR: instruction requires: sve 44// CHECK-UNKNOWN: 55 01 35 04 <unknown> 45 46add z31.b, z31.b, z31.b 47// CHECK-INST: add z31.b, z31.b, z31.b 48// CHECK-ENCODING: [0xff,0x03,0x3f,0x04] 49// CHECK-ERROR: instruction requires: sve 50// CHECK-UNKNOWN: ff 03 3f 04 <unknown> 51 52add z0.h, p0/m, z0.h, z0.h 53// CHECK-INST: add z0.h, p0/m, z0.h, z0.h 54// CHECK-ENCODING: [0x00,0x00,0x40,0x04] 55// CHECK-ERROR: instruction requires: sve 56// CHECK-UNKNOWN: 00 00 40 04 <unknown> 57 58add z0.h, z0.h, z0.h 59// CHECK-INST: add z0.h, z0.h, z0.h 60// CHECK-ENCODING: [0x00,0x00,0x60,0x04] 61// CHECK-ERROR: instruction requires: sve 62// CHECK-UNKNOWN: 00 00 60 04 <unknown> 63 64add z0.b, p0/m, z0.b, z0.b 65// CHECK-INST: add z0.b, p0/m, z0.b, z0.b 66// CHECK-ENCODING: [0x00,0x00,0x00,0x04] 67// CHECK-ERROR: instruction requires: sve 68// CHECK-UNKNOWN: 00 00 00 04 <unknown> 69 70add z0.s, p0/m, z0.s, z0.s 71// CHECK-INST: add z0.s, p0/m, z0.s, z0.s 72// CHECK-ENCODING: [0x00,0x00,0x80,0x04] 73// CHECK-ERROR: instruction requires: sve 74// CHECK-UNKNOWN: 00 00 80 04 <unknown> 75 76add z23.b, z13.b, z8.b 77// CHECK-INST: add z23.b, z13.b, z8.b 78// CHECK-ENCODING: [0xb7,0x01,0x28,0x04] 79// CHECK-ERROR: instruction requires: sve 80// CHECK-UNKNOWN: b7 01 28 04 <unknown> 81 82add z0.d, z0.d, z0.d 83// CHECK-INST: add z0.d, z0.d, z0.d 84// CHECK-ENCODING: [0x00,0x00,0xe0,0x04] 85// CHECK-ERROR: instruction requires: sve 86// CHECK-UNKNOWN: 00 00 e0 04 <unknown> 87 88add z0.d, p0/m, z0.d, z0.d 89// CHECK-INST: add z0.d, p0/m, z0.d, z0.d 90// CHECK-ENCODING: [0x00,0x00,0xc0,0x04] 91// CHECK-ERROR: instruction requires: sve 92// CHECK-UNKNOWN: 00 00 c0 04 <unknown> 93 94add z31.h, z31.h, z31.h 95// CHECK-INST: add z31.h, z31.h, z31.h 96// CHECK-ENCODING: [0xff,0x03,0x7f,0x04] 97// CHECK-ERROR: instruction requires: sve 98// CHECK-UNKNOWN: ff 03 7f 04 <unknown> 99 100add z0.b, z0.b, z0.b 101// CHECK-INST: add z0.b, z0.b, z0.b 102// CHECK-ENCODING: [0x00,0x00,0x20,0x04] 103// CHECK-ERROR: instruction requires: sve 104// CHECK-UNKNOWN: 00 00 20 04 <unknown> 105 106add z21.d, z10.d, z21.d 107// CHECK-INST: add z21.d, z10.d, z21.d 108// CHECK-ENCODING: [0x55,0x01,0xf5,0x04] 109// CHECK-ERROR: instruction requires: sve 110// CHECK-UNKNOWN: 55 01 f5 04 <unknown> 111 112add z23.h, p3/m, z23.h, z13.h 113// CHECK-INST: add z23.h, p3/m, z23.h, z13.h 114// CHECK-ENCODING: [0xb7,0x0d,0x40,0x04] 115// CHECK-ERROR: instruction requires: sve 116// CHECK-UNKNOWN: b7 0d 40 04 <unknown> 117 118add z23.s, p3/m, z23.s, z13.s 119// CHECK-INST: add z23.s, p3/m, z23.s, z13.s 120// CHECK-ENCODING: [0xb7,0x0d,0x80,0x04] 121// CHECK-ERROR: instruction requires: sve 122// CHECK-UNKNOWN: b7 0d 80 04 <unknown> 123 124add z31.s, p7/m, z31.s, z31.s 125// CHECK-INST: add z31.s, p7/m, z31.s, z31.s 126// CHECK-ENCODING: [0xff,0x1f,0x80,0x04] 127// CHECK-ERROR: instruction requires: sve 128// CHECK-UNKNOWN: ff 1f 80 04 <unknown> 129 130add z21.h, z10.h, z21.h 131// CHECK-INST: add z21.h, z10.h, z21.h 132// CHECK-ENCODING: [0x55,0x01,0x75,0x04] 133// CHECK-ERROR: instruction requires: sve 134// CHECK-UNKNOWN: 55 01 75 04 <unknown> 135 136add z23.d, p3/m, z23.d, z13.d 137// CHECK-INST: add z23.d, p3/m, z23.d, z13.d 138// CHECK-ENCODING: [0xb7,0x0d,0xc0,0x04] 139// CHECK-ERROR: instruction requires: sve 140// CHECK-UNKNOWN: b7 0d c0 04 <unknown> 141 142add z21.d, p5/m, z21.d, z10.d 143// CHECK-INST: add z21.d, p5/m, z21.d, z10.d 144// CHECK-ENCODING: [0x55,0x15,0xc0,0x04] 145// CHECK-ERROR: instruction requires: sve 146// CHECK-UNKNOWN: 55 15 c0 04 <unknown> 147 148add z21.b, p5/m, z21.b, z10.b 149// CHECK-INST: add z21.b, p5/m, z21.b, z10.b 150// CHECK-ENCODING: [0x55,0x15,0x00,0x04] 151// CHECK-ERROR: instruction requires: sve 152// CHECK-UNKNOWN: 55 15 00 04 <unknown> 153 154add z21.s, z10.s, z21.s 155// CHECK-INST: add z21.s, z10.s, z21.s 156// CHECK-ENCODING: [0x55,0x01,0xb5,0x04] 157// CHECK-ERROR: instruction requires: sve 158// CHECK-UNKNOWN: 55 01 b5 04 <unknown> 159 160add z21.h, p5/m, z21.h, z10.h 161// CHECK-INST: add z21.h, p5/m, z21.h, z10.h 162// CHECK-ENCODING: [0x55,0x15,0x40,0x04] 163// CHECK-ERROR: instruction requires: sve 164// CHECK-UNKNOWN: 55 15 40 04 <unknown> 165 166add z31.h, p7/m, z31.h, z31.h 167// CHECK-INST: add z31.h, p7/m, z31.h, z31.h 168// CHECK-ENCODING: [0xff,0x1f,0x40,0x04] 169// CHECK-ERROR: instruction requires: sve 170// CHECK-UNKNOWN: ff 1f 40 04 <unknown> 171 172add z23.h, z13.h, z8.h 173// CHECK-INST: add z23.h, z13.h, z8.h 174// CHECK-ENCODING: [0xb7,0x01,0x68,0x04] 175// CHECK-ERROR: instruction requires: sve 176// CHECK-UNKNOWN: b7 01 68 04 <unknown> 177 178add z31.d, p7/m, z31.d, z31.d 179// CHECK-INST: add z31.d, p7/m, z31.d, z31.d 180// CHECK-ENCODING: [0xff,0x1f,0xc0,0x04] 181// CHECK-ERROR: instruction requires: sve 182// CHECK-UNKNOWN: ff 1f c0 04 <unknown> 183 184add z21.s, p5/m, z21.s, z10.s 185// CHECK-INST: add z21.s, p5/m, z21.s, z10.s 186// CHECK-ENCODING: [0x55,0x15,0x80,0x04] 187// CHECK-ERROR: instruction requires: sve 188// CHECK-UNKNOWN: 55 15 80 04 <unknown> 189 190add z31.b, p7/m, z31.b, z31.b 191// CHECK-INST: add z31.b, p7/m, z31.b, z31.b 192// CHECK-ENCODING: [0xff,0x1f,0x00,0x04] 193// CHECK-ERROR: instruction requires: sve 194// CHECK-UNKNOWN: ff 1f 00 04 <unknown> 195 196add z23.s, z13.s, z8.s 197// CHECK-INST: add z23.s, z13.s, z8.s 198// CHECK-ENCODING: [0xb7,0x01,0xa8,0x04] 199// CHECK-ERROR: instruction requires: sve 200// CHECK-UNKNOWN: b7 01 a8 04 <unknown> 201 202add z0.b, z0.b, #0 203// CHECK-INST: add z0.b, z0.b, #0 204// CHECK-ENCODING: [0x00,0xc0,0x20,0x25] 205// CHECK-ERROR: instruction requires: sve 206// CHECK-UNKNOWN: 00 c0 20 25 <unknown> 207 208add z31.b, z31.b, #255 209// CHECK-INST: add z31.b, z31.b, #255 210// CHECK-ENCODING: [0xff,0xdf,0x20,0x25] 211// CHECK-ERROR: instruction requires: sve 212// CHECK-UNKNOWN: ff df 20 25 <unknown> 213 214add z0.h, z0.h, #0 215// CHECK-INST: add z0.h, z0.h, #0 216// CHECK-ENCODING: [0x00,0xc0,0x60,0x25] 217// CHECK-ERROR: instruction requires: sve 218// CHECK-UNKNOWN: 00 c0 60 25 <unknown> 219 220add z0.h, z0.h, #0, lsl #8 221// CHECK-INST: add z0.h, z0.h, #0, lsl #8 222// CHECK-ENCODING: [0x00,0xe0,0x60,0x25] 223// CHECK-ERROR: instruction requires: sve 224// CHECK-UNKNOWN: 00 e0 60 25 <unknown> 225 226add z31.h, z31.h, #255, lsl #8 227// CHECK-INST: add z31.h, z31.h, #65280 228// CHECK-ENCODING: [0xff,0xff,0x60,0x25] 229// CHECK-ERROR: instruction requires: sve 230// CHECK-UNKNOWN: ff ff 60 25 <unknown> 231 232add z31.h, z31.h, #65280 233// CHECK-INST: add z31.h, z31.h, #65280 234// CHECK-ENCODING: [0xff,0xff,0x60,0x25] 235// CHECK-ERROR: instruction requires: sve 236// CHECK-UNKNOWN: ff ff 60 25 <unknown> 237 238add z0.s, z0.s, #0 239// CHECK-INST: add z0.s, z0.s, #0 240// CHECK-ENCODING: [0x00,0xc0,0xa0,0x25] 241// CHECK-ERROR: instruction requires: sve 242// CHECK-UNKNOWN: 00 c0 a0 25 <unknown> 243 244add z0.s, z0.s, #0, lsl #8 245// CHECK-INST: add z0.s, z0.s, #0, lsl #8 246// CHECK-ENCODING: [0x00,0xe0,0xa0,0x25] 247// CHECK-ERROR: instruction requires: sve 248// CHECK-UNKNOWN: 00 e0 a0 25 <unknown> 249 250add z31.s, z31.s, #255, lsl #8 251// CHECK-INST: add z31.s, z31.s, #65280 252// CHECK-ENCODING: [0xff,0xff,0xa0,0x25] 253// CHECK-ERROR: instruction requires: sve 254// CHECK-UNKNOWN: ff ff a0 25 <unknown> 255 256add z31.s, z31.s, #65280 257// CHECK-INST: add z31.s, z31.s, #65280 258// CHECK-ENCODING: [0xff,0xff,0xa0,0x25] 259// CHECK-ERROR: instruction requires: sve 260// CHECK-UNKNOWN: ff ff a0 25 <unknown> 261 262add z0.d, z0.d, #0 263// CHECK-INST: add z0.d, z0.d, #0 264// CHECK-ENCODING: [0x00,0xc0,0xe0,0x25] 265// CHECK-ERROR: instruction requires: sve 266// CHECK-UNKNOWN: 00 c0 e0 25 <unknown> 267 268add z0.d, z0.d, #0, lsl #8 269// CHECK-INST: add z0.d, z0.d, #0, lsl #8 270// CHECK-ENCODING: [0x00,0xe0,0xe0,0x25] 271// CHECK-ERROR: instruction requires: sve 272// CHECK-UNKNOWN: 00 e0 e0 25 <unknown> 273 274add z31.d, z31.d, #255, lsl #8 275// CHECK-INST: add z31.d, z31.d, #65280 276// CHECK-ENCODING: [0xff,0xff,0xe0,0x25] 277// CHECK-ERROR: instruction requires: sve 278// CHECK-UNKNOWN: ff ff e0 25 <unknown> 279 280add z31.d, z31.d, #65280 281// CHECK-INST: add z31.d, z31.d, #65280 282// CHECK-ENCODING: [0xff,0xff,0xe0,0x25] 283// CHECK-ERROR: instruction requires: sve 284// CHECK-UNKNOWN: ff ff e0 25 <unknown> 285 286 287 288// --------------------------------------------------------------------------// 289// Test compatibility with MOVPRFX instruction. 290 291movprfx z4.b, p7/z, z6.b 292// CHECK-INST: movprfx z4.b, p7/z, z6.b 293// CHECK-ENCODING: [0xc4,0x3c,0x10,0x04] 294// CHECK-ERROR: instruction requires: sve 295// CHECK-UNKNOWN: c4 3c 10 04 <unknown> 296 297add z4.b, p7/m, z4.b, z31.b 298// CHECK-INST: add z4.b, p7/m, z4.b, z31.b 299// CHECK-ENCODING: [0xe4,0x1f,0x00,0x04] 300// CHECK-ERROR: instruction requires: sve 301// CHECK-UNKNOWN: e4 1f 00 04 <unknown> 302 303movprfx z4, z6 304// CHECK-INST: movprfx z4, z6 305// CHECK-ENCODING: [0xc4,0xbc,0x20,0x04] 306// CHECK-ERROR: instruction requires: sve 307// CHECK-UNKNOWN: c4 bc 20 04 <unknown> 308 309add z4.b, p7/m, z4.b, z31.b 310// CHECK-INST: add z4.b, p7/m, z4.b, z31.b 311// CHECK-ENCODING: [0xe4,0x1f,0x00,0x04] 312// CHECK-ERROR: instruction requires: sve 313// CHECK-UNKNOWN: e4 1f 00 04 <unknown> 314 315movprfx z31, z6 316// CHECK-INST: movprfx z31, z6 317// CHECK-ENCODING: [0xdf,0xbc,0x20,0x04] 318// CHECK-ERROR: instruction requires: sve 319// CHECK-UNKNOWN: df bc 20 04 <unknown> 320 321add z31.d, z31.d, #65280 322// CHECK-INST: add z31.d, z31.d, #65280 323// CHECK-ENCODING: [0xff,0xff,0xe0,0x25] 324// CHECK-ERROR: instruction requires: sve 325// CHECK-UNKNOWN: ff ff e0 25 <unknown> 326