[libc-commits] [PATCH] D82036: [libc] Add implementations long double fabsl and truncl functions.
Siva Chandra via Phabricator via libc-commits
libc-commits at lists.llvm.org
Wed Jun 17 11:51:02 PDT 2020
sivachandra created this revision.
sivachandra added a reviewer: asteinhauser.
Herald added subscribers: libc-commits, ecnelises, tschuett, mgorny.
Herald added a project: libc-project.
sivachandra updated this revision to Diff 271426.
sivachandra added a comment.
Fix few header guards.
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.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D82036
Files:
libc/config/linux/api.td
libc/config/linux/x86_64/entrypoints.txt
libc/spec/stdc.td
libc/src/math/CMakeLists.txt
libc/src/math/fabsl.cpp
libc/src/math/fabsl.h
libc/src/math/truncl.cpp
libc/src/math/truncl.h
libc/test/src/math/CMakeLists.txt
libc/test/src/math/fabsl_test.cpp
libc/test/src/math/truncl_test.cpp
libc/utils/FPUtil/BasicOperations.h
libc/utils/FPUtil/CMakeLists.txt
libc/utils/FPUtil/FPBits.h
libc/utils/FPUtil/FloatOperations.h
libc/utils/FPUtil/LongDoubleBitsX86.h
libc/utils/FPUtil/NearestIntegerOperations.h
libc/utils/MPFRWrapper/MPFRUtils.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D82036.271426.patch
Type: text/x-patch
Size: 28108 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20200617/25e594bf/attachment-0001.bin>
More information about the libc-commits
mailing list