[PATCH, rs6000] Fix PR77613 (swap optimization for splat-with-truncate)

Segher Boessenkool segher@kernel.crashing.org
Fri Sep 16 16:31:00 GMT 2016


On Fri, Sep 16, 2016 at 10:13:09AM -0500, Bill Schmidt wrote:
> Bootstrapped and tested on powerpc64le-unknown-linux-gnu with no
> regressions.  Ok for trunk, and eventual backport to 6 and 5 branches?

Okay and okay.  One nit...

> --- gcc/config/rs6000/rs6000.c	(revision 240187)
> +++ gcc/config/rs6000/rs6000.c	(working copy)
> @@ -39105,6 +39105,11 @@ rtx_is_swappable_p (rtx op, unsigned int *special)
>  	       && GET_MODE_INNER (GET_MODE (op)) == GET_MODE (XEXP (op, 0)))
>  	/* This catches V2DF and V2DI splat, at a minimum.  */
>  	return 1;
> +      else if (GET_CODE (XEXP (op, 0)) == TRUNCATE
> +	       && GET_CODE (XEXP (XEXP (op, 0), 0)) == REG

Please use REG_P here.

> +	       && GET_MODE_INNER (GET_MODE (op)) == GET_MODE (XEXP (op, 0)))
> +	/* This catches splat of a truncated value.  */
> +	return 1;
>        else if (GET_CODE (XEXP (op, 0)) == VEC_SELECT)
>  	/* If the duplicated item is from a select, defer to the select
>  	   processing to see if we can change the lane for the splat.  */

Thanks,


Segher



More information about the Gcc-patches mailing list