This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, rs6000] Gimple folding of splat_uX
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: Will Schmidt <will_schmidt at vnet dot ibm dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Richard Biener <richard dot guenther at gmail dot com>, Bill Schmidt <wschmidt at linux dot vnet dot ibm dot com>, David Edelsohn <dje dot gcc at gmail dot com>
- Date: Thu, 7 Dec 2017 05:53:28 -0600
- Subject: Re: [PATCH, rs6000] Gimple folding of splat_uX
- Authentication-results: sourceware.org; auth=none
- References: <1512578218.11602.59.camel@brimstone.rchland.ibm.com>
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