356 lines · plain
1// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+fp8 < %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=+fp8 < %s \6// RUN: | llvm-objdump -d --mattr=+fp8 - | FileCheck %s --check-prefix=CHECK-INST7// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+fp8 < %s \8// RUN: | llvm-objdump -d --mattr=-sme2 - | 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=+fp8 < %s \11// RUN: | sed '/.text/d' | sed 's/.*encoding: //g' \12// RUN: | llvm-mc -triple=aarch64 -mattr=+fp8 -disassemble -show-encoding \13// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST14 15///16/// BF1CVTL instructions.17///18bf1cvtl v0.8h, v0.8b19// CHECK-INST: bf1cvtl v0.8h, v0.8b20// CHECK-ENCODING: [0x00,0x78,0xa1,0x2e]21// CHECK-ERROR: instruction requires: fp822// CHECK-UNKNOWN: 2ea17800 <unknown>23 24bf1cvtl v0.8h, v31.8b25// CHECK-INST: bf1cvtl v0.8h, v31.8b26// CHECK-ENCODING: [0xe0,0x7b,0xa1,0x2e]27// CHECK-ERROR: instruction requires: fp828// CHECK-UNKNOWN: 2ea17be0 <unknown>29 30bf1cvtl v31.8h, v31.8b31// CHECK-INST: bf1cvtl v31.8h, v31.8b32// CHECK-ENCODING: [0xff,0x7b,0xa1,0x2e]33// CHECK-ERROR: instruction requires: fp834// CHECK-UNKNOWN: 2ea17bff <unknown>35 36///37/// BF1CVTL2 instructions.38///39bf1cvtl2 v0.8h, v0.16b40// CHECK-INST: bf1cvtl2 v0.8h, v0.16b41// CHECK-ENCODING: [0x00,0x78,0xa1,0x6e]42// CHECK-ERROR: instruction requires: fp843// CHECK-UNKNOWN: 6ea17800 <unknown>44 45bf1cvtl2 v0.8h, v31.16b46// CHECK-INST: bf1cvtl2 v0.8h, v31.16b47// CHECK-ENCODING: [0xe0,0x7b,0xa1,0x6e]48// CHECK-ERROR: instruction requires: fp849// CHECK-UNKNOWN: 6ea17be0 <unknown>50 51bf1cvtl2 v31.8h, v31.16b52// CHECK-INST: bf1cvtl2 v31.8h, v31.16b53// CHECK-ENCODING: [0xff,0x7b,0xa1,0x6e]54// CHECK-ERROR: instruction requires: fp855// CHECK-UNKNOWN: 6ea17bff <unknown>56 57///58/// BF2CVTL instructions.59///60bf2cvtl v0.8h, v0.8b61// CHECK-INST: bf2cvtl v0.8h, v0.8b62// CHECK-ENCODING: [0x00,0x78,0xe1,0x2e]63// CHECK-ERROR: instruction requires: fp864// CHECK-UNKNOWN: 2ee17800 <unknown>65 66bf2cvtl v0.8h, v31.8b67// CHECK-INST: bf2cvtl v0.8h, v31.8b68// CHECK-ENCODING: [0xe0,0x7b,0xe1,0x2e]69// CHECK-ERROR: instruction requires: fp870// CHECK-UNKNOWN: 2ee17be0 <unknown>71 72bf2cvtl v31.8h, v31.8b73// CHECK-INST: bf2cvtl v31.8h, v31.8b74// CHECK-ENCODING: [0xff,0x7b,0xe1,0x2e]75// CHECK-ERROR: instruction requires: fp876// CHECK-UNKNOWN: 2ee17bff <unknown>77 78///79/// BF2CVTL2 instructions.80///81bf2cvtl2 v0.8h, v0.16b82// CHECK-INST: bf2cvtl2 v0.8h, v0.16b83// CHECK-ENCODING: [0x00,0x78,0xe1,0x6e]84// CHECK-ERROR: instruction requires: fp885// CHECK-UNKNOWN: 6ee17800 <unknown>86 87bf2cvtl2 v0.8h, v31.16b88// CHECK-INST: bf2cvtl2 v0.8h, v31.16b89// CHECK-ENCODING: [0xe0,0x7b,0xe1,0x6e]90// CHECK-ERROR: instruction requires: fp891// CHECK-UNKNOWN: 6ee17be0 <unknown>92 93bf2cvtl2 v31.8h, v31.16b94// CHECK-INST: bf2cvtl2 v31.8h, v31.16b95// CHECK-ENCODING: [0xff,0x7b,0xe1,0x6e]96// CHECK-ERROR: instruction requires: fp897// CHECK-UNKNOWN: 6ee17bff <unknown>98 99///100/// F1CVTL instructions.101///102f1cvtl v0.8h, v0.8b103// CHECK-INST: f1cvtl v0.8h, v0.8b104// CHECK-ENCODING: [0x00,0x78,0x21,0x2e]105// CHECK-ERROR: instruction requires: fp8106// CHECK-UNKNOWN: 2e217800 <unknown>107 108f1cvtl v0.8h, v31.8b109// CHECK-INST: f1cvtl v0.8h, v31.8b110// CHECK-ENCODING: [0xe0,0x7b,0x21,0x2e]111// CHECK-ERROR: instruction requires: fp8112// CHECK-UNKNOWN: 2e217be0 <unknown>113 114f1cvtl v31.8h, v31.8b115// CHECK-INST: f1cvtl v31.8h, v31.8b116// CHECK-ENCODING: [0xff,0x7b,0x21,0x2e]117// CHECK-ERROR: instruction requires: fp8118// CHECK-UNKNOWN: 2e217bff <unknown>119 120///121/// F1CVTL2 instructions.122///123f1cvtl2 v0.8h, v0.16b124// CHECK-INST: f1cvtl2 v0.8h, v0.16b125// CHECK-ENCODING: [0x00,0x78,0x21,0x6e]126// CHECK-ERROR: instruction requires: fp8127// CHECK-UNKNOWN: 6e217800 <unknown>128 129f1cvtl2 v0.8h, v31.16b130// CHECK-INST: f1cvtl2 v0.8h, v31.16b131// CHECK-ENCODING: [0xe0,0x7b,0x21,0x6e]132// CHECK-ERROR: instruction requires: fp8133// CHECK-UNKNOWN: 6e217be0 <unknown>134 135f1cvtl2 v31.8h, v31.16b136// CHECK-INST: f1cvtl2 v31.8h, v31.16b137// CHECK-ENCODING: [0xff,0x7b,0x21,0x6e]138// CHECK-ERROR: instruction requires: fp8139// CHECK-UNKNOWN: 6e217bff <unknown>140 141///142/// F2CVTL instructions.143///144f2cvtl v0.8h, v0.8b145// CHECK-INST: f2cvtl v0.8h, v0.8b146// CHECK-ENCODING: [0x00,0x78,0x61,0x2e]147// CHECK-ERROR: instruction requires: fp8148// CHECK-UNKNOWN: 2e617800 <unknown>149 150f2cvtl v0.8h, v31.8b151// CHECK-INST: f2cvtl v0.8h, v31.8b152// CHECK-ENCODING: [0xe0,0x7b,0x61,0x2e]153// CHECK-ERROR: instruction requires: fp8154// CHECK-UNKNOWN: 2e617be0 <unknown>155 156f2cvtl v31.8h, v31.8b157// CHECK-INST: f2cvtl v31.8h, v31.8b158// CHECK-ENCODING: [0xff,0x7b,0x61,0x2e]159// CHECK-ERROR: instruction requires: fp8160// CHECK-UNKNOWN: 2e617bff <unknown>161 162///163/// F2CVTL2 instructions.164///165f2cvtl2 v0.8h, v0.16b166// CHECK-INST: f2cvtl2 v0.8h, v0.16b167// CHECK-ENCODING: [0x00,0x78,0x61,0x6e]168// CHECK-ERROR: instruction requires: fp8169// CHECK-UNKNOWN: 6e617800 <unknown>170 171f2cvtl2 v0.8h, v31.16b172// CHECK-INST: f2cvtl2 v0.8h, v31.16b173// CHECK-ENCODING: [0xe0,0x7b,0x61,0x6e]174// CHECK-ERROR: instruction requires: fp8175// CHECK-UNKNOWN: 6e617be0 <unknown>176 177f2cvtl2 v31.8h, v31.16b178// CHECK-INST: f2cvtl2 v31.8h, v31.16b179// CHECK-ENCODING: [0xff,0x7b,0x61,0x6e]180// CHECK-ERROR: instruction requires: fp8181// CHECK-UNKNOWN: 6e617bff <unknown>182 183///184/// FCVTN instructions.185///186// FP16 TO FP8187fcvtn v31.8b, v31.4h, v31.4h188// CHECK-INST: fcvtn v31.8b, v31.4h, v31.4h189// CHECK-ENCODING: [0xff,0xf7,0x5f,0x0e]190// CHECK-ERROR: instruction requires: fp8191// CHECK-UNKNOWN: 0e5ff7ff <unknown>192 193fcvtn v31.8b, v0.4h, v0.4h194// CHECK-INST: fcvtn v31.8b, v0.4h, v0.4h195// CHECK-ENCODING: [0x1f,0xf4,0x40,0x0e]196// CHECK-ERROR: instruction requires: fp8197// CHECK-UNKNOWN: 0e40f41f <unknown>198 199fcvtn v0.8b, v0.4h, v0.4h200// CHECK-INST: fcvtn v0.8b, v0.4h, v0.4h201// CHECK-ENCODING: [0x00,0xf4,0x40,0x0e]202// CHECK-ERROR: instruction requires: fp8203// CHECK-UNKNOWN: 0e40f400 <unknown>204 205fcvtn v0.16b, v0.8h, v0.8h206// CHECK-INST: fcvtn v0.16b, v0.8h, v0.8h207// CHECK-ENCODING: [0x00,0xf4,0x40,0x4e]208// CHECK-ERROR: instruction requires: fp8209// CHECK-UNKNOWN: 4e40f400 <unknown>210 211fcvtn v31.16b, v0.8h, v0.8h212// CHECK-INST: fcvtn v31.16b, v0.8h, v0.8h213// CHECK-ENCODING: [0x1f,0xf4,0x40,0x4e]214// CHECK-ERROR: instruction requires: fp8215// CHECK-UNKNOWN: 4e40f41f <unknown>216 217fcvtn v31.16b, v31.8h, v31.8h218// CHECK-INST: fcvtn v31.16b, v31.8h, v31.8h219// CHECK-ENCODING: [0xff,0xf7,0x5f,0x4e]220// CHECK-ERROR: instruction requires: fp8221// CHECK-UNKNOWN: 4e5ff7ff <unknown>222 223// FP32 TO FP8224fcvtn v0.8b, v0.4s, v0.4s225// CHECK-INST: fcvtn v0.8b, v0.4s, v0.4s226// CHECK-ENCODING: [0x00,0xf4,0x00,0x0e]227// CHECK-ERROR: instruction requires: fp8228// CHECK-UNKNOWN: 0e00f400 <unknown>229 230fcvtn v0.8b, v31.4s, v31.4s231// CHECK-INST: fcvtn v0.8b, v31.4s, v31.4s232// CHECK-ENCODING: [0xe0,0xf7,0x1f,0x0e]233// CHECK-ERROR: instruction requires: fp8234// CHECK-UNKNOWN: 0e1ff7e0 <unknown>235 236fcvtn v31.8b, v31.4s, v31.4s237// CHECK-INST: fcvtn v31.8b, v31.4s, v31.4s238// CHECK-ENCODING: [0xff,0xf7,0x1f,0x0e]239// CHECK-ERROR: instruction requires: fp8240// CHECK-UNKNOWN: 0e1ff7ff <unknown>241 242///243/// FCVTN2 instructions.244///245 246fcvtn2 v0.16b, v0.4s, v0.4s247// CHECK-INST: fcvtn2 v0.16b, v0.4s, v0.4s248// CHECK-ENCODING: [0x00,0xf4,0x00,0x4e]249// CHECK-ERROR: instruction requires: fp8250// CHECK-UNKNOWN: 4e00f400 <unknown>251 252fcvtn2 v0.16b, v0.4s, v31.4s253// CHECK-INST: fcvtn2 v0.16b, v0.4s, v31.4s254// CHECK-ENCODING: [0x00,0xf4,0x1f,0x4e]255// CHECK-ERROR: instruction requires: fp8256// CHECK-UNKNOWN: 4e1ff400 <unknown>257 258fcvtn2 v31.16b, v31.4s, v31.4s259// CHECK-INST: fcvtn2 v31.16b, v31.4s, v31.4s260// CHECK-ENCODING: [0xff,0xf7,0x1f,0x4e]261// CHECK-ERROR: instruction requires: fp8262// CHECK-UNKNOWN: 4e1ff7ff <unknown>263 264///265/// FSCALE instructions.266///267fscale v0.4h, v0.4h, v0.4h268// CHECK-INST: fscale v0.4h, v0.4h, v0.4h269// CHECK-ENCODING: [0x00,0x3c,0xc0,0x2e]270// CHECK-ERROR: instruction requires: fp8271// CHECK-UNKNOWN: 2ec03c00 <unknown>272 273fscale v0.4h, v31.4h, v31.4h274// CHECK-INST: fscale v0.4h, v31.4h, v31.4h275// CHECK-ENCODING: [0xe0,0x3f,0xdf,0x2e]276// CHECK-ERROR: instruction requires: fp8277// CHECK-UNKNOWN: 2edf3fe0 <unknown>278 279fscale v31.4h, v31.4h, v31.4h280// CHECK-INST: fscale v31.4h, v31.4h, v31.4h281// CHECK-ENCODING: [0xff,0x3f,0xdf,0x2e]282// CHECK-ERROR: instruction requires: fp8283// CHECK-UNKNOWN: 2edf3fff <unknown>284 285fscale v0.8h, v0.8h, v0.8h286// CHECK-INST: fscale v0.8h, v0.8h, v0.8h287// CHECK-ENCODING: [0x00,0x3c,0xc0,0x6e]288// CHECK-ERROR: instruction requires: fp8289// CHECK-UNKNOWN: 6ec03c00 <unknown>290 291fscale v31.8h, v0.8h, v0.8h292// CHECK-INST: fscale v31.8h, v0.8h, v0.8h293// CHECK-ENCODING: [0x1f,0x3c,0xc0,0x6e]294// CHECK-ERROR: instruction requires: fp8295// CHECK-UNKNOWN: 6ec03c1f <unknown>296 297fscale v31.8h, v31.8h, v31.8h298// CHECK-INST: fscale v31.8h, v31.8h, v31.8h299// CHECK-ENCODING: [0xff,0x3f,0xdf,0x6e]300// CHECK-ERROR: instruction requires: fp8301// CHECK-UNKNOWN: 6edf3fff <unknown>302 303fscale v0.2s, v0.2s, v0.2s304// CHECK-INST: fscale v0.2s, v0.2s, v0.2s305// CHECK-ENCODING: [0x00,0xfc,0xa0,0x2e]306// CHECK-ERROR: instruction requires: fp8307// CHECK-UNKNOWN: 2ea0fc00 <unknown>308 309fscale v0.2s, v0.2s, v31.2s310// CHECK-INST: fscale v0.2s, v0.2s, v31.2s311// CHECK-ENCODING: [0x00,0xfc,0xbf,0x2e]312// CHECK-ERROR: instruction requires: fp8313// CHECK-UNKNOWN: 2ebffc00 <unknown>314 315fscale v31.2s, v31.2s, v31.2s316// CHECK-INST: fscale v31.2s, v31.2s, v31.2s317// CHECK-ENCODING: [0xff,0xff,0xbf,0x2e]318// CHECK-ERROR: instruction requires: fp8319// CHECK-UNKNOWN: 2ebfffff <unknown>320 321fscale v0.4s, v0.4s, v0.4s322// CHECK-INST: fscale v0.4s, v0.4s, v0.4s323// CHECK-ENCODING: [0x00,0xfc,0xa0,0x6e]324// CHECK-ERROR: instruction requires: fp8325// CHECK-UNKNOWN: 6ea0fc00 <unknown>326 327fscale v0.4s, v31.4s, v0.4s328// CHECK-INST: fscale v0.4s, v31.4s, v0.4s329// CHECK-ENCODING: [0xe0,0xff,0xa0,0x6e]330// CHECK-ERROR: instruction requires: fp8331// CHECK-UNKNOWN: 6ea0ffe0 <unknown>332 333fscale v31.4s, v31.4s, v31.4s334// CHECK-INST: fscale v31.4s, v31.4s, v31.4s335// CHECK-ENCODING: [0xff,0xff,0xbf,0x6e]336// CHECK-ERROR: instruction requires: fp8337// CHECK-UNKNOWN: 6ebfffff <unknown>338 339fscale v0.2d, v0.2d, v0.2d340// CHECK-INST: fscale v0.2d, v0.2d, v0.2d341// CHECK-ENCODING: [0x00,0xfc,0xe0,0x6e]342// CHECK-ERROR: instruction requires: fp8343// CHECK-UNKNOWN: 6ee0fc00 <unknown>344 345fscale v0.2d, v31.2d, v0.2d346// CHECK-INST: fscale v0.2d, v31.2d, v0.2d347// CHECK-ENCODING: [0xe0,0xff,0xe0,0x6e]348// CHECK-ERROR: instruction requires: fp8349// CHECK-UNKNOWN: 6ee0ffe0 <unknown>350 351fscale v31.2d, v31.2d, v31.2d352// CHECK-INST: fscale v31.2d, v31.2d, v31.2d353// CHECK-ENCODING: [0xff,0xff,0xff,0x6e]354// CHECK-ERROR: instruction requires: fp8355// CHECK-UNKNOWN: 6effffff356