From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24574 invoked by alias); 15 May 2014 12:09:17 -0000 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 Received: (qmail 24344 invoked by uid 48); 15 May 2014 12:09:13 -0000 From: "vincenzo.innocente at cern dot ch" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/61194] New: vectorization failed with "bit-precision arithmetic not supported" even if conversion to int is requested Date: Thu, 15 May 2014 12:09:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vincenzo.innocente at cern dot ch X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-05/txt/msg01373.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61194 Bug ID: 61194 Summary: vectorization failed with "bit-precision arithmetic not supported" even if conversion to int is requested Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: vincenzo.innocente at cern dot ch z[i] = ( (x[i]>0) & (w[i]<0)) ? z[i] : y[i]; produces bit-precision arithmetic not supported. note: not vectorized: relevant stmt not supported: _6 = _5 > 0.0; while integer bitwise operators are vectorized at will z[i] = ( k[i] & j[i] ) ? z[i] : y[i]; I tried to force conversion to int in many ways (see below) such as z[i] = ( int(x[i]>0) & int(w[i]<0)) ? z[i] : y[i]; succeeding only with the quite expensive z[i] = (2==(int(x[i]>0) + int(w[i]<0))) ? z[i] : y[i]; is there a way to force gcc to use integer w/o using arithmetic operators? c++ -Ofast -Wall -fno-tree-slp-vectorize -ftree-loop-if-convert-stores -S cond.cc -msse4.2 -fopt-info-vec -fno-tree-slp-vectorize -fopenmp cat cond.cc float x[1024]; float y[1024]; float z[1024]; float w[1024]; int k[1024]; int j[1024]; void bar() { for (int i=0; i<1024; ++i) z[i] = ( (x[i]>0) & (w[i]<0)) ? z[i] : y[i]; } void barMP() { #pragma omp simd for (int i=0; i<1024; ++i) z[i] = ( int(x[i]>0) & int(w[i]<0)) ? z[i] : y[i]; } void barInt() { for (int i=0; i<1024; ++i) z[i] = ( int(x[i]>0) & int(w[i]<0)) ? z[i] : y[i]; } void barInt0() { for (int i=0; i<1024; ++i) z[i] = ( (0+int(x[i]>0)) & (0+int(w[i]<0)) ) ? z[i] : y[i]; } void barPlus() { for (int i=0; i<1024; ++i) z[i] = (2==(int(x[i]>0) + int(w[i]<0))) ? z[i] : y[i]; } void foo() { for (int i=0; i<1024; ++i) z[i] = ( k[i] & j[i] ) ? z[i] : y[i]; } void foo2() { for (int i=0; i<1024; ++i) { k[i] = x[i]>0; j[i] = w[i]<0; } } void bar2() { for (int i=0; i<1024; ++i) { k[i] = x[i]>0; j[i] = w[i]<0; z[i] = ( k[i] & j[i]) ? z[i] : y[i]; } }