Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change __ARM_NEON_SVE_BRIDGE to refer to the availability of the head…
…er (#362) **Afterthought**: Another way of looking at this is that the user should not expect to be able to use intrinsics after specifying the relevant target features via anything other than the command line, it's unclear to me if this is the case. The ACLE suggests the use of the predefined `__ARM_NEON_SVE_BRIDGE` macro to gaurd the inclusion of `arm_neon_sve_bridge.h`. ><arm_neon_sve_bridge.h> defines intrinsics for moving data between Neon and SVE vector types; see [NEON-SVE Bridge](https://github.com/ARM-software/acle/blob/main/main/acle.md#neon-sve-bridge) for details. Before including the header, you should test the __ARM_NEON_SVE_BRIDGE macro. The current definition of this macro is >`__ARM_NEON_SVE_BRIDGE` is defined to 1 if [NEON-SVE Bridge](#neon-sve-bridge) intrinsics are available. This implies that the following macros are nonzero > - __ARM_NEON > - __ARM_NEON_FP > - __ARM_FEATURE_SVE The intrinsics described here are not preprocessor guarded (See [change for LLVM]( https://reviews.llvm.org/D132639)). We should expect to be able to use them in any function with the necessary features, whether they are supplied globally on the command line or via a `target` attribute. However, since we cannot make assumptions about the order in which the predefined feature macros are evaluated (see [relevant ACLE](https://github.com/ARM-software/acle/blob/main/main/acle.md#predefined-feature-macros-and-header-file)), we cannot use the `__ARM_NEON_SVE_BRIDGE` macro to guard the inclusion of `arm_neon_sve_bridge.h` **and** expect to use it's builtins in unless the required features are supplied globally on the command line. See an example of this issue (in LLVM Vs. GCC) from @georges-arm - https://godbolt.org/z/6YPvqdjTv. The proposal of this PR is to change the meaning of `__ARM_NEON_SVE_BRIDGE` to refer to the availability of the `arm_neon_sve_bridge.h` header file only, such that it can be unconditionally defined in supporting compilers and it's builtins can be safely used in the context of the example above.
- Loading branch information