-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[LLVM][AArch64] Add assembly/disassembly for MUL/BFMUL SME instructio…
…ns (#113535) According to https://developer.arm.com/documentation/ddi0602 Co-authored-by: Momchil-Velikov [email protected]
- Loading branch information
1 parent
7544d3a
commit d4197f3
Showing
6 changed files
with
696 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 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 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,111 @@ | ||
// RUN: not llvm-mc -triple=aarch64 -mattr=+sme2,+sve-bfscale 2>&1 < %s| FileCheck %s | ||
|
||
// Multiple and single, 2 regs | ||
|
||
bfmul {z0.s-z1.s}, {z0.h-z1.h}, z0.h | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction | ||
|
||
bfmul {z1.h-z2.h}, {z0.h-z1.h}, z0.h | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid vector list, expected list with 2 consecutive SVE vectors, where the first vector is a multiple of 2 and with matching element types | ||
|
||
bfmul {z0.h-z2.h}, {z0.h-z1.h}, z0.h | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction | ||
|
||
bfmul {z0.h-z1.h}, {z0.s-z1.s}, z0.h | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction | ||
|
||
bfmul {z0.h-z1.h}, {z1.h-z2.h}, z0.h | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid vector list, expected list with 2 consecutive SVE vectors, where the first vector is a multiple of 2 and with matching element types | ||
|
||
bfmul {z0.h-z1.h}, {z0.h-z2.h}, z0.h | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction | ||
|
||
bfmul {z0.h-z1.h}, {z0.h-z1.h}, z0.s | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid restricted vector register, expected z0.h..z15.h | ||
|
||
bfmul {z0.h-z1.h}, {z0.h-z1.h}, z16.h | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid restricted vector register, expected z0.h..z15.h | ||
|
||
// Multiple and single, 4 regs | ||
|
||
bfmul {z0.s-z3.s}, {z0.h-z3.h}, z0.h | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction | ||
|
||
bfmul {z1.h-z4.h}, {z0.h-z3.h}, z0.h | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid vector list, expected list with 4 consecutive SVE vectors, where the first vector is a multiple of 4 and with matching element types | ||
|
||
bfmul {z0.h-z4.h}, {z0.h-z3.h}, z0.h | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid number of vectors | ||
|
||
bfmul {z0.h-z3.h}, {z0.s-z3.s}, z0.h | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction | ||
|
||
bfmul {z0.h-z3.h}, {z1.h-z4.h}, z0.h | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid vector list, expected list with 4 consecutive SVE vectors, where the first vector is a multiple of 4 and with matching element types | ||
|
||
bfmul {z0.h-z3.h}, {z0.h-z4.h}, z0.h | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid number of vectors | ||
|
||
bfmul {z0.h-z3.h}, {z0.h-z3.h}, z0.s | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid restricted vector register, expected z0.h..z15.h | ||
|
||
bfmul {z0.h-z3.h}, {z0.h-z3.h}, z16.h | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid restricted vector register, expected z0.h..z15.h | ||
|
||
// Multiple, 2 regs | ||
|
||
bfmul {z0.s-z1.s}, {z0.h-z1.h}, {z0.h-z1.h} | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction | ||
|
||
bfmul {z1.h-z2.h}, {z0.h-z1.h}, {z0.h-z1.h} | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid vector list, expected list with 2 consecutive SVE vectors, where the first vector is a multiple of 2 and with matching element types | ||
|
||
bfmul {z0.h-z2.h}, {z0.h-z1.h}, {z0.h-z1.h} | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction | ||
|
||
bfmul {z0.h-z1.h}, {z0.s-z1.s}, {z0.h-z1.h} | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction | ||
|
||
bfmul {z0.h-z1.h}, {z1.h-z2.h}, {z0.h-z1.h} | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid vector list, expected list with 2 consecutive SVE vectors, where the first vector is a multiple of 2 and with matching element types | ||
|
||
bfmul {z0.h-z1.h}, {z0.h-z2.h}, {z0.h-z1.h} | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction | ||
|
||
bfmul {z0.h-z1.h}, {z0.h-z1.h}, {z0.s-z1.s} | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction | ||
|
||
bfmul {z0.h-z1.h}, {z0.h-z1.h}, {z1.h-z2.h} | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid vector list, expected list with 2 consecutive SVE vectors, where the first vector is a multiple of 2 and with matching element types | ||
|
||
bfmul {z0.h-z1.h}, {z0.h-z1.h}, {z0.h-z2.h} | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction | ||
|
||
// Multiple, 4 regs | ||
|
||
bfmul {z0.s-z3.s}, {z0.h-z3.h}, {z0.h-z3.h} | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction | ||
|
||
bfmul {z1.h-z4.h}, {z0.h-z3.h}, {z0.h-z3.h} | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid vector list, expected list with 4 consecutive SVE vectors, where the first vector is a multiple of 4 and with matching element types | ||
|
||
bfmul {z0.h-z4.h}, {z0.h-z3.h}, {z0.h-z3.h} | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid number of vectors | ||
|
||
bfmul {z0.h-z3.h}, {z0.s-z3.s}, {z0.h-z3.h} | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction | ||
|
||
bfmul {z0.h-z3.h}, {z1.h-z4.h}, {z0.h-z3.h} | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid vector list, expected list with 4 consecutive SVE vectors, where the first vector is a multiple of 4 and with matching element types | ||
|
||
bfmul {z0.h-z3.h}, {z0.h-z4.h}, {z0.h-z3.h} | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid number of vectors | ||
|
||
bfmul {z0.h-z3.h}, {z0.h-z3.h}, {z0.s-z3.s} | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction | ||
|
||
bfmul {z0.h-z3.h}, {z0.h-z3.h}, {z1.h-z4.h} | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid vector list, expected list with 4 consecutive SVE vectors, where the first vector is a multiple of 4 and with matching element types | ||
|
||
bfmul {z0.h-z3.h}, {z0.h-z3.h}, {z0.h-z4.h} | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid number of vectors |
This file contains 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,92 @@ | ||
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sme2,+sve-bfscale < %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=+sme2,+sve-bfscale < %s \ | ||
// RUN: | llvm-objdump -d --mattr=+sme2,+sve-bfscale - | FileCheck %s --check-prefix=CHECK-INST | ||
// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sme2,+sve-bfscale < %s \ | ||
// RUN: | llvm-objdump -d --mattr=-sme2 - | FileCheck %s --check-prefix=CHECK-UNKNOWN | ||
// Disassemble encoding and check the re-encoding (-show-encoding) matches. | ||
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sme2,+sve-bfscale < %s \ | ||
// RUN: | sed '/.text/d' | sed 's/.*encoding: //g' \ | ||
// RUN: | llvm-mc -triple=aarch64 -mattr=+sme2,+sve-bfscale -disassemble -show-encoding \ | ||
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST | ||
|
||
// Multiple and single, 2 regs | ||
|
||
bfmul {z0.h-z1.h}, {z0.h-z1.h}, z0.h // 11000001-00100000-11101000-00000000 | ||
// CHECK-INST: bfmul { z0.h, z1.h }, { z0.h, z1.h }, z0.h | ||
// CHECK-ENCODING: [0x00,0xe8,0x20,0xc1] | ||
// CHECK-ERROR: instruction requires: sme2 sve-bfscale | ||
// CHECK-UNKNOWN: c120e800 <unknown> | ||
|
||
bfmul {z20.h-z21.h}, {z10.h-z11.h}, z10.h // 11000001-00110100-11101001-01010100 | ||
// CHECK-INST: bfmul { z20.h, z21.h }, { z10.h, z11.h }, z10.h | ||
// CHECK-ENCODING: [0x54,0xe9,0x34,0xc1] | ||
// CHECK-ERROR: instruction requires: sme2 sve-bfscale | ||
// CHECK-UNKNOWN: c134e954 <unknown> | ||
|
||
bfmul {z30.h-z31.h}, {z30.h-z31.h}, z15.h // 11000001-00111110-11101011-11011110 | ||
// CHECK-INST: bfmul { z30.h, z31.h }, { z30.h, z31.h }, z15.h | ||
// CHECK-ENCODING: [0xde,0xeb,0x3e,0xc1] | ||
// CHECK-ERROR: instruction requires: sme2 sve-bfscale | ||
// CHECK-UNKNOWN: c13eebde <unknown> | ||
|
||
// Multiple and single, 4 regs | ||
|
||
bfmul {z0.h-z3.h}, {z0.h-z3.h}, z0.h // 11000001-00100001-11101000-00000000 | ||
// CHECK-INST: bfmul { z0.h - z3.h }, { z0.h - z3.h }, z0.h | ||
// CHECK-ENCODING: [0x00,0xe8,0x21,0xc1] | ||
// CHECK-ERROR: instruction requires: sme2 sve-bfscale | ||
// CHECK-UNKNOWN: c121e800 <unknown> | ||
|
||
bfmul {z20.h-z23.h}, {z8.h-z11.h}, z10.h // 11000001-00110101-11101001-00010100 | ||
// CHECK-INST: bfmul { z20.h - z23.h }, { z8.h - z11.h }, z10.h | ||
// CHECK-ENCODING: [0x14,0xe9,0x35,0xc1] | ||
// CHECK-ERROR: instruction requires: sme2 sve-bfscale | ||
// CHECK-UNKNOWN: c135e914 <unknown> | ||
|
||
bfmul {z28.h-z31.h}, {z28.h-z31.h}, z15.h // 11000001-00111111-11101011-10011100 | ||
// CHECK-INST: bfmul { z28.h - z31.h }, { z28.h - z31.h }, z15.h | ||
// CHECK-ENCODING: [0x9c,0xeb,0x3f,0xc1] | ||
// CHECK-ERROR: instruction requires: sme2 sve-bfscale | ||
// CHECK-UNKNOWN: c13feb9c <unknown> | ||
|
||
// Multiple, 2 regs | ||
bfmul {z0.h-z1.h}, {z0.h-z1.h}, {z0.h-z1.h} // 11000001-00100000-11100100-00000000 | ||
// CHECK-INST: bfmul { z0.h, z1.h }, { z0.h, z1.h }, { z0.h, z1.h } | ||
// CHECK-ENCODING: [0x00,0xe4,0x20,0xc1] | ||
// CHECK-ERROR: instruction requires: sme2 sve-bfscale | ||
// CHECK-UNKNOWN: c120e400 <unknown> | ||
|
||
bfmul {z20.h-z21.h}, {z10.h-z11.h}, {z20.h-z21.h} // 11000001-00110100-11100101-01010100 | ||
// CHECK-INST: bfmul { z20.h, z21.h }, { z10.h, z11.h }, { z20.h, z21.h } | ||
// CHECK-ENCODING: [0x54,0xe5,0x34,0xc1] | ||
// CHECK-ERROR: instruction requires: sme2 sve-bfscale | ||
// CHECK-UNKNOWN: c134e554 <unknown> | ||
|
||
bfmul {z30.h-z31.h}, {z30.h-z31.h}, {z30.h-z31.h} // 11000001-00111110-11100111-11011110 | ||
// CHECK-INST: bfmul { z30.h, z31.h }, { z30.h, z31.h }, { z30.h, z31.h } | ||
// CHECK-ENCODING: [0xde,0xe7,0x3e,0xc1] | ||
// CHECK-ERROR: instruction requires: sme2 sve-bfscale | ||
// CHECK-UNKNOWN: c13ee7de <unknown> | ||
|
||
// Multiple, 4 regs | ||
|
||
bfmul {z0.h-z3.h}, {z0.h-z3.h}, {z0.h-z3.h} // 11000001-00100001-11100100-00000000 | ||
// CHECK-INST: bfmul { z0.h - z3.h }, { z0.h - z3.h }, { z0.h - z3.h } | ||
// CHECK-ENCODING: [0x00,0xe4,0x21,0xc1] | ||
// CHECK-ERROR: instruction requires: sme2 sve-bfscale | ||
// CHECK-UNKNOWN: c121e400 <unknown> | ||
|
||
bfmul {z20.h-z23.h}, {z8.h-z11.h}, {z20.h-z23.h} // 11000001-00110101-11100101-00010100 | ||
// CHECK-INST: bfmul { z20.h - z23.h }, { z8.h - z11.h }, { z20.h - z23.h } | ||
// CHECK-ENCODING: [0x14,0xe5,0x35,0xc1] | ||
// CHECK-ERROR: instruction requires: sme2 sve-bfscale | ||
// CHECK-UNKNOWN: c135e514 <unknown> | ||
|
||
bfmul {z28.h-z31.h}, {z28.h-z31.h}, {z28.h-z31.h} // 11000001-00111101-11100111-10011100 | ||
// CHECK-INST: bfmul { z28.h - z31.h }, { z28.h - z31.h }, { z28.h - z31.h } | ||
// CHECK-ENCODING: [0x9c,0xe7,0x3d,0xc1] | ||
// CHECK-ERROR: instruction requires: sme2 sve-bfscale | ||
// CHECK-UNKNOWN: c13de79c <unknown> |
Oops, something went wrong.