aboutsummaryrefslogtreecommitdiff
path: root/libdecnumber/bid
AgeCommit message (Collapse)AuthorFilesLines
2024-01-03Update copyright years.Jakub Jelinek9-9/+9
2023-01-16Update copyright years.Jakub Jelinek9-9/+9
2022-01-03Update copyright years.Jakub Jelinek9-9/+9
2021-01-04Update copyright years.Jakub Jelinek9-9/+9
2020-01-01Update copyright years.Jakub Jelinek9-9/+9
From-SVN: r279813
2019-12-09Fix libdecnumber handling of non-canonical BID significands (PR ↵Joseph Myers1-3/+19
middle-end/91226). As reported in bug 91226, the libdecnumber code used on the host to interpret DFP values in the BID encoding fails, for _Decimal64 and _Decimal128, to check for the case where a significand is too large and so specified in IEEE 754 to be a non-canonical encoding of the zero significand. This patch adds the required handling of that case, together with tests both using -O2 (testing this host code) and -O0 (testing libgcc code, which already worked before the patch); the tests also cover _Decimal32, which already had the required check. In the _Decimal128 case, where the code previously completely ignored the case where the first four bits of the combination field are 1100, 1101 or 1110, the logic for determining the correct quantum exponent in that case is also newly added by this patch, so tests are added for that as well (again, libgcc already handled it correctly when the conversion was done at runtime rather than at compile time). Bootstrapped with no regressions for x86_64-pc-linux-gnu. PR middle-end/91226 libdecnumber: * bid/bid2dpd_dpd2bid.c (_bid_to_dpd64): Handle non-canonical significands. (_bid_to_dpd128): Likewise. Check for case where combination field starts 1100, 1101 or 1110. gcc/testsuite: * gcc.dg/dfp/bid-non-canonical-d128-1.c, gcc.dg/dfp/bid-non-canonical-d128-2.c, gcc.dg/dfp/bid-non-canonical-d128-3.c, gcc.dg/dfp/bid-non-canonical-d128-4.c, gcc.dg/dfp/bid-non-canonical-d32-1.c, gcc.dg/dfp/bid-non-canonical-d32-2.c, gcc.dg/dfp/bid-non-canonical-d64-1.c, gcc.dg/dfp/bid-non-canonical-d64-2.c: New tests. From-SVN: r279129
2019-01-01Update copyright years.Jakub Jelinek9-9/+9
From-SVN: r267494
2018-01-03Update copyright years.Jakub Jelinek9-9/+9
From-SVN: r256169
2017-06-29bid2dpd_dpd2bid.c (_bid_to_dpd32): Fix whitespace.Sylvestre Ledru1-149/+124
* bid/bid2dpd_dpd2bid.c (_bid_to_dpd32): Fix whitespace. (_dpd_to_bid32): Simplify identical code on multiple branches. Fix whitespace. (_bid_to_dpd64, _dpd_to_bid64): Likewise. (_bid_to_dpd128, _dpd_to_bid128): Likewise. From-SVN: r249803
2017-01-01Update copyright years.Jakub Jelinek9-9/+9
From-SVN: r243994
2016-01-04Update copyright years.Jakub Jelinek9-9/+9
From-SVN: r232055
2015-01-05Update copyright years.Jakub Jelinek9-9/+9
From-SVN: r219188
2014-01-02Update copyright years in libdecnumber/Richard Sandiford9-9/+9
From-SVN: r206294
2013-02-06Update copyright in libdecnumber.Richard Sandiford9-13/+9
From-SVN: r195821
2009-04-09Licensing changes to GPLv3 resp. GPLv3 with GCC Runtime Exception.Jakub Jelinek9-127/+90
From-SVN: r145841
2008-06-11dfp.c (WORDS_BIGENDIAN): Define to 0 if not defined.Joseph Myers1-0/+15
gcc: * dfp.c (WORDS_BIGENDIAN): Define to 0 if not defined. (encode_decimal64, decode_decimal64, encode_decimal128, decode_decimal128): Reverse order of 32-bit parts of value if host and target endianness differ. libdecnumber: * dconfig.h: New. * decContext.c, decExcept.c, decExcept.h, decLibrary.c, decNumber.c, decNumberLocal.h, decRound.c, dpd/decimal128.c, dpd/decimal32.c, dpd/decimal64.c: Include dconfig.h not config.h. * dpd/decimal128Local.h (decimal128SetSign, decimal128ClearSign, decimal128FlipSign): Use WORDS_BIGENDIAN not FLOAT_WORDS_BIG_ENDIAN. * bid/host-ieee128.c: Include dconfig.h. (__host_to_ieee_128, __ieee_to_host_128): Swap 64-bit halves of value if WORDS_BIGENDIAN. libgcc: * Makefile.in (DECNUMINC): Remove -I$(MULTIBUILDTOP)../../libdecnumber. * gstdint.h: New. From-SVN: r136641
2007-09-10Makefile.in (libdecnumber_a_OBJS): Remove decUtility.oJanis Johnson7-117/+10
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-03-24Add BID decimal supportMichael Meissner12-0/+11598
Co-Authored-By: H.J. Lu <hongjiu.lu@intel.com> Co-Authored-By: Marius Cornea <marius.cornea@intel.com> From-SVN: r123185