On Wed, Sep 7, 2011 at 8:17 PM, Jakub Jelinek <ja...@redhat.com> wrote:
> The attached testcase ICEs, because the vectorizer assumes that if vcond* > is available, it supports all comparisons, not just a subset of them. > With -mavx vcmpd etc. already support all the needed comparisons (and > several more - we wouldn't even need to swap the arguments), for SSE > the only missing ones (LTGT and UNEQ) can be handled as ORDERED & NE > resp. UNORDERED | EQ. > > Bootstrapped/regtested on x86_64-linux and i686-linux (on non-AVX host), > plus regtested on x86_64-linux on AVX box. Ok for trunk and 4.6? > > 2011-09-07 Jakub Jelinek <ja...@redhat.com> > > PR target/50310 > * config/i386/i386.c (ix86_prepare_sse_fp_compare_args): For > TARGET_AVX return code for LTGT and UNEQ. > (ix86_expand_fp_vcond): Handle LTGT and UNEQ. > > * gcc.c-torture/execute/ieee/pr50310.c: New test. > * gcc.dg/pr50310-2.c: New test. Please put early exit for TARGET_SSE at the beginning of ix86_prepare_sse_fp_compare_args function. There is really no need to swap operands - and to help reload, since AVX instructions are three-operand instructions. OK for mainline with this change. Thanks, Uros.