1// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve < %s \ 2// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST 3// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sme < %s \ 4// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST 5// RUN: not llvm-mc -triple=aarch64 -show-encoding < %s 2>&1 \ 6// RUN: | FileCheck %s --check-prefix=CHECK-ERROR 7// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve < %s \ 8// RUN: | llvm-objdump --no-print-imm-hex -d --mattr=+sve - | FileCheck %s --check-prefix=CHECK-INST 9// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve < %s \ 10// RUN: | llvm-objdump --no-print-imm-hex -d --mattr=-sve - | FileCheck %s --check-prefix=CHECK-UNKNOWN 11 12// --------------------------------------------------------------------------// 13// Test all possible prefetch operation specifiers 14 15prfw #0, p0, [x0] 16// CHECK-INST: prfw pldl1keep, p0, [x0] 17// CHECK-ENCODING: [0x00,0x40,0xc0,0x85] 18// CHECK-ERROR: instruction requires: sve or sme 19// CHECK-UNKNOWN: 85c04000 <unknown> 20 21prfw pldl1keep, p0, [x0] 22// CHECK-INST: prfw pldl1keep, p0, [x0] 23// CHECK-ENCODING: [0x00,0x40,0xc0,0x85] 24// CHECK-ERROR: instruction requires: sve or sme 25// CHECK-UNKNOWN: 85c04000 <unknown> 26 27prfw #1, p0, [x0] 28// CHECK-INST: prfw pldl1strm, p0, [x0] 29// CHECK-ENCODING: [0x01,0x40,0xc0,0x85] 30// CHECK-ERROR: instruction requires: sve or sme 31// CHECK-UNKNOWN: 85c04001 <unknown> 32 33prfw pldl1strm, p0, [x0] 34// CHECK-INST: prfw pldl1strm, p0, [x0] 35// CHECK-ENCODING: [0x01,0x40,0xc0,0x85] 36// CHECK-ERROR: instruction requires: sve or sme 37// CHECK-UNKNOWN: 85c04001 <unknown> 38 39prfw #2, p0, [x0] 40// CHECK-INST: prfw pldl2keep, p0, [x0] 41// CHECK-ENCODING: [0x02,0x40,0xc0,0x85] 42// CHECK-ERROR: instruction requires: sve or sme 43// CHECK-UNKNOWN: 85c04002 <unknown> 44 45prfw pldl2keep, p0, [x0] 46// CHECK-INST: prfw pldl2keep, p0, [x0] 47// CHECK-ENCODING: [0x02,0x40,0xc0,0x85] 48// CHECK-ERROR: instruction requires: sve or sme 49// CHECK-UNKNOWN: 85c04002 <unknown> 50 51prfw #3, p0, [x0] 52// CHECK-INST: prfw pldl2strm, p0, [x0] 53// CHECK-ENCODING: [0x03,0x40,0xc0,0x85] 54// CHECK-ERROR: instruction requires: sve or sme 55// CHECK-UNKNOWN: 85c04003 <unknown> 56 57prfw pldl2strm, p0, [x0] 58// CHECK-INST: prfw pldl2strm, p0, [x0] 59// CHECK-ENCODING: [0x03,0x40,0xc0,0x85] 60// CHECK-ERROR: instruction requires: sve or sme 61// CHECK-UNKNOWN: 85c04003 <unknown> 62 63prfw #4, p0, [x0] 64// CHECK-INST: prfw pldl3keep, p0, [x0] 65// CHECK-ENCODING: [0x04,0x40,0xc0,0x85] 66// CHECK-ERROR: instruction requires: sve or sme 67// CHECK-UNKNOWN: 85c04004 <unknown> 68 69prfw pldl3keep, p0, [x0] 70// CHECK-INST: prfw pldl3keep, p0, [x0] 71// CHECK-ENCODING: [0x04,0x40,0xc0,0x85] 72// CHECK-ERROR: instruction requires: sve or sme 73// CHECK-UNKNOWN: 85c04004 <unknown> 74 75prfw #5, p0, [x0] 76// CHECK-INST: prfw pldl3strm, p0, [x0] 77// CHECK-ENCODING: [0x05,0x40,0xc0,0x85] 78// CHECK-ERROR: instruction requires: sve or sme 79// CHECK-UNKNOWN: 85c04005 <unknown> 80 81prfw pldl3strm, p0, [x0] 82// CHECK-INST: prfw pldl3strm, p0, [x0] 83// CHECK-ENCODING: [0x05,0x40,0xc0,0x85] 84// CHECK-ERROR: instruction requires: sve or sme 85// CHECK-UNKNOWN: 85c04005 <unknown> 86 87prfw #6, p0, [x0] 88// CHECK-INST: prfw #6, p0, [x0] 89// CHECK-ENCODING: [0x06,0x40,0xc0,0x85] 90// CHECK-ERROR: instruction requires: sve or sme 91// CHECK-UNKNOWN: 85c04006 <unknown> 92 93prfw #7, p0, [x0] 94// CHECK-INST: prfw #7, p0, [x0] 95// CHECK-ENCODING: [0x07,0x40,0xc0,0x85] 96// CHECK-ERROR: instruction requires: sve or sme 97// CHECK-UNKNOWN: 85c04007 <unknown> 98 99prfw #8, p0, [x0] 100// CHECK-INST: prfw pstl1keep, p0, [x0] 101// CHECK-ENCODING: [0x08,0x40,0xc0,0x85] 102// CHECK-ERROR: instruction requires: sve or sme 103// CHECK-UNKNOWN: 85c04008 <unknown> 104 105prfw pstl1keep, p0, [x0] 106// CHECK-INST: prfw pstl1keep, p0, [x0] 107// CHECK-ENCODING: [0x08,0x40,0xc0,0x85] 108// CHECK-ERROR: instruction requires: sve or sme 109// CHECK-UNKNOWN: 85c04008 <unknown> 110 111prfw #9, p0, [x0] 112// CHECK-INST: prfw pstl1strm, p0, [x0] 113// CHECK-ENCODING: [0x09,0x40,0xc0,0x85] 114// CHECK-ERROR: instruction requires: sve or sme 115// CHECK-UNKNOWN: 85c04009 <unknown> 116 117prfw pstl1strm, p0, [x0] 118// CHECK-INST: prfw pstl1strm, p0, [x0] 119// CHECK-ENCODING: [0x09,0x40,0xc0,0x85] 120// CHECK-ERROR: instruction requires: sve or sme 121// CHECK-UNKNOWN: 85c04009 <unknown> 122 123prfw #10, p0, [x0] 124// CHECK-INST: prfw pstl2keep, p0, [x0] 125// CHECK-ENCODING: [0x0a,0x40,0xc0,0x85] 126// CHECK-ERROR: instruction requires: sve or sme 127// CHECK-UNKNOWN: 85c0400a <unknown> 128 129prfw pstl2keep, p0, [x0] 130// CHECK-INST: prfw pstl2keep, p0, [x0] 131// CHECK-ENCODING: [0x0a,0x40,0xc0,0x85] 132// CHECK-ERROR: instruction requires: sve or sme 133// CHECK-UNKNOWN: 85c0400a <unknown> 134 135prfw #11, p0, [x0] 136// CHECK-INST: prfw pstl2strm, p0, [x0] 137// CHECK-ENCODING: [0x0b,0x40,0xc0,0x85] 138// CHECK-ERROR: instruction requires: sve or sme 139// CHECK-UNKNOWN: 85c0400b <unknown> 140 141prfw pstl2strm, p0, [x0] 142// CHECK-INST: prfw pstl2strm, p0, [x0] 143// CHECK-ENCODING: [0x0b,0x40,0xc0,0x85] 144// CHECK-ERROR: instruction requires: sve or sme 145// CHECK-UNKNOWN: 85c0400b <unknown> 146 147prfw #12, p0, [x0] 148// CHECK-INST: prfw pstl3keep, p0, [x0] 149// CHECK-ENCODING: [0x0c,0x40,0xc0,0x85] 150// CHECK-ERROR: instruction requires: sve or sme 151// CHECK-UNKNOWN: 85c0400c <unknown> 152 153prfw pstl3keep, p0, [x0] 154// CHECK-INST: prfw pstl3keep, p0, [x0] 155// CHECK-ENCODING: [0x0c,0x40,0xc0,0x85] 156// CHECK-ERROR: instruction requires: sve or sme 157// CHECK-UNKNOWN: 85c0400c <unknown> 158 159prfw #13, p0, [x0] 160// CHECK-INST: prfw pstl3strm, p0, [x0] 161// CHECK-ENCODING: [0x0d,0x40,0xc0,0x85] 162// CHECK-ERROR: instruction requires: sve or sme 163// CHECK-UNKNOWN: 85c0400d <unknown> 164 165prfw pstl3strm, p0, [x0] 166// CHECK-INST: prfw pstl3strm, p0, [x0] 167// CHECK-ENCODING: [0x0d,0x40,0xc0,0x85] 168// CHECK-ERROR: instruction requires: sve or sme 169// CHECK-UNKNOWN: 85c0400d <unknown> 170 171prfw #14, p0, [x0] 172// CHECK-INST: prfw #14, p0, [x0] 173// CHECK-ENCODING: [0x0e,0x40,0xc0,0x85] 174// CHECK-ERROR: instruction requires: sve or sme 175// CHECK-UNKNOWN: 85c0400e <unknown> 176 177prfw #15, p0, [x0] 178// CHECK-INST: prfw #15, p0, [x0] 179// CHECK-ENCODING: [0x0f,0x40,0xc0,0x85] 180// CHECK-ERROR: instruction requires: sve or sme 181// CHECK-UNKNOWN: 85c0400f <unknown> 182 183// --------------------------------------------------------------------------// 184// Test addressing modes 185 186prfw pldl1strm, p0, [x0, #-32, mul vl] 187// CHECK-INST: prfw pldl1strm, p0, [x0, #-32, mul vl] 188// CHECK-ENCODING: [0x01,0x40,0xe0,0x85] 189// CHECK-ERROR: instruction requires: sve or sme 190// CHECK-UNKNOWN: 85e04001 191 192prfw pldl1strm, p0, [x0, #31, mul vl] 193// CHECK-INST: prfw pldl1strm, p0, [x0, #31, mul vl] 194// CHECK-ENCODING: [0x01,0x40,0xdf,0x85] 195// CHECK-ERROR: instruction requires: sve or sme 196// CHECK-UNKNOWN: 85df4001 197