This patch simply enables building the integer `abs` functions for the
GPU.
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D149317
This patch enables us to use the existing `libc` support for string
conversion functions on the GPU. This required setting the `fenv_t` and
long double configuration. As far as I am aware, long doubles are
converted to doubles on the GPU and the floating point environment is
just an `uint32_t`.
This code is still untested as we are still working out how to run the
unit tests on the GPU.
Reviewed By: michaelrj
Differential Revision: https://reviews.llvm.org/D149306
This patch updates some of the documentation for the GPU libc project.
There is a lot of work still to be done, but this sets the general
outline.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D149194
added getchar and getchar_unlocked which are just wrappers getc and getc_unlocked respectively.
Reviewed By: sivachandra, lntue, michaelrj
Differential Revision: https://reviews.llvm.org/D147919
Simplify the range reduction steps by choosing the reduction constants
carefully so that the reduced arguments v = r*m_x - 1 and v^2 are exact in double
precision, even without FMA instructions, and -2^-8 <= v < 2^-7. This allows the
polynomial evaluations to be parallelized more efficiently.
Reviewed By: zimmermann6
Differential Revision: https://reviews.llvm.org/D147676
Fixes#59277 - The main part of that bug has already been addressed. This commit
just adds documentation.
Reviewed By: jeffbailey
Differential Revision: https://reviews.llvm.org/D146115
* Add various options so that it uses the build lld and compiler-rt
* Add instructions on how to use the newly built libc
* Remove trailing comments in code-block for cut and pastability
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D145878
The entrypoint has been added to the various entrypoint lists. The libc
code style doc has been updated with information on how errno should be
set from the libc runtime code.
Reviewed By: lntue
Differential Revision: https://reviews.llvm.org/D145179
Add bazel targets and unit tests for single precision exponential,
logarithm, trigonometric, inverse trig, hyperbolic, and inverse hyperbolic
functions.
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D143275
These were using ” ("right double quotation mark") instead of
the usual ". This means CMake took the value literally and you
got:
```
CMake Error at CMakeLists.txt:139 (MESSAGE):
”libc” isn't a known project:
bolt;clang;clang-tools-extra;compiler-rt;cross-project-tests;libc;libclc;lld;lldb;mlir;openmp;polly;pstl;flang.
Did you mean to enable it as a runtime in LLVM_ENABLE_RUNTIMES?
```
`="libc"` works fine.
Reviewed By: lntue
Differential Revision: https://reviews.llvm.org/D143254
This is the first of patches doing similar cleanup. A section in the
code style doc has been added explaining where and how LIBC_INLINE is to
be used.
Reviewed By: jeffbailey, lntue
Differential Revision: https://reviews.llvm.org/D142434
Implement double precision log10 function correctly rounded for all
rounding modes. This implementation currently needs FMA instructions for
correctness.
Use 2 passes:
Fast pass:
- 1 step range reduction with a lookup table of `2^7 = 128` elements to reduce the ranges to `[-2^-7, 2^-7]`.
- Use a degree-7 minimax polynomial generated by Sollya, evaluated using a mixed of double-double and double precisions.
- Apply Ziv's test for accuracy.
Accurate pass:
- Apply 5 more range reduction steps to reduce the ranges further to [-2^-27, 2^-27].
- Use a degree-4 minimax polynomial generated by Sollya, evaluated using 192-bit precisions.
- By the result of Lefevre (add quote), this is more than enough for correct rounding to all rounding modes.
In progress: Adding detail documentations about the algorithm.
Depend on: https://reviews.llvm.org/D136799
Reviewed By: zimmermann6
Differential Revision: https://reviews.llvm.org/D139846
One should be able to do a cross build of the libc now. For example, using
clang on a x86_64 linux host, one can build for an aarch64 linux target by
specifying -DLIBC_TARGET_TRIPLE=aarch64-linux-gnu.
Follow up changes will add a baremetal config and also appropriate
documentation about cross compiling the libc for CPU targets.
Reviewed By: jhuber6
Differential Revision: https://reviews.llvm.org/D140351
This patch introduces documentation for the new GPU mode added in
D138608. The documentation includes instructions for building and using
the library, along with a description of the supported functions and
headers.
Reviewed By: sivachandra, lntue, michaelrj
Differential Revision: https://reviews.llvm.org/D138856
Implement gettimeofday per
.../onlinepubs/9699919799/functions/gettimeofday.html.
This call clock_gettime to implement gettimeofday function.
Tested:
Limited unit test: This makes a call and checks that no error was
returned. Used nanosleep for 100 microseconds and verfified it
returns a value that elapses more than 100 microseconds and less
than 300 microseconds.
Co-authored-by: Jeff Bailey <jeffbailey@google.com>
Differential Revision: https://reviews.llvm.org/D137881