267 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 12dup z0.b, w013// CHECK-INST: mov z0.b, w014// CHECK-ENCODING: [0x00,0x38,0x20,0x05]15// CHECK-ERROR: instruction requires: sve or sme16// CHECK-UNKNOWN: 05203800 <unknown>17 18dup z0.h, w019// CHECK-INST: mov z0.h, w020// CHECK-ENCODING: [0x00,0x38,0x60,0x05]21// CHECK-ERROR: instruction requires: sve or sme22// CHECK-UNKNOWN: 05603800 <unknown>23 24dup z0.s, w025// CHECK-INST: mov z0.s, w026// CHECK-ENCODING: [0x00,0x38,0xa0,0x05]27// CHECK-ERROR: instruction requires: sve or sme28// CHECK-UNKNOWN: 05a03800 <unknown>29 30dup z0.d, x031// CHECK-INST: mov z0.d, x032// CHECK-ENCODING: [0x00,0x38,0xe0,0x05]33// CHECK-ERROR: instruction requires: sve or sme34// CHECK-UNKNOWN: 05e03800 <unknown>35 36dup z31.h, wsp37// CHECK-INST: mov z31.h, wsp38// CHECK-ENCODING: [0xff,0x3b,0x60,0x05]39// CHECK-ERROR: instruction requires: sve or sme40// CHECK-UNKNOWN: 05603bff <unknown>41 42dup z31.s, wsp43// CHECK-INST: mov z31.s, wsp44// CHECK-ENCODING: [0xff,0x3b,0xa0,0x05]45// CHECK-ERROR: instruction requires: sve or sme46// CHECK-UNKNOWN: 05a03bff <unknown>47 48dup z31.d, sp49// CHECK-INST: mov z31.d, sp50// CHECK-ENCODING: [0xff,0x3b,0xe0,0x05]51// CHECK-ERROR: instruction requires: sve or sme52// CHECK-UNKNOWN: 05e03bff <unknown>53 54dup z31.b, wsp55// CHECK-INST: mov z31.b, wsp56// CHECK-ENCODING: [0xff,0x3b,0x20,0x05]57// CHECK-ERROR: instruction requires: sve or sme58// CHECK-UNKNOWN: 05203bff <unknown>59 60dup z5.b, #-12861// CHECK-INST: mov z5.b, #-12862// CHECK-ENCODING: [0x05,0xd0,0x38,0x25]63// CHECK-ERROR: instruction requires: sve or sme64// CHECK-UNKNOWN: 2538d005 <unknown>65 66dup z5.b, #12767// CHECK-INST: mov z5.b, #12768// CHECK-ENCODING: [0xe5,0xcf,0x38,0x25]69// CHECK-ERROR: instruction requires: sve or sme70// CHECK-UNKNOWN: 2538cfe5 <unknown>71 72dup z5.b, #25573// CHECK-INST: mov z5.b, #-174// CHECK-ENCODING: [0xe5,0xdf,0x38,0x25]75// CHECK-ERROR: instruction requires: sve or sme76// CHECK-UNKNOWN: 2538dfe5 <unknown>77 78dup z21.h, #-12879// CHECK-INST: mov z21.h, #-12880// CHECK-ENCODING: [0x15,0xd0,0x78,0x25]81// CHECK-ERROR: instruction requires: sve or sme82// CHECK-UNKNOWN: 2578d015 <unknown>83 84dup z21.h, #-128, lsl #885// CHECK-INST: mov z21.h, #-3276886// CHECK-ENCODING: [0x15,0xf0,0x78,0x25]87// CHECK-ERROR: instruction requires: sve or sme88// CHECK-UNKNOWN: 2578f015 <unknown>89 90dup z21.h, #-3276891// CHECK-INST: mov z21.h, #-3276892// CHECK-ENCODING: [0x15,0xf0,0x78,0x25]93// CHECK-ERROR: instruction requires: sve or sme94// CHECK-UNKNOWN: 2578f015 <unknown>95 96dup z21.h, #12797// CHECK-INST: mov z21.h, #12798// CHECK-ENCODING: [0xf5,0xcf,0x78,0x25]99// CHECK-ERROR: instruction requires: sve or sme100// CHECK-UNKNOWN: 2578cff5 <unknown>101 102dup z21.h, #127, lsl #8103// CHECK-INST: mov z21.h, #32512104// CHECK-ENCODING: [0xf5,0xef,0x78,0x25]105// CHECK-ERROR: instruction requires: sve or sme106// CHECK-UNKNOWN: 2578eff5 <unknown>107 108dup z21.h, #32512109// CHECK-INST: mov z21.h, #32512110// CHECK-ENCODING: [0xf5,0xef,0x78,0x25]111// CHECK-ERROR: instruction requires: sve or sme112// CHECK-UNKNOWN: 2578eff5 <unknown>113 114dup z21.s, #-128115// CHECK-INST: mov z21.s, #-128116// CHECK-ENCODING: [0x15,0xd0,0xb8,0x25]117// CHECK-ERROR: instruction requires: sve or sme118// CHECK-UNKNOWN: 25b8d015 <unknown>119 120dup z21.s, #-128, lsl #8121// CHECK-INST: mov z21.s, #-32768122// CHECK-ENCODING: [0x15,0xf0,0xb8,0x25]123// CHECK-ERROR: instruction requires: sve or sme124// CHECK-UNKNOWN: 25b8f015 <unknown>125 126dup z21.s, #-32768127// CHECK-INST: mov z21.s, #-32768128// CHECK-ENCODING: [0x15,0xf0,0xb8,0x25]129// CHECK-ERROR: instruction requires: sve or sme130// CHECK-UNKNOWN: 25b8f015 <unknown>131 132dup z21.s, #127133// CHECK-INST: mov z21.s, #127134// CHECK-ENCODING: [0xf5,0xcf,0xb8,0x25]135// CHECK-ERROR: instruction requires: sve or sme136// CHECK-UNKNOWN: 25b8cff5 <unknown>137 138dup z21.s, #127, lsl #8139// CHECK-INST: mov z21.s, #32512140// CHECK-ENCODING: [0xf5,0xef,0xb8,0x25]141// CHECK-ERROR: instruction requires: sve or sme142// CHECK-UNKNOWN: 25b8eff5 <unknown>143 144dup z21.s, #32512145// CHECK-INST: mov z21.s, #32512146// CHECK-ENCODING: [0xf5,0xef,0xb8,0x25]147// CHECK-ERROR: instruction requires: sve or sme148// CHECK-UNKNOWN: 25b8eff5 <unknown>149 150dup z21.d, #-128151// CHECK-INST: mov z21.d, #-128152// CHECK-ENCODING: [0x15,0xd0,0xf8,0x25]153// CHECK-ERROR: instruction requires: sve or sme154// CHECK-UNKNOWN: 25f8d015 <unknown>155 156dup z21.d, #-128, lsl #8157// CHECK-INST: mov z21.d, #-32768158// CHECK-ENCODING: [0x15,0xf0,0xf8,0x25]159// CHECK-ERROR: instruction requires: sve or sme160// CHECK-UNKNOWN: 25f8f015 <unknown>161 162dup z21.d, #-32768163// CHECK-INST: mov z21.d, #-32768164// CHECK-ENCODING: [0x15,0xf0,0xf8,0x25]165// CHECK-ERROR: instruction requires: sve or sme166// CHECK-UNKNOWN: 25f8f015 <unknown>167 168dup z21.d, #127169// CHECK-INST: mov z21.d, #127170// CHECK-ENCODING: [0xf5,0xcf,0xf8,0x25]171// CHECK-ERROR: instruction requires: sve or sme172// CHECK-UNKNOWN: 25f8cff5 <unknown>173 174dup z21.d, #127, lsl #8175// CHECK-INST: mov z21.d, #32512176// CHECK-ENCODING: [0xf5,0xef,0xf8,0x25]177// CHECK-ERROR: instruction requires: sve or sme178// CHECK-UNKNOWN: 25f8eff5 <unknown>179 180dup z21.d, #32512181// CHECK-INST: mov z21.d, #32512182// CHECK-ENCODING: [0xf5,0xef,0xf8,0x25]183// CHECK-ERROR: instruction requires: sve or sme184// CHECK-UNKNOWN: 25f8eff5 <unknown>185 186dup z0.b, z0.b[0]187// CHECK-INST: mov z0.b, b0188// CHECK-ENCODING: [0x00,0x20,0x21,0x05]189// CHECK-ERROR: instruction requires: sve or sme190// CHECK-UNKNOWN: 05212000 <unknown>191 192dup z0.h, z0.h[0]193// CHECK-INST: mov z0.h, h0194// CHECK-ENCODING: [0x00,0x20,0x22,0x05]195// CHECK-ERROR: instruction requires: sve or sme196// CHECK-UNKNOWN: 05222000 <unknown>197 198dup z0.s, z0.s[0]199// CHECK-INST: mov z0.s, s0200// CHECK-ENCODING: [0x00,0x20,0x24,0x05]201// CHECK-ERROR: instruction requires: sve or sme202// CHECK-UNKNOWN: 05242000 <unknown>203 204dup z0.d, z0.d[0]205// CHECK-INST: mov z0.d, d0206// CHECK-ENCODING: [0x00,0x20,0x28,0x05]207// CHECK-ERROR: instruction requires: sve or sme208// CHECK-UNKNOWN: 05282000 <unknown>209 210dup z0.q, z0.q[0]211// CHECK-INST: mov z0.q, q0212// CHECK-ENCODING: [0x00,0x20,0x30,0x05]213// CHECK-ERROR: instruction requires: sve or sme214// CHECK-UNKNOWN: 05302000 <unknown>215 216dup z31.b, z31.b[63]217// CHECK-INST: mov z31.b, z31.b[63]218// CHECK-ENCODING: [0xff,0x23,0xff,0x05]219// CHECK-ERROR: instruction requires: sve or sme220// CHECK-UNKNOWN: 05ff23ff <unknown>221 222dup z31.h, z31.h[31]223// CHECK-INST: mov z31.h, z31.h[31]224// CHECK-ENCODING: [0xff,0x23,0xfe,0x05]225// CHECK-ERROR: instruction requires: sve or sme226// CHECK-UNKNOWN: 05fe23ff <unknown>227 228dup z31.s, z31.s[15]229// CHECK-INST: mov z31.s, z31.s[15]230// CHECK-ENCODING: [0xff,0x23,0xfc,0x05]231// CHECK-ERROR: instruction requires: sve or sme232// CHECK-UNKNOWN: 05fc23ff <unknown>233 234dup z31.d, z31.d[7]235// CHECK-INST: mov z31.d, z31.d[7]236// CHECK-ENCODING: [0xff,0x23,0xf8,0x05]237// CHECK-ERROR: instruction requires: sve or sme238// CHECK-UNKNOWN: 05f823ff <unknown>239 240dup z5.q, z17.q[3]241// CHECK-INST: mov z5.q, z17.q[3]242// CHECK-ENCODING: [0x25,0x22,0xf0,0x05]243// CHECK-ERROR: instruction requires: sve or sme244// CHECK-UNKNOWN: 05f02225 <unknown>245 246// --------------------------------------------------------------------------//247// Tests where the negative immediate is in bounds when interpreted248// as the element type.249 250dup z0.b, #-129251// CHECK-INST: mov z0.b, #127252// CHECK-ENCODING: [0xe0,0xcf,0x38,0x25]253// CHECK-ERROR: instruction requires: sve or sme254// CHECK-UNKNOWN: 2538cfe0 <unknown>255 256dup z0.h, #-33024257// CHECK-INST: mov z0.h, #32512258// CHECK-ENCODING: [0xe0,0xef,0x78,0x25]259// CHECK-ERROR: instruction requires: sve or sme260// CHECK-UNKNOWN: 2578efe0 <unknown>261 262dup z0.h, #-129, lsl #8263// CHECK-INST: mov z0.h, #32512264// CHECK-ENCODING: [0xe0,0xef,0x78,0x25]265// CHECK-ERROR: instruction requires: sve or sme266// CHECK-UNKNOWN: 2578efe0 <unknown>267