From 3327418041ec57f6db06ba8ec7ea88616c2d7728 Mon Sep 17 00:00:00 2001 From: aesok Date: Sat, 1 May 2010 17:52:02 +0000 Subject: * 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 --- gcc/emit-rtl.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'gcc/emit-rtl.c') 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. */ -- cgit v1.2.1