- Jan 03, 2024
-
-
Jakub Jelinek authored
-
- Jan 16, 2023
-
-
Jakub Jelinek authored
-
- Jan 03, 2022
-
-
Jakub Jelinek authored
-
- Feb 22, 2021
-
-
Michael Meissner authored
libgcc/ 2021-02-22 Michael Meissner <meissner@linux.ibm.com> * dfp-bit.c (BFP_TO_DFP): Fix a comment line that was too long.
-
Michael Meissner authored
This patch implements conversions between _Float128 and the 3 Decimal floating types. It does this by extendending the dfp-bit conversions to add a new binary floating point type (KF), and doing the conversions in the same manner as the other binary/decimal conversions. For conversions from _Float128 to Decimal, this patch uses a function (__sprintfkf) instead of the sprintf function to convert long double values to strings. The __sprintfkf function determines if GLIBC 2.32 or newer is used and calls the IEEE 128-bit version of sprintf (__sprintfieee128). If the GLIBC is earlier than 2.32, the code will convert _Float128 to __ibm128 and then use the normal sprintf to convert this value. For conversions from Decimal to _Float128, this patch uses a function (__strtokf) instead of strtold to convert the strings from the Decimal conversion to long double. The __strtokf function determines if GLIBC 2.32 or newer is used, and if it is, calls the IEEE 128-bit version (__strtoieee128). If the GLIBC is earlier than 2.32, the code will call strtold and convert the __ibm128 value to _Float128. These functions will primarily be used if/when the default PowerPC long double type is changed to IEEE 128-bit, but they could also be used if the user explicitly converts _Float128 to/from a Decimal type. libgcc/ 2021-02-22 Michael Meissner <meissner@linux.ibm.com> * config/rs6000/_dd_to_kf.c: New file. * config/rs6000/_kf_to_dd.c: New file. * config/rs6000/_kf_to_sd.c: New file. * config/rs6000/_kf_to_td.c: New file. * config/rs6000/_sd_to_kf.c: New file. * config/rs6000/_sprintfkf.c: New file. * config/rs6000/_sprintfkf.h: New file. * config/rs6000/_strtokf.h: New file. * config/rs6000/_strtokf.c: New file. * config/rs6000/_td_to_kf.c: New file. * config/rs6000/quad-float128.h: Add new declarations. * config/rs6000/t-float128 (fp128_dec_funcs): New macro. (fp128_decstr_funcs): New macro. (ibm128_dec_funcs): New macro. (fp128_ppc_funcs): Add the new conversions. (fp128_dec_objs): Force Decimal <-> __float128 conversions to be compiled with -mabi=ieeelongdouble. (fp128_decstr_objs): Force __float128 <-> string conversions to be compiled with -mabi=ibmlongdouble. (ibm128_dec_objs): Force Decimal <-> __float128 conversions to be compiled with -mabi=ieeelongdouble. (FP128_CFLAGS_DECIMAL): New macro. (IBM128_CFLAGS_DECIMAL): New macro. * dfp-bit.c (DFP_TO_BFP): Add PowerPC _Float128 support. (BFP_TO_DFP): Add PowerPC _Float128 support. * dfp-bit.h (BFP_KIND): Add new binary floating point kind for IEEE 128-bit floating point. (DFP_TO_BFP): Add PowerPC _Float128 support. (BFP_TO_DFP): Add PowerPC _Float128 support. (BFP_SPRINTF): New macro.
-
- Jan 04, 2021
-
-
Jakub Jelinek authored
-
- Jan 01, 2020
-
-
Jakub Jelinek authored
From-SVN: r279813
-
- Jan 01, 2019
-
-
Jakub Jelinek authored
From-SVN: r267494
-
- Jan 03, 2018
-
-
Jakub Jelinek authored
From-SVN: r256169
-
- Jan 01, 2017
-
-
Jakub Jelinek authored
From-SVN: r243994
-
- Jan 04, 2016
-
-
Jakub Jelinek authored
From-SVN: r232055
-
- Jan 05, 2015
-
-
Jakub Jelinek authored
From-SVN: r219188
-
- Jan 02, 2014
-
-
Richard Sandiford authored
From-SVN: r206295
-
- Feb 04, 2013
-
-
Richard Sandiford authored
From-SVN: r195731
-
- Jul 11, 2011
-
-
Rainer Orth authored
gcc: * config/dfp-bit.c, config/dfp-bit.h: Move to ../libgcc. * config/t-dfprules: Move to ../libgcc/config. * config.gcc (i[34567]86-*-linux*, i[34567]86-*-kfreebsd*-gnu, i[34567]86-*-knetbsd*-gnu, i[34567]86-*-gnu*, i[34567]86-*-kopensolaris*-gnu): Remove t-dfprules from tmake_file. (x86_64-*-linux*, x86_64-*-kfreebsd*-gnu, x86_64-*-knetbsd*-gnu): Likewise. (i[34567]86-*-cygwin*): Likewise. (i[34567]86-*-mingw*, x86_64-*-mingw*): Likewise. (powerpc-*-linux*, powerpc64-*-linux*): Likewise. * Makefile.in (D32PBIT_FUNCS, D64PBIT_FUNCS, D128PBIT_FUNCS): Remove. (libgcc.mvars): Remove DFP_ENABLE, DFP_CFLAGS, D32PBIT_FUNCS, D64PBIT_FUNCS, D128PBIT_FUNCS. libgcc: * dfp-bit.c, dfp-bit.h: New files. * Makefile.in (D32PBIT_FUNCS, D64PBIT_FUNCS, D128PBIT_FUNCS): New variables. ($(d32pbit-o)): Use $(srcdir) to refer to dfp-bit.c ($(d64pbit-o)): Likewise. ($(d128pbit-o)): Likewise. * config/t-dfprules: New file. * config.host (i[34567]86-*-linux*): Add t-dfprules to tmake_file. (i[34567]86-*-kfreebsd*-gnu, i[34567]86-*-knetbsd*-gnu, i[34567]86-*-gnu*, i[34567]86-*-kopensolaris*-gnu): Likewise. (x86_64-*-linux*): Likewise. (x86_64-*-kfreebsd*-gnu, x86_64-*-knetbsd*-gnu): Likewise. (i[34567]86-*-cygwin*): Likewise. (i[34567]86-*-mingw*, x86_64-*-mingw*): Likewise. (powerpc-*-linux*, powerpc64-*-linux*): Likewise. From-SVN: r176156
-
- Sep 17, 2009
-
-
Janis Johnson authored
gcc/ PR c/41049 * real.c decimal_from_integer, decimal_integer_string): New. (real_from_integer): Use them as special case for decimal float. * config/dfp-bit.c (_si_to_sd, _usi_to_sd): Use default rounding. (_di_to_sd, _di_to_dd, _di_to_td, _udi_to_sd, _udi_to_dd, _udi_to_td): Do not append zero after the decimal point in string to convert. gcc/testsuite/ PR c/41049 * dfp/pr41049.c: New test. From-SVN: r151806
-
- Apr 09, 2009
-
-
Jakub Jelinek authored
From-SVN: r145841
-
- Feb 20, 2009
-
-
Jakub Jelinek authored
From-SVN: r144324
-
- Dec 09, 2008
-
-
Ben Elliston authored
From-SVN: r142577
-
- Jun 19, 2008
-
-
Ben Elliston authored
* dfp.h, dfp.c, config/dfp-bit.h, config/dfp-bit.c, real.h, real.c: Remove references to IEEE 754R. * doc/install.texi (Configuration): IEEE 754R -> IEEE 754-2008. * doc/libgcc.texi (Decimal float library routines): Likewise. From-SVN: r136933
-
- Sep 13, 2007
-
-
Janis Johnson authored
* config/dfp-bit.c (dfp_conversion_exception): New function. (DFP_TO_DFP) Add new variants to use direct conversions in decNumber. (DFP_TO_INT): Ditto. (INT_TO_DFP): Ditto. * config/dfp-bit.h (DEC_FLOAT_FROM_INT, DEC_FLOAT_TO_INT): New. From-SVN: r128449
-
- Sep 11, 2007
-
-
Janis Johnson authored
gcc/ PR c/30013 * config/dfp-bit.c: Don't skip TFmode conversions; move strto* declarations to top. (DFP_TO_BFP): Use for either XFmode or TFmode. (BFP_TO_DFP): Use for either XFmode or TFmode; always use cast of BFP_VIA_TYPE. * config/dfp-bit.h: Include float.h. (LONG_DOUBLE_HAS_XF_MODE, LONG_DOUBLE_HAS_TF_MODE): Define if long double is one of these modes, rather than using LIBGCC_HAS_*F_MODE which doesn't mean the same thing. (BFP_KIND): Use 4 to mean TFmode. (BFP_FMT): Specify the number of decimal digits based on the number of mantissa digits. (BFP_VIA_TYPE): Binary float type to use as cast for sprintf. (BFP_TO_DFP, DFP_TO_BFP): Define names for TFmode variants. (STR_TO_BFP): Use strtold for XFmode or TFmode. (TFtype): Define if TFmode is supported. * doc/libgcc.texi (Decimal float library routines): Document TF conversion functions. gcc/testsuite/ * gcc.dg/dfp/convert-bfp.c: Replace SKIP_LONG_DOUBLE with runtime checks for size of long double. * gcc.dg/dfp/convert.h: New file. * gcc.dg/dfp/convert-bfp-2.c: New test. * gcc.dg/dfp/convert-bfp-3.c: Ditto. * gcc.dg/dfp/convert-bfp-4.c: Ditto. * gcc.dg/dfp/convert-bfp-5.c: Ditto. * gcc.dg/dfp/convert-bfp-6.c: Ditto. * gcc.dg/dfp/convert-bfp-7.c: Ditto. * gcc.dg/dfp/convert-bfp-8.c: Ditto. * gcc.dg/dfp/convert-bfp-9.c: Ditto. * gcc.dg/dfp/convert-bfp-10.c: Ditto. * gcc.dg/dfp/convert-bfp-11.c: Ditto. From-SVN: r128361
-
Janis Johnson authored
* config/dfp-bit.c (dfp_unary_func): Delete. (dfp_unary_op): Delete. (dfp_binary_op): Use decFloat functions instead of decNumber functions for binary operations. (d32_binary_op): Convert 32-bit operands to 64 bits for evaluation. (dnn_binary_op): Call dfp_binary_op with decFloat rather than DFP_C_TYPE. (dfp_compare_op): Use decFloat functions insteadof decNumber functions for comparisons. (d32_compare_op): Convert 32-bit operands to 64 bits for evaluation. (dnn_binary_op): Call dfp_compare_op with decFloat rather than DFP_C_TYPE. (DFP_ADD, DFP_SUB, DFP_MULTIPLE, DFP_DIVIDE): Use macros for call to dxx_binary_op and decFloat function. (DFP_EQ, DFP_NE, DFP_LT, DFP_GT, DFP_LE, DFP_GE): Use macros for calls to dxx_binary_op and decFloat function. * config/dfp-bit.h: Include decFloat header files. (decFloat, DFP_BINARY_OP, DFP_COMPARE_OP, DEC_FLOAT_ADD, DEC_FLOAT_SUBTRACT, DEC_FLOAT_MULTIPLY, DEC_FLOAT_DIVIDE, DEC_FLOAT_COMPARE, DEC_FLOAT_IS_ZERO, DEC_FLOAT_IS_NAN, DEC_FLOAT_IS_SIGNED: Define for each of 3 operand widths. From-SVN: r128358
-
- Sep 10, 2007
-
-
Janis Johnson authored
2007-09-10 Janis Johnson <janis187@us.ibm.com> Ben Elliston <bje@au.ibm.com> libdecnumber/ * Makefile.in (libdecnumber_a_OBJS): Remove decUtility.o (dependencies): Add Symbols headers. * decContext.c: Upgrade to decNumber 3.53. * decContext.h: Ditto. * decDPD.h: Ditto. * decNumber.c: Ditto. * decNumber.h: Ditto. * decNumberLocal.h: Ditto. * decBasic.c: New file from decNumber 3.53. * decCommon.c: Ditto. * decDouble.c: Ditto. * decDouble.h: Ditto. * decQuad.c: Ditto. * decQuad.h: Ditto. * decSingle.c: Ditto. * decSingle.h: Ditto. * decPacked.c: Ditto. * decPacked.h: Ditto. * dpd/decimal128.c: Upgrade to decNumber 3.53. * dpd/decimal128.h: Ditto. * dpd/decimal32.c: Ditto. * dpd/decimal32.h: Ditto. * dpd/decimal64.c: Ditto. * dpd/decimal64.h: Ditto. * decLibrary.c (__dec_byte_swap): Remove. * decContextSymbols.h: New file. * decDoubleSymbols.h: New file. * decNumberSymbols.h: New file. * decPackedSymbols.h: New file. * decQuadSymbols.h: New file. * decSingleSymbols.h: New file. * decUtility.c: Delete file. * decUtility.h: Delete file. * bid/decimal128Symbols.h: New file. * bid/decimal128Local.h: New file. * bid/decimal32Symbols.h: New file. * bid/decimal64Symbols.h: New file. * bid/host-ieee128.c (__swap128): Remove. (__host_to_ieee_128, __ieee_to_host_128): Don't handle endianness. * bid/host-ieee32.c (__dec_type_swap): Remove. (__host_to_ieee_32, __ieee_to_host_32): Don't handle endianness. * bid/host-ieee64.c (__swap64): Remove. (__host_to_ieee_64, __ieee_to_host_64): Don't handle endianness. * dpd/decimal32Symbols.h: New file. * dpd/decimal64Symbols.h: New file. * dpd/decimal128Symbols.h: New file. * dpd/decimal128Local.h: New file. libgcc/ * Makefile.in (dfp-filenames): Remove decUtility, add decDouble, decPacked, decQuad, decSingle. gcc/ * dfp.c: Include decimal128Local.h; (dfp_byte_swap): Remove. (encode_decimal32, decode_decimal32): Don't handle endianness. (encode_decimal64, decode_decimal64): Ditto. (encode_decimal128, decode_decimal128): Ditto. * config/dfp-bit.c (host_to_ieee32, ieee_to_host_32): Ditto. (__swap64): Remove. (host_to_ieee_64, ieee_to_host_64): Don't handle endianness. (__swap128): Remove (host_to_ieee_128, ieee_to_host_128): Don't handle endianness. * Makefile.in (DECNUM_H): Add decimal128Local.h. Co-Authored-By:
Ben Elliston <bje@au.ibm.com> From-SVN: r128350
-
- Aug 22, 2007
-
-
Janis Johnson authored
From-SVN: r127710
-
- Jul 18, 2007
-
-
H.J. Lu authored
2007-07-18 H.J. Lu <hongjiu.lu@intel.com> * Makefile.in (D32PBIT_FUNCS): Add _sd_to_tf and _tf_to_sd. (D64PBIT_FUNCS): Add _dd_to_tf and _tf_to_dd. (D128PBIT_FUNCS): Add _td_to_tf and _tf_to_td. * config/dfp-bit.c: Empty for TFmode conversions. From-SVN: r126735
-
- Mar 24, 2007
-
-
Michael Meissner authored
Co-Authored-By:
H.J. Lu <hongjiu.lu@intel.com> Co-Authored-By:
Marius Cornea <marius.cornea@intel.com> From-SVN: r123185
-
- Mar 02, 2007
-
-
Ben Elliston authored
re PR middle-end/30992 (Scaling error in decimal floating-point arithmetic blows conversions to integers) 2007-03-02 Ben Elliston <bje@au.ibm.com> PR 30992 * config/dfp-bit.c (DFP_TO_INT): Initialise qval with "1.". From-SVN: r122469
-
- Jan 29, 2007
-
-
Janis Johnson authored
libdecnumber/ * decExcept.c: New. * decExcept.h: New. libgcc/ * Makefile.in (dec-filenames): Add decExcept. gcc/ * config/dfp-bit.c: Add parameterized support for fp exceptions. * config/dfp-bit.h: Ditto. gcc/testsuite/ * gcc.dg/dfp/dfp-except.h: New file. * gcc.dg/dfp/fe-check.h: New file. * gcc.dg/dfp/fe-binop.c: New test. * gcc.dg/dfp/fe-convert-1.c: New test. * gcc.dg/dfp/fe-convert-2.c: New test. * gcc.dg/dfp/fe-convert-3.c: New test. From-SVN: r121317
-
- Jan 16, 2007
-
-
Janis Johnson authored
gcc/ * config/dfp-bit.c (dfp_compare_op): Return separate value for NaN. (DFP_NE, DFP_LE, DFP_GE): Return false for NaN. gcc/testsuite/ * gcc.dg/dfp/compare-special.h: New file. * gcc.dg/dfp/compare-special-32.c: New test. * gcc.dg/dfp/compare-special-64.c: New test. * gcc.dg/dfp/compare-special-128.c: New test. From-SVN: r120830
-
- Nov 30, 2006
-
-
Janis Johnson authored
gcc/ * config/dfp-bit.c (DFP_TO_INT): Use wider precision. testsuite/ * gcc.dg/dfp/convert-int-max.c: New test. * gcc.dg/dfp/convert-int-max-fold.c: New test. From-SVN: r119368
-
- Nov 29, 2006
-
-
Janis Johnson authored
From-SVN: r119335
-
Janis Johnson authored
libdecnumber/ * decRound.c: Move declarations to new file, update comments. * decRound.h: New file. gcc/ * mklibgcc.in: Fix dependencies for dfp-bit.c. * config/dfp-bit.h (CONTEXT_ROUND): Delete. (DFP_INIT_ROUNDMODE): Define. * config/dfp-bit.c: Replace CONTEXT_ROUND with DFP_INIT_ROUNDMODE. From-SVN: r119329
-
- Nov 21, 2006
-
-
Janis Johnson authored
* config/dfp-bits.c (DFP_TO_INT): Remove code to saturate result of conversion that doesn't fit. From-SVN: r119069
-
Janis Johnson authored
decnumber/ * decLibrary.c (__dec_type_swap): Add prototype. (__dfp_enable_traps, dfp_raise): Delete. gcc/ * config/dfp-bit.h (CONTEXT_TRAPS, CONTEXT_ERRORS, DFP_RAISE): Delete. * config/dfp-bit.c (dfp_unary_op, dfp_binary_op, dfp_compare_op, DFP_TO_DFP, INT_TO_DFP, BFP_TO_DFP): Remove calls to DFP_RAISE. testsuite/ * gcc.dg/dfp/snan.c: Delete. From-SVN: r119068
-
Janis Johnson authored
From-SVN: r119067
-
- Apr 15, 2006
-
-
Kazu Hirata authored
* cfgcleanup.c, config/dfp-bit.c, expr.c, fold-const.c, jump.c, mips-tfile.c, omp-low.c, sched-int.h, tree-ssa-loop-prefetch.c, tree-vrp.c: Fix comment typos. From-SVN: r112971
-
- Mar 04, 2006
-
-
Kazu Hirata authored
* builtins.c, c-pragma.h, c-typeck.c, cgraph.c, cgraphunit.c, combine.c, common.opt, config/dfp-bit.c, config/i386/i386.c, config/m68k/m68k.c, config/m68k/m68k.md, config/mt/mt.c, config/mt/mt.h, config/s390/s390.md, df-core.c, df-problems.c, df-scan.c, df.h, diagnostic.c, expr.c, function.h, gimplify.c, loop-invariant.c, omp-low.c, opts.c, passes.c, rtl-factoring.c, rtlanal.c, struct-equiv.c, tree-cfgcleanup.c, tree-ssa-loop-niter.c, tree-ssa-loop-prefetch.c, tree-ssa-structalias.c, tree-ssa-threadedge.c, tree-ssa-threadupdate.c, tree-vect-patterns.c, tree-vect-transform.c, tree-vectorizer.h, tree-vrp.c, unwind-dw2.c: Fix comment typos. Follow spelling conventions. From-SVN: r111721
-
- Jan 18, 2006
-
-
Ben Elliston authored
* Makefile.in (D32PBIT_FUNCS): New. (D64PBIT_FUNCS, D128PBIT_FUNCS): Likewise. (libgcc.mk): Set D32PBIT, D64PBIT, D128PBIT, D32PBIT_FUNCS, D64PBIT_FUNCS and D128PBIT_FUNCS. (LIBGCC_DEPS): Include $(D32PBIT), $(D64PBIT), $(D128PBIT). * mklibgcc.in Bring in the DFP support code if D32PBIT, D64PBIT or D128PBIT are set. (decnumber_dep): Define. * doc/libgcc.texi (Decimal float library routines): New node. * config/dfp-bit.h, config/dfp-bit.c: New files. From-SVN: r109856
-