[libc-commits] [libc] f7d5e9b - [libc] Support the `abs` functions in the GPU libc.

Joseph Huber via libc-commits libc-commits at lists.llvm.org
Thu Apr 27 18:32:11 PDT 2023


Author: Joseph Huber
Date: 2023-04-27T20:31:59-05:00
New Revision: f7d5e9bc4ce5db276d5c0965dde4c4d323f699d1

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

LOG: [libc] Support the `abs` functions in the GPU libc.

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

Reviewed By: sivachandra

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

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/libc/config/gpu/entrypoints.txt b/libc/config/gpu/entrypoints.txt
index 13d70f97363f8..72c30676605e1 100644
--- a/libc/config/gpu/entrypoints.txt
+++ b/libc/config/gpu/entrypoints.txt
@@ -55,10 +55,13 @@ set(TARGET_LIBC_ENTRYPOINTS
     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

diff  --git a/libc/docs/gpu/support.rst b/libc/docs/gpu/support.rst
index 5638e51dd53f2..d5b9948fb779e 100644
--- a/libc/docs/gpu/support.rst
+++ b/libc/docs/gpu/support.rst
@@ -84,11 +84,13 @@ stdlib.h
 =============  =========  ============
 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|


        


More information about the libc-commits mailing list