Poor generated code for initializing vectors with constants because vec_init pattern is not defined for Altivec.
PR 10469 looks like a testcase where this could improve the code generation.
(In reply to comment #1) > PR 10469 looks like a testcase where this could improve the code generation.\ gcc.dg/vect/vect-25.c is a testcase too. This is what is currently generated (the invariant is in r3): mr r9,r3 mr r10,r3 mr r11,r3 mr r12,r3 L6: addi r7,r1,1104 stw r9,0(r7) stw r10,4(r7) stw r11,8(r7) stw r12,12(r7) lvx v0,0,r7 stvx v0,0,r2 addi r2,r2,16 bdnz L6 instead of: stw r3,0(r2) lvewx v0,0,r2 vspltw v0,v0,0 L4: stvx v0,r2,r0 addi r2,r2,16 bdnz L4
Subject: Bug 18506 CVSROOT: /cvs/gcc Module name: gcc Changes by: dje@gcc.gnu.org 2005-08-08 16:36:27 Modified files: gcc : ChangeLog gcc/config/rs6000: altivec.md rs6000.c rs6000.h rs6000-protos.h Log message: PR target/18506 * config/rs6000/altivec.md (vec_init<mode>): New. (vec_set<mode>): New. (vec_extract<mode>): New. * config/rs6000/rs6000.c (rs6000_expand_vector_init): New. (rs6000_expand_vector_set): New. (rs6000_expand_vector_extract): New. (rs6000_legitimate_offset_address_p): Offset addresses are valid for Altivec modes before reload. (altivec_expand_vec_init_builtin): New. (get_element_number): New. (altivec_expand_vec_set_builtin): New. (altivec_expand_vec_ext_builtin): New. (altivec_expand_builtin): Expand vec_init, vec_set, and vec_ext builtins. (altivec_init_builtins): Init vec_init, vec_set, and vec_ext builtins. * config/rs6000/rs6000.h (rs6000_builtins): Add ALTIVEC_BUILTIN_VEC_INIT_<mode>, ALTIVEC_BUILTIN_VEC_SET_<mode>, ALTIVEC_BUILTIN_VEC_EXT_<mode>. * config/rs6000/rs6000-protos.h: Declare new functions. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.9679&r2=2.9680 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/rs6000/altivec.md.diff?cvsroot=gcc&r1=1.41&r2=1.42 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/rs6000/rs6000.c.diff?cvsroot=gcc&r1=1.857&r2=1.858 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/rs6000/rs6000.h.diff?cvsroot=gcc&r1=1.381&r2=1.382 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/rs6000/rs6000-protos.h.diff?cvsroot=gcc&r1=1.105&r2=1.106
Patch committed