mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-23 10:03:47 +08:00
libdecnumber: Sync with GCC
This commit is contained in:
parent
b0f49e3fd7
commit
f57a3bca61
@ -1,3 +1,53 @@
|
||||
2018-02-19 Martin Liska <mliska@suse.cz>
|
||||
|
||||
PR c/81272
|
||||
* decNumber.c (decCompareOp): Do not use bit and
|
||||
for conjunction of predicates.
|
||||
|
||||
2018-01-03 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
Update copyright years.
|
||||
|
||||
2017-05-29 Sylvestre Ledru <sylvestre@debian.org>
|
||||
|
||||
* 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.
|
||||
|
||||
2017-04-03 Jonathan Wakely <jwakely@redhat.com>
|
||||
|
||||
* decCommon.c (decFloatFromPackedChecked): Fix typo in comment.
|
||||
* decNumber.c (decNumberPower, decMultiplyOp): Likewise.
|
||||
|
||||
2017-01-08 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR bootstrap/79003
|
||||
* Makefile.in (CFLAGS, CPPFLAGS, LDFLAGS): Remove -fno-lto.
|
||||
(NOLTO_FLAGS): New variable.
|
||||
(ALL_CFLAGS): Use it.
|
||||
* configure.ac (nolto_flags): New ACX_PROG_CC_WARNING_OPTS,
|
||||
check for whether -fno-lto works.
|
||||
* configure: Regenerated.
|
||||
|
||||
2017-01-06 Martin Liska <mliska@suse.cz>
|
||||
|
||||
PR bootstrap/79003
|
||||
* Makefile.in: Add -fno-lto to {C,CPP,LD}FLAGS.
|
||||
|
||||
2017-01-01 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
Update copyright years.
|
||||
|
||||
2016-11-15 Matthias Klose <doko@ubuntu.com>
|
||||
|
||||
* configure: Regenerate.
|
||||
|
||||
2016-01-04 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
Update copyright years.
|
||||
|
||||
2015-07-14 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
* configure: Regenerated.
|
||||
|
22
libdecnumber/ChangeLog.jit
Normal file
22
libdecnumber/ChangeLog.jit
Normal file
@ -0,0 +1,22 @@
|
||||
2014-09-24 David Malcolm <dmalcolm@redhat.com>
|
||||
|
||||
* ChangeLog.jit: Add copyright footer.
|
||||
|
||||
2013-10-07 David Malcolm <dmalcolm@redhat.com>
|
||||
|
||||
* Makefile.in: Set PICFLAG from configure script; add it to
|
||||
ALL_CFLAGS.
|
||||
* configure.ac (--enable-host-shared): Set up PICFLAG rather
|
||||
than attempting to append -fPIC to CFLAGS, CXXFLAGS, LDFLAGS.
|
||||
* configure: Regenerate.
|
||||
|
||||
2013-10-03 David Malcolm <dmalcolm@redhat.com>
|
||||
|
||||
* configure.ac: Add --enable-host-shared.
|
||||
* configure: Regenerate.
|
||||
|
||||
Copyright (C) 2013-2014 Free Software Foundation, Inc.
|
||||
|
||||
Copying and distribution of this file, with or without modification,
|
||||
are permitted in any medium without royalty provided the copyright
|
||||
notice and this notice are preserved.
|
@ -1,7 +1,7 @@
|
||||
# @configure_input@
|
||||
# Makefile for libdecnumber. Run 'configure' to generate Makefile from Makefile.in
|
||||
|
||||
# Copyright (C) 2005-2013 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2005-2018 Free Software Foundation, Inc.
|
||||
|
||||
#This file is part of GCC.
|
||||
|
||||
@ -44,6 +44,7 @@ PICFLAG = @PICFLAG@
|
||||
RANLIB = @RANLIB@
|
||||
SHELL = @SHELL@
|
||||
objext = @OBJEXT@
|
||||
NOLTO_FLAGS = @nolto_flags@
|
||||
|
||||
datarootdir = @datarootdir@
|
||||
datadir = @datadir@
|
||||
@ -58,7 +59,8 @@ enable_decimal_float= @enable_decimal_float@
|
||||
|
||||
INCLUDES = -I$(srcdir) -I.
|
||||
|
||||
ALL_CFLAGS = $(CFLAGS) $(WARN_CFLAGS) $(INCLUDES) $(CPPFLAGS) $(PICFLAG)
|
||||
ALL_CFLAGS = $(CFLAGS) $(WARN_CFLAGS) $(NOLTO_FLAGS) $(INCLUDES) $(CPPFLAGS) \
|
||||
$(PICFLAG)
|
||||
|
||||
bid_OBJS = bid2dpd_dpd2bid.$(objext) host-ieee32.$(objext) \
|
||||
host-ieee64.$(objext) host-ieee128.$(objext)
|
||||
|
5
libdecnumber/aclocal.m4
vendored
5
libdecnumber/aclocal.m4
vendored
@ -1,7 +1,8 @@
|
||||
# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
|
||||
# generated automatically by aclocal 1.11.6 -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
|
||||
# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
|
||||
# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,
|
||||
# Inc.
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2007-2013 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 2007-2018 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2007-2013 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 2007-2018 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
@ -114,10 +114,10 @@ _bid_to_dpd32 (_Decimal32 *pres, _Decimal32 *px) {
|
||||
b1 = b01 - 1000 * b0;
|
||||
dcoeff = b2d[b2] | b2d2[b1];
|
||||
if (b0 >= 8) { /* is b0 8 or 9? */
|
||||
res = sign | ((0x600 | ((exp >> 6) << 7) |
|
||||
res = sign | ((0x600 | ((exp >> 6) << 7) |
|
||||
((b0 & 1) << 6) | (exp & 0x3f)) << 20) | dcoeff;
|
||||
} else { /* else b0 is 0..7 */
|
||||
res = sign | ((((exp >> 6) << 9) | (b0 << 6) |
|
||||
res = sign | ((((exp >> 6) << 9) | (b0 << 6) |
|
||||
(exp & 0x3f)) << 20) | dcoeff;
|
||||
}
|
||||
*pres = res;
|
||||
@ -138,29 +138,29 @@ _dpd_to_bid32 (_Decimal32 *pres, _Decimal32 *px) {
|
||||
if ((x & 0x78000000) == 0x78000000) {
|
||||
*pres = x;
|
||||
return;
|
||||
} else { /* normal number */
|
||||
if ((x & 0x60000000) == 0x60000000) { /* G0..G1 = 11 -> d0 = 8 + G4 */
|
||||
d0 = d2b3[((x >> 26) & 1) | 8]; /* d0 = (comb & 0x0100 ? 9 : 8); */
|
||||
exp = (x >> 27) & 3; /* exp leading bits are G2..G3 */
|
||||
} else {
|
||||
d0 = d2b3[(x >> 26) & 0x7];
|
||||
exp = (x >> 29) & 3; /* exp loading bits are G0..G1 */
|
||||
}
|
||||
d1 = d2b2[(trailing >> 10) & 0x3ff];
|
||||
d2 = d2b[(trailing) & 0x3ff];
|
||||
bcoeff = d2 + d1 + d0;
|
||||
exp = (exp << 6) + ((x >> 20) & 0x3f);
|
||||
if (bcoeff < (1 << 23)) {
|
||||
r = exp;
|
||||
r <<= 23;
|
||||
r |= (bcoeff | sign);
|
||||
} else {
|
||||
r = exp;
|
||||
r <<= 21;
|
||||
r |= (sign | 0x60000000ul);
|
||||
/* add coeff, without leading bits */
|
||||
r |= (((unsigned int) bcoeff) & 0x1fffff);
|
||||
}
|
||||
}
|
||||
/* normal number */
|
||||
if ((x & 0x60000000) == 0x60000000) { /* G0..G1 = 11 -> d0 = 8 + G4 */
|
||||
d0 = d2b3[((x >> 26) & 1) | 8]; /* d0 = (comb & 0x0100 ? 9 : 8); */
|
||||
exp = (x >> 27) & 3; /* exp leading bits are G2..G3 */
|
||||
} else {
|
||||
d0 = d2b3[(x >> 26) & 0x7];
|
||||
exp = (x >> 29) & 3; /* exp loading bits are G0..G1 */
|
||||
}
|
||||
d1 = d2b2[(trailing >> 10) & 0x3ff];
|
||||
d2 = d2b[(trailing) & 0x3ff];
|
||||
bcoeff = d2 + d1 + d0;
|
||||
exp = (exp << 6) + ((x >> 20) & 0x3f);
|
||||
if (bcoeff < (1 << 23)) {
|
||||
r = exp;
|
||||
r <<= 23;
|
||||
r |= (bcoeff | sign);
|
||||
} else {
|
||||
r = exp;
|
||||
r <<= 21;
|
||||
r |= (sign | 0x60000000ul);
|
||||
/* add coeff, without leading bits */
|
||||
r |= (((unsigned int) bcoeff) & 0x1fffff);
|
||||
}
|
||||
*pres = r;
|
||||
}
|
||||
@ -184,40 +184,40 @@ _bid_to_dpd64 (_Decimal64 *pres, _Decimal64 *px) {
|
||||
if ((comb & 0xf00) == 0xf00) {
|
||||
*pres = x;
|
||||
return;
|
||||
} else { /* Normal number */
|
||||
if ((comb & 0xc00) == 0xc00) { /* G0..G1 = 11 -> exp is G2..G11 */
|
||||
exp = (comb) & 0x3ff;
|
||||
bcoeff = (x & 0x0007ffffffffffffull) | 0x0020000000000000ull;
|
||||
} else {
|
||||
exp = (comb >> 2) & 0x3ff;
|
||||
bcoeff = (x & 0x001fffffffffffffull);
|
||||
}
|
||||
D61 = 2305843009ull; /* Floor(2^61 / 10^9) */
|
||||
/* Multiply the binary coefficient by ceil(2^64 / 1000), and take the upper
|
||||
64-bits in order to compute a division by 1000. */
|
||||
yhi = (D61 * (UINT64)(bcoeff >> (UINT64)27)) >> (UINT64)34;
|
||||
ylo = bcoeff - 1000000000ull * yhi;
|
||||
if (ylo >= 1000000000) {
|
||||
ylo = ylo - 1000000000;
|
||||
yhi = yhi + 1;
|
||||
}
|
||||
d103 = 0x4189374c;
|
||||
B34 = ((UINT64) ylo * d103) >> (32 + 8);
|
||||
B01 = ((UINT64) yhi * d103) >> (32 + 8);
|
||||
b5 = ylo - B34 * 1000;
|
||||
b2 = yhi - B01 * 1000;
|
||||
b3 = ((UINT64) B34 * d103) >> (32 + 8);
|
||||
b0 = ((UINT64) B01 * d103) >> (32 + 8);
|
||||
b4 = (unsigned int) B34 - (unsigned int) b3 *1000;
|
||||
b1 = (unsigned int) B01 - (unsigned int) dm103[b0];
|
||||
dcoeff = b2d[b5] | b2d2[b4] | b2d3[b3] | b2d4[b2] | b2d5[b1];
|
||||
if (b0 >= 8) /* is b0 8 or 9? */
|
||||
res = sign | ((0x1800 | ((exp >> 8) << 9) | ((b0 & 1) << 8) |
|
||||
(exp & 0xff)) << 50) | dcoeff;
|
||||
else /* else b0 is 0..7 */
|
||||
res = sign | ((((exp >> 8) << 11) | (b0 << 8) |
|
||||
(exp & 0xff)) << 50) | dcoeff;
|
||||
}
|
||||
/* Normal number */
|
||||
if ((comb & 0xc00) == 0xc00) { /* G0..G1 = 11 -> exp is G2..G11 */
|
||||
exp = (comb) & 0x3ff;
|
||||
bcoeff = (x & 0x0007ffffffffffffull) | 0x0020000000000000ull;
|
||||
} else {
|
||||
exp = (comb >> 2) & 0x3ff;
|
||||
bcoeff = (x & 0x001fffffffffffffull);
|
||||
}
|
||||
D61 = 2305843009ull; /* Floor(2^61 / 10^9) */
|
||||
/* Multiply the binary coefficient by ceil(2^64 / 1000), and take the upper
|
||||
64-bits in order to compute a division by 1000. */
|
||||
yhi = (D61 * (UINT64)(bcoeff >> (UINT64)27)) >> (UINT64)34;
|
||||
ylo = bcoeff - 1000000000ull * yhi;
|
||||
if (ylo >= 1000000000) {
|
||||
ylo = ylo - 1000000000;
|
||||
yhi = yhi + 1;
|
||||
}
|
||||
d103 = 0x4189374c;
|
||||
B34 = ((UINT64) ylo * d103) >> (32 + 8);
|
||||
B01 = ((UINT64) yhi * d103) >> (32 + 8);
|
||||
b5 = ylo - B34 * 1000;
|
||||
b2 = yhi - B01 * 1000;
|
||||
b3 = ((UINT64) B34 * d103) >> (32 + 8);
|
||||
b0 = ((UINT64) B01 * d103) >> (32 + 8);
|
||||
b4 = (unsigned int) B34 - (unsigned int) b3 *1000;
|
||||
b1 = (unsigned int) B01 - (unsigned int) dm103[b0];
|
||||
dcoeff = b2d[b5] | b2d2[b4] | b2d3[b3] | b2d4[b2] | b2d5[b1];
|
||||
if (b0 >= 8) /* is b0 8 or 9? */
|
||||
res = sign | ((0x1800 | ((exp >> 8) << 9) | ((b0 & 1) << 8) |
|
||||
(exp & 0xff)) << 50) | dcoeff;
|
||||
else /* else b0 is 0..7 */
|
||||
res = sign | ((((exp >> 8) << 11) | (b0 << 8) |
|
||||
(exp & 0xff)) << 50) | dcoeff;
|
||||
*pres = res;
|
||||
}
|
||||
|
||||
@ -237,49 +237,41 @@ _dpd_to_bid64 (_Decimal64 *pres, _Decimal64 *px) {
|
||||
comb = (x & 0x7ffc000000000000ull) >> 50;
|
||||
trailing = (x & 0x0003ffffffffffffull);
|
||||
if ((comb & 0x1e00) == 0x1e00) {
|
||||
if ((comb & 0x1f00) == 0x1f00) { /* G0..G4 = 11111 -> NaN */
|
||||
if (comb & 0x0100) { /* G5 = 1 -> sNaN */
|
||||
*pres = x;
|
||||
} else { /* G5 = 0 -> qNaN */
|
||||
*pres = x;
|
||||
}
|
||||
} else { /*if ((comb & 0x1e00) == 0x1e00); G0..G4 = 11110 -> INF */
|
||||
*pres = x;
|
||||
}
|
||||
*pres = x;
|
||||
return;
|
||||
} else { /* normal number */
|
||||
if ((comb & 0x1800) == 0x1800) { /* G0..G1 = 11 -> d0 = 8 + G4 */
|
||||
d0 = d2b6[((comb >> 8) & 1) | 8]; /* d0 = (comb & 0x0100 ? 9 : 8); */
|
||||
exp = (comb & 0x600) >> 1; /* exp = (comb & 0x0400 ? 1 : 0) * 0x200 +
|
||||
(comb & 0x0200 ? 1 : 0) * 0x100; exp leading bits are G2..G3 */
|
||||
} else {
|
||||
d0 = d2b6[(comb >> 8) & 0x7];
|
||||
exp = (comb & 0x1800) >> 3; /* exp = (comb & 0x1000 ? 1 : 0) * 0x200 +
|
||||
(comb & 0x0800 ? 1 : 0) * 0x100; exp loading bits are G0..G1 */
|
||||
}
|
||||
d1 = d2b5[(trailing >> 40) & 0x3ff];
|
||||
d2 = d2b4[(trailing >> 30) & 0x3ff];
|
||||
d3 = d2b3[(trailing >> 20) & 0x3ff];
|
||||
d4 = d2b2[(trailing >> 10) & 0x3ff];
|
||||
d5 = d2b[(trailing) & 0x3ff];
|
||||
bcoeff = (d5 + d4 + d3) + d2 + d1 + d0;
|
||||
exp += (comb & 0xff);
|
||||
mask = 1;
|
||||
mask <<= 53;
|
||||
if (bcoeff < mask) { /* check whether coefficient fits in 10*5+3 bits */
|
||||
res = exp;
|
||||
res <<= 53;
|
||||
res |= (bcoeff | sign);
|
||||
*pres = res;
|
||||
return;
|
||||
}
|
||||
/* special format */
|
||||
res = (exp << 51) | (sign | 0x6000000000000000ull);
|
||||
/* add coeff, without leading bits */
|
||||
mask = (mask >> 2) - 1;
|
||||
bcoeff &= mask;
|
||||
res |= bcoeff;
|
||||
}
|
||||
/* normal number */
|
||||
if ((comb & 0x1800) == 0x1800) { /* G0..G1 = 11 -> d0 = 8 + G4 */
|
||||
d0 = d2b6[((comb >> 8) & 1) | 8]; /* d0 = (comb & 0x0100 ? 9 : 8); */
|
||||
exp = (comb & 0x600) >> 1; /* exp = (comb & 0x0400 ? 1 : 0) * 0x200 +
|
||||
(comb & 0x0200 ? 1 : 0) * 0x100; exp leading bits are G2..G3 */
|
||||
} else {
|
||||
d0 = d2b6[(comb >> 8) & 0x7];
|
||||
exp = (comb & 0x1800) >> 3; /* exp = (comb & 0x1000 ? 1 : 0) * 0x200 +
|
||||
(comb & 0x0800 ? 1 : 0) * 0x100; exp loading bits are G0..G1 */
|
||||
}
|
||||
d1 = d2b5[(trailing >> 40) & 0x3ff];
|
||||
d2 = d2b4[(trailing >> 30) & 0x3ff];
|
||||
d3 = d2b3[(trailing >> 20) & 0x3ff];
|
||||
d4 = d2b2[(trailing >> 10) & 0x3ff];
|
||||
d5 = d2b[(trailing) & 0x3ff];
|
||||
bcoeff = (d5 + d4 + d3) + d2 + d1 + d0;
|
||||
exp += (comb & 0xff);
|
||||
mask = 1;
|
||||
mask <<= 53;
|
||||
if (bcoeff < mask) { /* check whether coefficient fits in 10*5+3 bits */
|
||||
res = exp;
|
||||
res <<= 53;
|
||||
res |= (bcoeff | sign);
|
||||
*pres = res;
|
||||
return;
|
||||
}
|
||||
/* special format */
|
||||
res = (exp << 51) | (sign | 0x6000000000000000ull);
|
||||
/* add coeff, without leading bits */
|
||||
mask = (mask >> 2) - 1;
|
||||
bcoeff &= mask;
|
||||
res |= bcoeff;
|
||||
*pres = res;
|
||||
}
|
||||
|
||||
@ -304,15 +296,7 @@ _bid_to_dpd128 (_Decimal128 *pres, _Decimal128 *px) {
|
||||
comb = (x.w[1] /*& 0x7fffc00000000000ull */ ) >> 46;
|
||||
exp = 0;
|
||||
if ((comb & 0x1e000) == 0x1e000) {
|
||||
if ((comb & 0x1f000) == 0x1f000) { /* G0..G4 = 11111 -> NaN */
|
||||
if (comb & 0x01000) { /* G5 = 1 -> sNaN */
|
||||
res = x;
|
||||
} else { /* G5 = 0 -> qNaN */
|
||||
res = x;
|
||||
}
|
||||
} else { /* G0..G4 = 11110 -> INF */
|
||||
res = x;
|
||||
}
|
||||
res = x;
|
||||
} else { /* normal number */
|
||||
exp = ((x.w[1] & 0x7fff000000000000ull) >> 49) & 0x3fff;
|
||||
bcoeff.w[1] = (x.w[1] & 0x0001ffffffffffffull);
|
||||
@ -347,16 +331,16 @@ _bid_to_dpd128 (_Decimal128 *pres, _Decimal128 *px) {
|
||||
BLL32 -= (unsigned int) k9 *1000000;
|
||||
k10 = ((UINT64) BLL32 * d103) >> (32 + 8);
|
||||
k11 = BLL32 - (unsigned int) k10 *1000;
|
||||
dcoeff.w[1] = (b2d[k5] >> 4) | (b2d[k4] << 6) | (b2d[k3] << 16) |
|
||||
(b2d[k2] << 26) | (b2d[k1] << 36);
|
||||
dcoeff.w[0] = b2d[k11] | (b2d[k10] << 10) | (b2d[k9] << 20) |
|
||||
(b2d[k8] << 30) | (b2d[k7] << 40) | (b2d[k6] << 50) | (b2d[k5] << 60);
|
||||
dcoeff.w[1] = (b2d[k5] >> 4) | (b2d[k4] << 6) | (b2d[k3] << 16) |
|
||||
(b2d[k2] << 26) | (b2d[k1] << 36);
|
||||
dcoeff.w[0] = b2d[k11] | (b2d[k10] << 10) | (b2d[k9] << 20) |
|
||||
(b2d[k8] << 30) | (b2d[k7] << 40) | (b2d[k6] << 50) | (b2d[k5] << 60);
|
||||
res.w[0] = dcoeff.w[0];
|
||||
if (k0 >= 8) {
|
||||
res.w[1] = sign.w[1] | ((0x18000 | ((exp >> 12) << 13) |
|
||||
res.w[1] = sign.w[1] | ((0x18000 | ((exp >> 12) << 13) |
|
||||
((k0 & 1) << 12) | (exp & 0xfff)) << 46) | dcoeff.w[1];
|
||||
} else {
|
||||
res.w[1] = sign.w[1] | ((((exp >> 12) << 15) | (k0 << 12) |
|
||||
res.w[1] = sign.w[1] | ((((exp >> 12) << 15) | (k0 << 12) |
|
||||
(exp & 0xfff)) << 46) | dcoeff.w[1];
|
||||
}
|
||||
}
|
||||
@ -382,42 +366,33 @@ _dpd_to_bid128 (_Decimal128 *pres, _Decimal128 *px) {
|
||||
trailing.w[1] = x.w[1];
|
||||
trailing.w[0] = x.w[0];
|
||||
if ((comb & 0x1e000) == 0x1e000) {
|
||||
if ((comb & 0x1f000) == 0x1f000) { /* G0..G4 = 11111 -> NaN */
|
||||
if (comb & 0x01000) { /* G5 = 1 -> sNaN */
|
||||
*pres = x;
|
||||
} else { /* G5 = 0 -> qNaN */
|
||||
*pres = x;
|
||||
}
|
||||
} else { /* G0..G4 = 11110 -> INF */
|
||||
*pres = x;
|
||||
}
|
||||
return;
|
||||
} else { /* Normal number */
|
||||
if ((comb & 0x18000) == 0x18000) { /* G0..G1 = 11 -> d0 = 8 + G4 */
|
||||
d0 = d2b6[8 + ((comb & 0x01000) >> 12)];
|
||||
exp = (comb & 0x06000) >> 1; /* exp leading bits are G2..G3 */
|
||||
} else {
|
||||
d0 = d2b6[((comb & 0x07000) >> 12)];
|
||||
exp = (comb & 0x18000) >> 3; /* exp loading bits are G0..G1 */
|
||||
}
|
||||
d11 = d2b[(trailing.w[0]) & 0x3ff];
|
||||
d10 = d2b2[(trailing.w[0] >> 10) & 0x3ff];
|
||||
d9 = d2b3[(trailing.w[0] >> 20) & 0x3ff];
|
||||
d8 = d2b4[(trailing.w[0] >> 30) & 0x3ff];
|
||||
d7 = d2b5[(trailing.w[0] >> 40) & 0x3ff];
|
||||
d6 = d2b6[(trailing.w[0] >> 50) & 0x3ff];
|
||||
d5 = d2b[(trailing.w[0] >> 60) | ((trailing.w[1] & 0x3f) << 4)];
|
||||
d4 = d2b2[(trailing.w[1] >> 6) & 0x3ff];
|
||||
d3 = d2b3[(trailing.w[1] >> 16) & 0x3ff];
|
||||
d2 = d2b4[(trailing.w[1] >> 26) & 0x3ff];
|
||||
d1 = d2b5[(trailing.w[1] >> 36) & 0x3ff];
|
||||
tl = d11 + d10 + d9 + d8 + d7 + d6;
|
||||
th = d5 + d4 + d3 + d2 + d1 + d0;
|
||||
__mul_64x64_to_128 (bcoeff, th, 1000000000000000000ull);
|
||||
__add_128_64 (bcoeff, bcoeff, tl);
|
||||
exp += (comb & 0xfff);
|
||||
res.w[0] = bcoeff.w[0];
|
||||
res.w[1] = (exp << 49) | sign.w[1] | bcoeff.w[1];
|
||||
return;
|
||||
}
|
||||
if ((comb & 0x18000) == 0x18000) { /* G0..G1 = 11 -> d0 = 8 + G4 */
|
||||
d0 = d2b6[8 + ((comb & 0x01000) >> 12)];
|
||||
exp = (comb & 0x06000) >> 1; /* exp leading bits are G2..G3 */
|
||||
} else {
|
||||
d0 = d2b6[((comb & 0x07000) >> 12)];
|
||||
exp = (comb & 0x18000) >> 3; /* exp loading bits are G0..G1 */
|
||||
}
|
||||
d11 = d2b[(trailing.w[0]) & 0x3ff];
|
||||
d10 = d2b2[(trailing.w[0] >> 10) & 0x3ff];
|
||||
d9 = d2b3[(trailing.w[0] >> 20) & 0x3ff];
|
||||
d8 = d2b4[(trailing.w[0] >> 30) & 0x3ff];
|
||||
d7 = d2b5[(trailing.w[0] >> 40) & 0x3ff];
|
||||
d6 = d2b6[(trailing.w[0] >> 50) & 0x3ff];
|
||||
d5 = d2b[(trailing.w[0] >> 60) | ((trailing.w[1] & 0x3f) << 4)];
|
||||
d4 = d2b2[(trailing.w[1] >> 6) & 0x3ff];
|
||||
d3 = d2b3[(trailing.w[1] >> 16) & 0x3ff];
|
||||
d2 = d2b4[(trailing.w[1] >> 26) & 0x3ff];
|
||||
d1 = d2b5[(trailing.w[1] >> 36) & 0x3ff];
|
||||
tl = d11 + d10 + d9 + d8 + d7 + d6;
|
||||
th = d5 + d4 + d3 + d2 + d1 + d0;
|
||||
__mul_64x64_to_128 (bcoeff, th, 1000000000000000000ull);
|
||||
__add_128_64 (bcoeff, bcoeff, tl);
|
||||
exp += (comb & 0xfff);
|
||||
res.w[0] = bcoeff.w[0];
|
||||
res.w[1] = (exp << 49) | sign.w[1] | bcoeff.w[1];
|
||||
*pres = res;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2007-2013 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 2007-2018 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2007-2013 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 2007-2018 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2007-2013 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 2007-2018 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2007-2013 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 2007-2018 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* This is a software decimal floating point library.
|
||||
Copyright (C) 2007-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007-2018 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* This is a software decimal floating point library.
|
||||
Copyright (C) 2007-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007-2018 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* This is a software decimal floating point library.
|
||||
Copyright (C) 2007-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007-2018 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
|
59
libdecnumber/configure
vendored
59
libdecnumber/configure
vendored
@ -613,6 +613,7 @@ EGREP
|
||||
GREP
|
||||
CPP
|
||||
WERROR
|
||||
nolto_flags
|
||||
WARN_PEDANTIC
|
||||
WARN_CFLAGS
|
||||
AUTOHEADER
|
||||
@ -3382,6 +3383,64 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
|
||||
|
||||
|
||||
|
||||
ac_ext=c
|
||||
ac_cpp='$CPP $CPPFLAGS'
|
||||
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
||||
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
|
||||
ac_compiler_gnu=$ac_cv_c_compiler_gnu
|
||||
|
||||
nolto_flags=
|
||||
save_CFLAGS="$CFLAGS"
|
||||
for real_option in -fno-lto; do
|
||||
# Do the check with the no- prefix removed since gcc silently
|
||||
# accepts any -Wno-* option on purpose
|
||||
case $real_option in
|
||||
-Wno-*) option=-W`expr x$real_option : 'x-Wno-\(.*\)'` ;;
|
||||
*) option=$real_option ;;
|
||||
esac
|
||||
as_acx_Woption=`$as_echo "acx_cv_prog_cc_warning_$option" | $as_tr_sh`
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports $option" >&5
|
||||
$as_echo_n "checking whether $CC supports $option... " >&6; }
|
||||
if { as_var=$as_acx_Woption; eval "test \"\${$as_var+set}\" = set"; }; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
CFLAGS="$option"
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_compile "$LINENO"; then :
|
||||
eval "$as_acx_Woption=yes"
|
||||
else
|
||||
eval "$as_acx_Woption=no"
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
|
||||
fi
|
||||
eval ac_res=\$$as_acx_Woption
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
|
||||
$as_echo "$ac_res" >&6; }
|
||||
if test `eval 'as_val=${'$as_acx_Woption'};$as_echo "$as_val"'` = yes; then :
|
||||
nolto_flags="$nolto_flags${nolto_flags:+ }$real_option"
|
||||
fi
|
||||
done
|
||||
CFLAGS="$save_CFLAGS"
|
||||
ac_ext=c
|
||||
ac_cpp='$CPP $CPPFLAGS'
|
||||
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
||||
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
|
||||
ac_compiler_gnu=$ac_cv_c_compiler_gnu
|
||||
|
||||
|
||||
|
||||
# Only enable with --enable-werror-always until existing warnings are
|
||||
# corrected.
|
||||
ac_ext=c
|
||||
|
@ -1,7 +1,7 @@
|
||||
# configure.ac for libdecnumber -*- Autoconf -*-
|
||||
# Process this file with autoconf to generate a configuration script.
|
||||
|
||||
# Copyright (C) 2005-2013 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2005-2018 Free Software Foundation, Inc.
|
||||
|
||||
# This file is part of GCC.
|
||||
|
||||
@ -43,6 +43,8 @@ ACX_PROG_CC_WARNING_OPTS([-W -Wall -Wwrite-strings -Wstrict-prototypes \
|
||||
-Wmissing-format-attribute -Wcast-qual])
|
||||
ACX_PROG_CC_WARNING_ALMOST_PEDANTIC([-Wno-long-long])
|
||||
|
||||
ACX_PROG_CC_WARNING_OPTS([-fno-lto], [nolto_flags])
|
||||
|
||||
# Only enable with --enable-werror-always until existing warnings are
|
||||
# corrected.
|
||||
ACX_PROG_CC_WARNINGS_ARE_ERRORS([manual])
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Configure decNumber for either host or target.
|
||||
Copyright (C) 2008-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2008-2018 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Common base code for the decNumber C Library.
|
||||
Copyright (C) 2007-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007-2018 Free Software Foundation, Inc.
|
||||
Contributed by IBM Corporation. Author Mike Cowlishaw.
|
||||
|
||||
This file is part of GCC.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Common code for fixed-size types in the decNumber C Library.
|
||||
Copyright (C) 2007-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007-2018 Free Software Foundation, Inc.
|
||||
Contributed by IBM Corporation. Author Mike Cowlishaw.
|
||||
|
||||
This file is part of GCC.
|
||||
@ -713,7 +713,7 @@ decFloat * decFloatFromPacked(decFloat *df, Int exp, const uByte *packed) {
|
||||
/* returns df, which will be canonical or NULL if any of the */
|
||||
/* requirements are not met (if this case df is unchanged); that */
|
||||
/* is, the input data must be as returned by decFloatToPacked, */
|
||||
/* except that all six sign codes are acccepted. */
|
||||
/* except that all six sign codes are accepted. */
|
||||
/* */
|
||||
/* No status will be set. */
|
||||
/* ------------------------------------------------------------------ */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Decimal context module for the decNumber C Library.
|
||||
Copyright (C) 2005-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2005-2018 Free Software Foundation, Inc.
|
||||
Contributed by IBM Corporation. Author Mike Cowlishaw.
|
||||
|
||||
This file is part of GCC.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Decimal context header module for the decNumber C Library.
|
||||
Copyright (C) 2005-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2005-2018 Free Software Foundation, Inc.
|
||||
Contributed by IBM Corporation. Author Mike Cowlishaw.
|
||||
|
||||
This file is part of GCC.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Conversion lookup tables for the decNumber C Library.
|
||||
Copyright (C) 2007-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007-2018 Free Software Foundation, Inc.
|
||||
Contributed by IBM Corporation. Author Mike Cowlishaw.
|
||||
|
||||
This file is part of GCC.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* decDouble module for the decNumber C Library.
|
||||
Copyright (C) 2007-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007-2018 Free Software Foundation, Inc.
|
||||
Contributed by IBM Corporation. Author Mike Cowlishaw.
|
||||
|
||||
This file is part of GCC.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* decDouble module header for the decNumber C Library.
|
||||
Copyright (C) 2007-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007-2018 Free Software Foundation, Inc.
|
||||
Contributed by IBM Corporation. Author Mike Cowlishaw.
|
||||
|
||||
This file is part of GCC.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Temporary library support for decimal floating point.
|
||||
Copyright (C) 2005-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2005-2018 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Temporary library support for decimal floating point.
|
||||
Copyright (C) 2006-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2006-2018 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Temporary library support for decimal floating point.
|
||||
Copyright (C) 2005-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2005-2018 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Decimal number arithmetic module for the decNumber C Library.
|
||||
Copyright (C) 2005-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2005-2018 Free Software Foundation, Inc.
|
||||
Contributed by IBM Corporation. Author Mike Cowlishaw.
|
||||
|
||||
This file is part of GCC.
|
||||
@ -2171,7 +2171,7 @@ decNumber * decNumberPower(decNumber *res, const decNumber *lhs,
|
||||
/* if a negative power the constant 1 is needed, and if not subset */
|
||||
/* invert the lhs now rather than inverting the result later */
|
||||
if (decNumberIsNegative(rhs)) { /* was a **-n [hence digits>0] */
|
||||
decNumber *inv=invbuff; /* asssume use fixed buffer */
|
||||
decNumber *inv=invbuff; /* assume use fixed buffer */
|
||||
decNumberCopy(&dnOne, dac); /* dnOne=1; [needed now or later] */
|
||||
#if DECSUBSET
|
||||
if (set->extended) { /* need to calculate 1/lhs */
|
||||
@ -5197,7 +5197,7 @@ static decNumber * decMultiplyOp(decNumber *res, const decNumber *lhs,
|
||||
/* exp(-x) where x can be the tiniest number (Ntiny). */
|
||||
/* */
|
||||
/* 2. Normalizing x to be <=0.1 (instead of <=1) reduces loop */
|
||||
/* iterations by appoximately a third with additional (although */
|
||||
/* iterations by approximately a third with additional (although */
|
||||
/* diminishing) returns as the range is reduced to even smaller */
|
||||
/* fractions. However, h (the power of 10 used to correct the */
|
||||
/* result at the end, see below) must be kept <=8 as otherwise */
|
||||
@ -6029,11 +6029,11 @@ decNumber * decCompareOp(decNumber *res, const decNumber *lhs,
|
||||
|
||||
/* If total ordering then handle differing signs 'up front' */
|
||||
if (op==COMPTOTAL) { /* total ordering */
|
||||
if (decNumberIsNegative(lhs) & !decNumberIsNegative(rhs)) {
|
||||
if (decNumberIsNegative(lhs) && !decNumberIsNegative(rhs)) {
|
||||
result=-1;
|
||||
break;
|
||||
}
|
||||
if (!decNumberIsNegative(lhs) & decNumberIsNegative(rhs)) {
|
||||
if (!decNumberIsNegative(lhs) && decNumberIsNegative(rhs)) {
|
||||
result=+1;
|
||||
break;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Decimal number arithmetic module header for the decNumber C Library.
|
||||
Copyright (C) 2005-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2005-2018 Free Software Foundation, Inc.
|
||||
Contributed by IBM Corporation. Author Mike Cowlishaw.
|
||||
|
||||
This file is part of GCC.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Local definitions for the decNumber C Library.
|
||||
Copyright (C) 2007-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007-2018 Free Software Foundation, Inc.
|
||||
Contributed by IBM Corporation. Author Mike Cowlishaw.
|
||||
|
||||
This file is part of GCC.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Packed decimal conversion module for the decNumber C Library.
|
||||
Copyright (C) 2007-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007-2018 Free Software Foundation, Inc.
|
||||
Contributed by IBM Corporation. Author Mike Cowlishaw.
|
||||
|
||||
This file is part of GCC.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Packed decimal conversion module header for the decNumber C Library.
|
||||
Copyright (C) 2007-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007-2018 Free Software Foundation, Inc.
|
||||
Contributed by IBM Corporation. Author Mike Cowlishaw.
|
||||
|
||||
This file is part of GCC.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* decQuad module for the decNumber C Library.
|
||||
Copyright (C) 2007-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007-2018 Free Software Foundation, Inc.
|
||||
Contributed by IBM Corporation. Author Mike Cowlishaw.
|
||||
|
||||
This file is part of GCC.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* decQuad module header for the decNumber C Library.
|
||||
Copyright (C) 2007-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007-2018 Free Software Foundation, Inc.
|
||||
Contributed by IBM Corporation. Author Mike Cowlishaw.
|
||||
|
||||
This file is part of GCC.
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* Internal testing support for rounding for decimal float.
|
||||
|
||||
Copyright (C) 2005-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2005-2018 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* Internal testing support for rounding for decimal float.
|
||||
|
||||
Copyright (C) 2006-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2006-2018 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* decSingle module for the decNumber C Library.
|
||||
Copyright (C) 2007-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007-2018 Free Software Foundation, Inc.
|
||||
Contributed by IBM Corporation. Author Mike Cowlishaw.
|
||||
|
||||
This file is part of GCC.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* decSingle module header for the decNumber C Library.
|
||||
Copyright (C) 2005-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2005-2018 Free Software Foundation, Inc.
|
||||
Contributed by IBM Corporation. Author Mike Cowlishaw.
|
||||
|
||||
This file is part of GCC.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Decimal 128-bit format module for the decNumber C Library.
|
||||
Copyright (C) 2005-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2005-2018 Free Software Foundation, Inc.
|
||||
Contributed by IBM Corporation. Author Mike Cowlishaw.
|
||||
|
||||
This file is part of GCC.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Decimal 128-bit format module header for the decNumber C Library.
|
||||
Copyright (C) 2005-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2005-2018 Free Software Foundation, Inc.
|
||||
Contributed by IBM Corporation. Author Mike Cowlishaw.
|
||||
|
||||
This file is part of GCC.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Local definitions for use with the decNumber C Library.
|
||||
Copyright (C) 2007-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007-2018 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Decimal 32-bit format module for the decNumber C Library.
|
||||
Copyright (C) 2005-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2005-2018 Free Software Foundation, Inc.
|
||||
Contributed by IBM Corporation. Author Mike Cowlishaw.
|
||||
|
||||
This file is part of GCC.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Decimal 32-bit format module header for the decNumber C Library.
|
||||
Copyright (C) 2005-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2005-2018 Free Software Foundation, Inc.
|
||||
Contributed by IBM Corporation. Author Mike Cowlishaw.
|
||||
|
||||
This file is part of GCC.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Decimal 64-bit format module for the decNumber C Library.
|
||||
Copyright (C) 2005-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2005-2018 Free Software Foundation, Inc.
|
||||
Contributed by IBM Corporation. Author Mike Cowlishaw.
|
||||
|
||||
This file is part of GCC.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Decimal 64-bit format module header for the decNumber C Library.
|
||||
Copyright (C) 2005-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2005-2018 Free Software Foundation, Inc.
|
||||
Contributed by IBM Corporation. Author Mike Cowlishaw.
|
||||
|
||||
This file is part of GCC.
|
||||
|
Loading…
Reference in New Issue
Block a user