-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[LLVM][AARCH64] Add assembly/disassembly of zeroing convert instructions #113292
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
Merged
Changes from all commits
Commits
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
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
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
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,52 @@ | ||
// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2p2 2>&1 < %s| FileCheck %s | ||
|
||
// --------------------------------------------------------------------------// | ||
// Invalid element width | ||
|
||
bfcvtnt z0.s, p0/z, z1.s | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width | ||
// CHECK-NEXT: bfcvtnt z0.s, p0/z, z1.s | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
bfcvtnt z0.d, p0/z, z1.d | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width | ||
// CHECK-NEXT: bfcvtnt z0.d, p0/z, z1.d | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
bfcvtnt z0.h, p0/z, z1.h | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width | ||
// CHECK-NEXT: bfcvtnt z0.h, p0/z, z1.h | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
bfcvtnt z0.h, p0/z, z1.d | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width | ||
// CHECK-NEXT: bfcvtnt z0.h, p0/z, z1.d | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
bfcvtnt z0.h, p0/z, z1.q | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width | ||
// CHECK-NEXT: bfcvtnt z0.h, p0/z, z1.q | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}} | ||
|
||
// --------------------------------------------------------------------------// | ||
// Predicate not in restricted predicate range | ||
|
||
bfcvtnt z0.h, p8/z, z1.s | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid restricted predicate register, expected p0..p7 (without element suffix) | ||
// CHECK-NEXT: bfcvtnt z0.h, p8/z, z1.s | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
// --------------------------------------------------------------------------// | ||
// Negative tests for instructions that are incompatible with movprfx | ||
|
||
movprfx z0.h, p0/m, z7.h | ||
bfcvtnt z0.h, p0/z, z1.s | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov | ||
// CHECK-NEXT: bfcvtnt z0.h, p0/z, z1.s | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
movprfx z0, z7 | ||
bfcvtnt z0.h, p0/z, z1.s | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov | ||
// CHECK-NEXT: bfcvtnt z0.h, p0/z, z1.s | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: |
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,33 @@ | ||
// 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 | ||
|
||
bfcvtnt z0.h, p0/z, z0.s // 01100100-10000010-10100000-00000000 | ||
// CHECK-INST: bfcvtnt z0.h, p0/z, z0.s | ||
// CHECK-ENCODING: [0x00,0xa0,0x82,0x64] | ||
// CHECK-ERROR: instruction requires: sme2p2 or sve2p2 | ||
// CHECK-UNKNOWN: 6482a000 <unknown> | ||
|
||
bfcvtnt z23.h, p3/z, z13.s // 01100100-10000010-10101101-10110111 | ||
// CHECK-INST: bfcvtnt z23.h, p3/z, z13.s | ||
// CHECK-ENCODING: [0xb7,0xad,0x82,0x64] | ||
// CHECK-ERROR: instruction requires: sme2p2 or sve2p2 | ||
// CHECK-UNKNOWN: 6482adb7 <unknown> | ||
|
||
bfcvtnt z31.h, p7/z, z31.s // 01100100-10000010-10111111-11111111 | ||
// CHECK-INST: bfcvtnt z31.h, p7/z, z31.s | ||
// CHECK-ENCODING: [0xff,0xbf,0x82,0x64] | ||
// CHECK-ERROR: instruction requires: sme2p2 or sve2p2 | ||
// CHECK-UNKNOWN: 6482bfff <unknown> |
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,7 @@ | ||
// RUN: not llvm-mc -triple aarch64 -filetype asm -o - %s 2>&1 | FileCheck %s | ||
|
||
.arch armv9-a+sve2p2 | ||
.arch armv9-a+nosve2p2 | ||
bfcvtnt z23.h, p3/z, z13.s | ||
// CHECK: error: instruction requires: sme2p2 or sve2p2 | ||
// CHECK-NEXT: bfcvtnt z23.h, p3/z, z13.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,5 @@ | ||
// RUN: llvm-mc -triple aarch64 -filetype asm -o - %s 2>&1 | FileCheck %s | ||
|
||
.arch armv9-a+sve2p2 | ||
bfcvtnt z23.h, p3/z, z13.s | ||
// CHECK: bfcvtnt z23.h, p3/z, z13.s |
7 changes: 7 additions & 0 deletions
7
llvm/test/MC/AArch64/SVE2p2/directive-arch_extension-negative.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,7 @@ | ||
// RUN: not llvm-mc -triple aarch64 -filetype asm -o - %s 2>&1 | FileCheck %s | ||
|
||
.arch_extension sve2p2 | ||
.arch_extension nosve2p2 | ||
bfcvtnt z0.h, p0/z, z0.s | ||
// CHECK: error: instruction requires: sme2p2 or sve2p2 | ||
// CHECK-NEXT: bfcvtnt z0.h, p0/z, z0.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,5 @@ | ||
// RUN: llvm-mc -triple aarch64 -filetype asm -o - %s 2>&1 | FileCheck %s | ||
|
||
.arch_extension sve2p2 | ||
bfcvtnt z0.h, p0/z, z0.s | ||
// CHECK: bfcvtnt z0.h, p0/z, z0.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,7 @@ | ||
// RUN: not llvm-mc -triple aarch64 -filetype asm -o - %s 2>&1 | FileCheck %s | ||
|
||
.cpu generic+sve2p2 | ||
.cpu generic+nosve2p2 | ||
fcvtnt z0.s, p0/z, z0.d | ||
// CHECK: error: instruction requires: sme2p2 or sve2p2 | ||
// CHECK-NEXT: fcvtnt z0.s, p0/z, z0.d |
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,5 @@ | ||
// RUN: llvm-mc -triple aarch64 -filetype asm -o - %s 2>&1 | FileCheck %s | ||
|
||
.cpu generic+sve2p2 | ||
fcvtnt z0.s, p0/z, z0.d | ||
// CHECK: fcvtnt z0.s, p0/z, z0.d |
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,57 @@ | ||
// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2p2 2>&1 < %s| FileCheck %s | ||
|
||
// --------------------------------------------------------------------------// | ||
// Invalid element width | ||
|
||
fcvtlt z0.b, p0/z, z0.b | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width | ||
// CHECK-NEXT: fcvtlt z0.b, p0/z, z0.b | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
fcvtlt z0.h, p0/z, z0.h | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width | ||
// CHECK-NEXT: fcvtlt z0.h, p0/z, z0.h | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
fcvtlt z0.s, p0/z, z0.s | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width | ||
// CHECK-NEXT: fcvtlt z0.s, p0/z, z0.s | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
fcvtlt z0.d, p0/z, z0.d | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width | ||
// CHECK-NEXT: fcvtlt z0.d, p0/z, z0.d | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
fcvtlt z0.h, p0/z, z0.b | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width | ||
// CHECK-NEXT: fcvtlt z0.h, p0/z, z0.b | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
fcvtlt z0.q, p0/z, z0.d | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width | ||
// CHECK-NEXT: fcvtlt z0.q, p0/z, z0.d | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
// --------------------------------------------------------------------------// | ||
// Predicate not in restricted predicate range | ||
|
||
fcvtlt z0.s, p8/z, z0.h | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid restricted predicate register, expected p0..p7 (without element suffix) | ||
// CHECK-NEXT: fcvtlt z0.s, p8/z, z0.h | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
// --------------------------------------------------------------------------// | ||
// Negative tests for instructions that are incompatible with movprfx | ||
|
||
movprfx z0.s, p0/z, z7.s | ||
fcvtlt z0.s, p7/z, z1.h | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov | ||
// CHECK-NEXT: fcvtlt z0.s, p7/z, z1.h | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
movprfx z0, z7 | ||
fcvtlt z0.s, p7/z, z1.h | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov | ||
// CHECK-NEXT: fcvtlt z0.s, p7/z, z1.h | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: |
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,33 @@ | ||
// 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 | ||
|
||
fcvtlt z0.d, p0/z, z0.s // 01100100-11000011-10100000-00000000 | ||
// CHECK-INST: fcvtlt z0.d, p0/z, z0.s | ||
// CHECK-ENCODING: [0x00,0xa0,0xc3,0x64] | ||
// CHECK-ERROR: instruction requires: sme2p2 or sve2p2 | ||
// CHECK-UNKNOWN: 64c3a000 <unknown> | ||
|
||
fcvtlt z23.d, p3/z, z13.s // 01100100-11000011-10101101-10110111 | ||
// CHECK-INST: fcvtlt z23.d, p3/z, z13.s | ||
// CHECK-ENCODING: [0xb7,0xad,0xc3,0x64] | ||
// CHECK-ERROR: instruction requires: sme2p2 or sve2p2 | ||
// CHECK-UNKNOWN: 64c3adb7 <unknown> | ||
|
||
fcvtlt z31.s, p7/z, z31.h // 01100100-10000001-10111111-11111111 | ||
// CHECK-INST: fcvtlt z31.s, p7/z, z31.h | ||
// CHECK-ENCODING: [0xff,0xbf,0x81,0x64] | ||
// CHECK-ERROR: instruction requires: sme2p2 or sve2p2 | ||
// CHECK-UNKNOWN: 6481bfff <unknown> |
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,56 @@ | ||
// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2p2 2>&1 < %s| FileCheck %s | ||
|
||
// --------------------------------------------------------------------------// | ||
// Invalid element width | ||
|
||
fcvtnt z0.h, p0/z, z0.h | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width | ||
// CHECK-NEXT: fcvtnt z0.h, p0/z, z0.h | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
fcvtnt z0.s, p0/z, z0.s | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width | ||
// CHECK-NEXT: fcvtnt z0.s, p0/z, z0.s | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
fcvtnt z0.d, p0/z, z0.q | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width | ||
// CHECK-NEXT: fcvtnt z0.d, p0/z, z0.q | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
// --------------------------------------------------------------------------// | ||
// Invalid operand for instruction | ||
|
||
fcvtnt z0.b, p0/z, z0.h | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction | ||
// CHECK-NEXT: fcvtnt z0.b, p0/z, z0.h | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
fcvtnt z0.b, p0/z, z0.b | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction | ||
// CHECK-NEXT: fcvtnt z0.b, p0/z, z0.b | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
// --------------------------------------------------------------------------// | ||
// Predicate not in restricted predicate range | ||
|
||
fcvtnt z0.h, p8/z, z0.s | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid restricted predicate register, expected p0..p7 (without element suffix) | ||
// CHECK-NEXT: fcvtnt z0.h, 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 | ||
fcvtnt z0.s, p7/z, z1.d | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov | ||
// CHECK-NEXT: fcvtnt z0.s, p7/z, z1.d | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
||
movprfx z0, z7 | ||
fcvtnt z0.s, p7/z, z1.d | ||
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov | ||
// CHECK-NEXT: fcvtnt z0.s, p7/z, z1.d | ||
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: | ||
|
Oops, something went wrong.
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.