100 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 -d --mattr=+sve - | FileCheck %s --check-prefix=CHECK-INST9// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve < %s \10// RUN: | llvm-objdump -d --mattr=-sve - | FileCheck %s --check-prefix=CHECK-UNKNOWN11 12// This test file is mostly empty because most 'movprfx' tests are embedded13// with other instructions that are destructive and can be prefixed14// by the movprfx instruction. A list of destructive instructions15// is given below by their mnemonic, which have tests in corresponding16// <mnemonic>.s test files:17//18// abs decp fdivr fnmla fsubr mov sdivr sqincw umulh19// add eon fmad fnmls ftmad msb sdot sqsub uqadd20// and eor fmax fnmsb incd mul smax sub uqdecd21// asr ext fmaxnm frecpx inch neg smin subr uqdech22// asrd fabd fmin frinta incp not smulh sxtb uqdecp23// asrr fabs fminnm frinti incw orn splice sxth uqdecw24// bic fadd fmla frintm insr orr sqadd sxtw uqincd25// clasta fcadd fmls frintn lsl rbit sqdecd uabd uqinch26// clastb fcmla fmov frintp lslr revb sqdech ucvtf uqincp27// cls fcpy fmsb frintx lsr revh sqdecp udiv uqincw28// clz fcvt fmul frintz lsrr revw sqdecw udivr uqsub29// cnot fcvtzs fmulx fscale mad sabd sqincd udot uxtb30// cnt fcvtzu fneg fsqrt mla scvtf sqinch umax uxth31// cpy fdiv fnmad fsub mls sdiv sqincp umin uxtw32 33 34// ------------------------------------------------------------------------- //35// Test compatibility with MOVPRFX instruction with BRK and HLT.36//37// Section 7.1.2 of the SVE Architecture Reference Manual Supplement:38// "it is permitted to use MOVPRFX to prefix an A64 BRK or HLT instruction"39 40movprfx z0, z141// CHECK-INST: movprfx z0, z142// CHECK-ENCODING: [0x20,0xbc,0x20,0x04]43// CHECK-ERROR: instruction requires: sve or sme44// CHECK-UNKNOWN: 0420bc20 <unknown>45 46hlt #147// CHECK-INST: hlt #0x148// CHECK-ENCODING: [0x20,0x00,0x40,0xd4]49 50movprfx z0.d, p0/z, z1.d51// CHECK-INST: movprfx z0.d, p0/z, z1.d52// CHECK-ENCODING: [0x20,0x20,0xd0,0x04]53// CHECK-ERROR: instruction requires: sve or sme54// CHECK-UNKNOWN: 04d02020 <unknown>55 56hlt #157// CHECK-INST: hlt #0x158// CHECK-ENCODING: [0x20,0x00,0x40,0xd4]59 60movprfx z0, z161// CHECK-INST: movprfx z0, z162// CHECK-ENCODING: [0x20,0xbc,0x20,0x04]63// CHECK-ERROR: instruction requires: sve or sme64// CHECK-UNKNOWN: 0420bc20 <unknown>65 66brk #167// CHECK-INST: brk #0x168// CHECK-ENCODING: [0x20,0x00,0x20,0xd4]69 70movprfx z0.d, p0/z, z1.d71// CHECK-INST: movprfx z0.d, p0/z, z1.d72// CHECK-ENCODING: [0x20,0x20,0xd0,0x04]73// CHECK-ERROR: instruction requires: sve or sme74// CHECK-UNKNOWN: 04d02020 <unknown>75 76brk #177// CHECK-INST: brk #0x178// CHECK-ENCODING: [0x20,0x00,0x20,0xd4]79 80// ------------------------------------------------------------------------- //81// Ensure we don't try to apply a prefix to subsequent instructions (upon success)82 83movprfx z0, z184// CHECK-INST: movprfx z0, z185// CHECK-ENCODING: [0x20,0xbc,0x20,0x04]86// CHECK-ERROR: instruction requires: sve or sme87// CHECK-UNKNOWN: 0420bc20 <unknown>88 89add z0.d, p0/m, z0.d, z1.d90// CHECK-INST: add z0.d, p0/m, z0.d, z1.d91// CHECK-ENCODING: [0x20,0x00,0xc0,0x04]92// CHECK-ERROR: instruction requires: sve or sme93// CHECK-UNKNOWN: 04c00020 <unknown>94 95add z0.d, p0/m, z0.d, z1.d96// CHECK-INST: add z0.d, p0/m, z0.d, z1.d97// CHECK-ENCODING: [0x20,0x00,0xc0,0x04]98// CHECK-ERROR: instruction requires: sve or sme99// CHECK-UNKNOWN: 04c00020 <unknown>100