On Fri, Jul 8, 2011 at 8:40 AM, Jakub Jelinek <ja...@redhat.com> wrote:
> Hi!
>
> As mentioned in the PR, IMNSHO the rs6000 vector_select_* patterns
> are invalid RTL, they compare a vector register in some vector mode
> to const0_rtx instead of corresponding vector zero constant.
>
> The "Comparison Operations" section of RTL docs says:
> "The mode of the comparison is determined by the operands; they
> must both be valid for a common machine mode."
>
> Having one vector mode and one VOIDmode confuses simplify-rtx.c enough
> to create simplifications which lead to ICEs.
>
> The following patch fixes that by using CONST0_RTX (mode) instead
> in the patterns.
>
> Bootstrapped/regtested on powerpc64-linux --with-cpu=default32 and
> powerpc64-linux, ok for trunk/4.6?
>
> 2011-07-08  Jakub Jelinek  <ja...@redhat.com>
>
>        PR target/49621
>        * config/rs6000/rs6000.c (rs6000_emit_vector_cond_expr): Use
>        CONST0_RTX (dest_mode) instead of const0_rtx as second operand
>        of NE.
>        * config/rs6000/vector.md (vector_select_<mode>,
>        vector_select_<mode>_uns): Change second operand of NE to
>        CONST0_RTX (<MODE>mode) instead of const0_rtx.
>        * config/rs6000/altivec.md (*altivec_vsel<mode>,
>        *altivec_vsel<mode>_uns): Expect second operand of NE to be
>        zero_constant of the corresponding vector mode.
>        * config/rs6000/vsx.md (*vsx_xxsel<mode>, *vsx_xxsel<mode>_uns):
>        Likewise.
>
>        * gcc.target/powerpc/altivec-34.c: New test.

Okay.

I remember Geoff fixing something similar for FP a while ago.  Sorry I
missed this when this series of patches was merged.

Thanks, David

Reply via email to