[libc-commits] [PATCH] D120914: [libc] Initial support for darwin-aarch64.

Tue Ly via Phabricator via libc-commits libc-commits at lists.llvm.org
Thu Mar 3 09:10:42 PST 2022


lntue created this revision.
lntue added reviewers: abrachet, michaelrj, sivachandra.
Herald added subscribers: ecnelises, tschuett, kristof.beyls, mgorny.
Herald added projects: libc-project, All.
lntue requested review of this revision.

Add initial support for darwin-aarch64 (macOS M1 <https://reviews.llvm.org/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 <https://reviews.llvm.org/M1> does not support `__math_errhandling()` builtin does not work as macro function or 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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D120914

Files:
  libc/config/darwin/arm/entrypoints.txt
  libc/config/darwin/arm/headers.txt
  libc/src/__support/FPUtil/CMakeLists.txt
  libc/src/__support/FPUtil/FEnvImpl.h
  libc/src/__support/FPUtil/FEnvUtils.h
  libc/src/__support/FPUtil/NearestIntegerOperations.h
  libc/src/__support/FPUtil/aarch64/FEnvImpl.h
  libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h
  libc/src/__support/common.h
  libc/src/__support/str_to_float.h
  libc/src/fenv/feclearexcept.cpp
  libc/src/fenv/fedisableexcept.cpp
  libc/src/fenv/feenableexcept.cpp
  libc/src/fenv/fegetenv.cpp
  libc/src/fenv/fegetexcept.cpp
  libc/src/fenv/fegetexceptflag.cpp
  libc/src/fenv/fegetround.cpp
  libc/src/fenv/feholdexcept.cpp
  libc/src/fenv/feraiseexcept.cpp
  libc/src/fenv/fesetenv.cpp
  libc/src/fenv/fesetexceptflag.cpp
  libc/src/fenv/fesetround.cpp
  libc/src/fenv/fetestexcept.cpp
  libc/src/fenv/feupdateenv.cpp
  libc/src/math/generic/log10f.cpp
  libc/src/math/generic/log1pf.cpp
  libc/src/math/generic/log2f.cpp
  libc/test/src/fenv/CMakeLists.txt
  libc/test/src/fenv/enabled_exceptions_test.cpp
  libc/test/src/fenv/exception_flags_test.cpp
  libc/test/src/fenv/exception_status_test.cpp
  libc/test/src/fenv/feclearexcept_test.cpp
  libc/test/src/fenv/feholdexcept_test.cpp
  libc/test/src/fenv/feupdateenv_test.cpp
  libc/test/src/fenv/getenv_and_setenv_test.cpp
  libc/test/src/math/RIntTest.h
  libc/test/src/math/RoundToIntegerTest.h
  libc/test/src/math/cosf_test.cpp
  libc/test/src/math/exp2f_test.cpp
  libc/test/src/math/expf_test.cpp
  libc/test/src/math/expm1f_test.cpp
  libc/test/src/math/sincosf_test.cpp
  libc/test/src/math/sinf_test.cpp
  libc/test/src/stdlib/strtold_test.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D120914.412742.patch
Type: text/x-patch
Size: 55519 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20220303/1591be16/attachment-0001.bin>


More information about the libc-commits mailing list