llvmbot wrote:

<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-backend-x86

Author: None (fineg74)

<details>
<summary>Changes</summary>

This is to add support to build libc for building with spirv backend, for use 
with OpenMP kernels


---

Patch is 79.17 KiB, truncated to 20.00 KiB below, full version: 
https://github.com/llvm/llvm-project/pull/181049.diff


68 Files Affected:

- (modified) clang/lib/Headers/llvm_libc_wrappers/assert.h (+3-2) 
- (modified) clang/lib/Headers/llvm_libc_wrappers/ctype.h (+3-2) 
- (modified) clang/lib/Headers/llvm_libc_wrappers/inttypes.h (+3-2) 
- (modified) clang/lib/Headers/llvm_libc_wrappers/stdio.h (+4-3) 
- (modified) clang/lib/Headers/llvm_libc_wrappers/stdlib.h (+3-2) 
- (modified) clang/lib/Headers/llvm_libc_wrappers/string.h (+3-2) 
- (modified) clang/lib/Headers/llvm_libc_wrappers/time.h (+3-2) 
- (modified) clang/lib/Headers/openmp_wrappers/new (+1-1) 
- (modified) libc/cmake/modules/LLVMLibCArchitectures.cmake (+6-1) 
- (modified) libc/cmake/modules/LLVMLibCLibraryRules.cmake (+7-1) 
- (added) libc/config/gpu/spirv64/entrypoints.txt (+693) 
- (added) libc/config/gpu/spirv64/headers.txt (+21) 
- (modified) libc/include/llvm-libc-macros/math-macros.h (+2-2) 
- (modified) libc/include/llvm-libc-macros/signal-macros.h (+1-1) 
- (modified) libc/include/llvm-libc-macros/time-macros.h (+1-1) 
- (modified) libc/include/llvm-libc-types/fenv_t.h (+1-1) 
- (modified) libc/shared/rpc_util.h (+1-1) 
- (modified) libc/src/__support/macros/properties/architectures.h (+6-1) 
- (modified) libc/src/__support/macros/properties/cpu_features.h (+3-2) 
- (modified) libc/src/__support/time/gpu/time_utils.cpp (+1-1) 
- (modified) libc/src/__support/time/gpu/time_utils.h (+1-1) 
- (added) libc/src/math/spirv64/CMakeLists.txt (+303) 
- (added) libc/src/math/spirv64/ceil.cpp (+17) 
- (added) libc/src/math/spirv64/ceilf.cpp (+17) 
- (added) libc/src/math/spirv64/copysign.cpp (+19) 
- (added) libc/src/math/spirv64/copysignf.cpp (+19) 
- (added) libc/src/math/spirv64/fabs.cpp (+17) 
- (added) libc/src/math/spirv64/fabsf.cpp (+17) 
- (added) libc/src/math/spirv64/floor.cpp (+17) 
- (added) libc/src/math/spirv64/floorf.cpp (+17) 
- (added) libc/src/math/spirv64/fma.cpp (+19) 
- (added) libc/src/math/spirv64/fmaf.cpp (+19) 
- (added) libc/src/math/spirv64/fmax.cpp (+22) 
- (added) libc/src/math/spirv64/fmaxf.cpp (+20) 
- (added) libc/src/math/spirv64/fmin.cpp (+20) 
- (added) libc/src/math/spirv64/fminf.cpp (+20) 
- (added) libc/src/math/spirv64/fmod.cpp (+19) 
- (added) libc/src/math/spirv64/fmodf.cpp (+19) 
- (added) libc/src/math/spirv64/frexp.cpp (+20) 
- (added) libc/src/math/spirv64/frexpf.cpp (+20) 
- (added) libc/src/math/spirv64/ldexp.cpp (+20) 
- (added) libc/src/math/spirv64/ldexpf.cpp (+20) 
- (added) libc/src/math/spirv64/lgamma.cpp (+19) 
- (added) libc/src/math/spirv64/lgamma_r.cpp (+22) 
- (added) libc/src/math/spirv64/llrint.cpp (+20) 
- (added) libc/src/math/spirv64/llrintf.cpp (+20) 
- (added) libc/src/math/spirv64/lrint.cpp (+20) 
- (added) libc/src/math/spirv64/lrintf.cpp (+20) 
- (added) libc/src/math/spirv64/nearbyint.cpp (+19) 
- (added) libc/src/math/spirv64/nearbyintf.cpp (+19) 
- (added) libc/src/math/spirv64/remainder.cpp (+19) 
- (added) libc/src/math/spirv64/remainderf.cpp (+19) 
- (added) libc/src/math/spirv64/rint.cpp (+17) 
- (added) libc/src/math/spirv64/rintf.cpp (+17) 
- (added) libc/src/math/spirv64/round.cpp (+17) 
- (added) libc/src/math/spirv64/roundf.cpp (+17) 
- (added) libc/src/math/spirv64/scalbn.cpp (+20) 
- (added) libc/src/math/spirv64/scalbnf.cpp (+20) 
- (added) libc/src/math/spirv64/sqrt.cpp (+17) 
- (added) libc/src/math/spirv64/sqrtf.cpp (+17) 
- (added) libc/src/math/spirv64/tgamma.cpp (+19) 
- (added) libc/src/math/spirv64/tgammaf.cpp (+19) 
- (added) libc/src/math/spirv64/trunc.cpp (+17) 
- (added) libc/src/math/spirv64/truncf.cpp (+17) 
- (modified) libc/startup/gpu/CMakeLists.txt (+11-3) 
- (added) libc/startup/gpu/spirv64/CMakeLists.txt (+16) 
- (added) libc/startup/gpu/spirv64/start.cpp (+71) 
- (modified) llvm/CMakeLists.txt (+3-2) 


``````````diff
diff --git a/clang/lib/Headers/llvm_libc_wrappers/assert.h 
b/clang/lib/Headers/llvm_libc_wrappers/assert.h
index 7eadb2c354aab..1b3ea6b4affa6 100644
--- a/clang/lib/Headers/llvm_libc_wrappers/assert.h
+++ b/clang/lib/Headers/llvm_libc_wrappers/assert.h
@@ -9,7 +9,8 @@
 #ifndef __CLANG_LLVM_LIBC_WRAPPERS_ASSERT_H__
 #define __CLANG_LLVM_LIBC_WRAPPERS_ASSERT_H__
 
-#if !defined(_OPENMP) && !defined(__HIP__) && !defined(__CUDA__)
+#if !defined(_OPENMP) && !defined(__HIP__) && !defined(__CUDA__) &&            
\
+    !defined(__SPIRV__)
 #error "This file is for GPU offloading compilation only"
 #endif
 
@@ -17,7 +18,7 @@
 
 #if __has_include(<llvm-libc-decls/assert.h>)
 
-#if defined(__HIP__) || defined(__CUDA__)
+#if defined(__HIP__) || defined(__CUDA__) || defined(__SPIRV__)
 #define __LIBC_ATTRS __attribute__((device))
 #else
 #define __LIBC_ATTRS
diff --git a/clang/lib/Headers/llvm_libc_wrappers/ctype.h 
b/clang/lib/Headers/llvm_libc_wrappers/ctype.h
index 79b0c1e9be953..8d7bb608d4c5b 100644
--- a/clang/lib/Headers/llvm_libc_wrappers/ctype.h
+++ b/clang/lib/Headers/llvm_libc_wrappers/ctype.h
@@ -9,13 +9,14 @@
 #ifndef __CLANG_LLVM_LIBC_WRAPPERS_CTYPE_H__
 #define __CLANG_LLVM_LIBC_WRAPPERS_CTYPE_H__
 
-#if !defined(_OPENMP) && !defined(__HIP__) && !defined(__CUDA__)
+#if !defined(_OPENMP) && !defined(__HIP__) && !defined(__CUDA__) &&            
\
+    !defined(__SPIRV__)
 #error "This file is for GPU offloading compilation only"
 #endif
 
 #include_next <ctype.h>
 
-#if defined(__HIP__) || defined(__CUDA__)
+#if defined(__HIP__) || defined(__CUDA__) || defined(__SPIRV__)
 #define __LIBC_ATTRS __attribute__((device))
 #else
 #define __LIBC_ATTRS
diff --git a/clang/lib/Headers/llvm_libc_wrappers/inttypes.h 
b/clang/lib/Headers/llvm_libc_wrappers/inttypes.h
index 22613898248f3..154b6cc212201 100644
--- a/clang/lib/Headers/llvm_libc_wrappers/inttypes.h
+++ b/clang/lib/Headers/llvm_libc_wrappers/inttypes.h
@@ -9,7 +9,8 @@
 #ifndef __CLANG_LLVM_LIBC_WRAPPERS_INTTYPES_H__
 #define __CLANG_LLVM_LIBC_WRAPPERS_INTTYPES_H__
 
-#if !defined(_OPENMP) && !defined(__HIP__) && !defined(__CUDA__)
+#if !defined(_OPENMP) && !defined(__HIP__) && !defined(__CUDA__) &&            
\
+    !defined(__SPIRV__)
 #error "This file is for GPU offloading compilation only"
 #endif
 
@@ -17,7 +18,7 @@
 
 #if __has_include(<llvm-libc-decls/inttypes.h>)
 
-#if defined(__HIP__) || defined(__CUDA__)
+#if defined(__HIP__) || defined(__CUDA__) || defined(__SPIRV__)
 #define __LIBC_ATTRS __attribute__((device))
 #else
 #define __LIBC_ATTRS
diff --git a/clang/lib/Headers/llvm_libc_wrappers/stdio.h 
b/clang/lib/Headers/llvm_libc_wrappers/stdio.h
index 0c3e44823da70..4044bb8400f44 100644
--- a/clang/lib/Headers/llvm_libc_wrappers/stdio.h
+++ b/clang/lib/Headers/llvm_libc_wrappers/stdio.h
@@ -9,13 +9,14 @@
 #ifndef __CLANG_LLVM_LIBC_WRAPPERS_STDIO_H__
 #define __CLANG_LLVM_LIBC_WRAPPERS_STDIO_H__
 
-#if !defined(_OPENMP) && !defined(__HIP__) && !defined(__CUDA__)
+#if !defined(_OPENMP) && !defined(__HIP__) && !defined(__CUDA__) &&            
\
+    !defined(__SPIRV__)
 #error "This file is for GPU offloading compilation only"
 #endif
 
 #include_next <stdio.h>
 
-#if defined(__HIP__) || defined(__CUDA__)
+#if defined(__HIP__) || defined(__CUDA__) || defined(__SPIRV__)
 #define __LIBC_ATTRS __attribute__((device))
 #else
 #define __LIBC_ATTRS
@@ -41,7 +42,7 @@ __LIBC_ATTRS extern FILE *stdout;
 #pragma omp end declare target
 
 // Restore the original macros when compiling on the host.
-#if !defined(__NVPTX__) && !defined(__AMDGPU__)
+#if !defined(__NVPTX__) && !defined(__AMDGPU__) && !defined(__SPIRV__)
 #pragma pop_macro("stderr")
 #pragma pop_macro("stdin")
 #pragma pop_macro("stdout")
diff --git a/clang/lib/Headers/llvm_libc_wrappers/stdlib.h 
b/clang/lib/Headers/llvm_libc_wrappers/stdlib.h
index 7af5e2ebe031a..6d4987936b295 100644
--- a/clang/lib/Headers/llvm_libc_wrappers/stdlib.h
+++ b/clang/lib/Headers/llvm_libc_wrappers/stdlib.h
@@ -9,13 +9,14 @@
 #ifndef __CLANG_LLVM_LIBC_WRAPPERS_STDLIB_H__
 #define __CLANG_LLVM_LIBC_WRAPPERS_STDLIB_H__
 
-#if !defined(_OPENMP) && !defined(__HIP__) && !defined(__CUDA__)
+#if !defined(_OPENMP) && !defined(__HIP__) && !defined(__CUDA__) &&            
\
+    !defined(__SPIRV__)
 #error "This file is for GPU offloading compilation only"
 #endif
 
 #include_next <stdlib.h>
 
-#if defined(__HIP__) || defined(__CUDA__)
+#if defined(__HIP__) || defined(__CUDA__) || defined(__SPIRV__)
 #define __LIBC_ATTRS __attribute__((device))
 #else
 #define __LIBC_ATTRS
diff --git a/clang/lib/Headers/llvm_libc_wrappers/string.h 
b/clang/lib/Headers/llvm_libc_wrappers/string.h
index 766a58f5b6db4..5edb86ac9d520 100644
--- a/clang/lib/Headers/llvm_libc_wrappers/string.h
+++ b/clang/lib/Headers/llvm_libc_wrappers/string.h
@@ -9,13 +9,14 @@
 #ifndef __CLANG_LLVM_LIBC_WRAPPERS_STRING_H__
 #define __CLANG_LLVM_LIBC_WRAPPERS_STRING_H__
 
-#if !defined(_OPENMP) && !defined(__HIP__) && !defined(__CUDA__)
+#if !defined(_OPENMP) && !defined(__HIP__) && !defined(__CUDA__) &&            
\
+    !defined(__SPIRV__)
 #error "This file is for GPU offloading compilation only"
 #endif
 
 #include_next <string.h>
 
-#if defined(__HIP__) || defined(__CUDA__)
+#if defined(__HIP__) || defined(__CUDA__) || defined(__SPIRV__)
 #define __LIBC_ATTRS __attribute__((device))
 #else
 #define __LIBC_ATTRS
diff --git a/clang/lib/Headers/llvm_libc_wrappers/time.h 
b/clang/lib/Headers/llvm_libc_wrappers/time.h
index d38eea327a199..b798d462aa7d4 100644
--- a/clang/lib/Headers/llvm_libc_wrappers/time.h
+++ b/clang/lib/Headers/llvm_libc_wrappers/time.h
@@ -9,13 +9,14 @@
 #ifndef __CLANG_LLVM_LIBC_WRAPPERS_TIME_H__
 #define __CLANG_LLVM_LIBC_WRAPPERS_TIME_H__
 
-#if !defined(_OPENMP) && !defined(__HIP__) && !defined(__CUDA__)
+#if !defined(_OPENMP) && !defined(__HIP__) && !defined(__CUDA__) &&            
\
+    !defined(__SPIRV__)
 #error "This file is for GPU offloading compilation only"
 #endif
 
 #include_next <time.h>
 
-#if defined(__HIP__) || defined(__CUDA__)
+#if defined(__HIP__) || defined(__CUDA__) || defined(__SPIRV__)
 #define __LIBC_ATTRS __attribute__((device))
 #else
 #define __LIBC_ATTRS
diff --git a/clang/lib/Headers/openmp_wrappers/new 
b/clang/lib/Headers/openmp_wrappers/new
index 8bad3f19d6251..de40cb9a210a1 100644
--- a/clang/lib/Headers/openmp_wrappers/new
+++ b/clang/lib/Headers/openmp_wrappers/new
@@ -13,7 +13,7 @@
 // which do not use nothrow_t are provided without the <new> header.
 #include_next <new>
 
-#if (defined(__NVPTX__) || defined(__AMDGPU__)) && defined(_OPENMP)
+#if (defined(__NVPTX__) || defined(__AMDGPU__) || defined(__SPIRV__)) && 
defined(_OPENMP)
 
 #include <cstdlib>
 
diff --git a/libc/cmake/modules/LLVMLibCArchitectures.cmake 
b/libc/cmake/modules/LLVMLibCArchitectures.cmake
index 939fc1226a4e9..5f2be539e7169 100644
--- a/libc/cmake/modules/LLVMLibCArchitectures.cmake
+++ b/libc/cmake/modules/LLVMLibCArchitectures.cmake
@@ -71,10 +71,15 @@ function(get_arch_and_system_from_triple triple arch_var 
sys_var)
 
   # Setting OS name for GPU architectures.
   list(GET triple_comps -1 gpu_target_sys)
-  if(gpu_target_sys MATCHES "^amdhsa" OR gpu_target_sys MATCHES "^cuda")
+  if(gpu_target_sys MATCHES "^amdhsa" OR gpu_target_sys MATCHES "^cuda" OR 
target_arch MATCHES "^spirv64")
     set(target_sys "gpu")
   endif()
 
+  if (target_arch MATCHES "^spirv64")
+    list(APPEND
+         LIBC_COMPILE_OPTIONS_DEFAULT "-emit-llvm")
+  endif()
+  
   set(${sys_var} ${target_sys} PARENT_SCOPE)
 endfunction(get_arch_and_system_from_triple)
 
diff --git a/libc/cmake/modules/LLVMLibCLibraryRules.cmake 
b/libc/cmake/modules/LLVMLibCLibraryRules.cmake
index 80439de6bb4b0..7352802bc9ce4 100644
--- a/libc/cmake/modules/LLVMLibCLibraryRules.cmake
+++ b/libc/cmake/modules/LLVMLibCLibraryRules.cmake
@@ -109,8 +109,14 @@ function(add_bitcode_entrypoint_library target_name 
base_target_name)
   endforeach()
 
   add_executable(${target_name} ${objects})
-  target_link_options(${target_name} PRIVATE "${LIBC_COMPILE_OPTIONS_DEFAULT}"
+  if("${LLVM_DEFAULT_TARGET_TRIPLE}" MATCHES "^spirv" OR
+     "${CMAKE_CXX_COMPILER_TARGET}" MATCHES "^spirv")
+      target_link_options(${target_name} PRIVATE 
"${LIBC_COMPILE_OPTIONS_DEFAULT}"
+                      "-nostdlib" "-emit-llvm")
+  else()  
+      target_link_options(${target_name} PRIVATE 
"${LIBC_COMPILE_OPTIONS_DEFAULT}"
                       "-r" "-nostdlib" "-flto" "-Wl,--lto-emit-llvm")
+  endif()
 endfunction(add_bitcode_entrypoint_library)
 
 # A rule to build a library from a collection of entrypoint objects.
diff --git a/libc/config/gpu/spirv64/entrypoints.txt 
b/libc/config/gpu/spirv64/entrypoints.txt
new file mode 100644
index 0000000000000..0dda7d5c683ec
--- /dev/null
+++ b/libc/config/gpu/spirv64/entrypoints.txt
@@ -0,0 +1,693 @@
+set(TARGET_LIBC_ENTRYPOINTS
+    # assert.h entrypoints
+    libc.src.assert.__assert_fail
+
+    # ctype.h entrypoints
+    libc.src.ctype.isalnum
+    libc.src.ctype.isalnum_l
+    libc.src.ctype.isalpha
+    libc.src.ctype.isalpha_l
+    libc.src.ctype.isascii
+    libc.src.ctype.isblank
+    libc.src.ctype.isblank_l
+    libc.src.ctype.iscntrl
+    libc.src.ctype.iscntrl_l
+    libc.src.ctype.isdigit
+    libc.src.ctype.isdigit_l
+    libc.src.ctype.isgraph
+    libc.src.ctype.isgraph_l
+    libc.src.ctype.islower
+    libc.src.ctype.islower_l
+    libc.src.ctype.isprint
+    libc.src.ctype.isprint_l
+    libc.src.ctype.ispunct
+    libc.src.ctype.ispunct_l
+    libc.src.ctype.isspace
+    libc.src.ctype.isspace_l
+    libc.src.ctype.isupper
+    libc.src.ctype.isupper_l
+    libc.src.ctype.isxdigit
+    libc.src.ctype.isxdigit_l
+    libc.src.ctype.toascii
+    libc.src.ctype.tolower
+    libc.src.ctype.tolower_l
+    libc.src.ctype.toupper
+    libc.src.ctype.toupper_l
+
+    # string.h entrypoints
+    libc.src.string.memccpy
+    libc.src.string.memchr
+    libc.src.string.memcmp
+    libc.src.string.memcpy
+    libc.src.string.memmem
+    libc.src.string.memmove
+    libc.src.string.mempcpy
+    libc.src.string.memrchr
+    libc.src.string.memset
+    libc.src.string.stpcpy
+    libc.src.string.stpncpy
+    libc.src.string.strcasestr
+    libc.src.string.strcat
+    libc.src.string.strchr
+    libc.src.string.strchrnul
+    libc.src.string.strcmp
+    libc.src.string.strcoll
+    libc.src.string.strcoll_l
+    libc.src.string.strcpy
+    libc.src.string.strcspn
+    libc.src.string.strdup
+    libc.src.string.strerror
+    libc.src.string.strlcat
+    libc.src.string.strlcpy
+    libc.src.string.strlen
+    libc.src.string.strncat
+    libc.src.string.strncmp
+    libc.src.string.strncpy
+    libc.src.string.strndup
+    libc.src.string.strnlen
+    libc.src.string.strpbrk
+    libc.src.string.strrchr
+    libc.src.string.strsep
+    libc.src.string.strspn
+    libc.src.string.strstr
+    libc.src.string.strtok
+    libc.src.string.strtok_r
+    libc.src.string.strxfrm
+    libc.src.string.strxfrm_l
+
+    # strings.h entrypoints
+    libc.src.strings.bcmp
+    libc.src.strings.bcopy
+    libc.src.strings.bzero
+    libc.src.strings.index
+    libc.src.strings.rindex
+    libc.src.strings.strcasecmp
+    libc.src.strings.strncasecmp
+
+    # stdbit.h entrypoints
+    libc.src.stdbit.stdc_bit_ceil_uc
+    libc.src.stdbit.stdc_bit_ceil_ui
+    libc.src.stdbit.stdc_bit_ceil_ul
+    libc.src.stdbit.stdc_bit_ceil_ull
+    libc.src.stdbit.stdc_bit_ceil_us
+    libc.src.stdbit.stdc_bit_floor_uc
+    libc.src.stdbit.stdc_bit_floor_ui
+    libc.src.stdbit.stdc_bit_floor_ul
+    libc.src.stdbit.stdc_bit_floor_ull
+    libc.src.stdbit.stdc_bit_floor_us
+    libc.src.stdbit.stdc_bit_width_uc
+    libc.src.stdbit.stdc_bit_width_ui
+    libc.src.stdbit.stdc_bit_width_ul
+    libc.src.stdbit.stdc_bit_width_ull
+    libc.src.stdbit.stdc_bit_width_us
+    libc.src.stdbit.stdc_count_ones_uc
+    libc.src.stdbit.stdc_count_ones_ui
+    libc.src.stdbit.stdc_count_ones_ul
+    libc.src.stdbit.stdc_count_ones_ull
+    libc.src.stdbit.stdc_count_ones_us
+    libc.src.stdbit.stdc_count_zeros_uc
+    libc.src.stdbit.stdc_count_zeros_ui
+    libc.src.stdbit.stdc_count_zeros_ul
+    libc.src.stdbit.stdc_count_zeros_ull
+    libc.src.stdbit.stdc_count_zeros_us
+    libc.src.stdbit.stdc_first_leading_one_uc
+    libc.src.stdbit.stdc_first_leading_one_ui
+    libc.src.stdbit.stdc_first_leading_one_ul
+    libc.src.stdbit.stdc_first_leading_one_ull
+    libc.src.stdbit.stdc_first_leading_one_us
+    libc.src.stdbit.stdc_first_leading_zero_uc
+    libc.src.stdbit.stdc_first_leading_zero_ui
+    libc.src.stdbit.stdc_first_leading_zero_ul
+    libc.src.stdbit.stdc_first_leading_zero_ull
+    libc.src.stdbit.stdc_first_leading_zero_us
+    libc.src.stdbit.stdc_first_trailing_one_uc
+    libc.src.stdbit.stdc_first_trailing_one_ui
+    libc.src.stdbit.stdc_first_trailing_one_ul
+    libc.src.stdbit.stdc_first_trailing_one_ull
+    libc.src.stdbit.stdc_first_trailing_one_us
+    libc.src.stdbit.stdc_first_trailing_zero_uc
+    libc.src.stdbit.stdc_first_trailing_zero_ui
+    libc.src.stdbit.stdc_first_trailing_zero_ul
+    libc.src.stdbit.stdc_first_trailing_zero_ull
+    libc.src.stdbit.stdc_first_trailing_zero_us
+    libc.src.stdbit.stdc_has_single_bit_uc
+    libc.src.stdbit.stdc_has_single_bit_ui
+    libc.src.stdbit.stdc_has_single_bit_ul
+    libc.src.stdbit.stdc_has_single_bit_ull
+    libc.src.stdbit.stdc_has_single_bit_us
+    libc.src.stdbit.stdc_leading_ones_uc
+    libc.src.stdbit.stdc_leading_ones_ui
+    libc.src.stdbit.stdc_leading_ones_ul
+    libc.src.stdbit.stdc_leading_ones_ull
+    libc.src.stdbit.stdc_leading_ones_us
+    libc.src.stdbit.stdc_leading_zeros_uc
+    libc.src.stdbit.stdc_leading_zeros_ui
+    libc.src.stdbit.stdc_leading_zeros_ul
+    libc.src.stdbit.stdc_leading_zeros_ull
+    libc.src.stdbit.stdc_leading_zeros_us
+    libc.src.stdbit.stdc_trailing_ones_uc
+    libc.src.stdbit.stdc_trailing_ones_ui
+    libc.src.stdbit.stdc_trailing_ones_ul
+    libc.src.stdbit.stdc_trailing_ones_ull
+    libc.src.stdbit.stdc_trailing_ones_us
+    libc.src.stdbit.stdc_trailing_zeros_uc
+    libc.src.stdbit.stdc_trailing_zeros_ui
+    libc.src.stdbit.stdc_trailing_zeros_ul
+    libc.src.stdbit.stdc_trailing_zeros_ull
+    libc.src.stdbit.stdc_trailing_zeros_us
+
+    # stdlib.h entrypoints
+    libc.src.stdlib._Exit
+    libc.src.stdlib.abort
+    libc.src.stdlib.abs
+    libc.src.stdlib.atexit
+    libc.src.stdlib.atof
+    libc.src.stdlib.atoi
+    libc.src.stdlib.atol
+    libc.src.stdlib.atoll
+    libc.src.stdlib.bsearch
+    libc.src.stdlib.div
+    libc.src.stdlib.exit
+    libc.src.stdlib.labs
+    libc.src.stdlib.ldiv
+    libc.src.stdlib.llabs
+    libc.src.stdlib.lldiv
+    libc.src.stdlib.memalignment
+    libc.src.stdlib.qsort
+    libc.src.stdlib.qsort_r
+    libc.src.stdlib.rand
+    libc.src.stdlib.srand
+    libc.src.stdlib.strtod
+    libc.src.stdlib.strtod_l
+    libc.src.stdlib.strtof
+    libc.src.stdlib.strtof_l
+    libc.src.stdlib.strtol
+    libc.src.stdlib.strtol_l
+    libc.src.stdlib.strtold
+    libc.src.stdlib.strtold_l
+    libc.src.stdlib.strtoll
+    libc.src.stdlib.strtoll_l
+    libc.src.stdlib.strtoul
+    libc.src.stdlib.strtoul_l
+    libc.src.stdlib.strtoull
+    libc.src.stdlib.strtoull_l
+    libc.src.stdlib.at_quick_exit
+    libc.src.stdlib.quick_exit
+    libc.src.stdlib.getenv
+    libc.src.stdlib.system
+
+    # TODO: Implement these correctly
+    libc.src.stdlib.aligned_alloc
+    libc.src.stdlib.calloc
+    libc.src.stdlib.free
+    libc.src.stdlib.malloc
+    libc.src.stdlib.realloc
+
+    # errno.h entrypoints
+    libc.src.errno.errno
+
+    # stdio.h entrypoints
+    libc.src.stdio.clearerr
+    libc.src.stdio.fclose
+    libc.src.stdio.printf
+    libc.src.stdio.vprintf
+    libc.src.stdio.fprintf
+    libc.src.stdio.vfprintf
+    libc.src.stdio.snprintf
+    libc.src.stdio.sprintf
+    libc.src.stdio.vsnprintf
+    libc.src.stdio.vsprintf
+    libc.src.stdio.asprintf
+    libc.src.stdio.vasprintf
+    libc.src.stdio.scanf
+    libc.src.stdio.vscanf
+    libc.src.stdio.fscanf
+    libc.src.stdio.vfscanf
+    libc.src.stdio.sscanf
+    libc.src.stdio.vsscanf
+    libc.src.stdio.feof
+    libc.src.stdio.ferror
+    libc.src.stdio.fflush
+    libc.src.stdio.fgetc
+    libc.src.stdio.fgets
+    libc.src.stdio.fopen
+    libc.src.stdio.fputc
+    libc.src.stdio.fputs
+    libc.src.stdio.fread
+    libc.src.stdio.fseek
+    libc.src.stdio.ftell
+    libc.src.stdio.fwrite
+    libc.src.stdio.getc
+    libc.src.stdio.getchar
+    libc.src.stdio.putc
+    libc.src.stdio.putchar
+    libc.src.stdio.puts
+    libc.src.stdio.remove
+    libc.src.stdio.rename
+    libc.src.stdio.stderr
+    libc.src.stdio.stdin
+    libc.src.stdio.stdout
+    libc.src.stdio.ungetc
+
+    # inttypes.h entrypoints
+    libc.src.inttypes.imaxabs
+    libc.src.inttypes.imaxdiv
+    libc.src.inttypes.strtoimax
+    libc.src.inttypes.strtoumax
+
+    # time.h entrypoints
+    libc.src.time.clock
+    libc.src.time.clock_gettime
+    libc.src.time.timespec_get
+    libc.src.time.nanosleep
+    libc.src.time.strftime
+    libc.src.time.strftime_l
+    libc.src.time.mktime
+
+    # wchar.h entrypoints
+    libc.src.wchar.wcslen
+    libc.src.wchar.wctob
+
+    # locale.h entrypoints
+    libc.src.locale.localeconv
+    libc.src.locale.duplocale
+    libc.src.locale.freelocale
+    libc.src.locale.localeconv
+    libc.src.locale.newlocale
+    libc.src.locale.setlocale
+    libc.src.locale.uselocale
+)
+
+set(TARGET_LIBM_ENTRYPOINTS
+    # math.h entrypoints
+    libc.src.math.acos
+    libc.src.math.acosf
+    libc.src.math.acoshf
+    libc.src.math.asin
+    libc.src.math.asinf
+    libc.src.math.asinhf
+    libc.src.math.atan
+    libc.src.math.atan2
+    libc.src.math.atan2f
+    libc.src.math.atan2l
+    libc.src.math.atanf
+    libc.src.math.atanhf
+    libc.src.math.canonicalize
+    libc.src.math.canonicalizef
+    libc.src.math.canonicalizel
+    libc.src.math.cbrt
+    libc.src.math.cbrtf
+    libc.src.math.ceil
+    libc.src.math.ceilf
+    libc.src.math.ceill
+    libc.src.math.copysign
+    libc.src.math.copysignf
+    libc.src.math.copysignl
+    libc.src.math.cos
+    libc.src.math.cosf
+    libc.src.math.coshf
+    libc.src.math.cospif
+    libc.src.math.ddivl
+    libc.src.math.dfmal
+    libc.src.math.dmull
+    libc.src.math.dsqrtl
+    libc.src.math.erff
+    libc.src.math.exp
+    libc.src.math.exp10
+    libc.src.math.exp10f
+    libc.src.math.exp2
+    libc.src.math.exp2f
+    libc.src.math.exp2m1f
+    libc.src.math.expf
+    libc.src.math.expm1
+    libc.src.math.expm1f
+    libc.src.math.fabs
+    libc.src.math.fabsf
+    libc.src.math.fabsl
+    libc.src.math.fadd
+    libc.src.math.faddl
+    libc.src.math.fdim
+    libc.src.math.fdimf
+    libc.src.math.fdiml
+    libc.src.math.fdiv
+    libc.src.math.fdivl
+    libc.src.math.ffma
+    libc.src.math.ffmal
+    libc.src.math.floor
+    libc.src.math.floorf
+    libc.src.math.floorl
+    libc.src.math.fma
+    libc.src.math.fmaf
+    libc.src.math.fmax
+    libc.src.math.fmaxf
+    libc.src.math.fmaximum
+    libc.src.math.fmaximumf
+    libc.src.math.fmaximuml
+    libc.src.math.fmaximum_mag
+    libc.src.math.fmaximum_magf
+    libc.src.math.fmaximum_magl
+    libc.src.math.fmaximum_mag_num
+    libc.src.math.fmaximum_mag_numf
+    libc.src.math.fmaximum_mag_numl
+    libc.src.math.fmaximum_num
+    libc.src.math.fmaximum_numf
+    libc.src.math.fmaximum_numl
+    libc.src.math.fmaxl
+    libc.src.math.fmin
+    libc.src.math.fminf
+    libc.src.math.fminimum
+    libc.src.math.fminimumf
+    libc.src.math.fminimuml
+    libc.src.math.fminimum_mag
+    libc.src.math.fminimum_magf
+    libc.src.math.fminimum_magl
+    libc.src.math.fminimum_mag_num
+    libc.src.math.fminimum_mag_numf
+    libc.src.math.fminimum_mag_numl
+    libc.src.math.fminimum_num
+    libc.src.math.fminimum_numf
+    libc.src.math.fminimum_numl
+    libc.src.math.fminl
+    libc.src.math.fmod
+    libc.src.math.fmodf
+    libc.src.math.fmodl
+    libc.src.math.fmul
+    libc.src.math.fmull
+    libc.src.math.frexp
+    libc.src.math.frexpf
+    libc.src.math.frexpl
+    libc.src.math.fromfp
+    libc.src.math.fromfpf
+    libc.src.math.fromfpl
+    libc.src.math.fromfpx
+    libc.src.math.fromfpxf
+    libc.src.math.fromfpxl
+    libc.src.math.fsqrt
+    libc.src.math.fsqrtl
+    libc.src.math.fsub
+    libc.src.math.fsubl
+    libc.src.math.getpayload
+    libc.src.math.getpayloadf
+    libc.src.m...
[truncated]

``````````

</details>


https://github.com/llvm/llvm-project/pull/181049
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to