[all-commits] [llvm/llvm-project] 0f031d: [libc] Initial support for darwin-aarch64.

lntue via All-commits all-commits at lists.llvm.org
Thu Mar 10 06:26:47 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0f031daea8fc01ce44766f07b0f4c626ef28f8f5
      https://github.com/llvm/llvm-project/commit/0f031daea8fc01ce44766f07b0f4c626ef28f8f5
  Author: Tue Ly <lntue at google.com>
  Date:   2022-03-10 (Thu, 10 Mar 2022)

  Changed paths:
    A libc/config/darwin/arm/entrypoints.txt
    A libc/config/darwin/arm/headers.txt
    M libc/src/__support/FPUtil/FEnvImpl.h
    M libc/src/__support/FPUtil/NearestIntegerOperations.h
    M libc/src/__support/FPUtil/aarch64/FEnvImpl.h
    A libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h
    M libc/src/__support/common.h
    M libc/src/__support/str_to_float.h
    M libc/test/src/fenv/CMakeLists.txt
    M libc/test/src/math/RoundToIntegerTest.h
    M libc/test/src/stdlib/strtold_test.cpp

  Log Message:
  -----------
  [libc] Initial support for darwin-aarch64.

Add initial support for darwin-aarch64 (macOS M1).

Some differences compared to linux-aarch64:
- `math.h` defined `math_errhandling` by the compiler builtin `__math_errhandling()` but Apple Clang 13.0.0 on M1 does not support `__math_errhandling()` builtin as a macro function or a constexpr function.
- `math.h` defines `UNDERFLOW` and `OVERFLOW` macros.
- Besides 5 usual floating point exceptions: `FE_INEXACT`, `FE_UNDERFLOW`, `FE_OVERFLOW`, `FE_DIVBYZERO`, and `FE_INVALID`, `fenv.h` also has another floating point exception: `FE_FLUSHTOZERO`.  The corresponding trap for `FE_FLUSHTOZERO` in the control register is at the different location compared to the status register.
- `FE_FLUSHTOZERO` exception flag cannot be raised with the default CPU floating point operation mode.

Reviewed By: sivachandra

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




More information about the All-commits mailing list