Skip to content

Commit 525726a

Browse files
authored
[libc] Cleanup unimplemented math functions (#143173)
Summary: This patch cleans up the leftoever files that were either implemented or are still unimplemented stubs.
1 parent e6d62c9 commit 525726a

File tree

161 files changed

+19
-3255
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

161 files changed

+19
-3255
lines changed

libc/cmake/modules/LLVMLibCLibraryRules.cmake

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ function(collect_object_file_deps target result)
1919
return()
2020
endif()
2121

22-
if(${target_type} STREQUAL ${ENTRYPOINT_OBJ_TARGET_TYPE} OR
23-
${target_type} STREQUAL ${ENTRYPOINT_OBJ_VENDOR_TARGET_TYPE})
22+
if(${target_type} STREQUAL ${ENTRYPOINT_OBJ_TARGET_TYPE})
2423
set(entrypoint_target ${target})
2524
get_target_property(is_alias ${entrypoint_target} "IS_ALIAS")
2625
if(is_alias)
@@ -55,17 +54,15 @@ function(get_all_object_file_deps result fq_deps_list)
5554
foreach(dep ${fq_deps_list})
5655
get_target_property(dep_type ${dep} "TARGET_TYPE")
5756
if(NOT ((${dep_type} STREQUAL ${ENTRYPOINT_OBJ_TARGET_TYPE}) OR
58-
(${dep_type} STREQUAL ${ENTRYPOINT_EXT_TARGET_TYPE}) OR
59-
(${dep_type} STREQUAL ${ENTRYPOINT_OBJ_VENDOR_TARGET_TYPE})))
57+
(${dep_type} STREQUAL ${ENTRYPOINT_EXT_TARGET_TYPE})))
6058
message(FATAL_ERROR "Dependency '${dep}' of 'add_entrypoint_collection' is "
6159
"not an 'add_entrypoint_object' or 'add_entrypoint_external' target.")
6260
endif()
6361
collect_object_file_deps(${dep} recursive_deps)
6462
list(APPEND all_deps ${recursive_deps})
6563
# Add the entrypoint object target explicitly as collect_object_file_deps
6664
# only collects object files from non-entrypoint targets.
67-
if(${dep_type} STREQUAL ${ENTRYPOINT_OBJ_TARGET_TYPE} OR
68-
${dep_type} STREQUAL ${ENTRYPOINT_OBJ_VENDOR_TARGET_TYPE})
65+
if(${dep_type} STREQUAL ${ENTRYPOINT_OBJ_TARGET_TYPE})
6966
set(entrypoint_target ${dep})
7067
get_target_property(is_alias ${entrypoint_target} "IS_ALIAS")
7168
if(is_alias)

libc/cmake/modules/LLVMLibCObjectRules.cmake

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ function(add_object_library target_name)
111111
endfunction(add_object_library)
112112

113113
set(ENTRYPOINT_OBJ_TARGET_TYPE "ENTRYPOINT_OBJ")
114-
set(ENTRYPOINT_OBJ_VENDOR_TARGET_TYPE "ENTRYPOINT_OBJ_VENDOR")
115114

116115
# A rule for entrypoint object targets.
117116
# Usage:
@@ -129,20 +128,13 @@ set(ENTRYPOINT_OBJ_VENDOR_TARGET_TYPE "ENTRYPOINT_OBJ_VENDOR")
129128
function(create_entrypoint_object fq_target_name)
130129
cmake_parse_arguments(
131130
"ADD_ENTRYPOINT_OBJ"
132-
"ALIAS;REDIRECTED;VENDOR" # Optional argument
131+
"ALIAS;REDIRECTED" # Optional argument
133132
"NAME;CXX_STANDARD" # Single value arguments
134133
"SRCS;HDRS;DEPENDS;COMPILE_OPTIONS;FLAGS" # Multi value arguments
135134
${ARGN}
136135
)
137136

138137
set(entrypoint_target_type ${ENTRYPOINT_OBJ_TARGET_TYPE})
139-
if(${ADD_ENTRYPOINT_OBJ_VENDOR})
140-
# TODO: We currently rely on external definitions of certain math functions
141-
# provided by GPU vendors like AMD or Nvidia. We need to mark these so we
142-
# don't end up running tests on these. In the future all of these should be
143-
# implemented and this can be removed.
144-
set(entrypoint_target_type ${ENTRYPOINT_OBJ_VENDOR_TARGET_TYPE})
145-
endif()
146138
list(FIND TARGET_ENTRYPOINT_NAME_LIST ${ADD_ENTRYPOINT_OBJ_NAME} entrypoint_name_index)
147139
if(${entrypoint_name_index} EQUAL -1)
148140
add_custom_target(${fq_target_name})
@@ -186,8 +178,8 @@ function(create_entrypoint_object fq_target_name)
186178
endif()
187179

188180
get_target_property(obj_type ${fq_dep_name} "TARGET_TYPE")
189-
if((NOT obj_type) OR (NOT (${obj_type} STREQUAL ${ENTRYPOINT_OBJ_TARGET_TYPE} OR
190-
${obj_type} STREQUAL ${ENTRYPOINT_OBJ_VENDOR_TARGET_TYPE})))
181+
if((NOT obj_type) OR (NOT ${obj_type} STREQUAL ${ENTRYPOINT_OBJ_TARGET_TYPE}))
182+
191183
message(FATAL_ERROR "The aliasee of an entrypoint alias should be an entrypoint.")
192184
endif()
193185

libc/cmake/modules/LLVMLibCTestRules.cmake

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,6 @@ function(get_object_files_for_test result skipped_entrypoints_list)
168168
endif()
169169
list(APPEND dep_obj ${object_file_raw})
170170
endif()
171-
elseif(${dep_type} STREQUAL ${ENTRYPOINT_OBJ_VENDOR_TARGET_TYPE})
172-
# Skip tests for externally implemented entrypoints.
173-
list(APPEND dep_skip ${dep})
174-
list(REMOVE_ITEM dep_obj ${dep})
175171
endif()
176172

177173
set_target_properties(${dep} PROPERTIES

libc/config/gpu/amdgpu/entrypoints.txt

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -282,18 +282,14 @@ set(TARGET_LIBM_ENTRYPOINTS
282282
# math.h entrypoints
283283
libc.src.math.acos
284284
libc.src.math.acosf
285-
libc.src.math.acosh
286-
libc.src.math.acoshf
287285
libc.src.math.asin
288286
libc.src.math.asinf
289-
libc.src.math.asinh
290287
libc.src.math.asinhf
291288
libc.src.math.atan
292289
libc.src.math.atan2
293290
libc.src.math.atan2f
294291
libc.src.math.atan2l
295292
libc.src.math.atanf
296-
libc.src.math.atanh
297293
libc.src.math.atanhf
298294
libc.src.math.canonicalize
299295
libc.src.math.canonicalizef
@@ -308,14 +304,12 @@ set(TARGET_LIBM_ENTRYPOINTS
308304
libc.src.math.copysignl
309305
libc.src.math.cos
310306
libc.src.math.cosf
311-
libc.src.math.cosh
312307
libc.src.math.coshf
313308
libc.src.math.cospif
314309
libc.src.math.ddivl
315310
libc.src.math.dfmal
316311
libc.src.math.dmull
317312
libc.src.math.dsqrtl
318-
libc.src.math.erf
319313
libc.src.math.erff
320314
libc.src.math.exp
321315
libc.src.math.exp10
@@ -456,8 +450,6 @@ set(TARGET_LIBM_ENTRYPOINTS
456450
libc.src.math.nextupl
457451
libc.src.math.pow
458452
libc.src.math.powf
459-
libc.src.math.powi
460-
libc.src.math.powif
461453
libc.src.math.remainder
462454
libc.src.math.remainderf
463455
libc.src.math.remainderl
@@ -489,15 +481,13 @@ set(TARGET_LIBM_ENTRYPOINTS
489481
libc.src.math.sincos
490482
libc.src.math.sincosf
491483
libc.src.math.sinf
492-
libc.src.math.sinh
493484
libc.src.math.sinhf
494485
libc.src.math.sinpif
495486
libc.src.math.sqrt
496487
libc.src.math.sqrtf
497488
libc.src.math.sqrtl
498489
libc.src.math.tan
499490
libc.src.math.tanf
500-
libc.src.math.tanh
501491
libc.src.math.tanhf
502492
libc.src.math.tgamma
503493
libc.src.math.tgammaf

libc/config/gpu/nvptx/entrypoints.txt

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -280,20 +280,16 @@ set(TARGET_LIBC_ENTRYPOINTS
280280

281281
set(TARGET_LIBM_ENTRYPOINTS
282282
# math.h entrypoints
283-
libc.src.math.acos
284283
libc.src.math.acosf
285-
libc.src.math.acosh
286284
libc.src.math.acoshf
287285
libc.src.math.asin
288286
libc.src.math.asinf
289-
libc.src.math.asinh
290287
libc.src.math.asinhf
291288
libc.src.math.atan
292289
libc.src.math.atan2
293290
libc.src.math.atan2f
294291
libc.src.math.atan2l
295292
libc.src.math.atanf
296-
libc.src.math.atanh
297293
libc.src.math.atanhf
298294
libc.src.math.canonicalize
299295
libc.src.math.canonicalizef
@@ -308,14 +304,12 @@ set(TARGET_LIBM_ENTRYPOINTS
308304
libc.src.math.copysignl
309305
libc.src.math.cos
310306
libc.src.math.cosf
311-
libc.src.math.cosh
312307
libc.src.math.coshf
313308
libc.src.math.cospif
314309
libc.src.math.ddivl
315310
libc.src.math.dfmal
316311
libc.src.math.dmull
317312
libc.src.math.dsqrtl
318-
libc.src.math.erf
319313
libc.src.math.erff
320314
libc.src.math.exp
321315
libc.src.math.exp10
@@ -457,8 +451,6 @@ set(TARGET_LIBM_ENTRYPOINTS
457451
libc.src.math.nextupl
458452
libc.src.math.pow
459453
libc.src.math.powf
460-
libc.src.math.powi
461-
libc.src.math.powif
462454
libc.src.math.remainder
463455
libc.src.math.remainderf
464456
libc.src.math.remainderl
@@ -490,15 +482,13 @@ set(TARGET_LIBM_ENTRYPOINTS
490482
libc.src.math.sincos
491483
libc.src.math.sincosf
492484
libc.src.math.sinf
493-
libc.src.math.sinh
494485
libc.src.math.sinhf
495486
libc.src.math.sinpif
496487
libc.src.math.sqrt
497488
libc.src.math.sqrtf
498489
libc.src.math.sqrtl
499490
libc.src.math.tan
500491
libc.src.math.tanf
501-
libc.src.math.tanh
502492
libc.src.math.tanhf
503493
libc.src.math.tgamma
504494
libc.src.math.tgammaf

libc/src/math/amdgpu/CMakeLists.txt

Lines changed: 0 additions & 150 deletions
Original file line numberDiff line numberDiff line change
@@ -346,152 +346,6 @@ add_entrypoint_object(
346346
-O2
347347
)
348348

349-
# The following functions currently are not implemented natively and borrow from
350-
# existing implementations. This will be removed in the future.
351-
add_entrypoint_object(
352-
acos
353-
SRCS
354-
acos.cpp
355-
HDRS
356-
../acos.h
357-
VENDOR
358-
COMPILE_OPTIONS
359-
${bitcode_link_flags}
360-
-O2
361-
)
362-
363-
add_entrypoint_object(
364-
acosh
365-
SRCS
366-
acosh.cpp
367-
HDRS
368-
../acosh.h
369-
COMPILE_OPTIONS
370-
${bitcode_link_flags}
371-
-O2
372-
VENDOR
373-
)
374-
375-
add_entrypoint_object(
376-
asin
377-
SRCS
378-
asin.cpp
379-
HDRS
380-
../asin.h
381-
COMPILE_OPTIONS
382-
${bitcode_link_flags}
383-
-O2
384-
VENDOR
385-
)
386-
387-
add_entrypoint_object(
388-
asinh
389-
SRCS
390-
asinh.cpp
391-
HDRS
392-
../asinh.h
393-
COMPILE_OPTIONS
394-
${bitcode_link_flags}
395-
-O2
396-
VENDOR
397-
)
398-
399-
add_entrypoint_object(
400-
atan
401-
SRCS
402-
atan.cpp
403-
HDRS
404-
../atan.h
405-
COMPILE_OPTIONS
406-
${bitcode_link_flags}
407-
-O2
408-
VENDOR
409-
)
410-
411-
add_entrypoint_object(
412-
atanh
413-
SRCS
414-
atanh.cpp
415-
HDRS
416-
../atanh.h
417-
COMPILE_OPTIONS
418-
${bitcode_link_flags}
419-
-O2
420-
VENDOR
421-
)
422-
423-
add_entrypoint_object(
424-
cosh
425-
SRCS
426-
cosh.cpp
427-
HDRS
428-
../cosh.h
429-
COMPILE_OPTIONS
430-
${bitcode_link_flags}
431-
-O2
432-
VENDOR
433-
)
434-
435-
add_entrypoint_object(
436-
erf
437-
SRCS
438-
erf.cpp
439-
HDRS
440-
../erf.h
441-
COMPILE_OPTIONS
442-
${bitcode_link_flags}
443-
-O2
444-
VENDOR
445-
)
446-
447-
add_entrypoint_object(
448-
powi
449-
SRCS
450-
powi.cpp
451-
HDRS
452-
../powi.h
453-
COMPILE_OPTIONS
454-
${bitcode_link_flags}
455-
-O2
456-
VENDOR
457-
)
458-
459-
add_entrypoint_object(
460-
powif
461-
SRCS
462-
powif.cpp
463-
HDRS
464-
../powif.h
465-
COMPILE_OPTIONS
466-
${bitcode_link_flags}
467-
-O2
468-
VENDOR
469-
)
470-
471-
add_entrypoint_object(
472-
sinh
473-
SRCS
474-
sinh.cpp
475-
HDRS
476-
../sinh.h
477-
COMPILE_OPTIONS
478-
${bitcode_link_flags}
479-
-O2
480-
VENDOR
481-
)
482-
483-
add_entrypoint_object(
484-
tanh
485-
SRCS
486-
tanh.cpp
487-
HDRS
488-
../tanh.h
489-
COMPILE_OPTIONS
490-
${bitcode_link_flags}
491-
-O2
492-
VENDOR
493-
)
494-
495349
add_entrypoint_object(
496350
tgamma
497351
SRCS
@@ -501,7 +355,6 @@ add_entrypoint_object(
501355
COMPILE_OPTIONS
502356
${bitcode_link_flags}
503357
-O2
504-
VENDOR
505358
)
506359

507360
add_entrypoint_object(
@@ -513,7 +366,6 @@ add_entrypoint_object(
513366
COMPILE_OPTIONS
514367
${bitcode_link_flags}
515368
-O2
516-
VENDOR
517369
)
518370

519371
add_entrypoint_object(
@@ -525,7 +377,6 @@ add_entrypoint_object(
525377
COMPILE_OPTIONS
526378
${bitcode_link_flags}
527379
-O2
528-
VENDOR
529380
)
530381

531382
add_entrypoint_object(
@@ -537,5 +388,4 @@ add_entrypoint_object(
537388
COMPILE_OPTIONS
538389
${bitcode_link_flags}
539390
-O2
540-
VENDOR
541391
)

0 commit comments

Comments
 (0)