[libc] Switch to use a macro which does not insert a section for every libc function.

Summary:
The new macro also inserts the C alias for the C++ implementations
without needing an objcopy based post processing step. The CMake
rules have been updated to reflect this. More CMake cleanup can be
taken up in future rounds and appropriate TODOs have been added for them.

Reviewers: mcgrathr, sivachandra

Subscribers:
This commit is contained in:
Michael Jones 2020-12-23 18:46:09 +00:00
parent daaaed6bb8
commit a0b65a7bcd
147 changed files with 210 additions and 222 deletions

View File

@ -147,10 +147,26 @@ function(add_entrypoint_object target_name)
message(FATAL_ERROR "`add_entrypoint_object` rule requires HDRS to be specified.")
endif()
set(objects_target_name "${fq_target_name}_objects")
set(common_compile_options -fpie ${LLVM_CXX_STD_default} -ffreestanding ${ADD_ENTRYPOINT_OBJ_COMPILE_OPTIONS})
set(internal_target_name ${fq_target_name}.__internal__)
set(include_dirs ${LIBC_BUILD_DIR}/include ${LIBC_SOURCE_DIR} ${LIBC_BUILD_DIR})
get_fq_deps_list(fq_deps_list ${ADD_ENTRYPOINT_OBJ_DEPENDS})
set(full_deps_list ${fq_deps_list} libc.src.__support.common)
add_library(
${objects_target_name}
${internal_target_name}
# TODO: We don't need an object library for internal consumption.
# A future change should switch this to a normal static library.
OBJECT
${ADD_ENTRYPOINT_OBJ_SRCS}
${ADD_ENTRYPOINT_OBJ_HDRS}
)
target_compile_options(${internal_target_name} BEFORE PRIVATE ${common_compile_options})
target_include_directories(${internal_target_name} PRIVATE ${include_dirs})
add_dependencies(${internal_target_name} ${full_deps_list})
add_library(
${fq_target_name}
# We want an object library as the objects will eventually get packaged into
# an archive (like libc.a).
OBJECT
@ -158,68 +174,20 @@ function(add_entrypoint_object target_name)
${ADD_ENTRYPOINT_OBJ_HDRS}
)
target_compile_options(
${objects_target_name}
BEFORE
PRIVATE
-fpie ${LLVM_CXX_STD_default} -ffreestanding
)
target_include_directories(
${objects_target_name}
PRIVATE
${LIBC_BUILD_DIR}/include
${LIBC_SOURCE_DIR}
${LIBC_BUILD_DIR}
)
get_fq_deps_list(fq_deps_list ${ADD_ENTRYPOINT_OBJ_DEPENDS})
add_dependencies(
${objects_target_name}
libc.src.__support.common
${fq_deps_list}
${fq_target_name} BEFORE PRIVATE ${common_compile_options} -DLLVM_LIBC_PUBLIC_PACKAGING
)
target_include_directories(${fq_target_name} PRIVATE ${include_dirs})
add_dependencies(${fq_target_name} ${full_deps_list})
if(ADD_ENTRYPOINT_OBJ_COMPILE_OPTIONS)
target_compile_options(
${objects_target_name}
PRIVATE ${ADD_ENTRYPOINT_OBJ_COMPILE_OPTIONS}
)
endif()
set(object_file_raw "${CMAKE_CURRENT_BINARY_DIR}/${target_name}_raw.o")
set(object_file "${CMAKE_CURRENT_BINARY_DIR}/${target_name}.o")
set(input_objects $<TARGET_OBJECTS:${objects_target_name}>)
add_custom_command(
OUTPUT ${object_file_raw}
DEPENDS ${input_objects}
COMMAND ${CMAKE_LINKER} -r ${input_objects} -o ${object_file_raw}
)
set(alias_attributes "0,function,global")
if(ADD_ENTRYPOINT_OBJ_REDIRECTED)
set(alias_attributes "${alias_attributes},hidden")
endif()
add_custom_command(
OUTPUT ${object_file}
# We llvm-objcopy here as GNU-binutils objcopy does not support the 'hidden' flag.
DEPENDS ${object_file_raw} ${llvm-objcopy}
COMMAND $<TARGET_FILE:llvm-objcopy> --add-symbol
"${entrypoint_name}=.llvm.libc.entrypoint.${entrypoint_name}:${alias_attributes}"
${object_file_raw} ${object_file}
)
add_custom_target(
${fq_target_name}
ALL
DEPENDS ${object_file}
)
set_target_properties(
${fq_target_name}
PROPERTIES
"ENTRYPOINT_NAME" ${entrypoint_name}
"TARGET_TYPE" ${ENTRYPOINT_OBJ_TARGET_TYPE}
"OBJECT_FILE" "${object_file}"
"OBJECT_FILE_RAW" "${object_file_raw}"
"OBJECT_FILE" $<TARGET_OBJECTS:${fq_target_name}>
# TODO: We don't need to list internal object files if the internal
# target is a normal static library.
"OBJECT_FILE_RAW" $<TARGET_OBJECTS:${internal_target_name}>
"DEPS" "${fq_deps_list}"
)
@ -273,7 +241,7 @@ function(add_entrypoint_object target_name)
# crossplatform touch.
COMMAND "${CMAKE_COMMAND}" -E touch ${lint_timestamp}
COMMENT "Linting... ${target_name}"
DEPENDS clang-tidy ${objects_target_name} ${ADD_ENTRYPOINT_OBJ_SRCS}
DEPENDS clang-tidy ${internal_target_name} ${ADD_ENTRYPOINT_OBJ_SRCS}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)

View File

@ -15,8 +15,19 @@
#define unlikely(x) __builtin_expect (x, 0)
#define UNUSED __attribute__((unused))
<!> Include the platform specific definitions at build time. For example, that
<!> of entrypoint macro.
%%include_file(${platform_defs})
#ifndef LLVM_LIBC_FUNCTION_ATTR
#define LLVM_LIBC_FUNCTION_ATTR
#endif
#ifdef LLVM_LIBC_PUBLIC_PACKAGING
#define LLVM_LIBC_FUNCTION(type, name, arglist) \
type name arglist; \
LLVM_LIBC_FUNCTION_ATTR decltype(__llvm_libc::name) __##name##_impl__ __asm__(#name); \
decltype(__llvm_libc::name) name [[gnu::alias(#name)]]; \
type __##name##_impl__ arglist
#else
#define LLVM_LIBC_FUNCTION(type, name, arglist)\
type name arglist
#endif
#endif // LLVM_LIBC_SUPPORT_COMMON_H

View File

@ -24,8 +24,9 @@ static void writeToStderr(const char *s) {
__llvm_libc::syscall(SYS_write, 2, s, length);
}
void LLVM_LIBC_ENTRYPOINT(__assert_fail)(const char *assertion, const char *file,
unsigned line, const char *function) {
LLVM_LIBC_FUNCTION(void, __assert_fail,
(const char *assertion, const char *file, unsigned line,
const char *function)) {
writeToStderr(file);
writeToStderr(": Assertion failed: '");
writeToStderr(assertion);

View File

@ -15,6 +15,6 @@ namespace __llvm_libc {
// TODO: Currently restricted to default locale.
// These should be extended using locale information.
int LLVM_LIBC_ENTRYPOINT(isalnum)(int c) { return internal::isalnum(c); }
LLVM_LIBC_FUNCTION(int, isalnum, (int c)) { return internal::isalnum(c); }
} // namespace __llvm_libc

View File

@ -15,6 +15,6 @@ namespace __llvm_libc {
// TODO: Currently restricted to default locale.
// These should be extended using locale information.
int LLVM_LIBC_ENTRYPOINT(isalpha)(int c) { return internal::isalpha(c); }
LLVM_LIBC_FUNCTION(int, isalpha, (int c)) { return internal::isalpha(c); }
} // namespace __llvm_libc

View File

@ -14,7 +14,7 @@ namespace __llvm_libc {
// TODO: Currently restricted to default locale.
// These should be extended using locale information.
int LLVM_LIBC_ENTRYPOINT(isblank)(int c) {
LLVM_LIBC_FUNCTION(int, isblank, (int c)) {
const unsigned char ch = c;
return ch == ' ' || ch == '\t';
}

View File

@ -14,7 +14,7 @@ namespace __llvm_libc {
// TODO: Currently restricted to default locale.
// These should be extended using locale information.
int LLVM_LIBC_ENTRYPOINT(iscntrl)(int c) {
LLVM_LIBC_FUNCTION(int, iscntrl, (int c)) {
const unsigned char ch = c;
return ch < 0x20 || ch == 0x7f;
}

View File

@ -14,6 +14,6 @@ namespace __llvm_libc {
// TODO: Currently restricted to default locale.
// These should be extended using locale information.
int LLVM_LIBC_ENTRYPOINT(isdigit)(int c) { return internal::isdigit(c); }
LLVM_LIBC_FUNCTION(int, isdigit, (int c)) { return internal::isdigit(c); }
} // namespace __llvm_libc

View File

@ -15,6 +15,6 @@ namespace __llvm_libc {
// TODO: Currently restricted to default locale.
// These should be extended using locale information.
int LLVM_LIBC_ENTRYPOINT(isgraph)(int c) { return internal::isgraph(c); }
LLVM_LIBC_FUNCTION(int, isgraph, (int c)) { return internal::isgraph(c); }
} // namespace __llvm_libc

View File

@ -15,6 +15,6 @@ namespace __llvm_libc {
// TODO: Currently restricted to default locale.
// These should be extended using locale information.
int LLVM_LIBC_ENTRYPOINT(islower)(int c) { return internal::islower(c); }
LLVM_LIBC_FUNCTION(int, islower, (int c)) { return internal::islower(c); }
} // namespace __llvm_libc

View File

@ -14,7 +14,7 @@ namespace __llvm_libc {
// TODO: Currently restricted to default locale.
// These should be extended using locale information.
int LLVM_LIBC_ENTRYPOINT(isprint)(int c) {
LLVM_LIBC_FUNCTION(int, isprint, (int c)) {
const unsigned ch = c;
return (ch - ' ') < 95;
}

View File

@ -15,7 +15,7 @@ namespace __llvm_libc {
// TODO: Currently restricted to default locale.
// These should be extended using locale information.
int LLVM_LIBC_ENTRYPOINT(ispunct)(int c) {
LLVM_LIBC_FUNCTION(int, ispunct, (int c)) {
return !internal::isalnum(c) && internal::isgraph(c);
}

View File

@ -14,7 +14,7 @@ namespace __llvm_libc {
// TODO: Currently restricted to default locale.
// These should be extended using locale information.
int LLVM_LIBC_ENTRYPOINT(isspace)(int c) {
LLVM_LIBC_FUNCTION(int, isspace, (int c)) {
const unsigned ch = c;
return ch == ' ' || (ch - '\t') < 5;
}

View File

@ -15,6 +15,6 @@ namespace __llvm_libc {
// TODO: Currently restricted to default locale.
// These should be extended using locale information.
int LLVM_LIBC_ENTRYPOINT(isupper)(int c) { return internal::isupper(c); }
LLVM_LIBC_FUNCTION(int, isupper, (int c)) { return internal::isupper(c); }
} // namespace __llvm_libc

View File

@ -15,7 +15,7 @@ namespace __llvm_libc {
// TODO: Currently restricted to default locale.
// These should be extended using locale information.
int LLVM_LIBC_ENTRYPOINT(isxdigit)(int c) {
LLVM_LIBC_FUNCTION(int, isxdigit, (int c)) {
const unsigned ch = c;
return internal::isdigit(ch) || (ch | 32) - 'a' < 6;
}

View File

@ -15,7 +15,7 @@ namespace __llvm_libc {
// TODO: Currently restricted to default locale.
// These should be extended using locale information.
int LLVM_LIBC_ENTRYPOINT(tolower)(int c) {
LLVM_LIBC_FUNCTION(int, tolower, (int c)) {
if (internal::isupper(c))
return c + 'a' - 'A';
return c;

View File

@ -15,7 +15,7 @@ namespace __llvm_libc {
// TODO: Currently restricted to default locale.
// These should be extended using locale information.
int LLVM_LIBC_ENTRYPOINT(toupper)(int c) {
LLVM_LIBC_FUNCTION(int, toupper, (int c)) {
if (internal::islower(c))
return c + 'A' - 'a';
return c;

View File

@ -17,6 +17,6 @@ static thread_local int __errno = 0;
// __errno_location is not really an entry point but we still want it to behave
// like an entry point because the errno macro resolves to the C symbol
// "__errno_location".
int *LLVM_LIBC_ENTRYPOINT(__errno_location)() { return &__errno; }
LLVM_LIBC_FUNCTION(int *, __errno_location, ()) { return &__errno; }
} // namespace __llvm_libc

View File

@ -11,7 +11,7 @@
namespace __llvm_libc {
int LLVM_LIBC_ENTRYPOINT(feclearexcept)(int e) {
LLVM_LIBC_FUNCTION(int, feclearexcept, (int e)) {
return fputil::clearExcept(e);
}

View File

@ -11,6 +11,6 @@
namespace __llvm_libc {
int LLVM_LIBC_ENTRYPOINT(fegetround)() { return fputil::getRound(); }
LLVM_LIBC_FUNCTION(int, fegetround, ()) { return fputil::getRound(); }
} // namespace __llvm_libc

View File

@ -11,7 +11,7 @@
namespace __llvm_libc {
int LLVM_LIBC_ENTRYPOINT(feraiseexcept)(int e) {
LLVM_LIBC_FUNCTION(int, feraiseexcept, (int e)) {
return fputil::raiseExcept(e);
}

View File

@ -11,6 +11,6 @@
namespace __llvm_libc {
int LLVM_LIBC_ENTRYPOINT(fesetround)(int m) { return fputil::setRound(m); }
LLVM_LIBC_FUNCTION(int, fesetround, (int m)) { return fputil::setRound(m); }
} // namespace __llvm_libc

View File

@ -11,6 +11,6 @@
namespace __llvm_libc {
int LLVM_LIBC_ENTRYPOINT(fetestexcept)(int e) { return fputil::testExcept(e); }
LLVM_LIBC_FUNCTION(int, fetestexcept, (int e)) { return fputil::testExcept(e); }
} // namespace __llvm_libc

View File

@ -11,6 +11,6 @@
namespace __llvm_libc {
double LLVM_LIBC_ENTRYPOINT(ceil)(double x) { return fputil::ceil(x); }
LLVM_LIBC_FUNCTION(double, ceil, (double x)) { return fputil::ceil(x); }
} // namespace __llvm_libc

View File

@ -11,6 +11,6 @@
namespace __llvm_libc {
float LLVM_LIBC_ENTRYPOINT(ceilf)(float x) { return fputil::ceil(x); }
LLVM_LIBC_FUNCTION(float, ceilf, (float x)) { return fputil::ceil(x); }
} // namespace __llvm_libc

View File

@ -11,7 +11,7 @@
namespace __llvm_libc {
long double LLVM_LIBC_ENTRYPOINT(ceill)(long double x) {
LLVM_LIBC_FUNCTION(long double, ceill, (long double x)) {
return fputil::ceil(x);
}

View File

@ -11,7 +11,7 @@
namespace __llvm_libc {
double LLVM_LIBC_ENTRYPOINT(copysign)(double x, double y) {
LLVM_LIBC_FUNCTION(double, copysign, (double x, double y)) {
return fputil::copysign(x, y);
}

View File

@ -11,7 +11,7 @@
namespace __llvm_libc {
float LLVM_LIBC_ENTRYPOINT(copysignf)(float x, float y) {
LLVM_LIBC_FUNCTION(float, copysignf, (float x, float y)) {
return fputil::copysign(x, y);
}

View File

@ -11,7 +11,7 @@
namespace __llvm_libc {
long double LLVM_LIBC_ENTRYPOINT(copysignl)(long double x, long double y) {
LLVM_LIBC_FUNCTION(long double, copysignl, (long double x, long double y)) {
return fputil::copysign(x, y);
}

View File

@ -20,7 +20,7 @@ namespace __llvm_libc {
// error is 0.5303 * 2^-23. A single-step range reduction is used for
// small values. Large inputs have their range reduced using fast integer
// arithmetic.
float LLVM_LIBC_ENTRYPOINT(cosf)(float y) {
LLVM_LIBC_FUNCTION(float, cosf, (float y)) {
double x = y;
double s;
int n;

View File

@ -20,7 +20,7 @@
namespace __llvm_libc {
float LLVM_LIBC_ENTRYPOINT(exp2f)(float x) {
LLVM_LIBC_FUNCTION(float, exp2f, (float x)) {
uint32_t abstop;
uint64_t ki, t;
// double_t for better performance on targets with FLT_EVAL_METHOD==2.

View File

@ -21,7 +21,7 @@
namespace __llvm_libc {
float LLVM_LIBC_ENTRYPOINT(expf)(float x) {
LLVM_LIBC_FUNCTION(float, expf, (float x)) {
uint32_t abstop;
uint64_t ki, t;
// double_t for better performance on targets with FLT_EVAL_METHOD == 2.

View File

@ -11,6 +11,6 @@
namespace __llvm_libc {
double LLVM_LIBC_ENTRYPOINT(fabs)(double x) { return fputil::abs(x); }
LLVM_LIBC_FUNCTION(double, fabs, (double x)) { return fputil::abs(x); }
} // namespace __llvm_libc

View File

@ -11,6 +11,6 @@
namespace __llvm_libc {
float LLVM_LIBC_ENTRYPOINT(fabsf)(float x) { return fputil::abs(x); }
LLVM_LIBC_FUNCTION(float, fabsf, (float x)) { return fputil::abs(x); }
} // namespace __llvm_libc

View File

@ -11,7 +11,7 @@
namespace __llvm_libc {
long double LLVM_LIBC_ENTRYPOINT(fabsl)(long double x) {
LLVM_LIBC_FUNCTION(long double, fabsl, (long double x)) {
return fputil::abs(x);
}

View File

@ -11,7 +11,7 @@
namespace __llvm_libc {
double LLVM_LIBC_ENTRYPOINT(fdim)(double x, double y) {
LLVM_LIBC_FUNCTION(double, fdim, (double x, double y)) {
return fputil::fdim(x, y);
}

View File

@ -11,7 +11,7 @@
namespace __llvm_libc {
float LLVM_LIBC_ENTRYPOINT(fdimf)(float x, float y) {
LLVM_LIBC_FUNCTION(float, fdimf, (float x, float y)) {
return fputil::fdim(x, y);
}

View File

@ -11,7 +11,7 @@
namespace __llvm_libc {
long double LLVM_LIBC_ENTRYPOINT(fdiml)(long double x, long double y) {
LLVM_LIBC_FUNCTION(long double, fdiml, (long double x, long double y)) {
return fputil::fdim(x, y);
}

View File

@ -11,6 +11,6 @@
namespace __llvm_libc {
double LLVM_LIBC_ENTRYPOINT(floor)(double x) { return fputil::floor(x); }
LLVM_LIBC_FUNCTION(double, floor, (double x)) { return fputil::floor(x); }
} // namespace __llvm_libc

View File

@ -11,6 +11,6 @@
namespace __llvm_libc {
float LLVM_LIBC_ENTRYPOINT(floorf)(float x) { return fputil::floor(x); }
LLVM_LIBC_FUNCTION(float, floorf, (float x)) { return fputil::floor(x); }
} // namespace __llvm_libc

View File

@ -11,7 +11,7 @@
namespace __llvm_libc {
long double LLVM_LIBC_ENTRYPOINT(floorl)(long double x) {
LLVM_LIBC_FUNCTION(long double, floorl, (long double x)) {
return fputil::floor(x);
}

View File

@ -13,7 +13,7 @@
namespace __llvm_libc {
float LLVM_LIBC_ENTRYPOINT(fmaf)(float x, float y, float z) {
LLVM_LIBC_FUNCTION(float, fmaf, (float x, float y, float z)){
// Product is exact.
double prod = static_cast<double>(x) * static_cast<double>(y);
double z_d = static_cast<double>(z);

View File

@ -11,7 +11,7 @@
namespace __llvm_libc {
double LLVM_LIBC_ENTRYPOINT(fmax)(double x, double y) {
LLVM_LIBC_FUNCTION(double, fmax, (double x, double y)) {
return fputil::fmax(x, y);
}

View File

@ -11,7 +11,7 @@
namespace __llvm_libc {
float LLVM_LIBC_ENTRYPOINT(fmaxf)(float x, float y) {
LLVM_LIBC_FUNCTION(float, fmaxf, (float x, float y)) {
return fputil::fmax(x, y);
}

View File

@ -11,7 +11,7 @@
namespace __llvm_libc {
long double LLVM_LIBC_ENTRYPOINT(fmaxl)(long double x, long double y) {
LLVM_LIBC_FUNCTION(long double, fmaxl, (long double x, long double y)) {
return fputil::fmax(x, y);
}

View File

@ -11,7 +11,7 @@
namespace __llvm_libc {
double LLVM_LIBC_ENTRYPOINT(fmin)(double x, double y) {
LLVM_LIBC_FUNCTION(double, fmin, (double x, double y)) {
return fputil::fmin(x, y);
}

View File

@ -11,7 +11,7 @@
namespace __llvm_libc {
float LLVM_LIBC_ENTRYPOINT(fminf)(float x, float y) {
LLVM_LIBC_FUNCTION(float, fminf, (float x, float y)) {
return fputil::fmin(x, y);
}

View File

@ -11,7 +11,7 @@
namespace __llvm_libc {
long double LLVM_LIBC_ENTRYPOINT(fminl)(long double x, long double y) {
LLVM_LIBC_FUNCTION(long double, fminl, (long double x, long double y)) {
return fputil::fmin(x, y);
}

View File

@ -11,7 +11,7 @@
namespace __llvm_libc {
double LLVM_LIBC_ENTRYPOINT(frexp)(double x, int *exp) {
LLVM_LIBC_FUNCTION(double, frexp, (double x, int *exp)) {
return fputil::frexp(x, *exp);
}

View File

@ -11,7 +11,7 @@
namespace __llvm_libc {
float LLVM_LIBC_ENTRYPOINT(frexpf)(float x, int *exp) {
LLVM_LIBC_FUNCTION(float, frexpf, (float x, int *exp)) {
return fputil::frexp(x, *exp);
}

View File

@ -11,7 +11,7 @@
namespace __llvm_libc {
long double LLVM_LIBC_ENTRYPOINT(frexpl)(long double x, int *exp) {
LLVM_LIBC_FUNCTION(long double, frexpl, (long double x, int *exp)) {
return fputil::frexp(x, *exp);
}

View File

@ -11,7 +11,7 @@
namespace __llvm_libc {
double LLVM_LIBC_ENTRYPOINT(hypot)(double x, double y) {
LLVM_LIBC_FUNCTION(double, hypot, (double x, double y)) {
return __llvm_libc::fputil::hypot(x, y);
}

View File

@ -10,7 +10,7 @@
namespace __llvm_libc {
float LLVM_LIBC_ENTRYPOINT(hypotf)(float x, float y) {
LLVM_LIBC_FUNCTION(float, hypotf, (float x, float y)) {
return __llvm_libc::fputil::hypot(x, y);
}

View File

@ -11,6 +11,6 @@
namespace __llvm_libc {
int LLVM_LIBC_ENTRYPOINT(ilogb)(double x) { return fputil::ilogb(x); }
LLVM_LIBC_FUNCTION(int, ilogb, (double x)) { return fputil::ilogb(x); }
} // namespace __llvm_libc

View File

@ -11,6 +11,6 @@
namespace __llvm_libc {
int LLVM_LIBC_ENTRYPOINT(ilogbf)(float x) { return fputil::ilogb(x); }
LLVM_LIBC_FUNCTION(int, ilogbf, (float x)) { return fputil::ilogb(x); }
} // namespace __llvm_libc

View File

@ -11,6 +11,6 @@
namespace __llvm_libc {
int LLVM_LIBC_ENTRYPOINT(ilogbl)(long double x) { return fputil::ilogb(x); }
LLVM_LIBC_FUNCTION(int, ilogbl, (long double x)) { return fputil::ilogb(x); }
} // namespace __llvm_libc

View File

@ -11,7 +11,7 @@
namespace __llvm_libc {
double LLVM_LIBC_ENTRYPOINT(ldexp)(double x, int exp) {
LLVM_LIBC_FUNCTION(double, ldexp, (double x, int exp)) {
return fputil::ldexp(x, exp);
}

View File

@ -11,7 +11,7 @@
namespace __llvm_libc {
float LLVM_LIBC_ENTRYPOINT(ldexpf)(float x, int exp) {
LLVM_LIBC_FUNCTION(float, ldexpf, (float x, int exp)) {
return fputil::ldexp(x, exp);
}

View File

@ -11,7 +11,7 @@
namespace __llvm_libc {
long double LLVM_LIBC_ENTRYPOINT(ldexpl)(long double x, int exp) {
LLVM_LIBC_FUNCTION(long double, ldexpl, (long double x, int exp)) {
return fputil::ldexp(x, exp);
}

View File

@ -11,7 +11,7 @@
namespace __llvm_libc {
long long LLVM_LIBC_ENTRYPOINT(llrint)(double x) {
LLVM_LIBC_FUNCTION(long long, llrint, (double x)) {
return fputil::roundToSignedIntegerUsingCurrentRoundingMode<double,
long long>(x);
}

View File

@ -11,7 +11,7 @@
namespace __llvm_libc {
long long LLVM_LIBC_ENTRYPOINT(llrintf)(float x) {
LLVM_LIBC_FUNCTION(long long, llrintf, (float x)) {
return fputil::roundToSignedIntegerUsingCurrentRoundingMode<float, long long>(
x);
}

View File

@ -11,7 +11,7 @@
namespace __llvm_libc {
long long LLVM_LIBC_ENTRYPOINT(llrintl)(long double x) {
LLVM_LIBC_FUNCTION(long long, llrintl, (long double x)) {
return fputil::roundToSignedIntegerUsingCurrentRoundingMode<long double,
long long>(x);
}

View File

@ -11,7 +11,7 @@
namespace __llvm_libc {
long long LLVM_LIBC_ENTRYPOINT(llround)(double x) {
LLVM_LIBC_FUNCTION(long long, llround, (double x)) {
return fputil::roundToSignedInteger<double, long long>(x);
}

View File

@ -11,7 +11,7 @@
namespace __llvm_libc {
long long LLVM_LIBC_ENTRYPOINT(llroundf)(float x) {
LLVM_LIBC_FUNCTION(long long, llroundf, (float x)) {
return fputil::roundToSignedInteger<float, long long>(x);
}

View File

@ -11,7 +11,7 @@
namespace __llvm_libc {
long long LLVM_LIBC_ENTRYPOINT(llroundl)(long double x) {
LLVM_LIBC_FUNCTION(long long, llroundl, (long double x)) {
return fputil::roundToSignedInteger<long double, long long>(x);
}

View File

@ -11,6 +11,6 @@
namespace __llvm_libc {
double LLVM_LIBC_ENTRYPOINT(logb)(double x) { return fputil::logb(x); }
LLVM_LIBC_FUNCTION(double, logb, (double x)) { return fputil::logb(x); }
} // namespace __llvm_libc

View File

@ -11,6 +11,6 @@
namespace __llvm_libc {
float LLVM_LIBC_ENTRYPOINT(logbf)(float x) { return fputil::logb(x); }
LLVM_LIBC_FUNCTION(float, logbf, (float x)) { return fputil::logb(x); }
} // namespace __llvm_libc

View File

@ -11,7 +11,7 @@
namespace __llvm_libc {
long double LLVM_LIBC_ENTRYPOINT(logbl)(long double x) {
LLVM_LIBC_FUNCTION(long double, logbl, (long double x)) {
return fputil::logb(x);
}

View File

@ -11,7 +11,7 @@
namespace __llvm_libc {
long LLVM_LIBC_ENTRYPOINT(lrint)(double x) {
LLVM_LIBC_FUNCTION(long, lrint, (double x)) {
return fputil::roundToSignedIntegerUsingCurrentRoundingMode<double, long>(x);
}

View File

@ -11,7 +11,7 @@
namespace __llvm_libc {
long LLVM_LIBC_ENTRYPOINT(lrintf)(float x) {
LLVM_LIBC_FUNCTION(long, lrintf, (float x)) {
return fputil::roundToSignedIntegerUsingCurrentRoundingMode<float, long>(x);
}

View File

@ -11,7 +11,7 @@
namespace __llvm_libc {
long LLVM_LIBC_ENTRYPOINT(lrintl)(long double x) {
LLVM_LIBC_FUNCTION(long, lrintl, (long double x)) {
return fputil::roundToSignedIntegerUsingCurrentRoundingMode<long double,
long>(x);
}

View File

@ -11,7 +11,7 @@
namespace __llvm_libc {
long LLVM_LIBC_ENTRYPOINT(lround)(double x) {
LLVM_LIBC_FUNCTION(long, lround, (double x)) {
return fputil::roundToSignedInteger<double, long>(x);
}

View File

@ -11,7 +11,7 @@
namespace __llvm_libc {
long LLVM_LIBC_ENTRYPOINT(lroundf)(float x) {
LLVM_LIBC_FUNCTION(long, lroundf, (float x)) {
return fputil::roundToSignedInteger<float, long>(x);
}

View File

@ -11,7 +11,7 @@
namespace __llvm_libc {
long LLVM_LIBC_ENTRYPOINT(lroundl)(long double x) {
LLVM_LIBC_FUNCTION(long, lroundl, (long double x)) {
return fputil::roundToSignedInteger<long double, long>(x);
}

View File

@ -11,7 +11,7 @@
namespace __llvm_libc {
double LLVM_LIBC_ENTRYPOINT(modf)(double x, double *iptr) {
LLVM_LIBC_FUNCTION(double, modf, (double x, double *iptr)) {
return fputil::modf(x, *iptr);
}

View File

@ -11,7 +11,7 @@
namespace __llvm_libc {
float LLVM_LIBC_ENTRYPOINT(modff)(float x, float *iptr) {
LLVM_LIBC_FUNCTION(float, modff, (float x, float *iptr)) {
return fputil::modf(x, *iptr);
}

View File

@ -11,7 +11,7 @@
namespace __llvm_libc {
long double LLVM_LIBC_ENTRYPOINT(modfl)(long double x, long double *iptr) {
LLVM_LIBC_FUNCTION(long double, modfl, (long double x, long double *iptr)) {
return fputil::modf(x, *iptr);
}

View File

@ -11,7 +11,7 @@
namespace __llvm_libc {
double LLVM_LIBC_ENTRYPOINT(nearbyint)(double x) {
LLVM_LIBC_FUNCTION(double, nearbyint, (double x)) {
return fputil::roundUsingCurrentRoundingMode(x);
}

View File

@ -11,7 +11,7 @@
namespace __llvm_libc {
float LLVM_LIBC_ENTRYPOINT(nearbyintf)(float x) {
LLVM_LIBC_FUNCTION(float, nearbyintf, (float x)) {
return fputil::roundUsingCurrentRoundingMode(x);
}

View File

@ -11,7 +11,7 @@
namespace __llvm_libc {
long double LLVM_LIBC_ENTRYPOINT(nearbyintl)(long double x) {
LLVM_LIBC_FUNCTION(long double, nearbyintl, (long double x)) {
return fputil::roundUsingCurrentRoundingMode(x);
}

View File

@ -11,7 +11,7 @@
namespace __llvm_libc {
double LLVM_LIBC_ENTRYPOINT(nextafter)(double x, double y) {
LLVM_LIBC_FUNCTION(double, nextafter, (double x, double y)) {
return fputil::nextafter(x, y);
}

View File

@ -11,7 +11,7 @@
namespace __llvm_libc {
float LLVM_LIBC_ENTRYPOINT(nextafterf)(float x, float y) {
LLVM_LIBC_FUNCTION(float, nextafterf, (float x, float y)) {
return fputil::nextafter(x, y);
}

View File

@ -11,7 +11,7 @@
namespace __llvm_libc {
long double LLVM_LIBC_ENTRYPOINT(nextafterl)(long double x, long double y) {
LLVM_LIBC_FUNCTION(long double, nextafterl, (long double x, long double y)) {
return fputil::nextafter(x, y);
}

View File

@ -11,7 +11,7 @@
namespace __llvm_libc {
double LLVM_LIBC_ENTRYPOINT(remainder)(double x, double y) {
LLVM_LIBC_FUNCTION(double, remainder, (double x, double y)) {
int quotient;
return fputil::remquo(x, y, quotient);
}

View File

@ -11,7 +11,7 @@
namespace __llvm_libc {
float LLVM_LIBC_ENTRYPOINT(remainderf)(float x, float y) {
LLVM_LIBC_FUNCTION(float, remainderf, (float x, float y)) {
int quotient;
return fputil::remquo(x, y, quotient);
}

View File

@ -11,7 +11,7 @@
namespace __llvm_libc {
long double LLVM_LIBC_ENTRYPOINT(remainderl)(long double x, long double y) {
LLVM_LIBC_FUNCTION(long double, remainderl, (long double x, long double y)) {
int quotient;
return fputil::remquo(x, y, quotient);
}

View File

@ -11,7 +11,7 @@
namespace __llvm_libc {
double LLVM_LIBC_ENTRYPOINT(remquo)(double x, double y, int *exp) {
LLVM_LIBC_FUNCTION(double, remquo, (double x, double y, int *exp)) {
return fputil::remquo(x, y, *exp);
}

View File

@ -11,7 +11,7 @@
namespace __llvm_libc {
float LLVM_LIBC_ENTRYPOINT(remquof)(float x, float y, int *exp) {
LLVM_LIBC_FUNCTION(float, remquof, (float x, float y, int *exp)) {
return fputil::remquo(x, y, *exp);
}

View File

@ -11,8 +11,8 @@
namespace __llvm_libc {
long double LLVM_LIBC_ENTRYPOINT(remquol)(long double x, long double y,
int *exp) {
LLVM_LIBC_FUNCTION(long double, remquol,
(long double x, long double y, int *exp)) {
return fputil::remquo(x, y, *exp);
}

View File

@ -11,7 +11,7 @@
namespace __llvm_libc {
double LLVM_LIBC_ENTRYPOINT(rint)(double x) {
LLVM_LIBC_FUNCTION(double, rint, (double x)) {
return fputil::roundUsingCurrentRoundingMode(x);
}

View File

@ -11,7 +11,7 @@
namespace __llvm_libc {
float LLVM_LIBC_ENTRYPOINT(rintf)(float x) {
LLVM_LIBC_FUNCTION(float, rintf, (float x)) {
return fputil::roundUsingCurrentRoundingMode(x);
}

View File

@ -11,7 +11,7 @@
namespace __llvm_libc {
long double LLVM_LIBC_ENTRYPOINT(rintl)(long double x) {
LLVM_LIBC_FUNCTION(long double, rintl, (long double x)) {
return fputil::roundUsingCurrentRoundingMode(x);
}

View File

@ -11,6 +11,6 @@
namespace __llvm_libc {
double LLVM_LIBC_ENTRYPOINT(round)(double x) { return fputil::round(x); }
LLVM_LIBC_FUNCTION(double, round, (double x)) { return fputil::round(x); }
} // namespace __llvm_libc

View File

@ -11,6 +11,6 @@
namespace __llvm_libc {
float LLVM_LIBC_ENTRYPOINT(roundf)(float x) { return fputil::round(x); }
LLVM_LIBC_FUNCTION(float, roundf, (float x)) { return fputil::round(x); }
} // namespace __llvm_libc

View File

@ -11,7 +11,7 @@
namespace __llvm_libc {
long double LLVM_LIBC_ENTRYPOINT(roundl)(long double x) {
LLVM_LIBC_FUNCTION(long double, roundl, (long double x)) {
return fputil::round(x);
}

View File

@ -20,7 +20,7 @@ namespace __llvm_libc {
// error is 0.5303 * 2^-23. A single-step range reduction is used for
// small values. Large inputs have their range reduced using fast integer
// arithmetic.
void LLVM_LIBC_ENTRYPOINT(sincosf)(float y, float *sinp, float *cosp) {
LLVM_LIBC_FUNCTION(void, sincosf, (float y, float *sinp, float *cosp)) {
double x = y;
double s;
int n;

View File

@ -20,7 +20,7 @@ namespace __llvm_libc {
// error is 0.5303 * 2^-23. A single-step range reduction is used for
// small values. Large inputs have their range reduced using fast integer
// arithmetic.
float LLVM_LIBC_ENTRYPOINT(sinf)(float y) {
LLVM_LIBC_FUNCTION(float, sinf, (float y)) {
double x = y;
double s;
int n;

View File

@ -11,6 +11,6 @@
namespace __llvm_libc {
double LLVM_LIBC_ENTRYPOINT(sqrt)(double x) { return fputil::sqrt(x); }
LLVM_LIBC_FUNCTION(double, sqrt, (double x)) { return fputil::sqrt(x); }
} // namespace __llvm_libc

View File

@ -11,6 +11,6 @@
namespace __llvm_libc {
float LLVM_LIBC_ENTRYPOINT(sqrtf)(float x) { return fputil::sqrt(x); }
LLVM_LIBC_FUNCTION(float, sqrtf, (float x)) { return fputil::sqrt(x); }
} // namespace __llvm_libc

View File

@ -11,7 +11,7 @@
namespace __llvm_libc {
long double LLVM_LIBC_ENTRYPOINT(sqrtl)(long double x) {
LLVM_LIBC_FUNCTION(long double, sqrtl, (long double x)) {
return fputil::sqrt(x);
}

Some files were not shown because too many files have changed in this diff Show More