* double-int.c (double_int_setbit): New function.
* rtl.h (immed_double_int_const): Declare.
* emit-rtl.c (immed_double_int_const): New function.
* builtins.c (expand_builtin_signbit): Clean up, use double_int_*
and immed_double_int_const functions.
* optabs.c (expand_absneg_bit, expand_copysign_absneg,
expand_copysign_bit): (Ditto.).
* simplify-rtx.c (simplify_binary_operation_1): (Ditto.).
* tree-ssa-address.c (addr_for_mem_ref): (Ditto.).
* dojump.c (prefer_and_bit_test): (Ditto.).
* expr.c (convert_modes, reduce_to_bit_field_precision,
const_vector_from_tree): (Ditto.).
* expmed.c (mask_rtx, lshift_value): (Ditto.).
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158566
138bc75d-0d04-0410-961f-
82ee72b054a4
+2010-04-20 Anatoly Sokolov <aesok@post.ru
+
+ * double-int.h (double_int_setbit): Declare.
+ * double-int.c (double_int_setbit): New function.
+ * rtl.h (immed_double_int_const): Declare.
+ * emit-rtl.c (immed_double_int_const): New function.
+ * builtins.c (expand_builtin_signbit): Clean up, use double_int_*
+ and immed_double_int_const functions.
+ * optabs.c (expand_absneg_bit, expand_copysign_absneg,
+ expand_copysign_bit): (Ditto.).
+ * simplify-rtx.c (simplify_binary_operation_1): (Ditto.).
+ * tree-ssa-address.c (addr_for_mem_ref): (Ditto.).
+ * dojump.c (prefer_and_bit_test): (Ditto.).
+ * expr.c (convert_modes, reduce_to_bit_field_precision,
+ const_vector_from_tree): (Ditto.).
+ * expmed.c (mask_rtx, lshift_value): (Ditto.).
+
2010-04-20 Jan Hubicka <jh@suse.cz>
* cgraph.c (cgraph_remove_node): Kill bodies in other partitoin.
return double_int_mod (a, b, true, code);
}
+/* Set BITPOS bit in A. */
+double_int
+double_int_setbit (double_int a, unsigned bitpos)
+{
+ if (bitpos < HOST_BITS_PER_WIDE_INT)
+ a.low |= (unsigned HOST_WIDE_INT) 1 << bitpos;
+ else
+ a.high |= (HOST_WIDE_INT) 1 << (bitpos - HOST_BITS_PER_WIDE_INT);
+
+ return a;
+}
+
/* Shift A left by COUNT places keeping only PREC bits of result. Shift
right if COUNT is negative. ARITH true specifies arithmetic shifting;
otherwise use logical shift. */
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 *);
+double_int double_int_setbit (double_int, unsigned);
/* Logical operations. */
static inline double_int
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. */
if (complement)
mask = double_int_not (mask);
- return immed_double_const (mask.low, mask.high, mode);
+ return immed_double_int_const (mask, mode);
}
/* Return a constant integer (CONST_INT or CONST_DOUBLE) rtx with the value
val = double_int_zext (uhwi_to_double_int (INTVAL (value)), bitsize);
val = double_int_lshift (val, bitpos, HOST_BITS_PER_DOUBLE_INT, false);
- return immed_double_const (val.low, val.high, mode);
+ return immed_double_int_const (val, mode);
}
\f
/* Extract a bit field that is split across two words
#include "input.h"
#include "real.h"
#include "vec.h"
-#include "vecir.h"
#include "fixed-value.h"
#include "alias.h"
HOST_WIDE_INT offset;
};
+DEF_VEC_P(rtx);
+DEF_VEC_ALLOC_P(rtx,heap);
+DEF_VEC_ALLOC_P(rtx,gc);
+
/* Describes a group of objects that are to be placed together in such
a way that their relative positions are known. */
struct GTY(()) object_block {
/* Predicate yielding nonzero iff X is an rtx for a constant integer. */
#define CONST_INT_P(X) (GET_CODE (X) == CONST_INT)
-/* Predicate yielding true iff X is an rtx for a double-int
- or floating point constant. */
-#define CONST_DOUBLE_P(X) (GET_CODE (X) == CONST_DOUBLE)
-
/* Predicate yielding nonzero iff X is a label insn. */
#define LABEL_P(X) (GET_CODE (X) == CODE_LABEL)
extern void push_to_sequence (rtx);
extern void push_to_sequence2 (rtx, rtx);
extern void end_sequence (void);
-extern double_int rtx_to_double_int (const_rtx);
extern rtx immed_double_int_const (double_int, enum machine_mode);
extern rtx immed_double_const (HOST_WIDE_INT, HOST_WIDE_INT,
enum machine_mode);
extern void init_varasm_once (void);
extern enum tls_model decl_default_tls_model (const_tree);
-extern rtx make_debug_expr_from_rtl (const_rtx);
-
/* In rtl.c */
extern void traverse_md_constants (int (*) (void **, void *), void *);
struct md_constant { char *name, *value; };