In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/8b4fb3c6d41d4b5fcb35eae18a732259a0ebce34?hp=6233097676c277b9213c6a4a9a165c2b60d0418e>
- Log ----------------------------------------------------------------- commit 8b4fb3c6d41d4b5fcb35eae18a732259a0ebce34 Author: Jarkko Hietaniemi <[email protected]> Date: Fri Nov 28 12:30:35 2014 -0500 Comment tweak. commit 23bf3b2a11494e5d2ccf1f38d8664f8e2183fdba Author: Jarkko Hietaniemi <[email protected]> Date: Sat Nov 29 15:50:28 2014 -0500 If neither quad nor long double, %Ld etc need to fail. (hpux 10.20 has no quad, and its long double is non-standard) M sv.c commit 6dda0af12a624cc45dec89affffc21192bb98638 Author: Jarkko Hietaniemi <[email protected]> Date: Sat Nov 29 11:12:24 2014 -0500 Use LONG_DOUBLEKIND only if HAS_LONG_DOUBLE. commit 3a7c53f016fdf36a1661e1e823b72b626557d4c5 Author: Jarkko Hietaniemi <[email protected]> Date: Fri Nov 28 11:53:57 2014 -0500 HP-UX 10.20 has pseudo-long-double which shouldn't be used. commit 7b9b7dffaf9bc38aaa4ac4b8dbcfe5a36005e7a8 Author: Jarkko Hietaniemi <[email protected]> Date: Fri Nov 28 12:30:35 2014 -0500 Comment tweak. M numeric.c commit 3690599a1990005cb80165b3239cfa4be968d51f Author: Jarkko Hietaniemi <[email protected]> Date: Sat Nov 29 11:12:24 2014 -0500 Use LONG_DOUBLEKIND only if HAS_LONG_DOUBLE. M sv.c commit bd86b473b240a3cb030acb29edd9aad2df62454d Author: Jarkko Hietaniemi <[email protected]> Date: Fri Nov 28 11:53:57 2014 -0500 HP-UX 10.20 has pseudo-long-double which shouldn't be used. M hints/hpux.sh ----------------------------------------------------------------------- Summary of changes: hints/hpux.sh | 24 ++++++++++++++++++++++++ numeric.c | 2 +- sv.c | 56 +++++++++++++++++++++++++++++++------------------------- 3 files changed, 56 insertions(+), 26 deletions(-) diff --git a/hints/hpux.sh b/hints/hpux.sh index 39150be..cb1895d 100644 --- a/hints/hpux.sh +++ b/hints/hpux.sh @@ -213,6 +213,30 @@ case "$usemorebits" in $define|true|[yY]*) use64bitint="$define"; uselongdouble="$define" ;; esac +# There is a weird pre-C99 long double (a struct of four uin32_t) +# in HP-UX 10.20 but beyond strtold() there's no support for them +# for example in <math.h>. +case "$uselongdouble" in + $define|true|[yY]*) + if [ "$xxOsRevMajor" -lt 11 ]; then + cat <<EOM >&4 + +*** uselongdouble (or usemorebits) is not supported on HP-UX $xxOsRevMajor. +*** You need at least HP-UX 11.0. +*** Cannot continue, aborting. +EOM + exit 1 + fi + ;; + esac + +# Configure long double scan will detect the HP-UX 10.20 "long double" +# (a struct of four uin32_t) and think it is IEEE quad. Make it not so. +if [ "$xxOsRevMajor" -lt 11 ]; then + d_longdbl="$undef" + longdblsize=8 # Make it double. +fi + case "$archname" in IA64*) # While here, override so=sl auto-detection diff --git a/numeric.c b/numeric.c index 5398d72..9e05d55 100644 --- a/numeric.c +++ b/numeric.c @@ -1449,7 +1449,7 @@ Perl_my_modfl(long double x, long double *ip) # endif #endif -/* Similarly, with ilobl and scalbnl we can emulate frexpl. */ +/* Similarly, with ilogbl and scalbnl we can emulate frexpl. */ #if ! defined(HAS_FREXPL) && defined(HAS_ILOGBL) && defined(HAS_SCALBNL) long double Perl_my_frexpl(long double x, int *e) { diff --git a/sv.c b/sv.c index 3cbcbf8..68af03c 100644 --- a/sv.c +++ b/sv.c @@ -10768,26 +10768,28 @@ Perl_sv_vcatpvfn(pTHX_ SV *const sv, const char *const pat, const STRLEN patlen, # define DOUBLE_LITTLE_ENDIAN #endif -#if LONG_DOUBLEKIND == LONG_DOUBLE_IS_IEEE_754_128_BIT_LITTLE_ENDIAN || \ - LONG_DOUBLEKIND == LONG_DOUBLE_IS_X86_80_BIT_LITTLE_ENDIAN || \ - LONG_DOUBLEKIND == LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_LITTLE_ENDIAN -# define LONGDOUBLE_LITTLE_ENDIAN -#endif +#ifdef HAS_LONG_DOUBLEKIND -#if LONG_DOUBLEKIND == LONG_DOUBLE_IS_IEEE_754_128_BIT_BIG_ENDIAN || \ - LONG_DOUBLEKIND == LONG_DOUBLE_IS_X86_80_BIT_BIG_ENDIAN || \ - LONG_DOUBLEKIND == LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_BIG_ENDIAN -# define LONGDOUBLE_BIG_ENDIAN -#endif +# if LONG_DOUBLEKIND == LONG_DOUBLE_IS_IEEE_754_128_BIT_LITTLE_ENDIAN || \ + LONG_DOUBLEKIND == LONG_DOUBLE_IS_X86_80_BIT_LITTLE_ENDIAN || \ + LONG_DOUBLEKIND == LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_LITTLE_ENDIAN +# define LONGDOUBLE_LITTLE_ENDIAN +# endif -#if LONG_DOUBLEKIND == LONG_DOUBLE_IS_X86_80_BIT_LITTLE_ENDIAN || \ - LONG_DOUBLEKIND == LONG_DOUBLE_IS_X86_80_BIT_BIG_ENDIAN -# define LONGDOUBLE_X86_80_BIT -#endif +# if LONG_DOUBLEKIND == LONG_DOUBLE_IS_IEEE_754_128_BIT_BIG_ENDIAN || \ + LONG_DOUBLEKIND == LONG_DOUBLE_IS_X86_80_BIT_BIG_ENDIAN || \ + LONG_DOUBLEKIND == LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_BIG_ENDIAN +# define LONGDOUBLE_BIG_ENDIAN +# endif + +# if LONG_DOUBLEKIND == LONG_DOUBLE_IS_X86_80_BIT_LITTLE_ENDIAN || \ + LONG_DOUBLEKIND == LONG_DOUBLE_IS_X86_80_BIT_BIG_ENDIAN +# define LONGDOUBLE_X86_80_BIT +# endif -#if LONG_DOUBLEKIND == LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_LITTLE_ENDIAN || \ - LONG_DOUBLEKIND == LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_BIG_ENDIAN -# define LONGDOUBLE_DOUBLEDOUBLE +# if LONG_DOUBLEKIND == LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_LITTLE_ENDIAN || \ + LONG_DOUBLEKIND == LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_BIG_ENDIAN +# define LONGDOUBLE_DOUBLEDOUBLE /* The first double can be as large as 2**1023, or '1' x '0' x 1023. * The second double can be as small as 2**-1074, or '0' x 1073 . '1'. * The sum of them can be '1' . '0' x 2096 . '1', with implied radix point @@ -10797,8 +10799,10 @@ Perl_sv_vcatpvfn(pTHX_ SV *const sv, const char *const pat, const STRLEN patlen, * of dynamically growing buffer might be better, start at just 16 bytes * (for example) and grow only when necessary. Or maybe just by looking * at the exponents of the two doubles? */ -# define DOUBLEDOUBLE_MAXBITS 2098 -#endif +# define DOUBLEDOUBLE_MAXBITS 2098 +# endif + +#endif /* HAS_LONG_DOUBLE */ /* vhex will contain the values (0..15) of the hex digits ("nybbles" * of 4 bits); 1 for the implicit 1, and the mantissa bits, four bits @@ -11603,23 +11607,25 @@ Perl_sv_vcatpvfn_flags(pTHX_ SV *const sv, const char *const pat, const STRLEN p q++; break; #endif -#if IVSIZE >= 8 || defined(HAS_LONG_DOUBLE) +#if (IVSIZE >= 8 || defined(HAS_LONG_DOUBLE)) || \ + (IVSIZE == 4 && !defined(HAS_LONG_DOUBLE)) case 'L': /* Ld */ /* FALLTHROUGH */ -#ifdef USE_QUADMATH +# ifdef USE_QUADMATH case 'Q': /* FALLTHROUGH */ -#endif -#if IVSIZE >= 8 +# endif +# if IVSIZE >= 8 case 'q': /* qd */ -#endif +# endif intsize = 'q'; q++; break; #endif case 'l': ++q; -#if IVSIZE >= 8 || defined(HAS_LONG_DOUBLE) +#if (IVSIZE >= 8 || defined(HAS_LONG_DOUBLE)) || \ + (IVSIZE == 4 && !defined(HAS_LONG_DOUBLE)) if (*q == 'l') { /* lld, llf */ intsize = 'q'; ++q; -- Perl5 Master Repository
