331 lines · plain
1// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve < %s \2// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST3// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sme < %s \4// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST5// RUN: not llvm-mc -triple=aarch64 -show-encoding < %s 2>&1 \6// RUN: | FileCheck %s --check-prefix=CHECK-ERROR7// 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-INST9// 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-UNKNOWN11 12sub z0.h, z0.h, z0.h13// CHECK-INST: sub z0.h, z0.h, z0.h14// CHECK-ENCODING: [0x00,0x04,0x60,0x04]15// CHECK-ERROR: instruction requires: sve or sme16// CHECK-UNKNOWN: 04600400 <unknown>17 18sub z21.b, z10.b, z21.b19// CHECK-INST: sub z21.b, z10.b, z21.b20// CHECK-ENCODING: [0x55,0x05,0x35,0x04]21// CHECK-ERROR: instruction requires: sve or sme22// CHECK-UNKNOWN: 04350555 <unknown>23 24sub z31.d, p7/m, z31.d, z31.d25// CHECK-INST: sub z31.d, p7/m, z31.d, z31.d26// CHECK-ENCODING: [0xff,0x1f,0xc1,0x04]27// CHECK-ERROR: instruction requires: sve or sme28// CHECK-UNKNOWN: 04c11fff <unknown>29 30sub z23.h, p3/m, z23.h, z13.h31// CHECK-INST: sub z23.h, p3/m, z23.h, z13.h32// CHECK-ENCODING: [0xb7,0x0d,0x41,0x04]33// CHECK-ERROR: instruction requires: sve or sme34// CHECK-UNKNOWN: 04410db7 <unknown>35 36sub z31.h, z31.h, z31.h37// CHECK-INST: sub z31.h, z31.h, z31.h38// CHECK-ENCODING: [0xff,0x07,0x7f,0x04]39// CHECK-ERROR: instruction requires: sve or sme40// CHECK-UNKNOWN: 047f07ff <unknown>41 42sub z21.h, z10.h, z21.h43// CHECK-INST: sub z21.h, z10.h, z21.h44// CHECK-ENCODING: [0x55,0x05,0x75,0x04]45// CHECK-ERROR: instruction requires: sve or sme46// CHECK-UNKNOWN: 04750555 <unknown>47 48sub z31.b, z31.b, z31.b49// CHECK-INST: sub z31.b, z31.b, z31.b50// CHECK-ENCODING: [0xff,0x07,0x3f,0x04]51// CHECK-ERROR: instruction requires: sve or sme52// CHECK-UNKNOWN: 043f07ff <unknown>53 54sub z0.s, z0.s, z0.s55// CHECK-INST: sub z0.s, z0.s, z0.s56// CHECK-ENCODING: [0x00,0x04,0xa0,0x04]57// CHECK-ERROR: instruction requires: sve or sme58// CHECK-UNKNOWN: 04a00400 <unknown>59 60sub z23.s, p3/m, z23.s, z13.s61// CHECK-INST: sub z23.s, p3/m, z23.s, z13.s62// CHECK-ENCODING: [0xb7,0x0d,0x81,0x04]63// CHECK-ERROR: instruction requires: sve or sme64// CHECK-UNKNOWN: 04810db7 <unknown>65 66sub z23.b, z13.b, z8.b67// CHECK-INST: sub z23.b, z13.b, z8.b68// CHECK-ENCODING: [0xb7,0x05,0x28,0x04]69// CHECK-ERROR: instruction requires: sve or sme70// CHECK-UNKNOWN: 042805b7 <unknown>71 72sub z21.d, z10.d, z21.d73// CHECK-INST: sub z21.d, z10.d, z21.d74// CHECK-ENCODING: [0x55,0x05,0xf5,0x04]75// CHECK-ERROR: instruction requires: sve or sme76// CHECK-UNKNOWN: 04f50555 <unknown>77 78sub z21.s, z10.s, z21.s79// CHECK-INST: sub z21.s, z10.s, z21.s80// CHECK-ENCODING: [0x55,0x05,0xb5,0x04]81// CHECK-ERROR: instruction requires: sve or sme82// CHECK-UNKNOWN: 04b50555 <unknown>83 84sub z21.s, p5/m, z21.s, z10.s85// CHECK-INST: sub z21.s, p5/m, z21.s, z10.s86// CHECK-ENCODING: [0x55,0x15,0x81,0x04]87// CHECK-ERROR: instruction requires: sve or sme88// CHECK-UNKNOWN: 04811555 <unknown>89 90sub z31.s, p7/m, z31.s, z31.s91// CHECK-INST: sub z31.s, p7/m, z31.s, z31.s92// CHECK-ENCODING: [0xff,0x1f,0x81,0x04]93// CHECK-ERROR: instruction requires: sve or sme94// CHECK-UNKNOWN: 04811fff <unknown>95 96sub z0.d, p0/m, z0.d, z0.d97// CHECK-INST: sub z0.d, p0/m, z0.d, z0.d98// CHECK-ENCODING: [0x00,0x00,0xc1,0x04]99// CHECK-ERROR: instruction requires: sve or sme100// CHECK-UNKNOWN: 04c10000 <unknown>101 102sub z0.b, z0.b, z0.b103// CHECK-INST: sub z0.b, z0.b, z0.b104// CHECK-ENCODING: [0x00,0x04,0x20,0x04]105// CHECK-ERROR: instruction requires: sve or sme106// CHECK-UNKNOWN: 04200400 <unknown>107 108sub z23.d, z13.d, z8.d109// CHECK-INST: sub z23.d, z13.d, z8.d110// CHECK-ENCODING: [0xb7,0x05,0xe8,0x04]111// CHECK-ERROR: instruction requires: sve or sme112// CHECK-UNKNOWN: 04e805b7 <unknown>113 114sub z23.d, p3/m, z23.d, z13.d115// CHECK-INST: sub z23.d, p3/m, z23.d, z13.d116// CHECK-ENCODING: [0xb7,0x0d,0xc1,0x04]117// CHECK-ERROR: instruction requires: sve or sme118// CHECK-UNKNOWN: 04c10db7 <unknown>119 120sub z23.s, z13.s, z8.s121// CHECK-INST: sub z23.s, z13.s, z8.s122// CHECK-ENCODING: [0xb7,0x05,0xa8,0x04]123// CHECK-ERROR: instruction requires: sve or sme124// CHECK-UNKNOWN: 04a805b7 <unknown>125 126sub z31.b, p7/m, z31.b, z31.b127// CHECK-INST: sub z31.b, p7/m, z31.b, z31.b128// CHECK-ENCODING: [0xff,0x1f,0x01,0x04]129// CHECK-ERROR: instruction requires: sve or sme130// CHECK-UNKNOWN: 04011fff <unknown>131 132sub z0.h, p0/m, z0.h, z0.h133// CHECK-INST: sub z0.h, p0/m, z0.h, z0.h134// CHECK-ENCODING: [0x00,0x00,0x41,0x04]135// CHECK-ERROR: instruction requires: sve or sme136// CHECK-UNKNOWN: 04410000 <unknown>137 138sub z31.d, z31.d, z31.d139// CHECK-INST: sub z31.d, z31.d, z31.d140// CHECK-ENCODING: [0xff,0x07,0xff,0x04]141// CHECK-ERROR: instruction requires: sve or sme142// CHECK-UNKNOWN: 04ff07ff <unknown>143 144sub z31.h, p7/m, z31.h, z31.h145// CHECK-INST: sub z31.h, p7/m, z31.h, z31.h146// CHECK-ENCODING: [0xff,0x1f,0x41,0x04]147// CHECK-ERROR: instruction requires: sve or sme148// CHECK-UNKNOWN: 04411fff <unknown>149 150sub z23.h, z13.h, z8.h151// CHECK-INST: sub z23.h, z13.h, z8.h152// CHECK-ENCODING: [0xb7,0x05,0x68,0x04]153// CHECK-ERROR: instruction requires: sve or sme154// CHECK-UNKNOWN: 046805b7 <unknown>155 156sub z21.b, p5/m, z21.b, z10.b157// CHECK-INST: sub z21.b, p5/m, z21.b, z10.b158// CHECK-ENCODING: [0x55,0x15,0x01,0x04]159// CHECK-ERROR: instruction requires: sve or sme160// CHECK-UNKNOWN: 04011555 <unknown>161 162sub z21.d, p5/m, z21.d, z10.d163// CHECK-INST: sub z21.d, p5/m, z21.d, z10.d164// CHECK-ENCODING: [0x55,0x15,0xc1,0x04]165// CHECK-ERROR: instruction requires: sve or sme166// CHECK-UNKNOWN: 04c11555 <unknown>167 168sub z0.d, z0.d, z0.d169// CHECK-INST: sub z0.d, z0.d, z0.d170// CHECK-ENCODING: [0x00,0x04,0xe0,0x04]171// CHECK-ERROR: instruction requires: sve or sme172// CHECK-UNKNOWN: 04e00400 <unknown>173 174sub z31.s, z31.s, z31.s175// CHECK-INST: sub z31.s, z31.s, z31.s176// CHECK-ENCODING: [0xff,0x07,0xbf,0x04]177// CHECK-ERROR: instruction requires: sve or sme178// CHECK-UNKNOWN: 04bf07ff <unknown>179 180sub z0.b, p0/m, z0.b, z0.b181// CHECK-INST: sub z0.b, p0/m, z0.b, z0.b182// CHECK-ENCODING: [0x00,0x00,0x01,0x04]183// CHECK-ERROR: instruction requires: sve or sme184// CHECK-UNKNOWN: 04010000 <unknown>185 186sub z0.s, p0/m, z0.s, z0.s187// CHECK-INST: sub z0.s, p0/m, z0.s, z0.s188// CHECK-ENCODING: [0x00,0x00,0x81,0x04]189// CHECK-ERROR: instruction requires: sve or sme190// CHECK-UNKNOWN: 04810000 <unknown>191 192sub z21.h, p5/m, z21.h, z10.h193// CHECK-INST: sub z21.h, p5/m, z21.h, z10.h194// CHECK-ENCODING: [0x55,0x15,0x41,0x04]195// CHECK-ERROR: instruction requires: sve or sme196// CHECK-UNKNOWN: 04411555 <unknown>197 198sub z23.b, p3/m, z23.b, z13.b199// CHECK-INST: sub z23.b, p3/m, z23.b, z13.b200// CHECK-ENCODING: [0xb7,0x0d,0x01,0x04]201// CHECK-ERROR: instruction requires: sve or sme202// CHECK-UNKNOWN: 04010db7 <unknown>203 204// -----------------------205//206 207sub z0.b, z0.b, #0208// CHECK-INST: sub z0.b, z0.b, #0209// CHECK-ENCODING: [0x00,0xc0,0x21,0x25]210// CHECK-ERROR: instruction requires: sve or sme211// CHECK-UNKNOWN: 2521c000 <unknown>212 213sub z31.b, z31.b, #255214// CHECK-INST: sub z31.b, z31.b, #255215// CHECK-ENCODING: [0xff,0xdf,0x21,0x25]216// CHECK-ERROR: instruction requires: sve or sme217// CHECK-UNKNOWN: 2521dfff <unknown>218 219sub z0.h, z0.h, #0220// CHECK-INST: sub z0.h, z0.h, #0221// CHECK-ENCODING: [0x00,0xc0,0x61,0x25]222// CHECK-ERROR: instruction requires: sve or sme223// CHECK-UNKNOWN: 2561c000 <unknown>224 225sub z0.h, z0.h, #0, lsl #8226// CHECK-INST: sub z0.h, z0.h, #0, lsl #8227// CHECK-ENCODING: [0x00,0xe0,0x61,0x25]228// CHECK-ERROR: instruction requires: sve or sme229// CHECK-UNKNOWN: 2561e000 <unknown>230 231sub z31.h, z31.h, #255, lsl #8232// CHECK-INST: sub z31.h, z31.h, #65280233// CHECK-ENCODING: [0xff,0xff,0x61,0x25]234// CHECK-ERROR: instruction requires: sve or sme235// CHECK-UNKNOWN: 2561ffff <unknown>236 237sub z31.h, z31.h, #65280238// CHECK-INST: sub z31.h, z31.h, #65280239// CHECK-ENCODING: [0xff,0xff,0x61,0x25]240// CHECK-ERROR: instruction requires: sve or sme241// CHECK-UNKNOWN: 2561ffff <unknown>242 243sub z0.s, z0.s, #0244// CHECK-INST: sub z0.s, z0.s, #0245// CHECK-ENCODING: [0x00,0xc0,0xa1,0x25]246// CHECK-ERROR: instruction requires: sve or sme247// CHECK-UNKNOWN: 25a1c000 <unknown>248 249sub z0.s, z0.s, #0, lsl #8250// CHECK-INST: sub z0.s, z0.s, #0, lsl #8251// CHECK-ENCODING: [0x00,0xe0,0xa1,0x25]252// CHECK-ERROR: instruction requires: sve or sme253// CHECK-UNKNOWN: 25a1e000 <unknown>254 255sub z31.s, z31.s, #255, lsl #8256// CHECK-INST: sub z31.s, z31.s, #65280257// CHECK-ENCODING: [0xff,0xff,0xa1,0x25]258// CHECK-ERROR: instruction requires: sve or sme259// CHECK-UNKNOWN: 25a1ffff <unknown>260 261sub z31.s, z31.s, #65280262// CHECK-INST: sub z31.s, z31.s, #65280263// CHECK-ENCODING: [0xff,0xff,0xa1,0x25]264// CHECK-ERROR: instruction requires: sve or sme265// CHECK-UNKNOWN: 25a1ffff <unknown>266 267sub z0.d, z0.d, #0268// CHECK-INST: sub z0.d, z0.d, #0269// CHECK-ENCODING: [0x00,0xc0,0xe1,0x25]270// CHECK-ERROR: instruction requires: sve or sme271// CHECK-UNKNOWN: 25e1c000 <unknown>272 273sub z0.d, z0.d, #0, lsl #8274// CHECK-INST: sub z0.d, z0.d, #0, lsl #8275// CHECK-ENCODING: [0x00,0xe0,0xe1,0x25]276// CHECK-ERROR: instruction requires: sve or sme277// CHECK-UNKNOWN: 25e1e000 <unknown>278 279sub z31.d, z31.d, #255, lsl #8280// CHECK-INST: sub z31.d, z31.d, #65280281// CHECK-ENCODING: [0xff,0xff,0xe1,0x25]282// CHECK-ERROR: instruction requires: sve or sme283// CHECK-UNKNOWN: 25e1ffff <unknown>284 285sub z31.d, z31.d, #65280286// CHECK-INST: sub z31.d, z31.d, #65280287// CHECK-ENCODING: [0xff,0xff,0xe1,0x25]288// CHECK-ERROR: instruction requires: sve or sme289// CHECK-UNKNOWN: 25e1ffff <unknown>290 291 292 293// --------------------------------------------------------------------------//294// Test compatibility with MOVPRFX instruction.295 296movprfx z23.b, p3/z, z30.b297// CHECK-INST: movprfx z23.b, p3/z, z30.b298// CHECK-ENCODING: [0xd7,0x2f,0x10,0x04]299// CHECK-ERROR: instruction requires: sve or sme300// CHECK-UNKNOWN: 04102fd7 <unknown>301 302sub z23.b, p3/m, z23.b, z13.b303// CHECK-INST: sub z23.b, p3/m, z23.b, z13.b304// CHECK-ENCODING: [0xb7,0x0d,0x01,0x04]305// CHECK-ERROR: instruction requires: sve or sme306// CHECK-UNKNOWN: 04010db7 <unknown>307 308movprfx z23, z30309// CHECK-INST: movprfx z23, z30310// CHECK-ENCODING: [0xd7,0xbf,0x20,0x04]311// CHECK-ERROR: instruction requires: sve or sme312// CHECK-UNKNOWN: 0420bfd7 <unknown>313 314sub z23.b, p3/m, z23.b, z13.b315// CHECK-INST: sub z23.b, p3/m, z23.b, z13.b316// CHECK-ENCODING: [0xb7,0x0d,0x01,0x04]317// CHECK-ERROR: instruction requires: sve or sme318// CHECK-UNKNOWN: 04010db7 <unknown>319 320movprfx z31, z6321// CHECK-INST: movprfx z31, z6322// CHECK-ENCODING: [0xdf,0xbc,0x20,0x04]323// CHECK-ERROR: instruction requires: sve or sme324// CHECK-UNKNOWN: 0420bcdf <unknown>325 326sub z31.d, z31.d, #65280327// CHECK-INST: sub z31.d, z31.d, #65280328// CHECK-ENCODING: [0xff,0xff,0xe1,0x25]329// CHECK-ERROR: instruction requires: sve or sme330// CHECK-UNKNOWN: 25e1ffff <unknown>331