1// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sme < %s \ 2// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST 3// RUN: not llvm-mc -triple=aarch64 -show-encoding < %s 2>&1 \ 4// RUN: | FileCheck %s --check-prefix=CHECK-ERROR 5// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sme < %s \ 6// RUN: | llvm-objdump -d --mattr=+sme - | FileCheck %s --check-prefix=CHECK-INST 7// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sme < %s \ 8// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN 9// 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-INST 14 15// --------------------------------------------------------------------------// 16// 8-bit 17 18uclamp z0.b, z0.b, z0.b 19// CHECK-INST: uclamp z0.b, z0.b, z0.b 20// CHECK-ENCODING: [0x00,0xc4,0x00,0x44] 21// CHECK-ERROR: instruction requires: sme 22// CHECK-UNKNOWN: 00 c4 00 44 <unknown> 23 24uclamp z21.b, z10.b, z21.b 25// CHECK-INST: uclamp z21.b, z10.b, z21.b 26// CHECK-ENCODING: [0x55,0xc5,0x15,0x44] 27// CHECK-ERROR: instruction requires: sme 28// CHECK-UNKNOWN: 55 c5 15 44 <unknown> 29 30uclamp z23.b, z13.b, z8.b 31// CHECK-INST: uclamp z23.b, z13.b, z8.b 32// CHECK-ENCODING: [0xb7,0xc5,0x08,0x44] 33// CHECK-ERROR: instruction requires: sme 34// CHECK-UNKNOWN: b7 c5 08 44 <unknown> 35 36uclamp z31.b, z31.b, z31.b 37// CHECK-INST: uclamp z31.b, z31.b, z31.b 38// CHECK-ENCODING: [0xff,0xc7,0x1f,0x44] 39// CHECK-ERROR: instruction requires: sme 40// CHECK-UNKNOWN: ff c7 1f 44 <unknown> 41 42// --------------------------------------------------------------------------// 43// 16-bit 44 45uclamp z0.h, z0.h, z0.h 46// CHECK-INST: uclamp z0.h, z0.h, z0.h 47// CHECK-ENCODING: [0x00,0xc4,0x40,0x44] 48// CHECK-ERROR: instruction requires: sme 49// CHECK-UNKNOWN: 00 c4 40 44 <unknown> 50 51uclamp z21.h, z10.h, z21.h 52// CHECK-INST: uclamp z21.h, z10.h, z21.h 53// CHECK-ENCODING: [0x55,0xc5,0x55,0x44] 54// CHECK-ERROR: instruction requires: sme 55// CHECK-UNKNOWN: 55 c5 55 44 <unknown> 56 57uclamp z23.h, z13.h, z8.h 58// CHECK-INST: uclamp z23.h, z13.h, z8.h 59// CHECK-ENCODING: [0xb7,0xc5,0x48,0x44] 60// CHECK-ERROR: instruction requires: sme 61// CHECK-UNKNOWN: b7 c5 48 44 <unknown> 62 63uclamp z31.h, z31.h, z31.h 64// CHECK-INST: uclamp z31.h, z31.h, z31.h 65// CHECK-ENCODING: [0xff,0xc7,0x5f,0x44] 66// CHECK-ERROR: instruction requires: sme 67// CHECK-UNKNOWN: ff c7 5f 44 <unknown> 68 69// --------------------------------------------------------------------------// 70// 32-bit 71 72uclamp z0.s, z0.s, z0.s 73// CHECK-INST: uclamp z0.s, z0.s, z0.s 74// CHECK-ENCODING: [0x00,0xc4,0x80,0x44] 75// CHECK-ERROR: instruction requires: sme 76// CHECK-UNKNOWN: 00 c4 80 44 <unknown> 77 78uclamp z21.s, z10.s, z21.s 79// CHECK-INST: uclamp z21.s, z10.s, z21.s 80// CHECK-ENCODING: [0x55,0xc5,0x95,0x44] 81// CHECK-ERROR: instruction requires: sme 82// CHECK-UNKNOWN: 55 c5 95 44 <unknown> 83 84uclamp z23.s, z13.s, z8.s 85// CHECK-INST: uclamp z23.s, z13.s, z8.s 86// CHECK-ENCODING: [0xb7,0xc5,0x88,0x44] 87// CHECK-ERROR: instruction requires: sme 88// CHECK-UNKNOWN: b7 c5 88 44 <unknown> 89 90uclamp z31.s, z31.s, z31.s 91// CHECK-INST: uclamp z31.s, z31.s, z31.s 92// CHECK-ENCODING: [0xff,0xc7,0x9f,0x44] 93// CHECK-ERROR: instruction requires: sme 94// CHECK-UNKNOWN: ff c7 9f 44 <unknown> 95 96// --------------------------------------------------------------------------// 97// 64-bit 98 99uclamp z0.d, z0.d, z0.d 100// CHECK-INST: uclamp z0.d, z0.d, z0.d 101// CHECK-ENCODING: [0x00,0xc4,0xc0,0x44] 102// CHECK-ERROR: instruction requires: sme 103// CHECK-UNKNOWN: 00 c4 c0 44 <unknown> 104 105uclamp z21.d, z10.d, z21.d 106// CHECK-INST: uclamp z21.d, z10.d, z21.d 107// CHECK-ENCODING: [0x55,0xc5,0xd5,0x44] 108// CHECK-ERROR: instruction requires: sme 109// CHECK-UNKNOWN: 55 c5 d5 44 <unknown> 110 111uclamp z23.d, z13.d, z8.d 112// CHECK-INST: uclamp z23.d, z13.d, z8.d 113// CHECK-ENCODING: [0xb7,0xc5,0xc8,0x44] 114// CHECK-ERROR: instruction requires: sme 115// CHECK-UNKNOWN: b7 c5 c8 44 <unknown> 116 117uclamp z31.d, z31.d, z31.d 118// CHECK-INST: uclamp z31.d, z31.d, z31.d 119// CHECK-ENCODING: [0xff,0xc7,0xdf,0x44] 120// CHECK-ERROR: instruction requires: sme 121// CHECK-UNKNOWN: ff c7 df 44 <unknown> 122 123// --------------------------------------------------------------------------// 124// Test compatibility with MOVPRFX instruction. 125 126movprfx z23, z27 127// CHECK-INST: movprfx z23, z27 128// CHECK-ENCODING: [0x77,0xbf,0x20,0x04] 129// CHECK-ERROR: instruction requires: streaming-sve or sve 130// CHECK-UNKNOWN: 77 bf 20 04 <unknown> 131 132uclamp z23.b, z13.b, z8.b 133// CHECK-INST: uclamp z23.b, z13.b, z8.b 134// CHECK-ENCODING: [0xb7,0xc5,0x08,0x44] 135// CHECK-ERROR: instruction requires: sme 136// CHECK-UNKNOWN: b7 c5 08 44 <unknown> 137 138movprfx z23, z27 139// CHECK-INST: movprfx z23, z27 140// CHECK-ENCODING: [0x77,0xbf,0x20,0x04] 141// CHECK-ERROR: instruction requires: streaming-sve or sve 142// CHECK-UNKNOWN: 77 bf 20 04 <unknown> 143 144uclamp z23.h, z13.h, z8.h 145// CHECK-INST: uclamp z23.h, z13.h, z8.h 146// CHECK-ENCODING: [0xb7,0xc5,0x48,0x44] 147// CHECK-ERROR: instruction requires: sme 148// CHECK-UNKNOWN: b7 c5 48 44 <unknown> 149 150movprfx z23, z27 151// CHECK-INST: movprfx z23, z27 152// CHECK-ENCODING: [0x77,0xbf,0x20,0x04] 153// CHECK-ERROR: instruction requires: streaming-sve or sve 154// CHECK-UNKNOWN: 77 bf 20 04 <unknown> 155 156uclamp z23.s, z13.s, z8.s 157// CHECK-INST: uclamp z23.s, z13.s, z8.s 158// CHECK-ENCODING: [0xb7,0xc5,0x88,0x44] 159// CHECK-ERROR: instruction requires: sme 160// CHECK-UNKNOWN: b7 c5 88 44 <unknown> 161 162movprfx z23, z27 163// CHECK-INST: movprfx z23, z27 164// CHECK-ENCODING: [0x77,0xbf,0x20,0x04] 165// CHECK-ERROR: instruction requires: streaming-sve or sve 166// CHECK-UNKNOWN: 77 bf 20 04 <unknown> 167 168uclamp z23.d, z13.d, z8.d 169// CHECK-INST: uclamp z23.d, z13.d, z8.d 170// CHECK-ENCODING: [0xb7,0xc5,0xc8,0x44] 171// CHECK-ERROR: instruction requires: sme 172// CHECK-UNKNOWN: b7 c5 c8 44 <unknown> 173