On Tue, May 10, 2016 at 05:05:06PM +0200, Bernd Schmidt wrote:
> On 05/10/2016 03:06 PM, Dominik Vogt wrote:
> >+ int cost_of_and;
> >+ int cost_of_zero_ext;
> >+
> >+ cost_of_and = rtx_cost (x, mode, in_code, 1, speed_p);
> >+ cost_of_zero_ext = rtx_cost (temp, mode, in_code, 1, speed_p);
> >+ if (cost_of_zero_ext <= cost_of_and)
>
> Earlier in the discussion you mentioned the intention to remove
> these costs. Nothing else in the function does cost calculations -
> maybe you can try placing a gcc_unreachable into the case where the
> costs would prevent the transformation to see if it ever triggers.
You mean to try it out locally or as part of the patch?
> >+/* Test whether an AND mask or'ed with the know zero bits that equals a mode
> >+ mask is a candidate for zero extendion. */
> >+
> >+/* Note: This test requires that char, int and long have different sizes
> >and the
> >+ target has a way to do 32 -> 64 bit zero extension other than AND.
> >Targets
> >+ that fail the test because they do not satisfy these preconditions can
> >skip
> >+ it. */
>
> Hmm, maybe place copies into a few gcc.target subdirectories
> instead? Or add a whitelist of targets (x86, power, aarch64 maybe)?
That's fine with me, but someone needs to find out what targets to
put on the whitelist. I've only tested s390x and x86_64 so far.
> >+/* { dg-do compile { target lp64 } } */
>
> I suspect this should be
>
> /* { dg-do compile } */
> /* { dg-require-effective-target lp64 } */
Er, yes.
Ciao
Dominik ^_^ ^_^
--
Dominik Vogt
IBM Germany