summaryrefslogtreecommitdiff
path: root/gcc/double-int.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2010-07-05 13:06:07 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2010-07-05 13:06:07 +0000
commitb6cfe28d11605d543af0a1dafdd7ecdfb7642871 (patch)
tree04c9b9fa1818c750489682948c3f7dda525bc7e4 /gcc/double-int.c
parent008f96d836284b65ab4bc3ee81b62d2bd84ba452 (diff)
downloadgcc-b6cfe28d11605d543af0a1dafdd7ecdfb7642871.tar.gz
2010-07-05 Richard Guenther <rguenther@suse.de>
* double-int.h (double_int_sub): Declare. * double-int.c (double_int_sub): New function. * dwarf2out.c (field_byte_offset): Use it. * fixed-value.c (do_fixed_add): Likewise. (do_fixed_multiply): Likewise. (do_fixed_divide): Likewise. * tree-predcom.c (add_ref_to_chain): Likewise. (determine_roots_comp): Likewise. * tree-ssa-loop-niter.c (derive_constant_upper_bound_ops): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161835 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/double-int.c')
-rw-r--r--gcc/double-int.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/double-int.c b/gcc/double-int.c
index aa175e89d41..0bfe514238d 100644
--- a/gcc/double-int.c
+++ b/gcc/double-int.c
@@ -792,6 +792,17 @@ double_int_add (double_int a, double_int b)
return ret;
}
+/* Returns A - B. */
+
+double_int
+double_int_sub (double_int a, double_int b)
+{
+ double_int ret;
+ neg_double (b.low, b.high, &b.low, &b.high);
+ add_double (a.low, a.high, b.low, b.high, &ret.low, &ret.high);
+ return ret;
+}
+
/* Returns -A. */
double_int