From de28b4d36616ed583ec247639d13bd76216fd3bf Mon Sep 17 00:00:00 2001 From: Tulio Magno Quites Machado Filho Date: Fri, 19 Oct 2018 10:09:49 -0300 Subject: [PATCH] powerpc64: Add support for IEEE 128-bit floating point long double --- INSTALL | 4 ++-- arch/powerpc64/bits/float.h | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/INSTALL b/INSTALL index a2a142bf..00d7282d 100644 --- a/INSTALL +++ b/INSTALL @@ -76,8 +76,8 @@ and ABI combinations: * PowerPC64 * Both little and big endian variants are supported - * Compiler toolchain must provide 64-bit long double, not IBM - double-double or IEEE quad + * Compiler toolchain must provide 64-bit long double, or IEEE 128-bit + long double not IBM double-double * Compiler toolchain must use the new (ELFv2) ABI regardless of whether it is for little or big endian diff --git a/arch/powerpc64/bits/float.h b/arch/powerpc64/bits/float.h index c4a655e7..4e485512 100644 --- a/arch/powerpc64/bits/float.h +++ b/arch/powerpc64/bits/float.h @@ -1,3 +1,19 @@ +#if __LDBL_MANT_DIG__ == 113 +#define LDBL_TRUE_MIN 6.47517511943802511092443895822764655e-4966L +#define LDBL_MIN 3.36210314311209350626267781732175260e-4932L +#define LDBL_MAX 1.18973149535723176508575932662800702e+4932L +#define LDBL_EPSILON 1.92592994438723585305597794258492732e-34L + +#define LDBL_MANT_DIG 113 +#define LDBL_MIN_EXP (-16381) +#define LDBL_MAX_EXP 16384 + +#define LDBL_DIG 33 +#define LDBL_MIN_10_EXP (-4931) +#define LDBL_MAX_10_EXP 4932 + +#define DECIMAL_DIG__ 36 +#else #define FLT_EVAL_METHOD 0 #define LDBL_TRUE_MIN 4.94065645841246544177e-324L @@ -14,3 +30,4 @@ #define LDBL_MAX_10_EXP 308 #define DECIMAL_DIG 17 +#endif -- 2.14.4