diff options
author | Joseph Huber <jhuber6@vols.utk.edu> | 2023-04-26 18:37:30 -0500 |
---|---|---|
committer | Joseph Huber <jhuber6@vols.utk.edu> | 2023-04-27 20:31:58 -0500 |
commit | 72bfe2c05a09e39c6e9c8f35fcbbd9322ed56432 (patch) | |
tree | 1901c864f225cd5eebdf770ea4ad55ecacd8749b /libc/config | |
parent | db381405ced7b65ad1cf8fc60bbdfb505e1ed3de (diff) | |
download | llvm-72bfe2c05a09e39c6e9c8f35fcbbd9322ed56432.tar.gz |
[libc] Support the string conversion methods on the GPU
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
Diffstat (limited to 'libc/config')
-rw-r--r-- | libc/config/gpu/api.td | 4 | ||||
-rw-r--r-- | libc/config/gpu/entrypoints.txt | 10 | ||||
-rw-r--r-- | libc/config/gpu/headers.txt | 1 |
3 files changed, 15 insertions, 0 deletions
diff --git a/libc/config/gpu/api.td b/libc/config/gpu/api.td index 3e6927de9463..c5f555c90178 100644 --- a/libc/config/gpu/api.td +++ b/libc/config/gpu/api.td @@ -12,3 +12,7 @@ def StdlibAPI : PublicAPI<"stdlib.h"> { "__atexithandler_t", ]; } + +def FenvAPI: PublicAPI<"fenv.h"> { + let Types = ["fenv_t"]; +} diff --git a/libc/config/gpu/entrypoints.txt b/libc/config/gpu/entrypoints.txt index c5ed1e3dd476..13d70f97363f 100644 --- a/libc/config/gpu/entrypoints.txt +++ b/libc/config/gpu/entrypoints.txt @@ -56,7 +56,17 @@ set(TARGET_LIBC_ENTRYPOINTS # stdlib.h entrypoints libc.src.stdlib.atoi + libc.src.stdlib.atof + libc.src.stdlib.atol + libc.src.stdlib.atoll libc.src.stdlib.atexit + libc.src.stdlib.strtod + libc.src.stdlib.strtof + libc.src.stdlib.strtol + libc.src.stdlib.strtold + libc.src.stdlib.strtoll + libc.src.stdlib.strtoul + libc.src.stdlib.strtoull # Only implemented in the test suite libc.src.stdlib.malloc diff --git a/libc/config/gpu/headers.txt b/libc/config/gpu/headers.txt index 1b77c97b00d8..608ff42cbdbc 100644 --- a/libc/config/gpu/headers.txt +++ b/libc/config/gpu/headers.txt @@ -1,6 +1,7 @@ set(TARGET_PUBLIC_HEADERS libc.include.ctype libc.include.string + libc.include.fenv libc.include.errno libc.include.stdlib ) |