aboutsummaryrefslogtreecommitdiff
path: root/libquadmath/math
AgeCommit message (Collapse)AuthorFilesLines
2017-09-01re PR libquadmath/81848 (Add PowerPC support to libquadmath)Michael Meissner3-12/+15
2017-09-01 Michael Meissner <meissner@linux.vnet.ibm.com> PR libquadmath/81848 * configure.ac (powerpc*-linux*): Use attribute mode KC to create complex __float128 on PowerPC instead of attribute mode TC. * quadmath.h (__complex128): Likewise. * configure: Regenerate. * math/cbrtq.c (CBRT2): Use __float128 not long double. (CBRT4): Likewise. (CBRT2I): Likewise. (CBRT4I): Likewise. * math/j0q.c (U0): Likewise. * math/sqrtq.c (sqrtq): Don't depend on implicit conversion between __float128, instead explicitly convert the __float128 value to long double because the PowerPC does not allow __float128 and long double in the same expression. From-SVN: r251613
2017-07-19* math/powq.c (powq): Use uint32_t instead of u_int32_t.Gerald Pfeifer1-1/+1
From-SVN: r250367
2017-07-19re PR libquadmath/65757 (gfortran gives incorrect result for anint with ↵Jakub Jelinek42-477/+698
real*16 argument) PR libquadmath/65757 * quadmath-imp.h (math_opt_barrier, math_force_eval, math_narrow_eval, math_check_force_underflow, math_check_force_underflow_nonneg): Define. * math/ceilq.c: Backport changes from upstream glibc between 2012-11-01 and 2017-07-13. * math/remquoq.c: Likewise. * math/expq.c: Likewise. * math/llroundq.c: Likewise. * math/logq.c: Likewise. * math/atanq.c: Likewise. * math/nearbyintq.c: Likewise. * math/scalblnq.c: Likewise. * math/finiteq.c: Likewise. * math/atanhq.c: Likewise. * math/expm1q.c: Likewise. * math/sinhq.c: Likewise. * math/log10q.c: Likewise. * math/rintq.c: Likewise. * math/roundq.c: Likewise. * math/fmaq.c: Likewise. * math/erfq.c: Likewise. * math/log2q.c: Likewise. * math/lroundq.c: Likewise. * math/j1q.c: Likewise. * math/scalbnq.c: Likewise. * math/truncq.c: Likewise. * math/frexpq.c: Likewise. * math/sincosq.c: Likewise. * math/tanhq.c: Likewise. * math/asinq.c: Likewise. * math/coshq.c: Likewise. * math/j0q.c: Likewise. * math/asinhq.c: Likewise. * math/floorq.c: Likewise. * math/sinq_kernel.c: Likewise. * math/powq.c: Likewise. * math/hypotq.c: Likewise. * math/sincos_table.c: Likewise. * math/rem_pio2q.c: Likewise. * math/nextafterq.c: Likewise. * math/log1pq.c: Likewise. * math/sincosq_kernel.c: Likewise. * math/tanq.c: Likewise. * math/acosq.c: Likewise. * math/lrintq.c: Likewise. * math/llrintq.c: Likewise. From-SVN: r250343
2015-08-09Makefile.am (libquadmath_la_SOURCES): Add math/logbq.c.Francois-Xavier Coudert1-0/+47
* Makefile.am (libquadmath_la_SOURCES): Add math/logbq.c. * Makefile.in: Regenerate. * libquadmath.texi: Document logbq. * quadmath.h: Add logbq prototype. * quadmath.map: Add logbq. * quadmath_weak.h: Add logbq prototype. * math/logbq.c: New file From-SVN: r226748
2013-02-17cacoshq.c (cacoshq): Call signbitq instead of signbit.Tobias Burnus1-1/+1
2013-02-17 Tobias Burnus <burnus@net-b.de> * math/cacoshq.c (cacoshq): Call signbitq instead of signbit. From-SVN: r196109
2013-02-06Revert libquadmath and libssp copyright patches.Richard Sandiford40-40/+40
From-SVN: r195820
2013-02-03Update copyright in libquadmath.Richard Sandiford40-40/+40
From-SVN: r195699
2012-12-13cbrtq.c (cbrtq): Use Q suffixed floating point constants instead of L ↵Jakub Jelinek3-16/+16
suffixed ones. * math/cbrtq.c (cbrtq): Use Q suffixed floating point constants instead of L suffixed ones. * math/fmaq.c (fmaq): Likewise. * math/rintq.c (TWO112): Likewise. From-SVN: r194475
2012-11-22atanq.c (atanq): Update from GLIBC.David S. Miller5-2/+34
2012-11-22 David S. Miller <davem@davemloft.net> Tobias Burnus <burnus@net-b.de> Joseph Myers <joseph@codesourcery.com> * math/atanq.c (atanq): Update from GLIBC. Handle tiny and very large arguments properly. * math/j0q.c (y0q): Update from GLIBC. Avoid arithmetic underflow when 'x' is very small. * math/j1q.c (y1q): Ditto. * math/log1pq.c (log1pq): Update from GLIBC. Saturate nonzero exponents with absolute value below 0x1p-128 to +/- 0x1p-128. * math/powq.c (powq): Update from GLIBC. If xm1 is smaller than LDBL_EPSILON/2.0L, just return xm1. Co-Authored-By: Joseph Myers <joseph@codesourcery.com> Co-Authored-By: Tobias Burnus <burnus@net-b.de> From-SVN: r193716
2012-11-21re PR libquadmath/55225 (Fail to build lgammaq.c from trunk with mingw-w64)Tobias Burnus1-1/+7
2012-11-21 Tobias Burnus <burnus@net-b.de> PR libquadmath/55225 * math/lgammaq.c (lgammaq): Use local variable if math.h does not provide signgam. * acinclude.m4 (LIBQUAD_CHECK_MATH_H_SIGNGAM): New check. * configure.ac: Use it. * configure: Regenerate. * config.h.in: Regenerate. From-SVN: r193695
2012-11-15fmaq.c (fmaq): Merge from GLIBC.Tobias Burnus1-14/+44
2012-11-15 Tobias Burnus <burnus@net-b.de> Joseph Myers <joseph@codesourcery.com> * math/fmaq.c (fmaq): Merge from GLIBC. Fix fma underflows with small x * y; Fix overflow results outside round-to-nearest mode; make use of Dekker and Knuth algorithms use round-to-nearest. Co-Authored-By: Joseph Myers <joseph@codesourcery.com> From-SVN: r193538
2012-11-02fmaq.c (fmaq): Fix build.Tobias Burnus1-5/+3
2012-11-01 Tobias Burnus <burnus@net-b.de> * math/fmaq.c (fmaq): Fix build. From-SVN: r193100
2012-11-02fmaq.c (fmaq): Merge from GLIBC.Tobias Burnus2-21/+49
2012-11-01 Tobias Burnus <burnus@net-b.de> Joseph Myers <joseph@codesourcery.com> * math/fmaq.c (fmaq): Merge from GLIBC. Handle cases with small x * y using scaling, not as x * y + z. * math/lgammaq.c (lgammaq): Fix signgam handling. Co-Authored-By: Joseph Myers <joseph@codesourcery.com> From-SVN: r193099
2012-11-01Makefile.am (libquadmath_la_SOURCES): Add new math/* files.Tobias Burnus61-359/+1692
2012-11-01 Tobias Burnus <burnus@net-b.de> * Makefile.am (libquadmath_la_SOURCES): Add new math/* files. * Makefile.in: Regenerated. * math/acoshq.c: Update comment. * math/acosq.c: Ditto. * math/asinhq.c: Ditto. * math/asinq.c: Ditto. * math/atan2q.c: Ditto. * math/atanhq.c: Ditto. * math/ceilq.c: Ditto. * math/copysignq.c: Ditto. * math/cosq.c: Ditto. * math/coshq.c: Ditto. * math/erfq.c: Ditto. * math/fabsq.c: Ditto. * math/finiteq.c: Ditto. * math/floorq.c: Ditto. * math/fmodq.c: Ditto. * math/frexpq.c: Ditto. * math/isnanq.c: Ditto. * math/j0q.c: Ditto. * math/j1q.c: Ditto. * math/ldexpq.c: Ditto. * math/llroundq.c: Ditto. * math/log10q.c: Ditto. * math/log1pq.c: Ditto. * math/log2q.c: Ditto. * math/logq.c: Ditto. * math/lroundq.c: Ditto. * math/modfq.c: Ditto. * math/nextafterq.c: Ditto. * math/powq.c: Ditto. * math/rem_pio2q.c: Ditto. * math/remainderq.c: Ditto. * math/rintq.c: Ditto. * math/roundq.c: Ditto. * math/scalblnq.c: Ditto. * math/scalbnq.c: Ditto. * math/sincosq_kernel.c: Ditto. * math/sinq.c: Ditto. * math/tanq.c: Ditto. * math/expq.c: Ditto. (__expq_table, expq): Renamed local array from __expl_table. * math/cosq_kernel.c (__quadmath_kernel_cosq): Fix sign * handling. * math/cacoshq.c: Changes from GLIBC; fix returned sign. * math/casinhq.c: Changes from GLIBC to fix special-case. * math/cbrtq.c: Use modified GLIBC version. * math/complex.c (ccoshd, cexpq, clog10q, clogq, csinhq, csinq, ctanhq, ctanq): Moved to separates files. (mult_c128, div_c128): Removed no longer needed functions. (cexpiq): Call sincosq instead of sinq and cosq. (cosq): Call cosh(-re,im) instead of cosq/sinq/sinh/cosh. * math/ccoshq.c (ccoshq): New file, moved from complex.c and modified based on GLIBC. * math/cexpq.c (cexp): Ditto. * math/clog10q.c (clog10q): Ditto. * math/clogq.c (clogq): Ditto. * math/csinhq.c: Ditto. * math/csinq.c: Ditto. * math/csqrtq.c: Ditto. * math/ctanhq.c: Ditto. * math/ctanq.c: Ditto. * math/fmaq.c (fmaq): Port TININESS_AFTER_ROUNDING handling from GLIBC. * math/ilogbq.c (ilogbq): Add errno = EDOM handling. * math/isinf_nsq.c (__quadmath_isinf_nsq): New file, ported from GLIBC. * math/lgammaq.c (lgammaq): Add signgam handling. * math/sinhq.c (sinhq): Fix sign handling. * math/sinq_kernel.c (__quadmath_kernel_sinq): Ditto. * math/tgammaq.c (tgammaq): Ditto. * math/x2y2m1q.c: New file. * quadmath-imp.h (TININESS_AFTER_ROUNDING): New define. (__quadmath_x2y2m1q, __quadmath_isinf_nsq): New prototypes. From-SVN: r193063
2012-10-31complex.c (csqrtq): NaN and INF fixes.Tobias Burnus10-74/+107
2012-10-31 Tobias Burnus <burnus@net-b.de> Joseph Myers <joseph@codesourcery.com> David S. Miller <davem@davemloft.net> Ulrich Drepper <drepper@redhat.com> Marek Polacek <polacek@redhat.com>: Petr Baudis <pasky@suse.cz> * math/complex.c (csqrtq): NaN and INF fixes. * math/sqrtq.c (sqrt): NaN, INF and < 0 fixes. * math/expm1q.c (expm1q): Changes from GLIBC. Use expq for large parameters. Fix errno for boundary conditions. * math/finiteq.c (finiteq): Add comment. * math/fmaq.c (fmaq): Changes from GLIBC. Fix missing underflows and bad results for some subnormal results. Fix sign of inexact zero return. Fix sign of exact zero return. Ensure additions are not scheduled after fetestexcept. * math/jnq.c (jnq): Changes from GLIBC. Set up errno properly for ynq. Fix jnq precision. * math/nearbyintq.c (nearbyintq): Changes from GLIBC. Do not manipulate bits before adding and subtracting TWO112[sx]. * math/rintq.c (rintq): Ditto. * math/scalbnq.c (scalbnq): Changes from GLIBC. Fix integer overflow. Co-Authored-By: David S. Miller <davem@davemloft.net> Co-Authored-By: Joseph Myers <joseph@codesourcery.com> Co-Authored-By: Ulrich Drepper <drepper@redhat.com> From-SVN: r193037
2011-08-01rem_pio2q.c (__quadmath_kernel_rem_pio2): Fix up fq to y conversion for prec ↵Jakub Jelinek1-6/+12
3 and __FLT_EVAL_METHOD__ != 0. * math/rem_pio2q.c (__quadmath_kernel_rem_pio2): Fix up fq to y conversion for prec 3 and __FLT_EVAL_METHOD__ != 0. From-SVN: r176999
2011-01-16re PR libfortran/47322 (libquadmath breaks bootstrap on ↵Jakub Jelinek1-1/+1
x86_64-unknown-freebsd8.2) PR libfortran/47322 * math/remquoq.c (remquoq): Use uint64_t type instead of u_int64_t. From-SVN: r168872
2011-01-16re PR fortran/46416 (libquadmath: missing functions)Jakub Jelinek14-1/+895
PR fortran/46416 * quadmath.h (cbrtq, finiteq, isnanq, signbitq, sqrtq): Remove const from prototype argument. (cimagq, conjq, cprojq, crealq, fdimq, fmaxq, fminq, ilogbq, llrintq, log2q, lrintq, nearbyintq, remquoq): New prototypes. (__quadmath_extern_inline): Define. (cimagq, conjq, crealq): New inlines. * Makefile.am (libquadmath_la_SOURCES): Add math/cimagq.c, math/conjq.c, math/cprojq.c, math/crealq.c, math/fdimq.c, math/fmaxq.c, math/fminq.c, math/ilogbq.c, math/llrintq.c, math/log2q.c, math/lrintq.c, math/nearbyintq.c and math/remquoq.c. * Makefile.in: Regenerated. * quadmath_weak.h (cimagq, conjq, cprojq, crealq, fdimq, fmaxq, fminq, ilogbq, llrintq, log2q, lrintq, nearbyintq, remquoq): Add. * quadmath-imp.h (__LITTLE_ENDIAN__): Don't define. (ieee854_float128): Use __BYTE_ORDER == __ORDER_BIG_ENDIAN__ tests instead of __BIG_ENDIAN__. * quadmath.map (QUADMATH_1.0): Add cimagq, conjq, cprojq, crealq, fdimq, fmaxq, fminq, ilogbq, llrintq, log2q, lrintq, nearbyintq and remquoq. * libquadmath.texi (cimagq, conjq, cprojq, crealq, fdimq, fmaxq, fminq, ilogbq, llrintq, log2q, lrintq, nearbyintq, remquoq): Add. * math/cprojq.c: New file. * math/ilogbq.c: New file. * math/fminq.c: New file. * math/llrintq.c: New file. * math/log2q.c: New file. * math/lrintq.c: New file. * math/crealq.c: New file. * math/nearbyintq.c: New file. * math/fmaxq.c: New file. * math/conjq.c: New file. * math/remquoq.c: New file. * math/cimagq.c: New file. * math/fdimq.c: New file. * math/ldexpq.c: Include errno.h. Set errno to ERANGE if needed. From-SVN: r168854
2011-01-16re PR fortran/46416 (libquadmath: missing functions)Jakub Jelinek9-12/+431
PR fortran/46416 * quadmath.h (cacosq, cacoshq, casinq, casinhq, catanq, catanhq): New prototypes. (M_Eq, M_LOG2Eq, M_LOG10Eq, M_LN2q, M_LN10q, M_PIq, M_PI_2q, M_PI_4q, M_1_PIq, M_2_PIq, M_2_SQRTPIq, M_SQRT2q, M_SQRT1_2q): Define. * quadmath_weak.h (cacosq, cacoshq, casinq, casinhq, catanq, catanhq): Add. * quadmath-imp.h (fpclassifyq, QUADFP_NAN, QUADFP_INFINITE, QUADFP_ZERO, QUADFP_SUBNORMAL, QUADFP_NORMAL): Define. * quadmath.map (QUADMATH_1.0): Add cacosq, cacoshq, casinq, casinhq, catanq and catanhq. * Makefile.am (libquadmath_la_SOURCES): Add math/cacosq.c, math/cacoshq.c, math/casinq.c, math/casinhq.c, math/catanq.c and math/catanhq.c. * Makefile.in: Regenerated. * libquadmath.texi (cacosq, cacoshq, casinq, casinhq, catanq, catanhq): Add. * math/cacoshq.c: New file. * math/cacosq.c: New file. * math/catanq.c: New file. * math/catanhq.c: New file. * math/casinq.c: New file. * math/casinhq.c: New file. * math/hypotq.c (hypotq): Use Q suffix instead of L. * math/atan2q.c (tiny, pi_o_4, pi_o_2, pi, pi_lo, atan2q): Likewise. * math/cosq.c (cosq): Likewise. From-SVN: r168853
2011-01-16re PR fortran/46402 (libquadmath: Add fmalq)Jakub Jelinek2-0/+271
PR fortran/46402 * quadmath.map (QUADMATH_1.0): Add fmaq. * configure.ac: Check for fenv.h, feholdexcept, fesetround, feupdateenv, fesetenv and fetestexcept. * configure: Regenerated. * config.h.in: Regenerated. * quadmath.h (fmaq): New prototype. * quadmath_weak.h (fmaq): Add. * Makefile.am (libquadmath_la_SOURCES): Add math/fmaq.c. * Makefile.in: Regenerated. * quadmath-imp.h: Include config.h. * math/expq.c: Include fenv.h. (USE_FENV_H): Define if libm support for fe* is there. (expq): Add fesetround etc. support if USE_FENV_H is defined. * math/fmaq.c: New file. * libquadmath.texi (fmaq): Add. From-SVN: r168852
2010-12-13re PR fortran/46625 (libquadmath: Mangle internal symbols; rename __float128 ↵Tobias Burnus8-31/+33
<-> string functions) 2010-12-13 Tobias Burnus <burnus@net-b.de> PR fortran/46625 * gdtoa/gdtoaimp.h: Mangle internal functions by prefixing them with __quadmath. Don't use gdtoa's strcp(y). * gdtoa/g_Qfmt.c (g_Qfmt): Use strcpy instead of strcp. * gdtoa/misc.c (strcpy): Renamed from strcp and only use if NO_STRING_H is set. * quadmath-imp.h (__quadmath_rem_pio2q, * __quadmath_kernel_sincosq __quadmath_kernel_sinq, __quadmath_kernel_cosq): Added __quadmath prefix to internal functions. * math/cosq.c (cosq): Ditto. * math/sinq.c (cosq): Ditto. * math/tanq.c (tanq,__quadmath_kernel_tanq): Ditto. * math/rem_pio2q.c (rem_pio2, __quadmath_kernel_rem_pio2): * Ditto. * math/sinq_kernel.c (__quadmath_kernel_sinq): Ditto. * math/cosq_kernel.c (__quadmath_kernel_cosq): Ditto. From-SVN: r167768
2010-11-16re PR fortran/32049 (Support on x86_64 also kind=16)Francois-Xavier Coudert57-0/+11971
/ 2010-11-13 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> Tobias Burnus <burnus@net-b.de> PR fortran/32049 * Makefile.def: Add libquadmath; build it with language=fortran. * configure.ac: Add libquadmath. * Makefile.tpl: Handle multiple libs in check-[+language+]. * Makefile.in: Regenerate. * configure: Regenerate. libquadmath/ 2010-11-13 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> Tobias Burnus <burnus@net-b.de> PR fortran/32049 Initial implementation and checkin. gcc/fortran/ 2010-11-13 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> Tobias Burnus <burnus@net-b.de> PR fortran/32049 * gfortranspec.c (find_spec_file): New function. (lang_specific_driver): Try to find .spec file and use it. * trans-io.c (iocall): Define * IOCALL_X_REAL128/COMPLEX128(,write). (gfc_build_io_library_fndecls): Build decl for __float128 I/O. (transfer_expr): Call __float128 I/O functions. * trans-types.c (gfc_init_kinds): Allow kind-16 belonging to __float128. gcc/testsuite/ 2010-11-13 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> Tobias Burnus <burnus@net-b.de> PR fortran/32049 * gfortran.dg/quad_1.f90: New. * lib/gcc-defs.exp (gcc-set-multilib-library-path): Use also compiler arguments. * lib/gfortran.exp (gfortran_link_flags): Add libquadmath to library search path; call gcc-set-multilib-library-path with arguments such that libgfortran.spec is found. (gfortran_init): Add path for libgfortran.spec to GFORTRAN_UNDER_TEST. libgomp/ 2010-11-13 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> Tobias Burnus <burnus@net-b.de> PR fortran/32049 * configure.ac: * configure: Regenerate. libgfortran/ 2010-11-13 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> Tobias Burnus <burnus@net-b.de> PR fortran/32049 * Makefile.am: Add missing pow_r16_i4.c, add transfer128.c, link libquadmath, if used. * acinclude.m4 (LIBGFOR_CHECK_FLOAT128): Add. * configure.ac: Use it, touch spec file. * gfortran.map: Add pow_r16_i4 and transfer_(real,complex)128(,write) functions. * intrinsics/cshift0.c (cshift0): Handle __float128 type. * intrinsics/erfc_scaled_inc.c: Ditto. * intrinsics/pack_generic.c (pack): Ditto * intrinsics/spread_generic.c (spread): Ditto. * intrinsics/unpack_generic.c (unpack1): Ditto. * io/read.c (convert_real): Ditto. * io/transfer.c: Update comments. * io/transfer128.c: New file. * io/write_float.def (write_float): Handle __float128 type. * libgfortran.h: #include quadmath_weak.h, define __builtin_infq and nanq. * m4/mtype.m4: Handle __float128 type. * runtime/in_pack_generic.c (internal_pack): Ditto. * runtime/in_unpack_generic.c (internal_unpack): Ditto. * kinds-override.h: New file. * libgfortran.spec.in: Ditto. * generated/pow_r16_i4.c: Generated. * Makefile.in: Regenerate. * configure: Regenerate. * config.h: Regenerate. * bessel_r10.c: Regenerate. * bessel_r16.c: Regenerate. * bessel_r4.c: Regenerate. * bessel_r8.c: Regenerate. * exponent_r16.c: Regenerate. * fraction_r16.c: Regenerate. * nearest_r16.c: Regenerate. * norm2_r10.c: Regenerate. * norm2_r16.c: Regenerate. * norm2_r4.c: Regenerate. * norm2_r8.c: Regenerate. * rrspacing_r16.c: Regenerate. * set_exponent_r16.c: Regenerate. * spacing_r16.c: Regenerate. Co-Authored-By: Tobias Burnus <burnus@net-b.de> From-SVN: r166825