diff options
author | aesok <aesok@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-05-01 17:52:02 +0000 |
---|---|---|
committer | aesok <aesok@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-05-01 17:52:02 +0000 |
commit | 3327418041ec57f6db06ba8ec7ea88616c2d7728 (patch) | |
tree | 04b921bafe9da0814bfd9d39ff3475fef41e5805 /gcc/emit-rtl.c | |
parent | bfe513a49f83aeaed190d83ba4497b85c1d8aaaf (diff) | |
download | gcc-3327418041ec57f6db06ba8ec7ea88616c2d7728.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158963 138bc75d-0d04-0410-961f-82ee72b054a4
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 d4ba5d706ed..e0acc0c2766 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. */ |