[all-commits] [llvm/llvm-project] 6cac7c: [AArch64] Alter arm_sve.h to be target-based, not ...

David Green via All-commits all-commits at lists.llvm.org
Wed Jan 4 03:22:36 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6cac7c285e69f9a3fc96e25453c246d218bd349f
      https://github.com/llvm/llvm-project/commit/6cac7c285e69f9a3fc96e25453c246d218bd349f
  Author: David Green <david.green at arm.com>
  Date:   2023-01-04 (Wed, 04 Jan 2023)

  Changed paths:
    M clang/include/clang/Basic/BuiltinsSVE.def
    M clang/include/clang/Basic/arm_sve.td
    M clang/lib/Basic/Targets/AArch64.cpp
    M clang/test/Sema/aarch64-sve-intrinsics/acle_sve_bfloat.cpp
    A clang/test/Sema/aarch64-sve-intrinsics/acle_sve_target.cpp
    M clang/test/Sema/aarch64-sve2-intrinsics/acle_sve2.cpp
    M clang/test/Sema/aarch64-sve2-intrinsics/acle_sve2_aes_bitperm_sha3_sm4.cpp
    M clang/test/Sema/aarch64-sve2-intrinsics/acle_sve2_bfloat.cpp
    M clang/utils/TableGen/SveEmitter.cpp

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

This patch makes SVE intrinsics more useable by gating them on the
target, not by ifdef preprocessor macros. See #56480. 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
are both 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.

Differential Revision: https://reviews.llvm.org/D131064




More information about the All-commits mailing list