From: David Miller <da...@davemloft.net> Date: Fri, 28 Oct 2011 01:05:54 -0400 (EDT)
> So should expand_vector_broadcast() really provide this invariant to > the vec_init expander, or does the vec_init expander need to tidy > things up with gen_lowpart() etc. calls? Richard I don't know if you had a chance to look into this at all yet, but I wanted to make a comment about vec_init in general. I've come to find that I want the compiler to do as little as possible with the expressions that get put into vector initializers. I don't want it to modify the mode of the individual inner elements in the assignment. I also don't want it to force mems into registers. In fact, the less it does the better. I want to make use of the special VIS load instructions that can take a QImode or HImode value in memory and load it zero extended into a 64-bit float register. For example: int x; __v8qi test_v8qi(void) { __v8qi ret = { x, x, x, x, x, x, x, x }; return ret; } I want to be able to generate: test_v8qi: sethi %hi(x + 3), %g1 or %g1, %lo(x + 3), %g1 ldda [%g1] ASI_FL8_P, %f2 sethi %hi(0x77777777), %g2 or %g2, %lo(0x77777777), %g2 bmask %g2, %g0, %g0 retl bshuffle %f2, %f2, %f0 but I can't because the vec_init expander sees: (parallel:V8QI [ (reg:QI 110 [ D.2249 ]) (reg:QI 110 [ D.2249 ]) (reg:QI 110 [ D.2249 ]) (reg:QI 110 [ D.2249 ]) (reg:QI 110 [ D.2249 ]) (reg:QI 110 [ D.2249 ]) (reg:QI 110 [ D.2249 ]) (reg:QI 110 [ D.2249 ]) ]) in operands[1].