Skip to content

Commit

Permalink
feature tests: signbit detection fix for ia64
Browse files Browse the repository at this point in the history
  • Loading branch information
McDutchie committed Feb 2, 2021
1 parent 7a6980a commit 0684806
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/cmd/ksh93/features/math.sh
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,18 @@ echo "#include <math.h>"
case $_hdr_ieeefp in
1) echo "#include <ieeefp.h>" ;;
esac
cat <<!
#if defined(__ia64__) && defined(signbit)
# if defined __GNUC__ && __GNUC__ >= 4
# define __signbitl(f) __builtin_signbitl(f)
# else
# include <ast_float.h>
# if _lib_copysignl
# define __signbitl(f) (int)(copysignl(1.0,(f))<0.0)
# endif
# endif
#endif
!
echo

: generate the intercept functions and table entries
Expand Down
10 changes: 10 additions & 0 deletions src/lib/libast/sfio/sfcvt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0684806

Please sign in to comment.