From 0684806d47969f08e8219c7e46d84aee64b48b32 Mon Sep 17 00:00:00 2001 From: Martijn Dekker Date: Tue, 2 Feb 2021 04:40:09 +0000 Subject: [PATCH] feature tests: signbit detection fix for ia64 An Intel Itanium fix from OpenSUSE: https://build.opensuse.org/package/view_file/shells/ksh/ksh93-ia64.dif --- src/cmd/ksh93/features/math.sh | 12 ++++++++++++ src/lib/libast/sfio/sfcvt.c | 10 ++++++++++ 2 files changed, 22 insertions(+) diff --git a/src/cmd/ksh93/features/math.sh b/src/cmd/ksh93/features/math.sh index 660e23b1c750..3d9b851ef1a0 100644 --- a/src/cmd/ksh93/features/math.sh +++ b/src/cmd/ksh93/features/math.sh @@ -135,6 +135,18 @@ echo "#include " case $_hdr_ieeefp in 1) echo "#include " ;; esac +cat <= 4 +# define __signbitl(f) __builtin_signbitl(f) +# else +# include +# if _lib_copysignl +# define __signbitl(f) (int)(copysignl(1.0,(f))<0.0) +# endif +# endif +#endif +! echo : generate the intercept functions and table entries diff --git a/src/lib/libast/sfio/sfcvt.c b/src/lib/libast/sfio/sfcvt.c index 8063a5f42604..8f765db42ed7 100644 --- a/src/lib/libast/sfio/sfcvt.c +++ b/src/lib/libast/sfio/sfcvt.c @@ -55,6 +55,16 @@ static char *Zero = "0"; #endif #endif +#if defined(__ia64__) && defined(signbit) +# if defined __GNUC__ && __GNUC__ >= 4 +# define __signbitl(f) __builtin_signbitl(f) +# else +# if _lib_copysignl +# define __signbitl(f) (int)(copysignl(1.0,(f))<0.0) +# endif +# endif +#endif + #if !_lib_signbit #if !_ast_fltmax_double static int neg0ld(Sfdouble_t f)