diff options
author | Anatoly Sokolov <aesok@post.ru> | 2010-05-01 21:52:02 +0400 |
---|---|---|
committer | Anatoly Sokolov <aesok@gcc.gnu.org> | 2010-05-01 21:52:02 +0400 |
commit | 3e93ff81965fedc0eaa06c8646a0ae6788f2fec5 (patch) | |
tree | 04b921bafe9da0814bfd9d39ff3475fef41e5805 /gcc/emit-rtl.c | |
parent | bcbc9564cdd3760173c91b7414eac62d3667ae7d (diff) | |
download | gcc-3e93ff81965fedc0eaa06c8646a0ae6788f2fec5.zip gcc-3e93ff81965fedc0eaa06c8646a0ae6788f2fec5.tar.gz gcc-3e93ff81965fedc0eaa06c8646a0ae6788f2fec5.tar.bz2 |
rtl.h (CONST_DOUBLE_P): Define.
* rtl.h (CONST_DOUBLE_P): Define.
(rtx_to_double_int): Declare.
* emit-rtl.c (rtx_to_double_int): New function.
* dwarf2out.c (insert_double): New function.
(loc_descriptor, add_const_value_attribute): Clean up, use
rtx_to_double_int and insert_double functions.
From-SVN: r158963
Diffstat (limited to 'gcc/emit-rtl.c')
-rw-r--r-- | gcc/emit-rtl.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index d4ba5d7..e0acc0c 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -518,6 +518,27 @@ const_fixed_from_fixed_value (FIXED_VALUE_TYPE value, enum machine_mode mode) return lookup_const_fixed (fixed); } +/* Constructs double_int from rtx CST. */ + +double_int +rtx_to_double_int (const_rtx cst) +{ + double_int r; + + if (CONST_INT_P (cst)) + r = shwi_to_double_int (INTVAL (cst)); + else if (CONST_DOUBLE_P (cst) && GET_MODE (cst) == VOIDmode) + { + r.low = CONST_DOUBLE_LOW (cst); + r.high = CONST_DOUBLE_HIGH (cst); + } + else + gcc_unreachable (); + + return r; +} + + /* Return a CONST_DOUBLE or CONST_INT for a value specified as a double_int. */ |