-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[AArch64] Add assembly/disassembly for FMOP4A (widening, 2-way, FP8 to FP16) instructions #113348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
momchil-velikov
merged 2 commits into
llvm:main
from
momchil-velikov:fmop4a-widening-2way-fp8-to-fp16
Nov 4, 2024
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
120 changes: 120 additions & 0 deletions
120
llvm/test/MC/AArch64/SME2p2/fmop4a-fp8-fp16-widening-diagnostics.s
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
// RUN: not llvm-mc -triple=aarch64 -mattr=+sme2p2,+sme-f8f16 < %s 2>&1 | FileCheck %s | ||
|
||
// Single vectors | ||
|
||
fmop4a za0.d, z0.b, z16.b | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid matrix operand | ||
|
||
fmop4a za2.h, z0.b, z16.b | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction | ||
|
||
fmop4a za0.h, z0.s, z16.b | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid restricted vector register, expected even register in z0.b..z14.b | ||
|
||
fmop4a za0.h, z15.b, z16.b | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid restricted vector register, expected even register in z0.b..z14.b | ||
|
||
fmop4a za0.h, z16.b, z16.b | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid restricted vector register, expected even register in z0.b..z14.b | ||
|
||
fmop4a za0.h, z0.b, z16.s | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid restricted vector register, expected even register in z16.b..z30.b | ||
|
||
fmop4a za0.h, z12.b, z17.b | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid restricted vector register, expected even register in z16.b..z30.b | ||
|
||
fmop4a za0.h, z12.b, z14.b | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid restricted vector register, expected even register in z16.b..z30.b | ||
|
||
fmop4a za0.h, z12.b, z31.b | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid restricted vector register, expected even register in z16.b..z30.b | ||
|
||
// Single and multiple vectors | ||
|
||
fmop4a za0.d, z0.b, {z16.b-z17.b} | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid matrix operand | ||
|
||
fmop4a za2.h, z0.b, {z16.b-z17.b} | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction | ||
|
||
fmop4a za0.h, z0.s, {z16.b-z17.b} | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid restricted vector register, expected even register in z0.b..z14.b | ||
|
||
fmop4a za0.h, z1.b, {z16.b-z17.b} | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid restricted vector register, expected even register in z0.b..z14.b | ||
|
||
fmop4a za0.h, z16.b, {z16.b-z17.b} | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid restricted vector register, expected even register in z0.b..z14.b | ||
|
||
fmop4a za0.h, z0.b, {z16.s-z17.s} | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction | ||
|
||
fmop4a za0.h, z0.b, {z17.b-z18.b} | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid vector list, expected list with 2 consecutive SVE vectors in the range z16-z30, where the first vector is a multiple of 2 and with matching element types | ||
|
||
fmop4a za0.h, z0.b, {z16.b-z18.b} | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction | ||
|
||
fmop4a za0.h, z0.b, {z12.b-z13.b} | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid vector list, expected list with 2 consecutive SVE vectors in the range z16-z30, where the first vector is a multiple of 2 and with matching element types | ||
|
||
// Multiple and single vectors | ||
|
||
fmop4a za0.d, {z0.b-z1.b}, z16.b | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid matrix operand | ||
|
||
fmop4a za2.h, {z0.b-z1.b}, z16.b | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction | ||
|
||
fmop4a za0.h, {z0.s-z1.b}, z16.b | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: mismatched register size suffix | ||
|
||
fmop4a za0.h, {z1.b-z2.b}, z16.b | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid vector list, expected list with 2 consecutive SVE vectors in the range z0-z14, where the first vector is a multiple of 2 and with matching element types | ||
|
||
fmop4a za2.h, {z0.b-z2.b}, z16.b | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction | ||
|
||
fmop4a za0.h, {z16.b-z17.b}, z16.b | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid vector list, expected list with 2 consecutive SVE vectors in the range z0-z14, where the first vector is a multiple of 2 and with matching element types | ||
|
||
fmop4a za0.h, {z0.b-z1.b}, z16.d | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid restricted vector register, expected even register in z16.b..z30.b | ||
|
||
fmop4a za0.h, {z0.b-z1.b}, z17.b | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid restricted vector register, expected even register in z16.b..z30.b | ||
|
||
fmop4a za0.h, {z0.b-z1.b}, z12.b | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid restricted vector register, expected even register in z16.b..z30.b | ||
|
||
// Multiple vectors | ||
|
||
fmop4a za0.d, {z0.b-z1.b}, {z16.b-z17.b} | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid matrix operand | ||
|
||
fmop4a za2.h, {z0.b-z1.b}, {z16.b-z17.b} | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction | ||
|
||
fmop4a za0.h, {z0.s-z1.s}, {z16.b-z17.b} | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction | ||
|
||
fmop4a za0.h, {z1.b-z2.b}, {z16.b-z17.b} | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid vector list, expected list with 2 consecutive SVE vectors in the range z0-z14, where the first vector is a multiple of 2 and with matching element types | ||
|
||
fmop4a za0.h, {z0.b-z2.b}, {z16.b-z17.b} | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction | ||
|
||
fmop4a za0.h, {z18.b-z19.b}, {z16.b-z17.b} | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid vector list, expected list with 2 consecutive SVE vectors in the range z0-z14, where the first vector is a multiple of 2 and with matching element types | ||
|
||
fmop4a za0.h, {z0.b-z1.b}, {z16.s-z17.s} | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction | ||
|
||
fmop4a za0.h, {z0.b-z1.b}, {z19.b-z20.b} | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid vector list, expected list with 2 consecutive SVE vectors in the range z16-z30, where the first vector is a multiple of 2 and with matching element types | ||
|
||
fmop4a za0.h, {z0.b-z1.b}, {z18.b-z20.b} | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction | ||
|
||
fmop4a za0.h, {z0.b-z1.b}, {z10.b-z11.b} | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid vector list, expected list with 2 consecutive SVE vectors in the range z16-z30, where the first vector is a multiple of 2 and with matching element types |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sme2p2,+sme-f8f16 < %s \ | ||
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST | ||
// RUN: not llvm-mc -triple=aarch64 -show-encoding < %s 2>&1 \ | ||
// RUN: | FileCheck %s --check-prefix=CHECK-ERROR | ||
// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sme2p2,+sme-f8f16 < %s \ | ||
// RUN: | llvm-objdump -d --mattr=+sme2p2,+sme-f8f16 - | FileCheck %s --check-prefix=CHECK-INST | ||
// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sme2p2,+sme-f8f16 < %s \ | ||
// RUN: | llvm-objdump -d --mattr=-sme2p2 - | FileCheck %s --check-prefix=CHECK-UNKNOWN | ||
// Disassemble encoding and check the re-encoding (-show-encoding) matches. | ||
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sme2p2,+sme-f8f16 < %s \ | ||
// RUN: | sed '/.text/d' | sed 's/.*encoding: //g' \ | ||
// RUN: | llvm-mc -triple=aarch64 -mattr=+sme2p2,+sme-f8f16 -disassemble -show-encoding \ | ||
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST | ||
|
||
// Single vectors | ||
|
||
fmop4a za0.h, z0.b, z16.b // 10000000-00100000-00000000-00001000 | ||
// CHECK-INST: fmop4a za0.h, z0.b, z16.b | ||
// CHECK-ENCODING: [0x08,0x00,0x20,0x80] | ||
// CHECK-ERROR: instruction requires: sme2p2 sme-f8f16 | ||
// CHECK-UNKNOWN: 80200008 <unknown> | ||
|
||
fmop4a za1.h, z12.b, z24.b // 10000000-00101000-00000001-10001001 | ||
// CHECK-INST: fmop4a za1.h, z12.b, z24.b | ||
// CHECK-ENCODING: [0x89,0x01,0x28,0x80] | ||
// CHECK-ERROR: instruction requires: sme2p2 sme-f8f16 | ||
// CHECK-UNKNOWN: 80280189 <unknown> | ||
|
||
fmop4a za1.h, z14.b, z30.b // 10000000-00101110-00000001-11001001 | ||
// CHECK-INST: fmop4a za1.h, z14.b, z30.b | ||
// CHECK-ENCODING: [0xc9,0x01,0x2e,0x80] | ||
// CHECK-ERROR: instruction requires: sme2p2 sme-f8f16 | ||
// CHECK-UNKNOWN: 802e01c9 <unknown> | ||
|
||
// Single and multiple vectors | ||
|
||
fmop4a za0.h, z0.b, {z16.b-z17.b} // 10000000-00110000-00000000-00001000 | ||
// CHECK-INST: fmop4a za0.h, z0.b, { z16.b, z17.b } | ||
// CHECK-ENCODING: [0x08,0x00,0x30,0x80] | ||
// CHECK-ERROR: instruction requires: sme2p2 sme-f8f16 | ||
// CHECK-UNKNOWN: 80300008 <unknown> | ||
|
||
fmop4a za1.h, z10.b, {z20.b-z21.b} // 10000000-00110100-00000001-01001001 | ||
// CHECK-INST: fmop4a za1.h, z10.b, { z20.b, z21.b } | ||
// CHECK-ENCODING: [0x49,0x01,0x34,0x80] | ||
// CHECK-ERROR: instruction requires: sme2p2 sme-f8f16 | ||
// CHECK-UNKNOWN: 80340149 <unknown> | ||
|
||
fmop4a za1.h, z14.b, {z30.b-z31.b} // 10000000-00111110-00000001-11001001 | ||
// CHECK-INST: fmop4a za1.h, z14.b, { z30.b, z31.b } | ||
// CHECK-ENCODING: [0xc9,0x01,0x3e,0x80] | ||
// CHECK-ERROR: instruction requires: sme2p2 sme-f8f16 | ||
// CHECK-UNKNOWN: 803e01c9 <unknown> | ||
|
||
// Multiple and single vectors | ||
|
||
fmop4a za0.h, {z0.b-z1.b}, z16.b // 10000000-00100000-00000010-00001000 | ||
// CHECK-INST: fmop4a za0.h, { z0.b, z1.b }, z16.b | ||
// CHECK-ENCODING: [0x08,0x02,0x20,0x80] | ||
// CHECK-ERROR: instruction requires: sme2p2 sme-f8f16 | ||
// CHECK-UNKNOWN: 80200208 <unknown> | ||
|
||
fmop4a za1.h, {z10.b-z11.b}, z20.b // 10000000-00100100-00000011-01001001 | ||
// CHECK-INST: fmop4a za1.h, { z10.b, z11.b }, z20.b | ||
// CHECK-ENCODING: [0x49,0x03,0x24,0x80] | ||
// CHECK-ERROR: instruction requires: sme2p2 sme-f8f16 | ||
// CHECK-UNKNOWN: 80240349 <unknown> | ||
|
||
fmop4a za1.h, {z14.b-z15.b}, z30.b // 10000000-00101110-00000011-11001001 | ||
// CHECK-INST: fmop4a za1.h, { z14.b, z15.b }, z30.b | ||
// CHECK-ENCODING: [0xc9,0x03,0x2e,0x80] | ||
// CHECK-ERROR: instruction requires: sme2p2 sme-f8f16 | ||
// CHECK-UNKNOWN: 802e03c9 <unknown> | ||
|
||
|
||
// Multiple vectors | ||
|
||
fmop4a za0.h, {z0.b-z1.b}, {z16.b-z17.b} // 10000000-00110000-00000010-00001000 | ||
// CHECK-INST: fmop4a za0.h, { z0.b, z1.b }, { z16.b, z17.b } | ||
// CHECK-ENCODING: [0x08,0x02,0x30,0x80] | ||
// CHECK-ERROR: instruction requires: sme2p2 sme-f8f16 | ||
// CHECK-UNKNOWN: 80300208 <unknown> | ||
|
||
fmop4a za1.h, {z10.b-z11.b}, {z20.b-z21.b} // 10000000-00110100-00000011-01001001 | ||
// CHECK-INST: fmop4a za1.h, { z10.b, z11.b }, { z20.b, z21.b } | ||
// CHECK-ENCODING: [0x49,0x03,0x34,0x80] | ||
// CHECK-ERROR: instruction requires: sme2p2 sme-f8f16 | ||
// CHECK-UNKNOWN: 80340349 <unknown> | ||
|
||
fmop4a za1.h, {z14.b-z15.b}, {z30.b-z31.b} // 10000000-00111110-00000011-11001001 | ||
// CHECK-INST: fmop4a za1.h, { z14.b, z15.b }, { z30.b, z31.b } | ||
// CHECK-ENCODING: [0xc9,0x03,0x3e,0x80] | ||
// CHECK-ERROR: instruction requires: sme2p2 sme-f8f16 | ||
// CHECK-UNKNOWN: 803e03c9 <unknown> | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.