173 lines · plain
1// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sme < %s \2// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST3// RUN: not llvm-mc -triple=aarch64 -show-encoding < %s 2>&1 \4// RUN: | FileCheck %s --check-prefix=CHECK-ERROR5// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sme < %s \6// RUN: | llvm-objdump -d --mattr=+sme - | FileCheck %s --check-prefix=CHECK-INST7// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sme < %s \8// RUN: | llvm-objdump -d --mattr=-sme - | FileCheck %s --check-prefix=CHECK-UNKNOWN9// Disassemble encoding and check the re-encoding (-show-encoding) matches.10// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sme < %s \11// RUN: | sed '/.text/d' | sed 's/.*encoding: //g' \12// RUN: | llvm-mc -triple=aarch64 -mattr=+sme -disassemble -show-encoding \13// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST14 15// --------------------------------------------------------------------------//16// 8-bit17 18uclamp z0.b, z0.b, z0.b19// CHECK-INST: uclamp z0.b, z0.b, z0.b20// CHECK-ENCODING: [0x00,0xc4,0x00,0x44]21// CHECK-ERROR: instruction requires: sme22// CHECK-UNKNOWN: 4400c400 <unknown>23 24uclamp z21.b, z10.b, z21.b25// CHECK-INST: uclamp z21.b, z10.b, z21.b26// CHECK-ENCODING: [0x55,0xc5,0x15,0x44]27// CHECK-ERROR: instruction requires: sme28// CHECK-UNKNOWN: 4415c555 <unknown>29 30uclamp z23.b, z13.b, z8.b31// CHECK-INST: uclamp z23.b, z13.b, z8.b32// CHECK-ENCODING: [0xb7,0xc5,0x08,0x44]33// CHECK-ERROR: instruction requires: sme34// CHECK-UNKNOWN: 4408c5b7 <unknown>35 36uclamp z31.b, z31.b, z31.b37// CHECK-INST: uclamp z31.b, z31.b, z31.b38// CHECK-ENCODING: [0xff,0xc7,0x1f,0x44]39// CHECK-ERROR: instruction requires: sme40// CHECK-UNKNOWN: 441fc7ff <unknown>41 42// --------------------------------------------------------------------------//43// 16-bit44 45uclamp z0.h, z0.h, z0.h46// CHECK-INST: uclamp z0.h, z0.h, z0.h47// CHECK-ENCODING: [0x00,0xc4,0x40,0x44]48// CHECK-ERROR: instruction requires: sme49// CHECK-UNKNOWN: 4440c400 <unknown>50 51uclamp z21.h, z10.h, z21.h52// CHECK-INST: uclamp z21.h, z10.h, z21.h53// CHECK-ENCODING: [0x55,0xc5,0x55,0x44]54// CHECK-ERROR: instruction requires: sme55// CHECK-UNKNOWN: 4455c555 <unknown>56 57uclamp z23.h, z13.h, z8.h58// CHECK-INST: uclamp z23.h, z13.h, z8.h59// CHECK-ENCODING: [0xb7,0xc5,0x48,0x44]60// CHECK-ERROR: instruction requires: sme61// CHECK-UNKNOWN: 4448c5b7 <unknown>62 63uclamp z31.h, z31.h, z31.h64// CHECK-INST: uclamp z31.h, z31.h, z31.h65// CHECK-ENCODING: [0xff,0xc7,0x5f,0x44]66// CHECK-ERROR: instruction requires: sme67// CHECK-UNKNOWN: 445fc7ff <unknown>68 69// --------------------------------------------------------------------------//70// 32-bit71 72uclamp z0.s, z0.s, z0.s73// CHECK-INST: uclamp z0.s, z0.s, z0.s74// CHECK-ENCODING: [0x00,0xc4,0x80,0x44]75// CHECK-ERROR: instruction requires: sme76// CHECK-UNKNOWN: 4480c400 <unknown>77 78uclamp z21.s, z10.s, z21.s79// CHECK-INST: uclamp z21.s, z10.s, z21.s80// CHECK-ENCODING: [0x55,0xc5,0x95,0x44]81// CHECK-ERROR: instruction requires: sme82// CHECK-UNKNOWN: 4495c555 <unknown>83 84uclamp z23.s, z13.s, z8.s85// CHECK-INST: uclamp z23.s, z13.s, z8.s86// CHECK-ENCODING: [0xb7,0xc5,0x88,0x44]87// CHECK-ERROR: instruction requires: sme88// CHECK-UNKNOWN: 4488c5b7 <unknown>89 90uclamp z31.s, z31.s, z31.s91// CHECK-INST: uclamp z31.s, z31.s, z31.s92// CHECK-ENCODING: [0xff,0xc7,0x9f,0x44]93// CHECK-ERROR: instruction requires: sme94// CHECK-UNKNOWN: 449fc7ff <unknown>95 96// --------------------------------------------------------------------------//97// 64-bit98 99uclamp z0.d, z0.d, z0.d100// CHECK-INST: uclamp z0.d, z0.d, z0.d101// CHECK-ENCODING: [0x00,0xc4,0xc0,0x44]102// CHECK-ERROR: instruction requires: sme103// CHECK-UNKNOWN: 44c0c400 <unknown>104 105uclamp z21.d, z10.d, z21.d106// CHECK-INST: uclamp z21.d, z10.d, z21.d107// CHECK-ENCODING: [0x55,0xc5,0xd5,0x44]108// CHECK-ERROR: instruction requires: sme109// CHECK-UNKNOWN: 44d5c555 <unknown>110 111uclamp z23.d, z13.d, z8.d112// CHECK-INST: uclamp z23.d, z13.d, z8.d113// CHECK-ENCODING: [0xb7,0xc5,0xc8,0x44]114// CHECK-ERROR: instruction requires: sme115// CHECK-UNKNOWN: 44c8c5b7 <unknown>116 117uclamp z31.d, z31.d, z31.d118// CHECK-INST: uclamp z31.d, z31.d, z31.d119// CHECK-ENCODING: [0xff,0xc7,0xdf,0x44]120// CHECK-ERROR: instruction requires: sme121// CHECK-UNKNOWN: 44dfc7ff <unknown>122 123// --------------------------------------------------------------------------//124// Test compatibility with MOVPRFX instruction.125 126movprfx z23, z27127// CHECK-INST: movprfx z23, z27128// CHECK-ENCODING: [0x77,0xbf,0x20,0x04]129// CHECK-ERROR: instruction requires: sve or sme130// CHECK-UNKNOWN: 0420bf77 <unknown>131 132uclamp z23.b, z13.b, z8.b133// CHECK-INST: uclamp z23.b, z13.b, z8.b134// CHECK-ENCODING: [0xb7,0xc5,0x08,0x44]135// CHECK-ERROR: instruction requires: sme136// CHECK-UNKNOWN: 4408c5b7 <unknown>137 138movprfx z23, z27139// CHECK-INST: movprfx z23, z27140// CHECK-ENCODING: [0x77,0xbf,0x20,0x04]141// CHECK-ERROR: instruction requires: sve or sme142// CHECK-UNKNOWN: 0420bf77 <unknown>143 144uclamp z23.h, z13.h, z8.h145// CHECK-INST: uclamp z23.h, z13.h, z8.h146// CHECK-ENCODING: [0xb7,0xc5,0x48,0x44]147// CHECK-ERROR: instruction requires: sme148// CHECK-UNKNOWN: 4448c5b7 <unknown>149 150movprfx z23, z27151// CHECK-INST: movprfx z23, z27152// CHECK-ENCODING: [0x77,0xbf,0x20,0x04]153// CHECK-ERROR: instruction requires: sve or sme154// CHECK-UNKNOWN: 0420bf77 <unknown>155 156uclamp z23.s, z13.s, z8.s157// CHECK-INST: uclamp z23.s, z13.s, z8.s158// CHECK-ENCODING: [0xb7,0xc5,0x88,0x44]159// CHECK-ERROR: instruction requires: sme160// CHECK-UNKNOWN: 4488c5b7 <unknown>161 162movprfx z23, z27163// CHECK-INST: movprfx z23, z27164// CHECK-ENCODING: [0x77,0xbf,0x20,0x04]165// CHECK-ERROR: instruction requires: sve or sme166// CHECK-UNKNOWN: 0420bf77 <unknown>167 168uclamp z23.d, z13.d, z8.d169// CHECK-INST: uclamp z23.d, z13.d, z8.d170// CHECK-ENCODING: [0xb7,0xc5,0xc8,0x44]171// CHECK-ERROR: instruction requires: sme172// CHECK-UNKNOWN: 44c8c5b7 <unknown>173