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