-
Notifications
You must be signed in to change notification settings - Fork 12.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AArch64] Assembler support for the ARMv8.2a dot product instructions
Dot product is an optional ARMv8.2a extension, see also the public architecture specification here: https://developer.arm.com/products/architecture/a-profile/exploration-tools. This patch adds AArch64 assembler support for these dot product instructions. Differential Revision: https://reviews.llvm.org/D36515 llvm-svn: 310480
- Loading branch information
Sjoerd Meijer
committed
Aug 9, 2017
1 parent
b9d1172
commit 7987633
Showing
11 changed files
with
158 additions
and
27 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
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,12 @@ | ||
// RUN: not llvm-mc -triple aarch64 -mattr=+dotprod -show-encoding < %s 2> %t | ||
// RUN: FileCheck --check-prefix=CHECK-ERROR < %t %s | ||
|
||
udot v0.2s, v1.8b, v2.4b[4] | ||
sdot v0.2s, v1.8b, v2.4b[4] | ||
udot v0.4s, v1.16b, v2.4b[4] | ||
sdot v0.4s, v1.16b, v2.4b[4] | ||
|
||
// CHECK-ERROR: vector lane must be an integer in range [0, 3] | ||
// CHECK-ERROR: vector lane must be an integer in range [0, 3] | ||
// CHECK-ERROR: vector lane must be an integer in range [0, 3] | ||
// CHECK-ERROR: vector lane must be an integer in range [0, 3] |
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,60 @@ | ||
// RUN: llvm-mc -triple aarch64 -mattr=+dotprod -show-encoding < %s | FileCheck %s --check-prefix=CHECK-DOTPROD | ||
// RUN: not llvm-mc -triple aarch64 -mattr=+v8.2a -show-encoding < %s 2> %t | ||
// RUN: FileCheck --check-prefix=CHECK-NO-DOTPROD < %t %s | ||
|
||
udot v0.2s, v1.8b, v2.8b | ||
sdot v0.2s, v1.8b, v2.8b | ||
udot v0.4s, v1.16b, v2.16b | ||
sdot v0.4s, v1.16b, v2.16b | ||
udot v0.2s, v1.8b, v2.4b[0] | ||
sdot v0.2s, v1.8b, v2.4b[1] | ||
udot v0.4s, v1.16b, v2.4b[2] | ||
sdot v0.4s, v1.16b, v2.4b[3] | ||
|
||
// Check that the upper case types are aliases | ||
udot v0.2S, v1.8B, v2.4B[0] | ||
udot v0.4S, v1.16B, v2.4B[2] | ||
|
||
// CHECK-DOTPROD: udot v0.2s, v1.8b, v2.8b // encoding: [0x20,0x94,0x82,0x2e] | ||
// CHECK-DOTPROD: sdot v0.2s, v1.8b, v2.8b // encoding: [0x20,0x94,0x82,0x0e] | ||
// CHECK-DOTPROD: udot v0.4s, v1.16b, v2.16b // encoding: [0x20,0x94,0x82,0x6e] | ||
// CHECK-DOTPROD: sdot v0.4s, v1.16b, v2.16b // encoding: [0x20,0x94,0x82,0x4e] | ||
// CHECK-DOTPROD: udot v0.2s, v1.8b, v2.4b[0] // encoding: [0x20,0xe0,0x82,0x2f] | ||
// CHECK-DOTPROD: sdot v0.2s, v1.8b, v2.4b[1] // encoding: [0x20,0xe0,0xa2,0x0f] | ||
// CHECK-DOTPROD: udot v0.4s, v1.16b, v2.4b[2] // encoding: [0x20,0xe8,0x82,0x6f] | ||
// CHECK-DOTPROD: sdot v0.4s, v1.16b, v2.4b[3] // encoding: [0x20,0xe8,0xa2,0x4f] | ||
|
||
// CHECK-DOTPROD: udot v0.2s, v1.8b, v2.4b[0] // encoding: [0x20,0xe0,0x82,0x2f] | ||
// CHECK-DOTPROD: udot v0.4s, v1.16b, v2.4b[2] // encoding: [0x20,0xe8,0x82,0x6f] | ||
|
||
// CHECK-NO-DOTPROD: error: instruction requires: dotprod | ||
// CHECK-NO-DOTPROD: udot v0.2s, v1.8b, v2.8b | ||
// CHECK-NO-DOTPROD: ^ | ||
// CHECK-NO-DOTPROD: error: instruction requires: dotprod | ||
// CHECK-NO-DOTPROD: sdot v0.2s, v1.8b, v2.8b | ||
// CHECK-NO-DOTPROD: ^ | ||
// CHECK-NO-DOTPROD: error: instruction requires: dotprod | ||
// CHECK-NO-DOTPROD: udot v0.4s, v1.16b, v2.16b | ||
// CHECK-NO-DOTPROD: ^ | ||
// CHECK-NO-DOTPROD: error: instruction requires: dotprod | ||
// CHECK-NO-DOTPROD: sdot v0.4s, v1.16b, v2.16b | ||
// CHECK-NO-DOTPROD: ^ | ||
// CHECK-NO-DOTPROD: error: instruction requires: dotprod | ||
// CHECK-NO-DOTPROD: udot v0.2s, v1.8b, v2.4b[0] | ||
// CHECK-NO-DOTPROD: ^ | ||
// CHECK-NO-DOTPROD: error: instruction requires: dotprod | ||
// CHECK-NO-DOTPROD: sdot v0.2s, v1.8b, v2.4b[1] | ||
// CHECK-NO-DOTPROD: ^ | ||
// CHECK-NO-DOTPROD: error: instruction requires: dotprod | ||
// CHECK-NO-DOTPROD: udot v0.4s, v1.16b, v2.4b[2] | ||
// CHECK-NO-DOTPROD: ^ | ||
// CHECK-NO-DOTPROD: error: instruction requires: dotprod | ||
// CHECK-NO-DOTPROD: sdot v0.4s, v1.16b, v2.4b[3] | ||
// CHECK-NO-DOTPROD: ^ | ||
|
||
// CHECK-NO-DOTPROD: error: instruction requires: dotprod | ||
// CHECK-NO-DOTPROD: udot v0.2S, v1.8B, v2.4B[0] | ||
// CHECK-NO-DOTPROD: ^ | ||
// CHECK-NO-DOTPROD: error: instruction requires: dotprod | ||
// CHECK-NO-DOTPROD: udot v0.4S, v1.16B, v2.4B[2] | ||
// CHECK-NO-DOTPROD: ^ |
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,29 @@ | ||
# RUN: llvm-mc -triple aarch64-none-linux-gnu -mattr=+dotprod --disassemble < %s | FileCheck %s | ||
# RUN: llvm-mc -triple aarch64-none-linux-gnu -mattr=-dotprod --disassemble < %s 2>&1 | FileCheck %s --check-prefix=CHECK-ERROR | ||
|
||
0x20,0x94,0x82,0x2e | ||
0x20,0x94,0x82,0x0e | ||
0x20,0x94,0x82,0x6e | ||
0x20,0x94,0x82,0x4e | ||
0x20,0xe0,0x82,0x2f | ||
0x20,0xe0,0xa2,0x0f | ||
0x20,0xe8,0x82,0x6f | ||
0x20,0xe8,0xa2,0x4f | ||
|
||
#CHECK: udot v0.2s, v1.8b, v2.8b | ||
#CHECK: sdot v0.2s, v1.8b, v2.8b | ||
#CHECK: udot v0.4s, v1.16b, v2.16b | ||
#CHECK: sdot v0.4s, v1.16b, v2.16b | ||
#CHECK: udot v0.2s, v1.8b, v2.4b[0] | ||
#CHECK: sdot v0.2s, v1.8b, v2.4b[1] | ||
#CHECK: udot v0.4s, v1.16b, v2.4b[2] | ||
#CHECK: sdot v0.4s, v1.16b, v2.4b[3] | ||
|
||
# CHECK-ERROR: invalid instruction encoding | ||
# CHECK-ERROR: invalid instruction encoding | ||
# CHECK-ERROR: invalid instruction encoding | ||
# CHECK-ERROR: invalid instruction encoding | ||
# CHECK-ERROR: invalid instruction encoding | ||
# CHECK-ERROR: invalid instruction encoding | ||
# CHECK-ERROR: invalid instruction encoding | ||
# CHECK-ERROR: invalid instruction encoding |