diff options
author | bonzini <bonzini@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-07-22 08:20:40 +0000 |
---|---|---|
committer | bonzini <bonzini@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-07-22 08:20:40 +0000 |
commit | 83e2a11b2613ddd8dfc024700b1c86729b058300 (patch) | |
tree | 4646f9e5e0b2387d4bcc7fc94aff9d320ae0030d /gcc/tree.c | |
parent | 280450faa1152c283c0bb88b31337cee8e569ff5 (diff) | |
download | gcc-83e2a11b2613ddd8dfc024700b1c86729b058300.tar.gz |
2004-07-22 Paolo Bonzini <bonzini@gnu.org>
* tree-cfg.c (gimplify_val): Move from tree-complex.c.
(gimplify_build1): Move from tree-complex.c do_unop.
(gimplify_build2): Move from tree-complex.c do_binop.
(gimplify_build3): New.
* tree-complex.c (gimplify_val, do_unop, do_binop): Remove.
Adjust throughout to call the functions above.
* tree-flow.h: Declare the functions above.
* tree-nested.c (gimplify_val): Rename to...
(tsi_gimplify_val): ... this.
* Makefile.in (tree_complex.o): Update dependencies.
(stor-layout.o): Depend on regs.h.
* c-common.c (handle_vector_size_attribute): Update for
vector types without corresponding vector modes.
* expr.c (expand_expr): Treat VECTOR_CST's like CONSTRUCTORS if
a corresponding vector mode is not available.
* print-tree.c (print_node): Print nunits for vector types
* regclass.c (have_regs_of_mode): New.
(init_reg_sets_1): Initialize it and use it instead
of allocatable_regs_of_mode.
* regs.h (have_regs_of_mode): Declare it.
* stor-layout.c (layout_type): Pick a mode for vector types.
* tree-complex.c (build_word_mode_vector_type, tree_vec_extract,
build_replicated_const, do_unop, do_binop, do_plus_minus,
do_negate, expand_vector_piecewise, expand_vector_parallel,
expand_vector_addition, expand_vector_operations_1,
expand_vector_operations, tree_lower_operations,
pass_lower_vector_ssa, pass_pre_expand): New.
(expand_complex_operations, pass_lower_complex): Remove.
* tree-optimize.c (init_tree_optimization_passes): Adjust
pass ordering for changes in tree-complex.c.
* tree-pass.h: Declare new passes.
* tree.c (finish_vector_type): Remove.
(make_vector_type): New.
(build_vector_type_for_mode, build_vector_type): Rewritten.
* tree.def (VECTOR_TYPE): Document where the number of
subparts is stored.
* tree.h (TYPE_VECTOR_SUBPARTS): Use TYPE_PRECISION field.
(make_vector): Remove declaration.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@85039 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree.c')
-rw-r--r-- | gcc/tree.c | 68 |
1 files changed, 39 insertions, 29 deletions
diff --git a/gcc/tree.c b/gcc/tree.c index 9122df5437f..4ed3b6714a1 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -111,7 +111,7 @@ static void set_type_quals (tree, int); static int type_hash_eq (const void *, const void *); static hashval_t type_hash_hash (const void *); static void print_type_hash_statistics (void); -static void finish_vector_type (tree); +static tree make_vector_type (tree, int, enum machine_mode); static int type_hash_marked_p (const void *); static unsigned int type_hash_list (tree, hashval_t); static unsigned int attribute_hash_list (tree, hashval_t); @@ -5279,18 +5279,23 @@ tree_operand_check_failed (int idx, enum tree_code code, const char *file, } #endif /* ENABLE_TREE_CHECKING */ -/* For a new vector type node T, build the information necessary for - debugging output. */ +/* Create a new vector type node holding SUBPARTS units of type INNERTYPE, + and mapped to the machine mode MODE. Initialize its fields and build + the information necessary for debugging output. */ -static void -finish_vector_type (tree t) +static tree +make_vector_type (tree innertype, int nunits, enum machine_mode mode) { + tree t = make_node (VECTOR_TYPE); + + TREE_TYPE (t) = innertype; + TYPE_VECTOR_SUBPARTS (t) = nunits; + TYPE_MODE (t) = mode; layout_type (t); { - tree index = build_int_2 (TYPE_VECTOR_SUBPARTS (t) - 1, 0); - tree array = build_array_type (TREE_TYPE (t), - build_index_type (index)); + tree index = build_int_2 (nunits - 1, 0); + tree array = build_array_type (innertype, build_index_type (index)); tree rt = make_node (RECORD_TYPE); TYPE_FIELDS (rt) = build_decl (FIELD_DECL, get_identifier ("f"), array); @@ -5303,6 +5308,8 @@ finish_vector_type (tree t) numbers equal. */ TYPE_UID (rt) = TYPE_UID (t); } + + return t; } static tree @@ -5521,36 +5528,39 @@ reconstruct_complex_type (tree type, tree bottom) return outer; } -/* Returns a vector tree node given a vector mode and inner type. */ +/* Returns a vector tree node given a mode (integer, vector, or BLKmode) and + the inner type. */ tree build_vector_type_for_mode (tree innertype, enum machine_mode mode) { - tree t; - t = make_node (VECTOR_TYPE); - TREE_TYPE (t) = innertype; - TYPE_MODE (t) = mode; - finish_vector_type (t); - return t; -} + int nunits; -/* Similarly, but takes inner type and units. */ + if (GET_MODE_CLASS (mode) == MODE_VECTOR_INT + || GET_MODE_CLASS (mode) == MODE_VECTOR_FLOAT) + nunits = GET_MODE_NUNITS (mode); -tree -build_vector_type (tree innertype, int nunits) -{ - enum machine_mode innermode = TYPE_MODE (innertype); - enum machine_mode mode; + else if (GET_MODE_CLASS (mode) == MODE_INT) + { + /* Check that there are no leftover bits. */ + if (GET_MODE_BITSIZE (mode) % TREE_INT_CST_LOW (TYPE_SIZE (innertype))) + abort (); - if (GET_MODE_CLASS (innermode) == MODE_FLOAT) - mode = MIN_MODE_VECTOR_FLOAT; + nunits = GET_MODE_BITSIZE (mode) + / TREE_INT_CST_LOW (TYPE_SIZE (innertype)); + } else - mode = MIN_MODE_VECTOR_INT; + abort (); - for (; mode != VOIDmode ; mode = GET_MODE_WIDER_MODE (mode)) - if (GET_MODE_NUNITS (mode) == nunits && GET_MODE_INNER (mode) == innermode) - return build_vector_type_for_mode (innertype, mode); + return make_vector_type (innertype, nunits, mode); +} - return NULL_TREE; +/* Similarly, but takes the inner type and number of units, which must be + a power of two. */ + +tree +build_vector_type (tree innertype, int nunits) +{ + return make_vector_type (innertype, nunits, VOIDmode); } /* Given an initializer INIT, return TRUE if INIT is zero or some |