[all-commits] [llvm/llvm-project] 139018: [libc] Add implementations long double fabsl and t...

Siva Chandra via All-commits all-commits at lists.llvm.org
Thu Jun 18 11:09:17 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 139018265bfecec450261292f24f8bf3c37be96f
      https://github.com/llvm/llvm-project/commit/139018265bfecec450261292f24f8bf3c37be96f
  Author: Siva Chandra Reddy <sivachandra at google.com>
  Date:   2020-06-18 (Thu, 18 Jun 2020)

  Changed paths:
    M libc/config/linux/aarch64/entrypoints.txt
    M libc/config/linux/api.td
    M libc/config/linux/x86_64/entrypoints.txt
    M libc/spec/stdc.td
    M libc/src/math/CMakeLists.txt
    A libc/src/math/fabsl.cpp
    A libc/src/math/fabsl.h
    A libc/src/math/truncl.cpp
    A libc/src/math/truncl.h
    M libc/test/src/math/CMakeLists.txt
    A libc/test/src/math/fabsl_test.cpp
    A libc/test/src/math/truncl_test.cpp
    M libc/utils/FPUtil/BasicOperations.h
    M libc/utils/FPUtil/CMakeLists.txt
    A libc/utils/FPUtil/FPBits.h
    M libc/utils/FPUtil/FloatOperations.h
    A libc/utils/FPUtil/LongDoubleBitsX86.h
    M libc/utils/FPUtil/NearestIntegerOperations.h
    M libc/utils/MPFRWrapper/MPFRUtils.cpp

  Log Message:
  -----------
  [libc] Add implementations long double fabsl and truncl functions.

Current implementations of single precision and double precision
floating point operations operate on bits of the integer type of
same size. The code made use of magic masks which were listed as
literal integer values. This is not possible in the case of long
double type as the mantissa of quad-precision long double type used
on non-x86 architectures is wider that the widest integer type for
which we can list literal values. So, in this patch, to avoid
using magic masks specified with literal values, we use packed
bit-field struct types and let the compiler generate the masks.
This new scheme allows us to implement long double flavors of the
various floating point operations. To keep the size of the patch
small, only the implementations of fabs and trunc have been
switched to the new scheme. In following patches, all exisiting
implementations will be switched to the new scheme.

Reviewers: asteinhauser

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




More information about the All-commits mailing list