aboutsummaryrefslogtreecommitdiff
path: root/gcc/dfp.c
diff options
context:
space:
mode:
authorKenneth Zadeck <zadeck@naturalbridge.com>2014-05-06 16:25:05 +0000
committerMike Stump <mrs@gcc.gnu.org>2014-05-06 16:25:05 +0000
commit807e902eea17f3132488c256c963823976b2348c (patch)
treee5e1af94eb1502ba893bd6ce4a11f68877ff62a9 /gcc/dfp.c
parent6122336c832dc4dfedc49279549caddce86306ff (diff)
downloadgcc-807e902eea17f3132488c256c963823976b2348c.zip
gcc-807e902eea17f3132488c256c963823976b2348c.tar.gz
gcc-807e902eea17f3132488c256c963823976b2348c.tar.bz2
Merge in wide-int.
From-SVN: r210113
Diffstat (limited to 'gcc/dfp.c')
-rw-r--r--gcc/dfp.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/gcc/dfp.c b/gcc/dfp.c
index 4f2abb1..8e79828 100644
--- a/gcc/dfp.c
+++ b/gcc/dfp.c
@@ -24,6 +24,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree.h"
#include "tm_p.h"
#include "dfp.h"
+#include "wide-int.h"
/* The order of the following headers is important for making sure
decNumber structure is large enough to hold decimal128 digits. */
@@ -604,11 +605,11 @@ decimal_real_to_integer (const REAL_VALUE_TYPE *r)
return real_to_integer (&to);
}
-/* Likewise, but to an integer pair, HI+LOW. */
+/* Likewise, but returns a wide_int with PRECISION. *FAIL is set if the
+ value does not fit. */
-void
-decimal_real_to_integer2 (HOST_WIDE_INT *plow, HOST_WIDE_INT *phigh,
- const REAL_VALUE_TYPE *r)
+wide_int
+decimal_real_to_integer (const REAL_VALUE_TYPE *r, bool *fail, int precision)
{
decContext set;
decNumber dn, dn2, dn3;
@@ -628,7 +629,7 @@ decimal_real_to_integer2 (HOST_WIDE_INT *plow, HOST_WIDE_INT *phigh,
function. */
decNumberToString (&dn, string);
real_from_string (&to, string);
- real_to_integer2 (plow, phigh, &to);
+ return real_to_integer (&to, fail, precision);
}
/* Perform the decimal floating point operation described by CODE.