Summary: This patch adds a temporary implementation that uses a struct-based interface in lieu of varargs support. Once varargs support exists we will move this implementation to the "real" printf implementation. Conceptually, this patch has the client copy over its format string and arguments to the server. The server will then scan the format string searching for any specifiers that are actually a string. If it is a string then we will send the pointer back to the server to tell it to copy it back. This copied value will then replace the pointer when the final formatting is done. This will require a built-in extension to the varargs support to get access to the underlying struct. The varargs used on the GPU will simply be a struct wrapped in a varargs ABI.
335 lines
9.2 KiB
Plaintext
335 lines
9.2 KiB
Plaintext
set(TARGET_LIBC_ENTRYPOINTS
|
|
# assert.h entrypoints
|
|
libc.src.assert.__assert_fail
|
|
|
|
# ctype.h entrypoints
|
|
libc.src.ctype.isalnum
|
|
libc.src.ctype.isalpha
|
|
libc.src.ctype.isascii
|
|
libc.src.ctype.isblank
|
|
libc.src.ctype.iscntrl
|
|
libc.src.ctype.isdigit
|
|
libc.src.ctype.isgraph
|
|
libc.src.ctype.islower
|
|
libc.src.ctype.isprint
|
|
libc.src.ctype.ispunct
|
|
libc.src.ctype.isspace
|
|
libc.src.ctype.isupper
|
|
libc.src.ctype.isxdigit
|
|
libc.src.ctype.toascii
|
|
libc.src.ctype.tolower
|
|
libc.src.ctype.toupper
|
|
|
|
# string.h entrypoints
|
|
libc.src.string.bcmp
|
|
libc.src.string.bcopy
|
|
libc.src.string.bzero
|
|
libc.src.string.index
|
|
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.rindex
|
|
libc.src.string.stpcpy
|
|
libc.src.string.stpncpy
|
|
libc.src.string.strcasecmp
|
|
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.strcpy
|
|
libc.src.string.strcspn
|
|
libc.src.string.strdup
|
|
libc.src.string.strlcat
|
|
libc.src.string.strlcpy
|
|
libc.src.string.strlen
|
|
libc.src.string.strncasecmp
|
|
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
|
|
|
|
# stdbit.h entrypoints
|
|
libc.src.stdbit.stdc_leading_zeros_uc
|
|
libc.src.stdbit.stdc_leading_zeros_us
|
|
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_ones_uc
|
|
libc.src.stdbit.stdc_leading_ones_us
|
|
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_trailing_zeros_uc
|
|
libc.src.stdbit.stdc_trailing_zeros_us
|
|
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_ones_uc
|
|
libc.src.stdbit.stdc_trailing_ones_us
|
|
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_first_leading_zero_uc
|
|
libc.src.stdbit.stdc_first_leading_zero_us
|
|
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_one_uc
|
|
libc.src.stdbit.stdc_first_leading_one_us
|
|
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_trailing_zero_uc
|
|
libc.src.stdbit.stdc_first_trailing_zero_us
|
|
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_one_uc
|
|
libc.src.stdbit.stdc_first_trailing_one_us
|
|
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_count_zeros_uc
|
|
libc.src.stdbit.stdc_count_zeros_us
|
|
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_ones_uc
|
|
libc.src.stdbit.stdc_count_ones_us
|
|
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_has_single_bit_uc
|
|
libc.src.stdbit.stdc_has_single_bit_us
|
|
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_bit_width_uc
|
|
libc.src.stdbit.stdc_bit_width_us
|
|
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_floor_uc
|
|
libc.src.stdbit.stdc_bit_floor_us
|
|
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_ceil_uc
|
|
libc.src.stdbit.stdc_bit_ceil_us
|
|
libc.src.stdbit.stdc_bit_ceil_ui
|
|
libc.src.stdbit.stdc_bit_ceil_ul
|
|
libc.src.stdbit.stdc_bit_ceil_ull
|
|
|
|
# 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.div
|
|
libc.src.stdlib.labs
|
|
libc.src.stdlib.bsearch
|
|
libc.src.stdlib.ldiv
|
|
libc.src.stdlib.llabs
|
|
libc.src.stdlib.lldiv
|
|
libc.src.stdlib.qsort
|
|
libc.src.stdlib.qsort_r
|
|
libc.src.stdlib.rand
|
|
libc.src.stdlib.srand
|
|
libc.src.stdlib.strtod
|
|
libc.src.stdlib.strtof
|
|
libc.src.stdlib.strtol
|
|
libc.src.stdlib.strtold
|
|
libc.src.stdlib.strtoll
|
|
libc.src.stdlib.strtoul
|
|
libc.src.stdlib.strtoull
|
|
libc.src.stdlib._Exit
|
|
libc.src.stdlib.atexit
|
|
libc.src.stdlib.exit
|
|
libc.src.stdlib.abort
|
|
|
|
# Only implemented in the test suite
|
|
libc.src.stdlib.malloc
|
|
libc.src.stdlib.aligned_alloc
|
|
libc.src.stdlib.realloc
|
|
libc.src.stdlib.free
|
|
|
|
# errno.h entrypoints
|
|
libc.src.errno.errno
|
|
|
|
# stdio.h entrypoints
|
|
libc.src.stdio.feof
|
|
libc.src.stdio.ferror
|
|
libc.src.stdio.fseek
|
|
libc.src.stdio.fflush
|
|
libc.src.stdio.ftell
|
|
libc.src.stdio.clearerr
|
|
libc.src.stdio.puts
|
|
libc.src.stdio.fopen
|
|
libc.src.stdio.fclose
|
|
libc.src.stdio.fread
|
|
libc.src.stdio.fputs
|
|
libc.src.stdio.fwrite
|
|
libc.src.stdio.fputc
|
|
libc.src.stdio.putc
|
|
libc.src.stdio.putchar
|
|
libc.src.stdio.fgets
|
|
libc.src.stdio.fgetc
|
|
libc.src.stdio.getc
|
|
libc.src.stdio.getchar
|
|
libc.src.stdio.ungetc
|
|
libc.src.stdio.stdin
|
|
libc.src.stdio.stdout
|
|
libc.src.stdio.stderr
|
|
|
|
# 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.nanosleep
|
|
|
|
# gpu/rpc.h entrypoints
|
|
libc.src.gpu.rpc_host_call
|
|
libc.src.gpu.rpc_fprintf
|
|
)
|
|
|
|
set(TARGET_LIBM_ENTRYPOINTS
|
|
# math.h entrypoints
|
|
libc.src.math.acos
|
|
libc.src.math.acosf
|
|
libc.src.math.acosh
|
|
libc.src.math.acoshf
|
|
libc.src.math.asin
|
|
libc.src.math.asinf
|
|
libc.src.math.asinh
|
|
libc.src.math.asinhf
|
|
libc.src.math.atan
|
|
libc.src.math.atanf
|
|
libc.src.math.atan2
|
|
libc.src.math.atan2f
|
|
libc.src.math.atanh
|
|
libc.src.math.atanhf
|
|
libc.src.math.ceil
|
|
libc.src.math.ceilf
|
|
libc.src.math.copysign
|
|
libc.src.math.copysignf
|
|
libc.src.math.cos
|
|
libc.src.math.cosf
|
|
libc.src.math.cosh
|
|
libc.src.math.coshf
|
|
libc.src.math.erf
|
|
libc.src.math.erff
|
|
libc.src.math.exp10
|
|
libc.src.math.exp10f
|
|
libc.src.math.exp2
|
|
libc.src.math.exp2f
|
|
libc.src.math.exp
|
|
libc.src.math.expf
|
|
libc.src.math.expm1
|
|
libc.src.math.expm1f
|
|
libc.src.math.fabs
|
|
libc.src.math.fabsf
|
|
libc.src.math.fdim
|
|
libc.src.math.fdimf
|
|
libc.src.math.floor
|
|
libc.src.math.floorf
|
|
libc.src.math.fma
|
|
libc.src.math.fmaf
|
|
libc.src.math.fmax
|
|
libc.src.math.fmaxf
|
|
libc.src.math.fmin
|
|
libc.src.math.fminf
|
|
libc.src.math.fmod
|
|
libc.src.math.fmodf
|
|
libc.src.math.frexp
|
|
libc.src.math.frexpf
|
|
libc.src.math.hypot
|
|
libc.src.math.hypotf
|
|
libc.src.math.ilogb
|
|
libc.src.math.ilogbf
|
|
libc.src.math.ldexp
|
|
libc.src.math.ldexpf
|
|
libc.src.math.llogb
|
|
libc.src.math.llogbf
|
|
libc.src.math.llrint
|
|
libc.src.math.llrintf
|
|
libc.src.math.llround
|
|
libc.src.math.llroundf
|
|
libc.src.math.log10
|
|
libc.src.math.log10f
|
|
libc.src.math.log1p
|
|
libc.src.math.log1pf
|
|
libc.src.math.log2
|
|
libc.src.math.log2f
|
|
libc.src.math.log
|
|
libc.src.math.logf
|
|
libc.src.math.lrint
|
|
libc.src.math.lrintf
|
|
libc.src.math.lround
|
|
libc.src.math.lroundf
|
|
libc.src.math.modf
|
|
libc.src.math.modff
|
|
libc.src.math.nan
|
|
libc.src.math.nanf
|
|
libc.src.math.nearbyint
|
|
libc.src.math.nearbyintf
|
|
libc.src.math.nextafter
|
|
libc.src.math.nextafterf
|
|
libc.src.math.nexttoward
|
|
libc.src.math.nexttowardf
|
|
libc.src.math.pow
|
|
libc.src.math.powf
|
|
libc.src.math.remainder
|
|
libc.src.math.remainderf
|
|
libc.src.math.remquo
|
|
libc.src.math.remquof
|
|
libc.src.math.rint
|
|
libc.src.math.rintf
|
|
libc.src.math.round
|
|
libc.src.math.roundf
|
|
libc.src.math.scalbn
|
|
libc.src.math.scalbnf
|
|
libc.src.math.sin
|
|
libc.src.math.sinf
|
|
libc.src.math.sincos
|
|
libc.src.math.sincosf
|
|
libc.src.math.sinh
|
|
libc.src.math.sinhf
|
|
libc.src.math.sqrt
|
|
libc.src.math.sqrtf
|
|
libc.src.math.tan
|
|
libc.src.math.tanf
|
|
libc.src.math.tanh
|
|
libc.src.math.tanhf
|
|
libc.src.math.tgamma
|
|
libc.src.math.tgammaf
|
|
libc.src.math.trunc
|
|
libc.src.math.truncf
|
|
)
|
|
|
|
set(TARGET_LLVMLIBC_ENTRYPOINTS
|
|
${TARGET_LIBC_ENTRYPOINTS}
|
|
${TARGET_LIBM_ENTRYPOINTS}
|
|
)
|