[PATCH] D108279: [AArch64][SME] Fix v8.6a bf16 NEON instruction predication
Cullen Rhodes via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 24 01:37:32 PDT 2021
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGe9c8973f1c68: [AArch64][SME] Fix v8.6a bf16 NEON instruction predication (authored by c-rhodes).
Changed prior to commit:
https://reviews.llvm.org/D108279?vs=367144&id=368301#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D108279/new/
https://reviews.llvm.org/D108279
Files:
llvm/lib/Target/AArch64/AArch64InstrInfo.td
llvm/test/MC/AArch64/SME/streaming-mode-neon-bf16.s
llvm/test/MC/AArch64/SME/streaming-mode-neon-negative.s
Index: llvm/test/MC/AArch64/SME/streaming-mode-neon-negative.s
===================================================================
--- llvm/test/MC/AArch64/SME/streaming-mode-neon-negative.s
+++ llvm/test/MC/AArch64/SME/streaming-mode-neon-negative.s
@@ -1,4 +1,4 @@
-// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+streaming-sve 2>&1 < %s| FileCheck %s
+// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+streaming-sve,+bf16 2>&1 < %s| FileCheck %s
// ------------------------------------------------------------------------- //
// Check FABD is illegal in streaming mode
@@ -7,3 +7,11 @@
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction requires: neon
// CHECK-NEXT: fabd s0, s1, s2
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
+
+// ------------------------------------------------------------------------- //
+// Check non-scalar v8.6a BFloat16 instructions are illegal in streaming mode
+
+bfcvtn v5.4h, v5.4s
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction requires: neon
+// CHECK-NEXT: bfcvtn v5.4h, v5.4s
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
Index: llvm/test/MC/AArch64/SME/streaming-mode-neon-bf16.s
===================================================================
--- /dev/null
+++ llvm/test/MC/AArch64/SME/streaming-mode-neon-bf16.s
@@ -0,0 +1,16 @@
+// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+streaming-sve,+bf16 < %s \
+// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
+// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=-neon < %s 2>&1 \
+// RUN: | FileCheck %s --check-prefix=CHECK-ERROR
+// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+streaming-sve,+bf16 < %s \
+// RUN: | llvm-objdump --mattr=+bf16 -d - | FileCheck %s --check-prefix=CHECK-INST
+// Disassemble encoding and check the re-encoding (-show-encoding) matches.
+// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+streaming-sve,+bf16 < %s \
+// RUN: | sed '/.text/d' | sed 's/.*encoding: //g' \
+// RUN: | llvm-mc -triple=aarch64 -mattr=+streaming-sve,+bf16 -disassemble -show-encoding \
+// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
+
+bfcvt h5, s3
+// CHECK-INST: bfcvt h5, s3
+// CHECK-ENCODING: [0x65,0x40,0x63,0x1e]
+// CHECK-ERROR: instruction requires: bf16
Index: llvm/lib/Target/AArch64/AArch64InstrInfo.td
===================================================================
--- llvm/lib/Target/AArch64/AArch64InstrInfo.td
+++ llvm/lib/Target/AArch64/AArch64InstrInfo.td
@@ -873,7 +873,7 @@
}
// ARMv8.6-A BFloat
-let Predicates = [HasBF16] in {
+let Predicates = [HasNEON, HasBF16] in {
defm BFDOT : SIMDThreeSameVectorBFDot<1, "bfdot">;
defm BF16DOTlane : SIMDThreeSameVectorBF16DotI<0, "bfdot">;
def BFMMLA : SIMDThreeSameVectorBF16MatrixMul<"bfmmla">;
@@ -883,7 +883,6 @@
def BFMLALTIdx : SIMDBF16MLALIndex<1, "bfmlalt", int_aarch64_neon_bfmlalt>;
def BFCVTN : SIMD_BFCVTN;
def BFCVTN2 : SIMD_BFCVTN2;
-def BFCVT : BF16ToSinglePrecision<"bfcvt">;
// Vector-scalar BFDOT:
// The second source operand of the 64-bit variant of BF16DOTlane is a 128-bit
@@ -903,6 +902,10 @@
VectorIndexS:$idx)>;
}
+let Predicates = [HasNEONorStreamingSVE, HasBF16] in {
+def BFCVT : BF16ToSinglePrecision<"bfcvt">;
+}
+
// ARMv8.6A AArch64 matrix multiplication
let Predicates = [HasMatMulInt8] in {
def SMMLA : SIMDThreeSameVectorMatMul<0, 0, "smmla", int_aarch64_neon_smmla>;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108279.368301.patch
Type: text/x-patch
Size: 3476 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210824/ad7fa9c5/attachment.bin>
More information about the llvm-commits
mailing list