[libc-commits] [PATCH] D149317: [libc] Support the `abs` functions in the GPU libc.

Joseph Huber via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed Apr 26 18:50:02 PDT 2023


jhuber6 created this revision.
jhuber6 added reviewers: jdoerfert, tianshilei1992, JonChesterfield, sivachandra, lntue, michaelrj.
Herald added subscribers: libc-commits, ecnelises, tschuett.
Herald added projects: libc-project, All.
jhuber6 requested review of this revision.

This patch simply enables building the integer `abs` functions for the
GPU.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D149317

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


Index: libc/docs/gpu/support.rst
===================================================================
--- libc/docs/gpu/support.rst
+++ libc/docs/gpu/support.rst
@@ -84,11 +84,14 @@
 =============  =========  ============
 Function Name  Available  RPC Required
 =============  =========  ============
+abs            |check|
 atoi           |check|
 atof           |check|
 atol           |check|
 atoll          |check|
 atexit         |check|
+labs           |check|
+llabs          |check|
 strtod         |check|
 strtof         |check|
 strtol         |check|
Index: libc/config/gpu/entrypoints.txt
===================================================================
--- libc/config/gpu/entrypoints.txt
+++ libc/config/gpu/entrypoints.txt
@@ -55,10 +55,13 @@
     libc.src.string.strtok_r
 
     # stdlib.h entrypoints
+    libc.src.stdlib.abs
     libc.src.stdlib.atoi
     libc.src.stdlib.atof
     libc.src.stdlib.atol
     libc.src.stdlib.atoll
+    libc.src.stdlib.labs
+    libc.src.stdlib.llabs
     libc.src.stdlib.atexit
     libc.src.stdlib.strtod
     libc.src.stdlib.strtof
Index: libc/config/gpu/api.td
===================================================================
--- libc/config/gpu/api.td
+++ libc/config/gpu/api.td
@@ -8,6 +8,9 @@
 
 def StdlibAPI : PublicAPI<"stdlib.h"> {
   let Types = [
+    "div_t",
+    "ldiv_t",
+    "lldiv_t",
     "size_t",
     "__atexithandler_t",
   ];


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D149317.517425.patch
Type: text/x-patch
Size: 1411 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20230427/21b15dd4/attachment.bin>


More information about the libc-commits mailing list