Skip to content

Commit

Permalink
Enable GNUABI build on more targets shibatch#525 (shibatch#562)
Browse files Browse the repository at this point in the history
* Enable GNUABI build on more targets shibatch#525

Previously SLEEF_BUILD_GNUABI_LIBS was silently ignored except for a
small number of targets, or if the compiler does not support weak
aliases.

It can now be built regardless of OS and compiler on AArch64 and
x86_64 - trying to enable it on any other target is now an error.

The GLIBC *_finite symbols are handled using the same workaround as is
used for the DALIAS macro when compiling on a target which does not
support aliases. Though in practice these symbols are unlikely to be
required on systems where aliases are unsupported, they are part of
the API so need adding, if just to make the tests build.

Also removed two CMake variables:
- ENABLE_ALIAS, which was unused
- ENABLE_GNUABI, which was now redundant but could still be forced on,
  leading to cryptic build failures
Both names are still used by the preprocessor in sleefsimd* sources
for managing names and aliases.

* Fix masked GNUABI build for NOALIAS

Masked symbols also need to sidestep aliases when they are not
supported.

* Disable GNUABI for unsupported targets in precommit

Default is on, but this setting was previously just ignored when
unsupported. Disable it in the failing pipelines.
  • Loading branch information
joeramsay authored and blapie committed Aug 2, 2024
1 parent 4e08851 commit 8c643c5
Show file tree
Hide file tree
Showing 8 changed files with 107 additions and 77 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ env:
LLVM_VERSION: "17"
COMMON_CMAKE_FLAGS: >
-DSLEEF_SHOW_CONFIG=1
-DSLEEF_BUILD_GNUABI_LIBS=ON
-DSLEEF_BUILD_INLINE_HEADERS=ON
-DSLEEF_BUILD_DFT=ON
-DSLEEF_BUILD_QUAD=ON
Expand Down Expand Up @@ -214,15 +213,15 @@ jobs:
EXTRA_CMAKE_FLAGS="${EXTRA_CMAKE_FLAGS} -DSLEEF_ENFORCE_SVE=ON"
elif [[ ${{ matrix.arch }} = "armhf" ]]; then
# Disable inline headers, they just don't compile on armhf
EXTRA_CMAKE_FLAGS="${EXTRA_CMAKE_FLAGS} -DSLEEF_BUILD_INLINE_HEADERS=OFF"
EXTRA_CMAKE_FLAGS="${EXTRA_CMAKE_FLAGS} -DSLEEF_BUILD_INLINE_HEADERS=OFF -DSLEEF_BUILD_GNUABI_LIBS=OFF"
elif [[ ${{ matrix.arch }} = "ppc64el" ]]; then
EXTRA_CMAKE_FLAGS="${EXTRA_CMAKE_FLAGS} -DSLEEF_ENFORCE_VSX=ON -DSLEEF_ENFORCE_VSX3=ON"
EXTRA_CMAKE_FLAGS="${EXTRA_CMAKE_FLAGS} -DSLEEF_ENFORCE_VSX=ON -DSLEEF_ENFORCE_VSX3=ON -DSLEEF_BUILD_GNUABI_LIBS=OFF"
elif [[ ${{ matrix.arch }} = "s390x" ]]; then
EXTRA_CMAKE_FLAGS="${EXTRA_CMAKE_FLAGS} -DSLEEF_ENFORCE_VXE=ON"
EXTRA_CMAKE_FLAGS="${EXTRA_CMAKE_FLAGS} -DSLEEF_ENFORCE_VXE=ON -DSLEEF_BUILD_GNUABI_LIBS=OFF"
# Disable VXE2 support, QEMU doesn't support some instructions generated by gcc or llvm
EXTRA_CMAKE_FLAGS="${EXTRA_CMAKE_FLAGS} -DSLEEF_DISABLE_VXE2=ON"
elif [[ ${{ matrix.arch }} = "riscv64" ]]; then
EXTRA_CMAKE_FLAGS="${EXTRA_CMAKE_FLAGS} -DSLEEF_ENFORCE_RVVM1=ON -DSLEEF_ENFORCE_RVVM2=ON"
EXTRA_CMAKE_FLAGS="${EXTRA_CMAKE_FLAGS} -DSLEEF_ENFORCE_RVVM1=ON -DSLEEF_ENFORCE_RVVM2=ON -DSLEEF_BUILD_GNUABI_LIBS=OFF"
fi
cmake -S . -B _build-${{ matrix.arch }} -GNinja \
Expand Down
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,12 @@ if(SLEEF_SHOW_CONFIG)
message(STATUS "SED : " ${SED_COMMAND})
endif()
message(STATUS "COMPILER_SUPPORTS_OPENMP : " ${COMPILER_SUPPORTS_OPENMP})
if(ENABLE_GNUABI)
message(STATUS "A version of SLEEF compatible with libm and libmvec in GNU libc will be produced (${TARGET_LIBSLEEFGNUABI}.so)")
if(${SLEEF_BUILD_GNUABI_LIBS})
if(NOT (SLEEF_ARCH_X86 OR SLEEF_ARCH_AARCH64))
message(FATAL_ERROR "GNUABI requested but not supported on ${CMAKE_SYSTEM_PROCESSOR}")
else()
message(STATUS "A version of SLEEF compatible with libm and libmvec in GNU libc will be produced (${TARGET_LIBSLEEFGNUABI}.so)")
endif()
endif()
if (COMPILER_SUPPORTS_SVE)
message(STATUS "Building SLEEF with VLA SVE support")
Expand Down
7 changes: 0 additions & 7 deletions Configure.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -758,13 +758,6 @@ CHECK_C_SOURCE_COMPILES("
return g(2);
}"
COMPILER_SUPPORTS_WEAK_ALIASES)
if (COMPILER_SUPPORTS_WEAK_ALIASES AND
NOT CMAKE_SYSTEM_PROCESSOR MATCHES "arm" AND
NOT CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)64" AND
NOT SLEEF_CLANG_ON_WINDOWS AND
NOT MINGW AND SLEEF_BUILD_GNUABI_LIBS)
set(ENABLE_GNUABI ${COMPILER_SUPPORTS_WEAK_ALIASES})
endif()

# Built-in math functions

Expand Down
8 changes: 4 additions & 4 deletions src/libm-tester/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ function(add_gnuabi_compatibility_test SIMD MASKED)
endif(EMULATOR)
endfunction(add_gnuabi_compatibility_test)

if(ENABLE_GNUABI)
if(SLEEF_BUILD_GNUABI_LIBS)
foreach(SIMD ${SLEEF_SUPPORTED_GNUABI_EXTENSIONS})
if(COMPILER_SUPPORTS_${SIMD})
# GNUABI compatibility for the unmasked symbols.
Expand All @@ -366,7 +366,7 @@ if(ENABLE_GNUABI)
endif(MKMASKED_PARAMS_GNUABI_${SIMD}_sp)
endif (COMPILER_SUPPORTS_${SIMD})
endforeach(SIMD ${SLEEF_SUPPORTED_GNUABI_EXTENSIONS})
endif(ENABLE_GNUABI)
endif(SLEEF_BUILD_GNUABI_LIBS)

#

Expand Down Expand Up @@ -461,7 +461,7 @@ if(LIB_MPFR AND NOT MINGW)
endif()
endif(LIB_MPFR AND NOT MINGW)

if(ENABLE_GNUABI AND COMPILER_SUPPORTS_OMP_SIMD AND NOT SLEEF_TARGET_PROCESSOR MATCHES "^i.86$")
if(SLEEF_BUILD_GNUABI_LIBS AND COMPILER_SUPPORTS_OMP_SIMD AND NOT SLEEF_TARGET_PROCESSOR MATCHES "^i.86$")
# Build tester for vectorabi
add_executable(testervecabi testervecabi.c)
target_compile_definitions(testervecabi PRIVATE ${COMMON_TARGET_DEFINITIONS})
Expand All @@ -474,7 +474,7 @@ endif()

# mveclibtest

if (ENABLE_GNUABI AND SLEEF_ARCH_X86 AND CMAKE_C_COMPILER_ID MATCHES "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER 7.99)
if (SLEEF_BUILD_GNUABI_LIBS AND SLEEF_ARCH_X86 AND CMAKE_C_COMPILER_ID MATCHES "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER 7.99)
add_executable(mveclibtest-sse2 mveclibtest.c ${sleef_SOURCE_DIR}/src/common/main_checkfeature.c)
set_target_properties(mveclibtest-sse2 PROPERTIES C_STANDARD 99)
target_compile_options(mveclibtest-sse2 PRIVATE ${FLAGS_FASTMATH} "-O3")
Expand Down
10 changes: 5 additions & 5 deletions src/libm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ add_custom_target(renameCUDA.h_generated DEPENDS ${HEADER_CUDA})
add_host_executable(${TARGET_MKRENAME_GNUABI} mkrename_gnuabi.c)

set(HEADER_GNUABI_FILES_GENERATED "")
if(ENABLE_GNUABI)
if(SLEEF_BUILD_GNUABI_LIBS)
foreach(SIMD ${SLEEF_SUPPORTED_GNUABI_EXTENSIONS})
if(COMPILER_SUPPORTS_${SIMD})
string(TOLOWER ${SIMD} vecarch)
Expand All @@ -288,7 +288,7 @@ endif()
add_host_executable(${TARGET_MKMASKED_GNUABI} mkmasked_gnuabi.c)

# maskedXXX_YY_gnuabi.h
if(ENABLE_GNUABI)
if(SLEEF_BUILD_GNUABI_LIBS)
foreach(SIMD ${SLEEF_SUPPORTED_GNUABI_EXTENSIONS})
if(COMPILER_SUPPORTS_${SIMD} AND MKMASKED_PARAMS_GNUABI_${SIMD}_sp)
string(TOLOWER ${SIMD} vecarch)
Expand Down Expand Up @@ -846,7 +846,7 @@ endif(SLEEF_ARCH_S390X)
# Compile SIMD versions for GNU Abi
# --------------------------------------------------------------------
# Build gnuabi version from just simd object files
if(ENABLE_GNUABI)
if(SLEEF_BUILD_GNUABI_LIBS)
set(TARGET_LIBSLEEFGNUABI_OBJECTS "")
foreach(SIMD ${SLEEF_SUPPORTED_GNUABI_EXTENSIONS})
if(COMPILER_SUPPORTS_${SIMD})
Expand Down Expand Up @@ -912,7 +912,7 @@ if(ENABLE_GNUABI)
if(LIBM AND NOT COMPILER_SUPPORTS_BUILTIN_MATH)
target_link_libraries(${TARGET_LIBSLEEFGNUABI} ${LIBM})
endif()
endif(ENABLE_GNUABI)
endif(SLEEF_BUILD_GNUABI_LIBS)

# --------------------------------------------------------------------
# TARGET_LLVM_BITCODE
Expand Down Expand Up @@ -1047,7 +1047,7 @@ install(
COMPONENT sleef_Development
)

if(ENABLE_GNUABI)
if(SLEEF_BUILD_GNUABI_LIBS)
install(
TARGETS ${TARGET_LIBSLEEFGNUABI}
EXPORT sleefTargets
Expand Down
21 changes: 7 additions & 14 deletions src/libm/mkmasked_gnuabi.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,25 +77,21 @@ int main(int argc, char **argv) {
switch(funcList[i].funcType) {
case 0: {
printf("EXPORT CONST %s %s(%s a0, vopmask m) { return %s(a0); }\n",
vfpname[fptype], funcname[1], vfpname[fptype], funcname[0]);
vfpname[fptype], funcname[1], vfpname[fptype], funcname[0]);

if (funcList[i].ulp < 20)
printf("EXPORT CONST %s %s(%s, vopmask) __attribute__((weak, alias(\"%s\")));\n",
vfpname[fptype], funcname[3], vfpname[fptype], funcname[1]);
printf("DMASKED_ALIAS_%s(%s, %s)\n", vfpname[fptype], funcname[3], funcname[1]);
else
printf("EXPORT CONST %s %s_u%d(%s, vopmask) __attribute__((weak, alias(\"%s\")));\n",
vfpname[fptype], funcname[3],funcList[i].ulp, vfpname[fptype], funcname[1]);
printf("DMASKED_ALIAS_%s(%s_u%d, %s)\n", vfpname[fptype], funcname[3], funcList[i].ulp, funcname[1]);
break;
}
case 1: {
printf("EXPORT CONST %s %s(%s a0, %s a1, vopmask m) { return %s(a0, a1); }\n",
vfpname[fptype], funcname[1], vfpname[fptype], vfpname[fptype], funcname[0]);
if (funcList[i].ulp < 20)
printf("EXPORT CONST %s %s(%s, %s, vopmask) __attribute__((weak, alias(\"%s\")));\n",
vfpname[fptype], funcname[3], vfpname[fptype], vfpname[fptype], funcname[1]);
printf("DMASKED_ALIAS_%s2(%s, %s)\n", vfpname[fptype], funcname[3], funcname[1]);
else
printf("EXPORT CONST %s %s_u%d(%s, %s, vopmask) __attribute__((weak, alias(\"%s\")));\n",
vfpname[fptype], funcname[3],funcList[i].ulp, vfpname[fptype], vfpname[fptype], funcname[1]);
printf("DMASKED_ALIAS_%s2(%s_u%d, %s)\n", vfpname[fptype], funcname[3], funcList[i].ulp, funcname[1]);
break;
}
case 2:
Expand Down Expand Up @@ -160,13 +156,10 @@ int main(int argc, char **argv) {

printf("EXPORT CONST %s %s(%s a0, %s a1, vopmask m) { return %s(a0, a1); }\n",
vfpname[fptype], funcname[1], vfpname[fptype], ptr_type, funcname[0]);

if (funcList[i].ulp < 20)
printf("EXPORT CONST %s %s(%s, %s, vopmask) __attribute__((weak, alias(\"%s\")));\n",
vfpname[fptype], funcname[3], vfpname[fptype], ptr_type, funcname[1]);
printf("DMASKED_ALIAS_%sp(%s, %s)\n", vfpname[fptype], funcname[3], funcname[1]);
else
printf("EXPORT CONST %s %s_u%d(%s, %s, vopmask) __attribute__((weak, alias(\"%s\")));\n",
vfpname[fptype], funcname[3],funcList[i].ulp, vfpname[fptype], ptr_type, funcname[1]);
printf("DMASKED_ALIAS_%sp(%s_u%d, %s)\n", vfpname[fptype], funcname[3], funcList[i].ulp, funcname[1]);
}
break;
}
Expand Down
60 changes: 40 additions & 20 deletions src/libm/sleefsimddp.c
Original file line number Diff line number Diff line change
Expand Up @@ -3714,28 +3714,48 @@ int main(int argc, char **argv) {

#ifdef ENABLE_GNUABI
/* "finite" aliases for compatibility with GLIBC */
EXPORT CONST VECTOR_CC vdouble __acos_finite (vdouble) __attribute__((weak, alias(str_xacos )));
EXPORT CONST VECTOR_CC vdouble __acosh_finite (vdouble) __attribute__((weak, alias(str_xacosh )));
EXPORT CONST VECTOR_CC vdouble __asin_finite (vdouble) __attribute__((weak, alias(str_xasin_u1 )));
EXPORT CONST VECTOR_CC vdouble __atan2_finite (vdouble, vdouble) __attribute__((weak, alias(str_xatan2_u1 )));
EXPORT CONST VECTOR_CC vdouble __atanh_finite (vdouble) __attribute__((weak, alias(str_xatanh )));
EXPORT CONST VECTOR_CC vdouble __cosh_finite (vdouble) __attribute__((weak, alias(str_xcosh )));
EXPORT CONST VECTOR_CC vdouble __exp10_finite (vdouble) __attribute__((weak, alias(str_xexp10 )));
EXPORT CONST VECTOR_CC vdouble __exp2_finite (vdouble) __attribute__((weak, alias(str_xexp2 )));
EXPORT CONST VECTOR_CC vdouble __exp_finite (vdouble) __attribute__((weak, alias(str_xexp )));
EXPORT CONST VECTOR_CC vdouble __fmod_finite (vdouble, vdouble) __attribute__((weak, alias(str_xfmod )));
EXPORT CONST VECTOR_CC vdouble __remainder_finite(vdouble, vdouble) __attribute__((weak, alias(str_xremainder)));
EXPORT CONST VECTOR_CC vdouble __modf_finite (vdouble, vdouble *) __attribute__((weak, alias(str_xmodf )));
EXPORT CONST VECTOR_CC vdouble __hypot_u05_finite(vdouble, vdouble) __attribute__((weak, alias(str_xhypot_u05)));
EXPORT CONST VECTOR_CC vdouble __lgamma_u1_finite(vdouble) __attribute__((weak, alias(str_xlgamma_u1)));
EXPORT CONST VECTOR_CC vdouble __log10_finite (vdouble) __attribute__((weak, alias(str_xlog10 )));
EXPORT CONST VECTOR_CC vdouble __log_finite (vdouble) __attribute__((weak, alias(str_xlog_u1 )));
EXPORT CONST VECTOR_CC vdouble __pow_finite (vdouble, vdouble) __attribute__((weak, alias(str_xpow )));
EXPORT CONST VECTOR_CC vdouble __sinh_finite (vdouble) __attribute__((weak, alias(str_xsinh )));
EXPORT CONST VECTOR_CC vdouble __sqrt_finite (vdouble) __attribute__((weak, alias(str_xsqrt )));
EXPORT CONST VECTOR_CC vdouble __tgamma_u1_finite(vdouble) __attribute__((weak, alias(str_xtgamma_u1)));
#if ENABLE_ALIAS
#define DFINITE_ALIAS_vd_vd(ALIASEE, TARGET) EXPORT CONST VECTOR_CC vdouble ALIASEE (vdouble) __attribute__((weak, alias(FUNC)));
#define DFINITE_ALIAS_vd2_vd(ALIASEE, TARGET) EXPORT CONST VECTOR_CC vdouble ALIASEE (vdouble, vdouble) __attribute__((weak, alias(FUNC)));
#define DFINITE_ALIAS_vdp_vd(ALIASEE, TARGET) EXPORT CONST VECTOR_CC vdouble ALIASEE (vdouble, vdouble *) __attribute__((weak, alias(FUNC)));
#else
#define DFINITE_ALIAS_vd_vd(ALIASEE, TARGET) EXPORT CONST VECTOR_CC vdouble ALIASEE (vdouble x) { return TARGET(x); }
#define DFINITE_ALIAS_vd2_vd(ALIASEE, TARGET) EXPORT CONST VECTOR_CC vdouble ALIASEE (vdouble x, vdouble y) { return TARGET(x, y); }
#define DFINITE_ALIAS_vdp_vd(ALIASEE, TARGET) EXPORT CONST VECTOR_CC vdouble ALIASEE (vdouble x, double *y) { return TARGET(x, y); }
#endif
DFINITE_ALIAS_vd_vd(__acos_finite, xacos)
DFINITE_ALIAS_vd_vd(__acosh_finite, xacosh)
DFINITE_ALIAS_vd_vd(__asin_finite, xasin_u1)
DFINITE_ALIAS_vd2_vd(__atan2_finite, xatan2_u1)
DFINITE_ALIAS_vd_vd(__atanh_finite, xatanh)
DFINITE_ALIAS_vd_vd(__cosh_finite, xcosh)
DFINITE_ALIAS_vd_vd(__exp10_finite, xexp10)
DFINITE_ALIAS_vd_vd(__exp2_finite, xexp2)
DFINITE_ALIAS_vd_vd(__exp_finite, xexp)
DFINITE_ALIAS_vd2_vd(__fmod_finite, xfmod)
DFINITE_ALIAS_vd2_vd(__remainder_finite, xremainder)
DFINITE_ALIAS_vdp_vd(__modf_finite, xmodf)
DFINITE_ALIAS_vd2_vd(__hypot_u05_finite, xhypot_u05)
DFINITE_ALIAS_vd_vd(__lgamma_u1_finite, xlgamma_u1)
DFINITE_ALIAS_vd_vd(__log10_finite, xlog10)
DFINITE_ALIAS_vd_vd(__log_finite, xlog_u1)
DFINITE_ALIAS_vd2_vd(__pow_finite, xpow)
DFINITE_ALIAS_vd_vd(__sinh_finite, xsinh)
DFINITE_ALIAS_vd_vd(__sqrt_finite, xsqrt)
DFINITE_ALIAS_vd_vd(__tgamma_u1_finite, xtgamma_u1)

#ifdef HEADER_MASKED

#if ENABLE_ALIAS
#define DMASKED_ALIAS_vdouble(ALIASEE, TARGET) EXPORT CONST VECTOR_CC vdouble ALIASEE(vdouble, vopmask) __attribute__((weak, alias(FUNC)));
#define DMASKED_ALIAS_vdouble2(ALIASEE, TARGET) EXPORT CONST VECTOR_CC vdouble ALIASEE(vdouble, vdouble, vopmask) __attribute__((weak, alias(FUNC)));
#define DMASKED_ALIAS_vdoublep(ALIASEE, TARGET) EXPORT CONST VECTOR_CC vdouble ALIASEE(vdouble, vdouble*, vopmask) __attribute__((weak, alias(FUNC)));
#else
#define DMASKED_ALIAS_vdouble(ALIASEE, TARGET) EXPORT CONST VECTOR_CC vdouble ALIASEE(vdouble x, vopmask m) { return TARGET(x, m); }
#define DMASKED_ALIAS_vdouble2(ALIASEE, TARGET) EXPORT CONST VECTOR_CC vdouble ALIASEE(vdouble x, vdouble y, vopmask m) { return TARGET(x, y, m); }
#define DMASKED_ALIAS_vdoublep(ALIASEE, TARGET) EXPORT CONST VECTOR_CC vdouble ALIASEE(vdouble x, double *y, vopmask m) { return TARGET(x, y, m); }
#endif

#include HEADER_MASKED
#endif
#endif /* #ifdef ENABLE_GNUABI */
61 changes: 41 additions & 20 deletions src/libm/sleefsimdsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -3663,28 +3663,49 @@ EXPORT CONST void *xgetPtrf(int name) {
#endif

#ifdef ENABLE_GNUABI
EXPORT CONST VECTOR_CC vfloat __acosf_finite (vfloat) __attribute__((weak, alias(str_xacosf_u1 )));
EXPORT CONST VECTOR_CC vfloat __acoshf_finite (vfloat) __attribute__((weak, alias(str_xacoshf )));
EXPORT CONST VECTOR_CC vfloat __asinf_finite (vfloat) __attribute__((weak, alias(str_xasinf_u1 )));
EXPORT CONST VECTOR_CC vfloat __atan2f_finite (vfloat, vfloat) __attribute__((weak, alias(str_xatan2f_u1 )));
EXPORT CONST VECTOR_CC vfloat __atanhf_finite (vfloat) __attribute__((weak, alias(str_xatanhf )));
EXPORT CONST VECTOR_CC vfloat __coshf_finite (vfloat) __attribute__((weak, alias(str_xcoshf )));
EXPORT CONST VECTOR_CC vfloat __exp10f_finite (vfloat) __attribute__((weak, alias(str_xexp10f )));
EXPORT CONST VECTOR_CC vfloat __exp2f_finite (vfloat) __attribute__((weak, alias(str_xexp2f )));
EXPORT CONST VECTOR_CC vfloat __expf_finite (vfloat) __attribute__((weak, alias(str_xexpf )));
EXPORT CONST VECTOR_CC vfloat __fmodf_finite (vfloat, vfloat) __attribute__((weak, alias(str_xfmodf )));
EXPORT CONST VECTOR_CC vfloat __remainderf_finite(vfloat, vfloat) __attribute__((weak, alias(str_xremainderf)));
EXPORT CONST VECTOR_CC vfloat __modff_finite (vfloat, vfloat *) __attribute__((weak, alias(str_xmodff )));
EXPORT CONST VECTOR_CC vfloat __hypotf_u05_finite(vfloat, vfloat) __attribute__((weak, alias(str_xhypotf_u05)));
EXPORT CONST VECTOR_CC vfloat __lgammaf_u1_finite(vfloat) __attribute__((weak, alias(str_xlgammaf_u1)));
EXPORT CONST VECTOR_CC vfloat __log10f_finite (vfloat) __attribute__((weak, alias(str_xlog10f )));
EXPORT CONST VECTOR_CC vfloat __logf_finite (vfloat) __attribute__((weak, alias(str_xlogf_u1 )));
EXPORT CONST VECTOR_CC vfloat __powf_finite (vfloat, vfloat) __attribute__((weak, alias(str_xpowf )));
EXPORT CONST VECTOR_CC vfloat __sinhf_finite (vfloat) __attribute__((weak, alias(str_xsinhf )));
EXPORT CONST VECTOR_CC vfloat __sqrtf_finite (vfloat) __attribute__((weak, alias(str_xsqrtf )));
EXPORT CONST VECTOR_CC vfloat __tgammaf_u1_finite(vfloat) __attribute__((weak, alias(str_xtgammaf_u1)));
/* "finite" aliases for compatibility with GLIBC */
#if ENABLE_ALIAS
#define DFINITE_ALIAS_vf_vf(ALIASEE, TARGET) EXPORT CONST VECTOR_CC vfloat ALIASEE (vfloat) __attribute__((weak, alias(FUNC)));
#define DFINITE_ALIAS_vf2_vf(ALIASEE, TARGET) EXPORT CONST VECTOR_CC vfloat ALIASEE (vfloat, vfloat) __attribute__((weak, alias(FUNC)));
# define DFINITE_ALIAS_vfp_vf(ALIASEE, TARGET) EXPORT CONST VECTOR_CC vfloat ALIASEE (vfloat, vfloat *) __attribute__((weak, alias(FUNC)));
#else
#define DFINITE_ALIAS_vf_vf(ALIASEE, TARGET) EXPORT CONST VECTOR_CC vfloat ALIASEE (vfloat x) { return TARGET(x); }
#define DFINITE_ALIAS_vf2_vf(ALIASEE, TARGET) EXPORT CONST VECTOR_CC vfloat ALIASEE (vfloat x, vfloat y) { return TARGET(x, y); }
#define DFINITE_ALIAS_vfp_vf(ALIASEE, TARGET) EXPORT CONST VECTOR_CC vfloat ALIASEE (vfloat x, float *y) { return TARGET(x, y); }
#endif
DFINITE_ALIAS_vf_vf(__acosf_finite, xacosf_u1)
DFINITE_ALIAS_vf_vf(__acoshf_finite, xacoshf)
DFINITE_ALIAS_vf_vf(__asinf_finite, xasinf_u1)
DFINITE_ALIAS_vf2_vf(__atan2f_finite, xatan2f_u1)
DFINITE_ALIAS_vf_vf(__atanhf_finite, xatanhf)
DFINITE_ALIAS_vf_vf(__coshf_finite, xcoshf)
DFINITE_ALIAS_vf_vf(__exp10f_finite, xexp10f)
DFINITE_ALIAS_vf_vf(__exp2f_finite, xexp2f)
DFINITE_ALIAS_vf_vf(__expf_finite, xexpf)
DFINITE_ALIAS_vf2_vf(__fmodf_finite, xfmodf)
DFINITE_ALIAS_vf2_vf(__remainderf_finite, xremainderf)
DFINITE_ALIAS_vfp_vf(__modff_finite, xmodff)
DFINITE_ALIAS_vf2_vf(__hypotf_u05_finite, xhypotf_u05)
DFINITE_ALIAS_vf_vf(__lgammaf_u1_finite, xlgammaf_u1)
DFINITE_ALIAS_vf_vf(__log10f_finite, xlog10f)
DFINITE_ALIAS_vf_vf(__logf_finite, xlogf_u1)
DFINITE_ALIAS_vf2_vf(__powf_finite, xpowf)
DFINITE_ALIAS_vf_vf(__sinhf_finite, xsinhf)
DFINITE_ALIAS_vf_vf(__sqrtf_finite, xsqrtf)
DFINITE_ALIAS_vf_vf(__tgammaf_u1_finite, xtgammaf_u1)

#ifdef HEADER_MASKED

#if ENABLE_ALIAS
#define DMASKED_ALIAS_vfloat(ALIASEE, TARGET) EXPORT CONST VECTOR_CC vfloat ALIASEE(vfloat, vopmask) __attribute__((weak, alias(FUNC)));
#define DMASKED_ALIAS_vfloat2(ALIASEE, TARGET) EXPORT CONST VECTOR_CC vfloat ALIASEE(vfloat, vfloat, vopmask) __attribute__((weak, alias(FUNC)));
#define DMASKED_ALIAS_vfloatp(ALIASEE, TARGET) EXPORT CONST VECTOR_CC vfloat ALIASEE(vfloat, vfloat*, vopmask) __attribute__((weak, alias(FUNC)));
#else
#define DMASKED_ALIAS_vfloat(ALIASEE, TARGET) EXPORT CONST VECTOR_CC vfloat ALIASEE(vfloat x, vopmask m) { return TARGET(x, m); }
#define DMASKED_ALIAS_vfloat2(ALIASEE, TARGET) EXPORT CONST VECTOR_CC vfloat ALIASEE(vfloat x, vfloat y, vopmask m) { return TARGET(x, y, m); }
#define DMASKED_ALIAS_vfloatp(ALIASEE, TARGET) EXPORT CONST VECTOR_CC vfloat ALIASEE(vfloat x, float *y, vopmask m) { return TARGET(x, y, m); }
#endif

#include HEADER_MASKED
#endif
#endif /* #ifdef ENABLE_GNUABI */
Expand Down

0 comments on commit 8c643c5

Please sign in to comment.