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 all possible prefetch operation specifiers 12 13prfb #0, p0, [x0] 14// CHECK-INST: prfb pldl1keep, p0, [x0] 15// CHECK-ENCODING: [0x00,0x00,0xc0,0x85] 16// CHECK-ERROR: instruction requires: sve 17// CHECK-UNKNOWN: 00 00 c0 85 <unknown> 18 19prfb pldl1keep, p0, [x0] 20// CHECK-INST: prfb pldl1keep, p0, [x0] 21// CHECK-ENCODING: [0x00,0x00,0xc0,0x85] 22// CHECK-ERROR: instruction requires: sve 23// CHECK-UNKNOWN: 00 00 c0 85 <unknown> 24 25prfb #1, p0, [x0] 26// CHECK-INST: prfb pldl1strm, p0, [x0] 27// CHECK-ENCODING: [0x01,0x00,0xc0,0x85] 28// CHECK-ERROR: instruction requires: sve 29// CHECK-UNKNOWN: 01 00 c0 85 <unknown> 30 31prfb pldl1strm, p0, [x0] 32// CHECK-INST: prfb pldl1strm, p0, [x0] 33// CHECK-ENCODING: [0x01,0x00,0xc0,0x85] 34// CHECK-ERROR: instruction requires: sve 35// CHECK-UNKNOWN: 01 00 c0 85 <unknown> 36 37prfb #2, p0, [x0] 38// CHECK-INST: prfb pldl2keep, p0, [x0] 39// CHECK-ENCODING: [0x02,0x00,0xc0,0x85] 40// CHECK-ERROR: instruction requires: sve 41// CHECK-UNKNOWN: 02 00 c0 85 <unknown> 42 43prfb pldl2keep, p0, [x0] 44// CHECK-INST: prfb pldl2keep, p0, [x0] 45// CHECK-ENCODING: [0x02,0x00,0xc0,0x85] 46// CHECK-ERROR: instruction requires: sve 47// CHECK-UNKNOWN: 02 00 c0 85 <unknown> 48 49prfb #3, p0, [x0] 50// CHECK-INST: prfb pldl2strm, p0, [x0] 51// CHECK-ENCODING: [0x03,0x00,0xc0,0x85] 52// CHECK-ERROR: instruction requires: sve 53// CHECK-UNKNOWN: 03 00 c0 85 <unknown> 54 55prfb pldl2strm, p0, [x0] 56// CHECK-INST: prfb pldl2strm, p0, [x0] 57// CHECK-ENCODING: [0x03,0x00,0xc0,0x85] 58// CHECK-ERROR: instruction requires: sve 59// CHECK-UNKNOWN: 03 00 c0 85 <unknown> 60 61prfb #4, p0, [x0] 62// CHECK-INST: prfb pldl3keep, p0, [x0] 63// CHECK-ENCODING: [0x04,0x00,0xc0,0x85] 64// CHECK-ERROR: instruction requires: sve 65// CHECK-UNKNOWN: 04 00 c0 85 <unknown> 66 67prfb pldl3keep, p0, [x0] 68// CHECK-INST: prfb pldl3keep, p0, [x0] 69// CHECK-ENCODING: [0x04,0x00,0xc0,0x85] 70// CHECK-ERROR: instruction requires: sve 71// CHECK-UNKNOWN: 04 00 c0 85 <unknown> 72 73prfb #5, p0, [x0] 74// CHECK-INST: prfb pldl3strm, p0, [x0] 75// CHECK-ENCODING: [0x05,0x00,0xc0,0x85] 76// CHECK-ERROR: instruction requires: sve 77// CHECK-UNKNOWN: 05 00 c0 85 <unknown> 78 79prfb pldl3strm, p0, [x0] 80// CHECK-INST: prfb pldl3strm, p0, [x0] 81// CHECK-ENCODING: [0x05,0x00,0xc0,0x85] 82// CHECK-ERROR: instruction requires: sve 83// CHECK-UNKNOWN: 05 00 c0 85 <unknown> 84 85prfb #6, p0, [x0] 86// CHECK-INST: prfb #6, p0, [x0] 87// CHECK-ENCODING: [0x06,0x00,0xc0,0x85] 88// CHECK-ERROR: instruction requires: sve 89// CHECK-UNKNOWN: 06 00 c0 85 <unknown> 90 91prfb #7, p0, [x0] 92// CHECK-INST: prfb #7, p0, [x0] 93// CHECK-ENCODING: [0x07,0x00,0xc0,0x85] 94// CHECK-ERROR: instruction requires: sve 95// CHECK-UNKNOWN: 07 00 c0 85 <unknown> 96 97prfb #8, p0, [x0] 98// CHECK-INST: prfb pstl1keep, p0, [x0] 99// CHECK-ENCODING: [0x08,0x00,0xc0,0x85] 100// CHECK-ERROR: instruction requires: sve 101// CHECK-UNKNOWN: 08 00 c0 85 <unknown> 102 103prfb pstl1keep, p0, [x0] 104// CHECK-INST: prfb pstl1keep, p0, [x0] 105// CHECK-ENCODING: [0x08,0x00,0xc0,0x85] 106// CHECK-ERROR: instruction requires: sve 107// CHECK-UNKNOWN: 08 00 c0 85 <unknown> 108 109prfb #9, p0, [x0] 110// CHECK-INST: prfb pstl1strm, p0, [x0] 111// CHECK-ENCODING: [0x09,0x00,0xc0,0x85] 112// CHECK-ERROR: instruction requires: sve 113// CHECK-UNKNOWN: 09 00 c0 85 <unknown> 114 115prfb pstl1strm, p0, [x0] 116// CHECK-INST: prfb pstl1strm, p0, [x0] 117// CHECK-ENCODING: [0x09,0x00,0xc0,0x85] 118// CHECK-ERROR: instruction requires: sve 119// CHECK-UNKNOWN: 09 00 c0 85 <unknown> 120 121prfb #10, p0, [x0] 122// CHECK-INST: prfb pstl2keep, p0, [x0] 123// CHECK-ENCODING: [0x0a,0x00,0xc0,0x85] 124// CHECK-ERROR: instruction requires: sve 125// CHECK-UNKNOWN: 0a 00 c0 85 <unknown> 126 127prfb pstl2keep, p0, [x0] 128// CHECK-INST: prfb pstl2keep, p0, [x0] 129// CHECK-ENCODING: [0x0a,0x00,0xc0,0x85] 130// CHECK-ERROR: instruction requires: sve 131// CHECK-UNKNOWN: 0a 00 c0 85 <unknown> 132 133prfb #11, p0, [x0] 134// CHECK-INST: prfb pstl2strm, p0, [x0] 135// CHECK-ENCODING: [0x0b,0x00,0xc0,0x85] 136// CHECK-ERROR: instruction requires: sve 137// CHECK-UNKNOWN: 0b 00 c0 85 <unknown> 138 139prfb pstl2strm, p0, [x0] 140// CHECK-INST: prfb pstl2strm, p0, [x0] 141// CHECK-ENCODING: [0x0b,0x00,0xc0,0x85] 142// CHECK-ERROR: instruction requires: sve 143// CHECK-UNKNOWN: 0b 00 c0 85 <unknown> 144 145prfb #12, p0, [x0] 146// CHECK-INST: prfb pstl3keep, p0, [x0] 147// CHECK-ENCODING: [0x0c,0x00,0xc0,0x85] 148// CHECK-ERROR: instruction requires: sve 149// CHECK-UNKNOWN: 0c 00 c0 85 <unknown> 150 151prfb pstl3keep, p0, [x0] 152// CHECK-INST: prfb pstl3keep, p0, [x0] 153// CHECK-ENCODING: [0x0c,0x00,0xc0,0x85] 154// CHECK-ERROR: instruction requires: sve 155// CHECK-UNKNOWN: 0c 00 c0 85 <unknown> 156 157prfb #13, p0, [x0] 158// CHECK-INST: prfb pstl3strm, p0, [x0] 159// CHECK-ENCODING: [0x0d,0x00,0xc0,0x85] 160// CHECK-ERROR: instruction requires: sve 161// CHECK-UNKNOWN: 0d 00 c0 85 <unknown> 162 163prfb pstl3strm, p0, [x0] 164// CHECK-INST: prfb pstl3strm, p0, [x0] 165// CHECK-ENCODING: [0x0d,0x00,0xc0,0x85] 166// CHECK-ERROR: instruction requires: sve 167// CHECK-UNKNOWN: 0d 00 c0 85 <unknown> 168 169prfb #14, p0, [x0] 170// CHECK-INST: prfb #14, p0, [x0] 171// CHECK-ENCODING: [0x0e,0x00,0xc0,0x85] 172// CHECK-ERROR: instruction requires: sve 173// CHECK-UNKNOWN: 0e 00 c0 85 <unknown> 174 175prfb #15, p0, [x0] 176// CHECK-INST: prfb #15, p0, [x0] 177// CHECK-ENCODING: [0x0f,0x00,0xc0,0x85] 178// CHECK-ERROR: instruction requires: sve 179// CHECK-UNKNOWN: 0f 00 c0 85 <unknown> 180 181// --------------------------------------------------------------------------// 182// Test addressing modes 183 184prfb #1, p0, [x0, #-32, mul vl] 185// CHECK-INST: prfb pldl1strm, p0, [x0, #-32, mul vl] 186// CHECK-ENCODING: [0x01,0x00,0xe0,0x85] 187// CHECK-ERROR: instruction requires: sve 188// CHECK-UNKNOWN: 01 00 e0 85 <unknown> 189 190prfb #1, p0, [x0, #31, mul vl] 191// CHECK-INST: prfb pldl1strm, p0, [x0, #31, mul vl] 192// CHECK-ENCODING: [0x01,0x00,0xdf,0x85] 193// CHECK-ERROR: instruction requires: sve 194// CHECK-UNKNOWN: 01 00 df 85 <unknown> 195 196prfb pldl1keep, p0, [x0, z0.s, uxtw] 197// CHECK-INST: prfb pldl1keep, p0, [x0, z0.s, uxtw] 198// CHECK-ENCODING: [0x00,0x00,0x20,0x84] 199// CHECK-ERROR: instruction requires: sve 200// CHECK-UNKNOWN: 00 00 20 84 <unknown> 201 202prfb pldl3strm, p5, [x10, z21.s, uxtw] 203// CHECK-INST: prfb pldl3strm, p5, [x10, z21.s, uxtw] 204// CHECK-ENCODING: [0x45,0x15,0x35,0x84] 205// CHECK-ERROR: instruction requires: sve 206// CHECK-UNKNOWN: 45 15 35 84 <unknown> 207 208prfb pldl1keep, p0, [x0, z0.d, uxtw] 209// CHECK-INST: prfb pldl1keep, p0, [x0, z0.d, uxtw] 210// CHECK-ENCODING: [0x00,0x00,0x20,0xc4] 211// CHECK-ERROR: instruction requires: sve 212// CHECK-UNKNOWN: 00 00 20 c4 <unknown> 213 214prfb pldl3strm, p5, [x10, z21.d, sxtw] 215// CHECK-INST: prfb pldl3strm, p5, [x10, z21.d, sxtw] 216// CHECK-ENCODING: [0x45,0x15,0x75,0xc4] 217// CHECK-ERROR: instruction requires: sve 218// CHECK-UNKNOWN: 45 15 75 c4 <unknown> 219 220prfb pldl1keep, p0, [x0, z0.d] 221// CHECK-INST: prfb pldl1keep, p0, [x0, z0.d] 222// CHECK-ENCODING: [0x00,0x80,0x60,0xc4] 223// CHECK-ERROR: instruction requires: sve 224// CHECK-UNKNOWN: 00 80 60 c4 <unknown> 225 226prfb #7, p3, [z13.s, #0] 227// CHECK-INST: prfb #7, p3, [z13.s] 228// CHECK-ENCODING: [0xa7,0xed,0x00,0x84] 229// CHECK-ERROR: instruction requires: sve 230// CHECK-UNKNOWN: a7 ed 00 84 <unknown> 231 232prfb #7, p3, [z13.s, #31] 233// CHECK-INST: prfb #7, p3, [z13.s, #31] 234// CHECK-ENCODING: [0xa7,0xed,0x1f,0x84] 235// CHECK-ERROR: instruction requires: sve 236// CHECK-UNKNOWN: a7 ed 1f 84 <unknown> 237 238prfb pldl3strm, p5, [z10.d, #0] 239// CHECK-INST: prfb pldl3strm, p5, [z10.d] 240// CHECK-ENCODING: [0x45,0xf5,0x00,0xc4] 241// CHECK-ERROR: instruction requires: sve 242// CHECK-UNKNOWN: 45 f5 00 c4 <unknown> 243 244prfb pldl3strm, p5, [z10.d, #31] 245// CHECK-INST: prfb pldl3strm, p5, [z10.d, #31] 246// CHECK-ENCODING: [0x45,0xf5,0x1f,0xc4] 247// CHECK-ERROR: instruction requires: sve 248// CHECK-UNKNOWN: 45 f5 1f c4 <unknown> 249