diff options
author | aldyh <aldyh@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-04-01 13:40:11 +0000 |
---|---|---|
committer | aldyh <aldyh@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-04-01 13:40:11 +0000 |
commit | c3309fc6b6b72cd2cebe33bc1b643b76d09bce90 (patch) | |
tree | 8129a959cc2632337ea9823f4d5298efac0ea6e5 /gcc/c-typeck.c | |
parent | fac69c46176dda4705ccbc71bde6d31c626d1757 (diff) | |
download | gcc-c3309fc6b6b72cd2cebe33bc1b643b76d09bce90.tar.gz |
* testsuite/gcc.c-torture/execute/simd-3.c: New.
* expr.c (expand_expr): Handle VECTOR_CST.
(const_vector_from_tree): New.
* varasm.c (output_constant): Handle VECTOR_CST.
* c-typeck.c (digest_init): Build a vector constant from a
VECTOR_TYPE.
* config/rs6000/rs6000.c: Remove prototype for
easy_vector_constant.
(easy_vector_constant): Add mode parameter. Rewrite to handle
more easy constants.
(rs6000_emit_move): Pass mode to easy_vector_constant.
Call emit_easy_vector_insn for SPE V2SI vector constant moves.
(emit_easy_vector_insn): New.
(easy_vector_same): New.
(EASY_VECTOR_15): New macro.
(EASY_VECTOR_15_ADD_SELF): New macro.
(bdesc_2arg): Rename to xorv2si3.
(easy_vector_constant_add_self): New.
(input_operand): Allow vector constants.
* config/rs6000/rs6000.h (PREDICATE_CODES): Add
easy_vector_constant, easy_vector_constant_add_self.
(EXTRA_CONSTRAINT): Add 'W'.
* config/rs6000/rs6000-protos.h: Add prototype for
easy_vector_constant, emit_easy_vector_insn.
* config/rs6000/altivec.md (xorv8hi3): New.
(xorv16qi3): New.
Remove all _const0 patterns.
(movv4si_internal): Rewrite to use code. Add vector constant to
vector alternative. Add splitter.
(movv8hi_internal): Same.
(movv16qi_internal): Same.
(movv4sf_internal): Same.
Change the unspecs for vspltis* to use constants.
* config/rs6000/spe.md ("xorv4hi3"): New.
("spe_evxor"): Rename to xorv2si3.
("xorv1di3"): New.
Remove all _const0 patterns.
(movv2si_internal): Rewrite to use code. Add vector constant to
alternatives. Add splitter.
(movv4hi_internal): Add vector constant to alternatives.
(movv1di_internal): Same.
(movv2sf_internal): Same.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@65130 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-typeck.c')
-rw-r--r-- | gcc/c-typeck.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index 8fbcd861d2b..ce37eea09f7 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -4759,6 +4759,14 @@ digest_init (type, init, require_constant) } } + /* Build a VECTOR_CST from a *constant* vector constructor. If the + vector constructor is not constant (e.g. {1,2,3,foo()}) then punt + below and handle as a constructor. */ + if (code == VECTOR_TYPE + && comptypes (TREE_TYPE (inside_init), type) + && TREE_CONSTANT (inside_init)) + return build_vector (type, TREE_OPERAND (inside_init, 1)); + /* Any type can be initialized from an expression of the same type, optionally with braces. */ |