[libc] Initial support so that libc-shared-tests can be built with pp64le (#188882)
This commit is contained in:
parent
fd609e5d33
commit
096f9d0aa8
@ -184,6 +184,8 @@ elseif(LIBC_TARGET_ARCHITECTURE STREQUAL "nvptx")
|
||||
set(LIBC_TARGET_ARCHITECTURE_IS_NVPTX TRUE)
|
||||
elseif(LIBC_TARGET_ARCHITECTURE STREQUAL "spirv")
|
||||
set(LIBC_TARGET_ARCHITECTURE_IS_SPIRV TRUE)
|
||||
elseif(LIBC_TARGET_ARCHITECTURE STREQUAL "power")
|
||||
set(LIBC_TARGET_ARCHITECTURE_IS_POWERPC TRUE)
|
||||
else()
|
||||
message(FATAL_ERROR
|
||||
"Unsupported libc target architecture ${LIBC_TARGET_ARCHITECTURE}")
|
||||
|
||||
7
libc/config/linux/power/config.json
Normal file
7
libc/config/linux/power/config.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"string": {
|
||||
"LIBC_CONF_STRING_LENGTH_IMPL": {
|
||||
"value": "element"
|
||||
}
|
||||
}
|
||||
}
|
||||
14
libc/config/linux/power/entrypoints.txt
Normal file
14
libc/config/linux/power/entrypoints.txt
Normal file
@ -0,0 +1,14 @@
|
||||
|
||||
set(TARGET_LIBC_ENTRYPOINTS
|
||||
libc.src.errno.errno
|
||||
)
|
||||
|
||||
set(TARGET_LIBM_ENTRYPOINTS)
|
||||
|
||||
set(TARGET_LIBMVEC_ENTRYPOINTS)
|
||||
|
||||
set(TARGET_LLVMLIBC_ENTRYPOINTS
|
||||
${TARGET_LIBC_ENTRYPOINTS}
|
||||
${TARGET_LIBM_ENTRYPOINTS}
|
||||
${TARGET_LIBMVEC_ENTRYPOINTS}
|
||||
)
|
||||
1
libc/config/linux/power/headers.txt
Normal file
1
libc/config/linux/power/headers.txt
Normal file
@ -0,0 +1 @@
|
||||
set(TARGET_PUBLIC_HEADERS)
|
||||
@ -9,7 +9,6 @@
|
||||
#ifndef LLVM_LIBC_SRC___SUPPORT_FPUTIL_GENERIC_SQRT_H
|
||||
#define LLVM_LIBC_SRC___SUPPORT_FPUTIL_GENERIC_SQRT_H
|
||||
|
||||
#include "sqrt_80_bit_long_double.h"
|
||||
#include "src/__support/CPP/bit.h" // countl_zero
|
||||
#include "src/__support/CPP/type_traits.h"
|
||||
#include "src/__support/FPUtil/FEnvImpl.h"
|
||||
@ -22,6 +21,10 @@
|
||||
|
||||
#include "hdr/fenv_macros.h"
|
||||
|
||||
#ifdef LIBC_TYPES_LONG_DOUBLE_IS_X86_FLOAT80
|
||||
#include "sqrt_80_bit_long_double.h"
|
||||
#endif // !LIBC_TYPES_LONG_DOUBLE_IS_X86_FLOAT80
|
||||
|
||||
namespace LIBC_NAMESPACE_DECL {
|
||||
namespace fputil {
|
||||
|
||||
@ -52,7 +55,7 @@ template <>
|
||||
LIBC_INLINE void normalize<long double>(int &exponent, uint64_t &mantissa) {
|
||||
normalize<double>(exponent, mantissa);
|
||||
}
|
||||
#elif !defined(LIBC_TYPES_LONG_DOUBLE_IS_X86_FLOAT80)
|
||||
#elif defined(LIBC_TYPES_LONG_DOUBLE_IS_FLOAT128)
|
||||
template <>
|
||||
LIBC_INLINE void normalize<long double>(int &exponent, UInt128 &mantissa) {
|
||||
const uint64_t hi_bits = static_cast<uint64_t>(mantissa >> 64);
|
||||
@ -76,8 +79,10 @@ LIBC_INLINE static constexpr cpp::enable_if_t<
|
||||
sqrt(InType x) {
|
||||
if constexpr (internal::SpecialLongDouble<OutType>::VALUE &&
|
||||
internal::SpecialLongDouble<InType>::VALUE) {
|
||||
#ifdef LIBC_TYPES_LONG_DOUBLE_IS_X86_FLOAT80
|
||||
// Special 80-bit long double.
|
||||
return x86::sqrt(x);
|
||||
#endif // !LIBC_TYPES_LONG_DOUBLE_IS_X86_FLOAT80
|
||||
} else {
|
||||
// IEEE floating points formats.
|
||||
using OutFPBits = FPBits<OutType>;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user