378 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 12cpy z0.b, p0/m, w013// CHECK-INST: mov z0.b, p0/m, w014// CHECK-ENCODING: [0x00,0xa0,0x28,0x05]15// CHECK-ERROR: instruction requires: sve or sme16// CHECK-UNKNOWN: 0528a000 <unknown>17 18cpy z0.h, p0/m, w019// CHECK-INST: mov z0.h, p0/m, w020// CHECK-ENCODING: [0x00,0xa0,0x68,0x05]21// CHECK-ERROR: instruction requires: sve or sme22// CHECK-UNKNOWN: 0568a000 <unknown>23 24cpy z0.s, p0/m, w025// CHECK-INST: mov z0.s, p0/m, w026// CHECK-ENCODING: [0x00,0xa0,0xa8,0x05]27// CHECK-ERROR: instruction requires: sve or sme28// CHECK-UNKNOWN: 05a8a000 <unknown>29 30cpy z0.d, p0/m, x031// CHECK-INST: mov z0.d, p0/m, x032// CHECK-ENCODING: [0x00,0xa0,0xe8,0x05]33// CHECK-ERROR: instruction requires: sve or sme34// CHECK-UNKNOWN: 05e8a000 <unknown>35 36cpy z31.b, p7/m, wsp37// CHECK-INST: mov z31.b, p7/m, wsp38// CHECK-ENCODING: [0xff,0xbf,0x28,0x05]39// CHECK-ERROR: instruction requires: sve or sme40// CHECK-UNKNOWN: 0528bfff <unknown>41 42cpy z31.h, p7/m, wsp43// CHECK-INST: mov z31.h, p7/m, wsp44// CHECK-ENCODING: [0xff,0xbf,0x68,0x05]45// CHECK-ERROR: instruction requires: sve or sme46// CHECK-UNKNOWN: 0568bfff <unknown>47 48cpy z31.s, p7/m, wsp49// CHECK-INST: mov z31.s, p7/m, wsp50// CHECK-ENCODING: [0xff,0xbf,0xa8,0x05]51// CHECK-ERROR: instruction requires: sve or sme52// CHECK-UNKNOWN: 05a8bfff <unknown>53 54cpy z31.d, p7/m, sp55// CHECK-INST: mov z31.d, p7/m, sp56// CHECK-ENCODING: [0xff,0xbf,0xe8,0x05]57// CHECK-ERROR: instruction requires: sve or sme58// CHECK-UNKNOWN: 05e8bfff <unknown>59 60cpy z0.b, p0/m, b061// CHECK-INST: mov z0.b, p0/m, b062// CHECK-ENCODING: [0x00,0x80,0x20,0x05]63// CHECK-ERROR: instruction requires: sve or sme64// CHECK-UNKNOWN: 05208000 <unknown>65 66cpy z31.b, p7/m, b3167// CHECK-INST: mov z31.b, p7/m, b3168// CHECK-ENCODING: [0xff,0x9f,0x20,0x05]69// CHECK-ERROR: instruction requires: sve or sme70// CHECK-UNKNOWN: 05209fff <unknown>71 72cpy z0.h, p0/m, h073// CHECK-INST: mov z0.h, p0/m, h074// CHECK-ENCODING: [0x00,0x80,0x60,0x05]75// CHECK-ERROR: instruction requires: sve or sme76// CHECK-UNKNOWN: 05608000 <unknown>77 78cpy z31.h, p7/m, h3179// CHECK-INST: mov z31.h, p7/m, h3180// CHECK-ENCODING: [0xff,0x9f,0x60,0x05]81// CHECK-ERROR: instruction requires: sve or sme82// CHECK-UNKNOWN: 05609fff <unknown>83 84cpy z0.s, p0/m, s085// CHECK-INST: mov z0.s, p0/m, s086// CHECK-ENCODING: [0x00,0x80,0xa0,0x05]87// CHECK-ERROR: instruction requires: sve or sme88// CHECK-UNKNOWN: 05a08000 <unknown>89 90cpy z31.s, p7/m, s3191// CHECK-INST: mov z31.s, p7/m, s3192// CHECK-ENCODING: [0xff,0x9f,0xa0,0x05]93// CHECK-ERROR: instruction requires: sve or sme94// CHECK-UNKNOWN: 05a09fff <unknown>95 96cpy z0.d, p0/m, d097// CHECK-INST: mov z0.d, p0/m, d098// CHECK-ENCODING: [0x00,0x80,0xe0,0x05]99// CHECK-ERROR: instruction requires: sve or sme100// CHECK-UNKNOWN: 05e08000 <unknown>101 102cpy z31.d, p7/m, d31103// CHECK-INST: mov z31.d, p7/m, d31104// CHECK-ENCODING: [0xff,0x9f,0xe0,0x05]105// CHECK-ERROR: instruction requires: sve or sme106// CHECK-UNKNOWN: 05e09fff <unknown>107 108cpy z5.b, p0/z, #-128109// CHECK-INST: mov z5.b, p0/z, #-128110// CHECK-ENCODING: [0x05,0x10,0x10,0x05]111// CHECK-ERROR: instruction requires: sve or sme112// CHECK-UNKNOWN: 05101005 <unknown>113 114cpy z5.b, p0/z, #127115// CHECK-INST: mov z5.b, p0/z, #127116// CHECK-ENCODING: [0xe5,0x0f,0x10,0x05]117// CHECK-ERROR: instruction requires: sve or sme118// CHECK-UNKNOWN: 05100fe5 <unknown>119 120cpy z5.b, p0/z, #255121// CHECK-INST: mov z5.b, p0/z, #-1122// CHECK-ENCODING: [0xe5,0x1f,0x10,0x05]123// CHECK-ERROR: instruction requires: sve or sme124// CHECK-UNKNOWN: 05101fe5 <unknown>125 126cpy z21.h, p0/z, #-128127// CHECK-INST: mov z21.h, p0/z, #-128128// CHECK-ENCODING: [0x15,0x10,0x50,0x05]129// CHECK-ERROR: instruction requires: sve or sme130// CHECK-UNKNOWN: 05501015 <unknown>131 132cpy z21.h, p0/z, #-128, lsl #8133// CHECK-INST: mov z21.h, p0/z, #-32768134// CHECK-ENCODING: [0x15,0x30,0x50,0x05]135// CHECK-ERROR: instruction requires: sve or sme136// CHECK-UNKNOWN: 05503015 <unknown>137 138cpy z21.h, p0/z, #-32768139// CHECK-INST: mov z21.h, p0/z, #-32768140// CHECK-ENCODING: [0x15,0x30,0x50,0x05]141// CHECK-ERROR: instruction requires: sve or sme142// CHECK-UNKNOWN: 05503015 <unknown>143 144cpy z21.h, p0/z, #127145// CHECK-INST: mov z21.h, p0/z, #127146// CHECK-ENCODING: [0xf5,0x0f,0x50,0x05]147// CHECK-ERROR: instruction requires: sve or sme148// CHECK-UNKNOWN: 05500ff5 <unknown>149 150cpy z21.h, p0/z, #127, lsl #8151// CHECK-INST: mov z21.h, p0/z, #32512152// CHECK-ENCODING: [0xf5,0x2f,0x50,0x05]153// CHECK-ERROR: instruction requires: sve or sme154// CHECK-UNKNOWN: 05502ff5 <unknown>155 156cpy z21.h, p0/z, #32512157// CHECK-INST: mov z21.h, p0/z, #32512158// CHECK-ENCODING: [0xf5,0x2f,0x50,0x05]159// CHECK-ERROR: instruction requires: sve or sme160// CHECK-UNKNOWN: 05502ff5 <unknown>161 162cpy z21.s, p0/z, #-128163// CHECK-INST: mov z21.s, p0/z, #-128164// CHECK-ENCODING: [0x15,0x10,0x90,0x05]165// CHECK-ERROR: instruction requires: sve or sme166// CHECK-UNKNOWN: 05901015 <unknown>167 168cpy z21.s, p0/z, #-128, lsl #8169// CHECK-INST: mov z21.s, p0/z, #-32768170// CHECK-ENCODING: [0x15,0x30,0x90,0x05]171// CHECK-ERROR: instruction requires: sve or sme172// CHECK-UNKNOWN: 05903015 <unknown>173 174cpy z21.s, p0/z, #-32768175// CHECK-INST: mov z21.s, p0/z, #-32768176// CHECK-ENCODING: [0x15,0x30,0x90,0x05]177// CHECK-ERROR: instruction requires: sve or sme178// CHECK-UNKNOWN: 05903015 <unknown>179 180cpy z21.s, p0/z, #127181// CHECK-INST: mov z21.s, p0/z, #127182// CHECK-ENCODING: [0xf5,0x0f,0x90,0x05]183// CHECK-ERROR: instruction requires: sve or sme184// CHECK-UNKNOWN: 05900ff5 <unknown>185 186cpy z21.s, p0/z, #127, lsl #8187// CHECK-INST: mov z21.s, p0/z, #32512188// CHECK-ENCODING: [0xf5,0x2f,0x90,0x05]189// CHECK-ERROR: instruction requires: sve or sme190// CHECK-UNKNOWN: 05902ff5 <unknown>191 192cpy z21.s, p0/z, #32512193// CHECK-INST: mov z21.s, p0/z, #32512194// CHECK-ENCODING: [0xf5,0x2f,0x90,0x05]195// CHECK-ERROR: instruction requires: sve or sme196// CHECK-UNKNOWN: 05902ff5 <unknown>197 198cpy z21.d, p0/z, #-128199// CHECK-INST: mov z21.d, p0/z, #-128200// CHECK-ENCODING: [0x15,0x10,0xd0,0x05]201// CHECK-ERROR: instruction requires: sve or sme202// CHECK-UNKNOWN: 05d01015 <unknown>203 204cpy z21.d, p0/z, #-128, lsl #8205// CHECK-INST: mov z21.d, p0/z, #-32768206// CHECK-ENCODING: [0x15,0x30,0xd0,0x05]207// CHECK-ERROR: instruction requires: sve or sme208// CHECK-UNKNOWN: 05d03015 <unknown>209 210cpy z21.d, p0/z, #-32768211// CHECK-INST: mov z21.d, p0/z, #-32768212// CHECK-ENCODING: [0x15,0x30,0xd0,0x05]213// CHECK-ERROR: instruction requires: sve or sme214// CHECK-UNKNOWN: 05d03015 <unknown>215 216cpy z21.d, p0/z, #127217// CHECK-INST: mov z21.d, p0/z, #127218// CHECK-ENCODING: [0xf5,0x0f,0xd0,0x05]219// CHECK-ERROR: instruction requires: sve or sme220// CHECK-UNKNOWN: 05d00ff5 <unknown>221 222cpy z21.d, p0/z, #127, lsl #8223// CHECK-INST: mov z21.d, p0/z, #32512224// CHECK-ENCODING: [0xf5,0x2f,0xd0,0x05]225// CHECK-ERROR: instruction requires: sve or sme226// CHECK-UNKNOWN: 05d02ff5 <unknown>227 228cpy z21.d, p0/z, #32512229// CHECK-INST: mov z21.d, p0/z, #32512230// CHECK-ENCODING: [0xf5,0x2f,0xd0,0x05]231// CHECK-ERROR: instruction requires: sve or sme232// CHECK-UNKNOWN: 05d02ff5 <unknown>233 234// --------------------------------------------------------------------------//235// Tests where the negative immediate is in bounds when interpreted236// as the element type.237 238cpy z0.b, p0/z, #-129239// CHECK-INST: mov z0.b, p0/z, #127240// CHECK-ENCODING: [0xe0,0x0f,0x10,0x05]241// CHECK-ERROR: instruction requires: sve or sme242// CHECK-UNKNOWN: 05100fe0 <unknown>243 244cpy z0.h, p0/z, #-33024245// CHECK-INST: mov z0.h, p0/z, #32512246// CHECK-ENCODING: [0xe0,0x2f,0x50,0x05]247// CHECK-ERROR: instruction requires: sve or sme248// CHECK-UNKNOWN: 05502fe0 <unknown>249 250cpy z0.h, p0/z, #-129, lsl #8251// CHECK-INST: mov z0.h, p0/z, #32512252// CHECK-ENCODING: [0xe0,0x2f,0x50,0x05]253// CHECK-ERROR: instruction requires: sve or sme254// CHECK-UNKNOWN: 05502fe0 <unknown>255 256 257// --------------------------------------------------------------------------//258// Tests for merging variant (/m) and testing the range of predicate (> 7)259// is allowed.260 261cpy z5.b, p15/m, #-128262// CHECK-INST: mov z5.b, p15/m, #-128263// CHECK-ENCODING: [0x05,0x50,0x1f,0x05]264// CHECK-ERROR: instruction requires: sve or sme265// CHECK-UNKNOWN: 051f5005 <unknown>266 267cpy z21.h, p15/m, #-128268// CHECK-INST: mov z21.h, p15/m, #-128269// CHECK-ENCODING: [0x15,0x50,0x5f,0x05]270// CHECK-ERROR: instruction requires: sve or sme271// CHECK-UNKNOWN: 055f5015 <unknown>272 273cpy z21.h, p15/m, #-128, lsl #8274// CHECK-INST: mov z21.h, p15/m, #-32768275// CHECK-ENCODING: [0x15,0x70,0x5f,0x05]276// CHECK-ERROR: instruction requires: sve or sme277// CHECK-UNKNOWN: 055f7015 <unknown>278 279cpy z21.s, p15/m, #-128280// CHECK-INST: mov z21.s, p15/m, #-128281// CHECK-ENCODING: [0x15,0x50,0x9f,0x05]282// CHECK-ERROR: instruction requires: sve or sme283// CHECK-UNKNOWN: 059f5015 <unknown>284 285cpy z21.s, p15/m, #-128, lsl #8286// CHECK-INST: mov z21.s, p15/m, #-32768287// CHECK-ENCODING: [0x15,0x70,0x9f,0x05]288// CHECK-ERROR: instruction requires: sve or sme289// CHECK-UNKNOWN: 059f7015 <unknown>290 291cpy z21.d, p15/m, #-128292// CHECK-INST: mov z21.d, p15/m, #-128293// CHECK-ENCODING: [0x15,0x50,0xdf,0x05]294// CHECK-ERROR: instruction requires: sve or sme295// CHECK-UNKNOWN: 05df5015 <unknown>296 297cpy z21.d, p15/m, #-128, lsl #8298// CHECK-INST: mov z21.d, p15/m, #-32768299// CHECK-ENCODING: [0x15,0x70,0xdf,0x05]300// CHECK-ERROR: instruction requires: sve or sme301// CHECK-UNKNOWN: 05df7015 <unknown>302 303 304// --------------------------------------------------------------------------//305// Test compatibility with MOVPRFX instruction.306 307movprfx z31.d, p7/z, z6.d308// CHECK-INST: movprfx z31.d, p7/z, z6.d309// CHECK-ENCODING: [0xdf,0x3c,0xd0,0x04]310// CHECK-ERROR: instruction requires: sve or sme311// CHECK-UNKNOWN: 04d03cdf <unknown>312 313cpy z31.d, p7/m, sp314// CHECK-INST: mov z31.d, p7/m, sp315// CHECK-ENCODING: [0xff,0xbf,0xe8,0x05]316// CHECK-ERROR: instruction requires: sve or sme317// CHECK-UNKNOWN: 05e8bfff <unknown>318 319movprfx z31, z6320// CHECK-INST: movprfx z31, z6321// CHECK-ENCODING: [0xdf,0xbc,0x20,0x04]322// CHECK-ERROR: instruction requires: sve or sme323// CHECK-UNKNOWN: 0420bcdf <unknown>324 325cpy z31.d, p7/m, sp326// CHECK-INST: mov z31.d, p7/m, sp327// CHECK-ENCODING: [0xff,0xbf,0xe8,0x05]328// CHECK-ERROR: instruction requires: sve or sme329// CHECK-UNKNOWN: 05e8bfff <unknown>330 331movprfx z21.d, p7/z, z28.d332// CHECK-INST: movprfx z21.d, p7/z, z28.d333// CHECK-ENCODING: [0x95,0x3f,0xd0,0x04]334// CHECK-ERROR: instruction requires: sve or sme335// CHECK-UNKNOWN: 04d03f95 <unknown>336 337cpy z21.d, p7/m, #-128, lsl #8338// CHECK-INST: mov z21.d, p7/m, #-32768339// CHECK-ENCODING: [0x15,0x70,0xd7,0x05]340// CHECK-ERROR: instruction requires: sve or sme341// CHECK-UNKNOWN: 05d77015 <unknown>342 343movprfx z21, z28344// CHECK-INST: movprfx z21, z28345// CHECK-ENCODING: [0x95,0xbf,0x20,0x04]346// CHECK-ERROR: instruction requires: sve or sme347// CHECK-UNKNOWN: 0420bf95 <unknown>348 349cpy z21.d, p15/m, #-128, lsl #8350// CHECK-INST: mov z21.d, p15/m, #-32768351// CHECK-ENCODING: [0x15,0x70,0xdf,0x05]352// CHECK-ERROR: instruction requires: sve or sme353// CHECK-UNKNOWN: 05df7015 <unknown>354 355movprfx z4.d, p7/z, z6.d356// CHECK-INST: movprfx z4.d, p7/z, z6.d357// CHECK-ENCODING: [0xc4,0x3c,0xd0,0x04]358// CHECK-ERROR: instruction requires: sve or sme359// CHECK-UNKNOWN: 04d03cc4 <unknown>360 361cpy z4.d, p7/m, d31362// CHECK-INST: mov z4.d, p7/m, d31363// CHECK-ENCODING: [0xe4,0x9f,0xe0,0x05]364// CHECK-ERROR: instruction requires: sve or sme365// CHECK-UNKNOWN: 05e09fe4 <unknown>366 367movprfx z4, z6368// CHECK-INST: movprfx z4, z6369// CHECK-ENCODING: [0xc4,0xbc,0x20,0x04]370// CHECK-ERROR: instruction requires: sve or sme371// CHECK-UNKNOWN: 0420bcc4 <unknown>372 373cpy z4.d, p7/m, d31374// CHECK-INST: mov z4.d, p7/m, d31375// CHECK-ENCODING: [0xe4,0x9f,0xe0,0x05]376// CHECK-ERROR: instruction requires: sve or sme377// CHECK-UNKNOWN: 05e09fe4 <unknown>378