[libc-commits] [libc] b15ac1f - [libc] Enable the 'div' routines on the GPU

Joseph Huber via libc-commits libc-commits at lists.llvm.org
Thu Jun 29 13:42:54 PDT 2023


Author: Joseph Huber
Date: 2023-06-29T15:42:46-05:00
New Revision: b15ac1fd899649e63011358798f8999d42075d05

URL: https://github.com/llvm/llvm-project/commit/b15ac1fd899649e63011358798f8999d42075d05
DIFF: https://github.com/llvm/llvm-project/commit/b15ac1fd899649e63011358798f8999d42075d05.diff

LOG: [libc] Enable the 'div' routines on the GPU

This patch simply enables the `div`, `ldiv,` and, `lldiv` functions on
the GPU. This should be straightforward enough.

Reviewed By: jdoerfert

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

Added: 
    

Modified: 
    libc/config/gpu/api.td
    libc/config/gpu/entrypoints.txt
    libc/docs/gpu/support.rst

Removed: 
    


################################################################################
diff  --git a/libc/config/gpu/api.td b/libc/config/gpu/api.td
index 1268a6f315b0a0..5a6a576a85310e 100644
--- a/libc/config/gpu/api.td
+++ b/libc/config/gpu/api.td
@@ -9,6 +9,9 @@ def StringAPI : PublicAPI<"string.h"> {
 
 def StdlibAPI : PublicAPI<"stdlib.h"> {
   let Types = [
+    "div_t",
+    "ldiv_t",
+    "lldiv_t",
     "size_t",
     "__atexithandler_t",
   ];

diff  --git a/libc/config/gpu/entrypoints.txt b/libc/config/gpu/entrypoints.txt
index 64a19a9c5183d0..c39de4d476f6b8 100644
--- a/libc/config/gpu/entrypoints.txt
+++ b/libc/config/gpu/entrypoints.txt
@@ -60,8 +60,11 @@ set(TARGET_LIBC_ENTRYPOINTS
     libc.src.stdlib.atof
     libc.src.stdlib.atol
     libc.src.stdlib.atoll
+    libc.src.stdlib.div
     libc.src.stdlib.labs
+    libc.src.stdlib.ldiv
     libc.src.stdlib.llabs
+    libc.src.stdlib.lldiv
     libc.src.stdlib.strtod
     libc.src.stdlib.strtof
     libc.src.stdlib.strtol

diff  --git a/libc/docs/gpu/support.rst b/libc/docs/gpu/support.rst
index a4ec0e658186a3..cc3e632f7f8af7 100644
--- a/libc/docs/gpu/support.rst
+++ b/libc/docs/gpu/support.rst
@@ -92,6 +92,9 @@ atoll          |check|
 exit           |check|    |check|
 labs           |check|
 llabs          |check|
+div            |check|
+ldiv           |check|
+lldiv          |check|
 strtod         |check|
 strtof         |check|
 strtol         |check|


        


More information about the libc-commits mailing list