aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/dfp-bit.c
AgeCommit message (Collapse)AuthorFilesLines
2011-07-12Delete moved source files.Rainer Orth1-680/+0
From-SVN: r176205
2009-09-17re PR c/41049 (conversion from integer to decimal float loses trailing zeros)Janis Johnson1-2/+1
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
2009-04-09Licensing changes to GPLv3 resp. GPLv3 with GCC Runtime Exception.Jakub Jelinek1-15/+10
From-SVN: r145841
2009-02-20Update Copyright years for files modified in 2008 and/or 2009.Jakub Jelinek1-1/+1
From-SVN: r144324
2008-12-09* config/dfp-bit.c (DFP_TO_INT): Remove unnecessary cast.Ben Elliston1-1/+1
From-SVN: r142577
2008-06-19dfp.h, [...]: Remove references to IEEE 754R.Ben Elliston1-1/+1
* 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
2007-09-13dfp-bit.c (dfp_conversion_exception): New function.Janis Johnson1-40/+187
* 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
2007-09-11re PR c/30013 (Multiple flaws in decimal floating-point arithmetic ↵Janis Johnson1-19/+9
conversions fixed) 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
2007-09-11dfp-bit.c (dfp_unary_func): Delete.Janis Johnson1-67/+90
* 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
2007-09-10Makefile.in (libdecnumber_a_OBJS): Remove decUtility.oJanis Johnson1-68/+6
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
2007-08-22* config/dfp-bit.c (DFP_TO_DFP): Check for overflow.Janis Johnson1-1/+2
From-SVN: r127710
2007-07-18Makefile.in (D32PBIT_FUNCS): Add _sd_to_tf and _tf_to_sd.H.J. Lu1-0/+9
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
2007-03-24Add BID decimal supportMichael Meissner1-2/+2
Co-Authored-By: H.J. Lu <hongjiu.lu@intel.com> Co-Authored-By: Marius Cornea <marius.cornea@intel.com> From-SVN: r123185
2007-03-02re PR middle-end/30992 (Scaling error in decimal floating-point arithmetic ↵Ben Elliston1-1/+1
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
2007-01-29decExcept.c: New.Janis Johnson1-0/+66
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
2007-01-16dfp-bit.c (dfp_compare_op): Return separate value for NaN.Janis Johnson1-1/+9
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
2006-11-30dfp-bit.c (DFP_TO_INT): Use wider precision.Janis Johnson1-1/+2
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
2006-11-29* dfp-bit.c (DFP_TO_INT): Fix rounding mode.Janis Johnson1-1/+1
From-SVN: r119335
2006-11-29decRound.c: Move declarations to new file, update comments.Janis Johnson1-7/+7
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
2006-11-21dfp-bits.c (DFP_TO_INT): Remove code to saturate result of conversion that ↵Janis Johnson1-23/+0
doesn't fit. * config/dfp-bits.c (DFP_TO_INT): Remove code to saturate result of conversion that doesn't fit. From-SVN: r119069
2006-11-21decLibrary.c (__dec_type_swap): Add prototype.Janis Johnson1-15/+0
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
2006-11-21* config/dfp-bit.c (dfp_binary_func): Fix typedef.Janis Johnson1-1/+1
From-SVN: r119067
2006-04-15cfgcleanup.c, [...]: Fix comment typos.Kazu Hirata1-1/+1
* 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
2006-03-04builtins.c, [...]: Fix comment typos.Kazu Hirata1-2/+2
* 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
2006-01-18Makefile.in (D32PBIT_FUNCS): New.Ben Elliston1-0/+541
* 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