Hi! On Wed, Dec 06, 2017 at 10:36:58AM -0600, Will Schmidt wrote: > Add support for gimple folding of splat_u{8,16,32}. > Testcase coverage is primarily handled by existing tests > testsuite/gcc.target/powerpc/fold-vec-splat_*.c > > One new test added to verify we continue to receive > an 'invalid argument, must be a 5-bit immediate' error > when we try to splat a non-constant value.
I don't have much to add, maybe Bill does? On the next version then I guess. Some more formatting stuff: > + arg0 = gimple_call_arg (stmt, 0); > + lhs = gimple_call_lhs (stmt); > + /* Only fold the vec_splat_*() if arg0 is constant. */ > + if ( TREE_CODE (arg0) != INTEGER_CST) > + return false; > + tree splat_value = build_int_cst (TREE_TYPE (TREE_TYPE (lhs)), > + TREE_INT_CST_LOW (arg0)); > + vec<constructor_elt, va_gc> *ctor_elts = NULL; > + unsigned int n_elts = TYPE_VECTOR_SUBPARTS (TREE_TYPE (lhs)); > + for (unsigned int i=0; i < n_elts ; i++) + for (unsigned int i = 0; i < n_elts; i++) Well that's all ;-) Segher