diff options
author | aesok <aesok@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-04-14 22:05:32 +0000 |
---|---|---|
committer | aesok <aesok@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-04-14 22:05:32 +0000 |
commit | 412839221276fd0a251ba61296262b09352c5927 (patch) | |
tree | 9138061992a73bba986379151a1a1c756a746bf2 /gcc/double-int.h | |
parent | 81eaa85281cc3b9e776b71fc6e2f4d5e0920eaf3 (diff) | |
download | gcc-412839221276fd0a251ba61296262b09352c5927.tar.gz |
* double-int.h (HOST_BITS_PER_DOUBLE_INT): Define.
(double_int_not, double_int_lshift, double_int_rshift): Declare.
(double_int_negative_p): Convert to static inline function.
* double-int.c (double_int_lshift, double_int_lshift): Add new function.
(double_int_negative_p): Remove.
* tree.h (lshift_double, rshift_double):
* tree.c (build_low_bits_mask): Clean up, use double_int_* functions.
* fold-const.c (fold_convert_const_int_from_real,
fold_convert_const_int_from_fixed, div_if_zero_remainder): (Ditto.).
(lshift_double): Change type of arith argument to bool.
(rshift_double): Change type of arith argument to bool. Correct
comment.
* expmed.c (mask_rtx, lshift_value): (Ditto.).
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158360 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/double-int.h')
-rw-r--r-- | gcc/double-int.h | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/gcc/double-int.h b/gcc/double-int.h index 84185890e29..30e32fcde13 100644 --- a/gcc/double-int.h +++ b/gcc/double-int.h @@ -1,5 +1,5 @@ /* Operations with long integers. - Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc. + Copyright (C) 2006, 2007, 2008, 2010 Free Software Foundation, Inc. This file is part of GCC. @@ -57,6 +57,8 @@ typedef struct HOST_WIDE_INT high; } double_int; +#define HOST_BITS_PER_DOUBLE_INT (2 * HOST_BITS_PER_WIDE_INT) + union tree_node; /* Constructors and conversions. */ @@ -127,7 +129,29 @@ double_int double_int_umod (double_int, double_int, unsigned); double_int double_int_divmod (double_int, double_int, bool, unsigned, double_int *); double_int double_int_sdivmod (double_int, double_int, unsigned, double_int *); double_int double_int_udivmod (double_int, double_int, unsigned, double_int *); -bool double_int_negative_p (double_int); + +/* Logical operations. */ +static inline double_int +double_int_not (double_int a) +{ + a.low = ~a.low; + a.high = ~ a.high; + return a; +} + +/* Shift operations. */ +double_int double_int_lshift (double_int, HOST_WIDE_INT, unsigned int, bool); +double_int double_int_rshift (double_int, HOST_WIDE_INT, unsigned int, bool); + +/* Returns true if CST is negative. Of course, CST is considered to + be signed. */ + +static inline bool +double_int_negative_p (double_int cst) +{ + return cst.high < 0; +} + int double_int_cmp (double_int, double_int, bool); int double_int_scmp (double_int, double_int); int double_int_ucmp (double_int, double_int); |