summaryrefslogtreecommitdiff
path: root/gcc/dfp.c
diff options
context:
space:
mode:
authormrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>2013-08-13 20:41:07 +0000
committermrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>2013-08-13 20:41:07 +0000
commite913b5cd5b6a9bd3a2ad58c65f9e3cd2bb55a28c (patch)
treef52a097017e3dcf89fad6525984e4591489f961e /gcc/dfp.c
parent9a5942c1d4d9116ab74b0741cfe3894a89fd17fb (diff)
downloadgcc-e913b5cd5b6a9bd3a2ad58c65f9e3cd2bb55a28c.tar.gz
Add wide-int branch.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/wide-int@201707 138bc75d-0d04-0410-961f-82ee72b054a4
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 d15ee8f8848..3988ac9f5fb 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.