-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[AArch64][Clang] Define __ARM_NEON_SVE_BRIDGE unconditionally #118272
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
Conversation
Your org has enabled the Graphite merge queue for merging into mainAdd the label “FP Bundles” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link. |
@llvm/pr-subscribers-backend-aarch64 @llvm/pr-subscribers-clang Author: None (SpencerAbson) ChangesThe meaning of Such that it should be defined to Full diff: https://github.com/llvm/llvm-project/pull/118272.diff 4 Files Affected:
diff --git a/clang/lib/Basic/Targets/AArch64.cpp b/clang/lib/Basic/Targets/AArch64.cpp
index 4efc1841c836d0..b7d374c67f33ef 100644
--- a/clang/lib/Basic/Targets/AArch64.cpp
+++ b/clang/lib/Basic/Targets/AArch64.cpp
@@ -447,6 +447,9 @@ void AArch64TargetInfo::getTargetDefines(const LangOptions &Opts,
Builder.defineMacro("__ARM_FP16_FORMAT_IEEE", "1");
Builder.defineMacro("__ARM_FP16_ARGS", "1");
+ // Clang supports arm_neon_sve_bridge.h
+ Builder.defineMacro("__ARM_NEON_SVE_BRIDGE", "1");
+
if (Opts.UnsafeFPMath)
Builder.defineMacro("__ARM_FP_FAST", "1");
@@ -464,9 +467,6 @@ void AArch64TargetInfo::getTargetDefines(const LangOptions &Opts,
if (FPU & SveMode)
Builder.defineMacro("__ARM_FEATURE_SVE", "1");
- if ((FPU & NeonMode) && (FPU & SveMode))
- Builder.defineMacro("__ARM_NEON_SVE_BRIDGE", "1");
-
if (HasSVE2)
Builder.defineMacro("__ARM_FEATURE_SVE2", "1");
diff --git a/clang/test/Preprocessor/aarch64-target-features.c b/clang/test/Preprocessor/aarch64-target-features.c
index 037a3e186ee559..86265f630296c3 100644
--- a/clang/test/Preprocessor/aarch64-target-features.c
+++ b/clang/test/Preprocessor/aarch64-target-features.c
@@ -39,6 +39,7 @@
// CHECK-NOT: __ARM_FP_FAST 1
// CHECK: __ARM_NEON 1
// CHECK: __ARM_NEON_FP 0xE
+// CHECK: __ARM_NEON_SVE_BRIDGE 1
// CHECK: __ARM_PCS_AAPCS64 1
// CHECK-NOT: __ARM_PCS 1
// CHECK-NOT: __ARM_PCS_VFP 1
diff --git a/clang/test/Preprocessor/init-aarch64.c b/clang/test/Preprocessor/init-aarch64.c
index 8ee6c6ba60af43..3d2f4b83abcb88 100644
--- a/clang/test/Preprocessor/init-aarch64.c
+++ b/clang/test/Preprocessor/init-aarch64.c
@@ -30,6 +30,7 @@
// AARCH64-NEXT: #define __ARM_FP 0xE
// AARCH64-NEXT: #define __ARM_FP16_ARGS 1
// AARCH64-NEXT: #define __ARM_FP16_FORMAT_IEEE 1
+// AARCH64-NEXT: #define __ARM_NEON_SVE_BRIDGE 1
// AARCH64-NEXT: #define __ARM_PCS_AAPCS64 1
// AARCH64-NEXT: #define __ARM_SIZEOF_MINIMAL_ENUM 4
// AARCH64-NEXT: #define __ARM_SIZEOF_WCHAR_T 4
diff --git a/clang/test/Sema/aarch64-sve-intrinsics/acle_neon_sve_bridge.cpp b/clang/test/Sema/aarch64-sve-intrinsics/acle_neon_sve_bridge.cpp
new file mode 100644
index 00000000000000..a3f3764939156f
--- /dev/null
+++ b/clang/test/Sema/aarch64-sve-intrinsics/acle_neon_sve_bridge.cpp
@@ -0,0 +1,15 @@
+// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -verify -emit-llvm -o - %s
+// REQUIRES: aarch64-registered-target
+
+// Test that we can use __ARM_NEON_SVE_BRIDGE to guard to inclusion of arm_neon_sve_bridge.h,
+// and use the associated intrinsics via a target() attribute.
+
+// expected-no-diagnostics
+
+#ifdef __ARM_NEON_SVE_BRIDGE
+#include <arm_neon_sve_bridge.h>
+#endif
+
+uint32x4_t __attribute__((target("+sve"))) foo(svuint32_t a) {
+ return svget_neonq_u32(a);
+}
\ No newline at end of file
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/30/builds/11544 Here is the relevant piece of the build log for the reference
|
The meaning of
__ARM_NEON_SVE_BRIDGE
was changed here:ARM-software/acle#362
Such that it should be defined to
1
if thearm_neon_sve_bridge.h
header file is available, which is the case for Clang.