Skip to content
Snippets Groups Projects
  1. Jan 03, 2024
  2. Jan 16, 2023
  3. Jan 03, 2022
  4. Feb 22, 2021
    • Michael Meissner's avatar
      Fix a comment line that was too long. · 692ba083
      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.
      692ba083
    • Michael Meissner's avatar
      Add conversions between _Float128 and Decimal. · 78118359
      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.
      78118359
  5. Jan 04, 2021
  6. Jan 01, 2020
  7. Jan 01, 2019
  8. Jan 03, 2018
  9. Jan 01, 2017
  10. Jan 04, 2016
  11. Jan 05, 2015
  12. Jan 02, 2014
  13. Feb 04, 2013
  14. Jul 11, 2011
    • Rainer Orth's avatar
      dfp-bit.c, dfp-bit.h: Move to ../libgcc. · 2d8d5935
      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
      2d8d5935
  15. Sep 17, 2009
    • Janis Johnson's avatar
      re PR c/41049 (conversion from integer to decimal float loses trailing zeros) · d2da4af2
      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
      d2da4af2
  16. Apr 09, 2009
  17. Feb 20, 2009
  18. Dec 09, 2008
  19. Jun 19, 2008
    • Ben Elliston's avatar
      dfp.h, [...]: Remove references to IEEE 754R. · 7292b8e4
      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
      7292b8e4
  20. Sep 13, 2007
    • Janis Johnson's avatar
      dfp-bit.c (dfp_conversion_exception): New function. · 55035467
      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
      55035467
  21. Sep 11, 2007
    • Janis Johnson's avatar
      re PR c/30013 (Multiple flaws in decimal floating-point arithmetic conversions fixed) · f3d110ef
      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
      f3d110ef
    • Janis Johnson's avatar
      dfp-bit.c (dfp_unary_func): Delete. · fb27b3f6
      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
      fb27b3f6
  22. Sep 10, 2007
    • Janis Johnson's avatar
      Makefile.in (libdecnumber_a_OBJS): Remove decUtility.o · 2533577f
      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: default avatarBen Elliston <bje@au.ibm.com>
      
      From-SVN: r128350
      2533577f
  23. Aug 22, 2007
  24. Jul 18, 2007
    • H.J. Lu's avatar
      Makefile.in (D32PBIT_FUNCS): Add _sd_to_tf and _tf_to_sd. · a6c9b188
      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
      a6c9b188
  25. Mar 24, 2007
  26. Mar 02, 2007
  27. Jan 29, 2007
    • Janis Johnson's avatar
      decExcept.c: New. · d9a66f98
      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
      d9a66f98
  28. Jan 16, 2007
    • Janis Johnson's avatar
      dfp-bit.c (dfp_compare_op): Return separate value for NaN. · 70b81845
      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
      70b81845
  29. Nov 30, 2006
  30. Nov 29, 2006
  31. Nov 21, 2006
  32. Apr 15, 2006
    • Kazu Hirata's avatar
      cfgcleanup.c, [...]: Fix comment typos. · 75c40d56
      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
      75c40d56
  33. Mar 04, 2006
    • Kazu Hirata's avatar
      builtins.c, [...]: Fix comment typos. · c0220ea4
      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
      c0220ea4
  34. Jan 18, 2006
    • Ben Elliston's avatar
      Makefile.in (D32PBIT_FUNCS): New. · d190d56b
      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
      d190d56b
Loading