From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14028 invoked by alias); 13 Jun 2012 06:49:22 -0000 Received: (qmail 14014 invoked by uid 22791); 13 Jun 2012 06:49:19 -0000 X-SWARE-Spam-Status: No, hits=-3.6 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 13 Jun 2012 06:49:07 +0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/53652] New: *andn* isn't used for vectorization Date: Wed, 13 Jun 2012 06:49:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-06/txt/msg00748.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53652 Bug #: 53652 Summary: *andn* isn't used for vectorization Classification: Unclassified Product: gcc Version: 4.7.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: normal Priority: P3 Component: rtl-optimization AssignedTo: unassigned@gcc.gnu.org ReportedBy: jakub@gcc.gnu.org CC: uros@gcc.gnu.org Target: x86_64-linux #define N 1024 long a[N], b[N], c[N]; int d[N], e[N], f[N]; void foo (void) { int i; for (i = 0; i < N; i++) a[i] = b[i] & ~c[i]; } void bar (void) { int i; for (i = 0; i < N; i++) d[i] = e[i] & ~f[i]; } doesn't use *andn* insns (e.g. vandnp[sd] for -O3 -mavx). The problem is that combiner doesn't help here, because (insn 42 18 33 2 (set (reg:V4DI 94) (mem/u/c:V4DI (symbol_ref/u:DI ("*.LC0") [flags 0x2]) [2 S32 A256])) -1 (expr_list:REG_EQUAL (const_vector:V4DI [ (const_int -1 [0xffffffffffffffff]) (const_int -1 [0xffffffffffffffff]) (const_int -1 [0xffffffffffffffff]) (const_int -1 [0xffffffffffffffff]) ]) (nil))) is before the loop and thus in a different bb, so the combiner doesn't substitute the all ones constant into the xor (which should fail, i?86 doesn't have a *not* SSE/AVX insn) and later on when the xor is substituted into the and (at that point it could figure that and (xor x -1) y is andn). Wonder if we should change the combiner somehow for the cases where REG_N_SETS == 1 pseudo has REG_EQUAL note, or if we want instead to handle this during expansion (introduce optional andnotM3 standard patterns?).