[PATCH] D131064: [AArch64] Alter arm_sve.h to be target-based, not preprocessor based.

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 3 03:58:14 PDT 2022


dmgreen created this revision.
dmgreen added reviewers: sdesmalen, simon_tatham, stuij, efriedma.
Herald added subscribers: ctetreau, kristof.beyls, tschuett.
Herald added a project: All.
dmgreen requested review of this revision.

We would like to make the ACLE NEON and SVE intrinsics more useable by gating them on the target, not by ifdef preprocessor macros. See #56480.  The arm_neon.h file is quite complex to change, so this patch begins with arm_sve.h. This alters the SVEEmitter for arm_sve.h to remove the #ifdef guards and instead use TARGET_BUILTIN with the correct features so that the existing `'func' needs target feature sve` error will be generated when sve is not present.

The `ArchGuard` containing defines in the SVEEmitter are changed to `TargetGuard` containing target features. In the arm_neon.h emitter there will likely be existing `ArchGuard` ifdefs mixed with new `TargetGuard` target feature guards, so the name is change in the SVE too for consistency. The few functions that are present in arm_sve.h (as opposed to builtin aliases) have `__attribute__((target(\"sve\")))` added. Some of the tests needed to be rejigged a little, as well as updating the error message, as the error now happens at a later point.


https://reviews.llvm.org/D131064

Files:
  clang/include/clang/Basic/TargetBuiltins.h
  clang/include/clang/Basic/arm_sve.td
  clang/lib/Basic/Targets/AArch64.cpp
  clang/test/Sema/aarch64-sve-intrinsics/acle_sve_bfloat.cpp
  clang/test/Sema/aarch64-sve-intrinsics/acle_sve_target.cpp
  clang/test/Sema/aarch64-sve2-intrinsics/acle_sve2.cpp
  clang/test/Sema/aarch64-sve2-intrinsics/acle_sve2_aes_bitperm_sha3_sm4.cpp
  clang/test/Sema/aarch64-sve2-intrinsics/acle_sve2_bfloat.cpp
  clang/utils/TableGen/SveEmitter.cpp



More information about the llvm-commits mailing list