This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, rs6000] Gimple folding of splat_uX


On Thu, Dec 07, 2017 at 12:21:03PM +0100, Richard Biener wrote:
> > +        if ( TREE_CODE (arg0) != INTEGER_CST)

Also watch formatting, the space after ( doesn't belong there.

> > +          return false;
> 
> Is there a reason to not do this for non-constants?  (even not for
> float constants?)
> You should probably double-check there is a LHS, folding runs before DCE.
> 
> > +        tree splat_value = build_int_cst (TREE_TYPE (TREE_TYPE (lhs)),
> > +                                          TREE_INT_CST_LOW (arg0));

	tree splat_value = fold_convert (TREE_TYPE (TREE_TYPE (lhs)), arg0);
?
TREE_INT_CST_LOW should not be used unless necessary, e.g. it can throw
the upper bits of large constants, even if the type is wide.

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]