[all-commits] [llvm/llvm-project] 5fba4c: [AArch64] Don't #define __ARM_FP when there's no FPU.

Simon Tatham via All-commits all-commits at lists.llvm.org
Mon Mar 13 09:43:39 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5fba4c4d08bdb38d0df2fd43afa4bec4f3809b66
      https://github.com/llvm/llvm-project/commit/5fba4c4d08bdb38d0df2fd43afa4bec4f3809b66
  Author: Simon Tatham <simon.tatham at arm.com>
  Date:   2023-03-13 (Mon, 13 Mar 2023)

  Changed paths:
    M clang/lib/Basic/Targets/AArch64.cpp
    M clang/lib/Basic/Targets/AArch64.h
    M clang/test/Preprocessor/aarch64-target-features.c

  Log Message:
  -----------
  [AArch64] Don't #define __ARM_FP when there's no FPU.

On some R-profile CPUs, leaving out the FPU is an option. Clang will
accept `-march=armv8-r+nofp`, but it's currently not possible to find
out via the preprocessor whether it's in that mode (e.g. to change or
disable inline asm statements in your code).

The __ARM_FP macro, which has a bit set for each size of floating
point number supported by the hardware, is the natural thing to test.
But Clang was defining it unconditionally on AArch64. Now it checks
for FP support before defining it at all.

Reviewed By: tmatheson, DavidSpickett

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




More information about the All-commits mailing list