forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AArch64] Add assembly/disassembly for zeroing SVE2 integer instructi…
…ons (llvm#113473) This patch adds assembly/disassembly for the following SVE2.2 instructions - SQABS (zeroing) - SQNEG (zeroing) - URECPE (zeroing) - USQRTE (zeroing) - Refactor the existing merging forms to remove the now redundant bit 17 argument. - In accordance with: https://developer.arm.com/documentation/ddi0602/latest/
- Loading branch information
1 parent
09160a9
commit 6414894
Showing
14 changed files
with
366 additions
and
20 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
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
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,37 @@ | ||
// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2p2 2>&1 < %s| FileCheck %s | ||
|
||
// ------------------------------------------------------------------------- // | ||
// Invalid element width | ||
|
||
sqabs z31.b, p7/z, z31.h | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width | ||
// CHECK-NEXT: sqabs z31.b, p7/z, z31.h | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
sqabs z31.d, p7/z, z31.s | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width | ||
// CHECK-NEXT: sqabs z31.d, p7/z, z31.s | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
// ------------------------------------------------------------------------- // | ||
// Invalid predicate | ||
|
||
sqabs z31.b, p8/z, z31.b | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid restricted predicate register, expected p0..p7 (without element suffix) | ||
// CHECK-NEXT: sqabs z31.b, p8/z, z31.b | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
// --------------------------------------------------------------------------// | ||
// Negative tests for instructions that are incompatible with movprfx | ||
|
||
movprfx z0.h, p0/z, z7.h | ||
sqabs z0.h, p0/z, z3.h | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov | ||
// CHECK-NEXT: sqabs z0.h, p0/z, z3.h | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
movprfx z0, z7 | ||
sqabs z0.h, p0/z, z3.h | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov | ||
// CHECK-NEXT: sqabs z0.h, p0/z, z3.h | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: |
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,39 @@ | ||
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2p2 < %s \ | ||
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST | ||
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sme2p2 < %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=+sve2p2 < %s \ | ||
// RUN: | llvm-objdump -d --mattr=+sve2p2 - | FileCheck %s --check-prefix=CHECK-INST | ||
// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2p2 < %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=+sve2p2 < %s \ | ||
// RUN: | sed '/.text/d' | sed 's/.*encoding: //g' \ | ||
// RUN: | llvm-mc -triple=aarch64 -mattr=+sve2p2 -disassemble -show-encoding \ | ||
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST | ||
|
||
sqabs z0.b, p0/z, z0.b // 01000100-00001010-10100000-00000000 | ||
// CHECK-INST: sqabs z0.b, p0/z, z0.b | ||
// CHECK-ENCODING: [0x00,0xa0,0x0a,0x44] | ||
// CHECK-ERROR: instruction requires: sme2p2 or sve2p2 | ||
// CHECK-UNKNOWN: 440aa000 <unknown> | ||
|
||
sqabs z21.h, p5/z, z10.h // 01000100-01001010-10110101-01010101 | ||
// CHECK-INST: sqabs z21.h, p5/z, z10.h | ||
// CHECK-ENCODING: [0x55,0xb5,0x4a,0x44] | ||
// CHECK-ERROR: instruction requires: sme2p2 or sve2p2 | ||
// CHECK-UNKNOWN: 444ab555 <unknown> | ||
|
||
sqabs z23.s, p3/z, z13.s // 01000100-10001010-10101101-10110111 | ||
// CHECK-INST: sqabs z23.s, p3/z, z13.s | ||
// CHECK-ENCODING: [0xb7,0xad,0x8a,0x44] | ||
// CHECK-ERROR: instruction requires: sme2p2 or sve2p2 | ||
// CHECK-UNKNOWN: 448aadb7 <unknown> | ||
|
||
sqabs z31.d, p7/z, z31.d // 01000100-11001010-10111111-11111111 | ||
// CHECK-INST: sqabs z31.d, p7/z, z31.d | ||
// CHECK-ENCODING: [0xff,0xbf,0xca,0x44] | ||
// CHECK-ERROR: instruction requires: sme2p2 or sve2p2 | ||
// CHECK-UNKNOWN: 44cabfff <unknown> |
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,37 @@ | ||
// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2p2 2>&1 < %s| FileCheck %s | ||
|
||
// ------------------------------------------------------------------------- // | ||
// Invalid element width | ||
|
||
sqneg z31.b, p7/z, z31.h | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width | ||
// CHECK-NEXT: sqneg z31.b, p7/z, z31.h | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
sqneg z31.d, p7/z, z31.s | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width | ||
// CHECK-NEXT: sqneg z31.d, p7/z, z31.s | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
// ------------------------------------------------------------------------- // | ||
// Invalid predicate | ||
|
||
sqneg z31.b, p8/z, z31.b | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid restricted predicate register, expected p0..p7 (without element suffix) | ||
// CHECK-NEXT: sqneg z31.b, p8/z, z31.b | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
// --------------------------------------------------------------------------// | ||
// Negative tests for instructions that are incompatible with movprfx | ||
|
||
movprfx z0.h, p0/z, z7.h | ||
sqneg z0.h, p0/z, z3.h | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov | ||
// CHECK-NEXT: sqneg z0.h, p0/z, z3.h | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
movprfx z0, z7 | ||
sqneg z0.h, p0/z, z3.h | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov | ||
// CHECK-NEXT: sqneg z0.h, p0/z, z3.h | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: |
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,39 @@ | ||
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2p2 < %s \ | ||
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST | ||
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sme2p2 < %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=+sve2p2 < %s \ | ||
// RUN: | llvm-objdump -d --mattr=+sve2p2 - | FileCheck %s --check-prefix=CHECK-INST | ||
// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2p2 < %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=+sve2p2 < %s \ | ||
// RUN: | sed '/.text/d' | sed 's/.*encoding: //g' \ | ||
// RUN: | llvm-mc -triple=aarch64 -mattr=+sve2p2 -disassemble -show-encoding \ | ||
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST | ||
|
||
sqneg z0.b, p0/z, z0.b // 01000100-00001011-10100000-00000000 | ||
// CHECK-INST: sqneg z0.b, p0/z, z0.b | ||
// CHECK-ENCODING: [0x00,0xa0,0x0b,0x44] | ||
// CHECK-ERROR: instruction requires: sme2p2 or sve2p2 | ||
// CHECK-UNKNOWN: 440ba000 <unknown> | ||
|
||
sqneg z23.h, p3/z, z13.h // 01000100-01001011-10101101-10110111 | ||
// CHECK-INST: sqneg z23.h, p3/z, z13.h | ||
// CHECK-ENCODING: [0xb7,0xad,0x4b,0x44] | ||
// CHECK-ERROR: instruction requires: sme2p2 or sve2p2 | ||
// CHECK-UNKNOWN: 444badb7 <unknown> | ||
|
||
sqneg z21.s, p5/z, z10.s // 01000100-10001011-10110101-01010101 | ||
// CHECK-INST: sqneg z21.s, p5/z, z10.s | ||
// CHECK-ENCODING: [0x55,0xb5,0x8b,0x44] | ||
// CHECK-ERROR: instruction requires: sme2p2 or sve2p2 | ||
// CHECK-UNKNOWN: 448bb555 <unknown> | ||
|
||
sqneg z31.d, p7/z, z31.d // 01000100-11001011-10111111-11111111 | ||
// CHECK-INST: sqneg z31.d, p7/z, z31.d | ||
// CHECK-ENCODING: [0xff,0xbf,0xcb,0x44] | ||
// CHECK-ERROR: instruction requires: sme2p2 or sve2p2 | ||
// CHECK-UNKNOWN: 44cbbfff <unknown> |
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,47 @@ | ||
// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2p2 2>&1 < %s| FileCheck %s | ||
|
||
// --------------------------------------------------------------------------// | ||
// Invalid element width | ||
|
||
urecpe z31.b, p7/z, z31.b | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width | ||
// CHECK-NEXT: urecpe z31.b, p7/z, z31.b | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
urecpe z31.h, p7/z, z31.h | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width | ||
// CHECK-NEXT: urecpe z31.h, p7/z, z31.h | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
urecpe z31.s, p7/z, z31.h | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width | ||
// CHECK-NEXT: urecpe z31.s, p7/z, z31.h | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
urecpe z31.d, p7/z, z31.d | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width | ||
// CHECK-NEXT: urecpe z31.d, p7/z, z31.d | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
// ------------------------------------------------------------------------- // | ||
// Invalid predicate | ||
|
||
urecpe z0.s, p8/z, z0.s | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid restricted predicate register, expected p0..p7 (without element suffix) | ||
// CHECK-NEXT: urecpe z0.s, p8/z, z0.s | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
// --------------------------------------------------------------------------// | ||
// Negative tests for instructions that are incompatible with movprfx | ||
|
||
movprfx z0.s, p0/z, z7.s | ||
urecpe z0.s, p0/z, z3.s | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov | ||
// CHECK-NEXT: urecpe z0.s, p0/z, z3.s | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
movprfx z0, z7 | ||
urecpe z0.s, p0/z, z3.s | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov | ||
// CHECK-NEXT: urecpe z0.s, p0/z, z3.s | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: |
Oops, something went wrong.