[PATCH] D82178: [AArch64][SVE] Guard svbfloat16_t with feature macro in ACLE
Cullen Rhodes via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Jun 19 08:38:51 PDT 2020
c-rhodes updated this revision to Diff 272091.
c-rhodes added a comment.
Changes:
- Include `arm_bf16.h` if `__ARM_FEATURE_BF16_SCALAR_ARITHMETIC` is defined.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D82178/new/
https://reviews.llvm.org/D82178
Files:
clang/include/clang/Basic/arm_sve.td
clang/test/CodeGen/aarch64-sve-intrinsics/acle_sve_ld1ro-bfloat.c
clang/utils/TableGen/SveEmitter.cpp
Index: clang/utils/TableGen/SveEmitter.cpp
===================================================================
--- clang/utils/TableGen/SveEmitter.cpp
+++ clang/utils/TableGen/SveEmitter.cpp
@@ -1085,10 +1085,20 @@
OS << "typedef __SVUint16_t svuint16_t;\n";
OS << "typedef __SVUint32_t svuint32_t;\n";
OS << "typedef __SVUint64_t svuint64_t;\n";
- OS << "typedef __SVFloat16_t svfloat16_t;\n";
- OS << "typedef __SVBFloat16_t svbfloat16_t;\n\n";
+ OS << "typedef __SVFloat16_t svfloat16_t;\n\n";
- OS << "#ifdef __ARM_FEATURE_BF16_SCALAR_ARITHMETIC\n";
+ OS << "#if defined(__ARM_FEATURE_SVE_BF16) && "
+ "!defined(__ARM_FEATURE_BF16_SCALAR_ARITHMETIC)\n";
+ OS << "#error \"__ARM_FEATURE_BF16_SCALAR_ARITHMETIC must be defined when "
+ "__ARM_FEATURE_SVE_BF16 is defined\"\n";
+ OS << "#endif\n\n";
+
+ OS << "#if defined(__ARM_FEATURE_SVE_BF16)\n";
+ OS << "typedef __SVBFloat16_t svbfloat16_t;\n";
+ OS << "#endif\n\n";
+
+ OS << "#if defined(__ARM_FEATURE_BF16_SCALAR_ARITHMETIC)\n";
+ OS << "#include <arm_bf16.h>\n";
OS << "typedef __bf16 bfloat16_t;\n";
OS << "#endif\n\n";
Index: clang/test/CodeGen/aarch64-sve-intrinsics/acle_sve_ld1ro-bfloat.c
===================================================================
--- clang/test/CodeGen/aarch64-sve-intrinsics/acle_sve_ld1ro-bfloat.c
+++ clang/test/CodeGen/aarch64-sve-intrinsics/acle_sve_ld1ro-bfloat.c
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -D__ARM_FEATURE_SVE_MATMUL_FP64 -D__ARM_FEATURE_BF16_SCALAR_ARITHMETIC -D__ARM_FEATURE_SVE -triple aarch64-none-linux-gnu -target-feature +sve -target-feature +bf16 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
-// RUN: %clang_cc1 -D__ARM_FEATURE_SVE_MATMUL_FP64 -D__ARM_FEATURE_BF16_SCALAR_ARITHMETIC -D__ARM_FEATURE_SVE -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve -target-feature +bf16 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE_MATMUL_FP64 -D__ARM_FEATURE_SVE_BF16 -D__ARM_FEATURE_BF16_SCALAR_ARITHMETIC -D__ARM_FEATURE_SVE -triple aarch64-none-linux-gnu -target-feature +sve -target-feature +bf16 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE_MATMUL_FP64 -D__ARM_FEATURE_SVE_BF16 -D__ARM_FEATURE_BF16_SCALAR_ARITHMETIC -D__ARM_FEATURE_SVE -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve -target-feature +bf16 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
#include <arm_sve.h>
Index: clang/include/clang/Basic/arm_sve.td
===================================================================
--- clang/include/clang/Basic/arm_sve.td
+++ clang/include/clang/Basic/arm_sve.td
@@ -484,8 +484,8 @@
let ArchGuard = "defined(__ARM_FEATURE_SVE_MATMUL_FP64)" in {
def SVLD1RO : SInst<"svld1ro[_{2}]", "dPc", "csilUcUsUiUlhfd", MergeNone, "aarch64_sve_ld1ro">;
}
-let ArchGuard = "defined(__ARM_FEATURE_SVE_MATMUL_FP64) && defined(__ARM_FEATURE_BF16_SCALAR_ARITHMETIC)" in {
- def SVLD1RO_BF : SInst<"svld1ro[_{2}]", "dPc", "b", MergeNone, "aarch64_sve_ld1ro">;
+let ArchGuard = "defined(__ARM_FEATURE_SVE_MATMUL_FP64) && defined(__ARM_FEATURE_SVE_BF16)" in {
+ def SVLD1RO_BF16 : SInst<"svld1ro[_{2}]", "dPc", "b", MergeNone, "aarch64_sve_ld1ro">;
}
////////////////////////////////////////////////////////////////////////////////
// Stores
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D82178.272091.patch
Type: text/x-patch
Size: 3509 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200619/0b930130/attachment-0001.bin>
More information about the cfe-commits
mailing list