From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31395 invoked by alias); 10 May 2012 20:47:53 -0000 Received: (qmail 31386 invoked by uid 22791); 10 May 2012 20:47:52 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,KHOP_THREADED,TW_DX 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; Thu, 10 May 2012 20:47:39 +0000 From: "xinliangli at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/49363] [feature request] multiple target attribute (and runtime dispatching based on cpuid) Date: Thu, 10 May 2012 20:50:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: xinliangli at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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-05/txt/msg01134.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D49363 --- Comment #20 from davidxl 2012-05-10 20:45= :58 UTC --- Auto Cloning is an independent feature. What is requested here is an extens= ion of a previous auto clone patch by Sri (which is based on command line option -mversion=3D...). David (In reply to comment #18) > On Thu, May 10, 2012 at 3:16 AM, vincenzo.innocente at cern dot ch > wrote: > > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D49363 > > > > --- Comment #17 from vincenzo Innocente 2012-05-10 10:16:13 UTC --- > > I tested this > > > > float x[1024], y[1024], z[1024], w[1024]; > > > > void foo() { > > =C2=A0for (int i=3D0; i!=3D1024; ++i) > > =C2=A0 =C2=A0 x[i]=3Dy[i]*z[i]+w[i]; > > } > > > > > > void __attribute__ ((target("arch=3Dcorei7"))) foo() { > > =C2=A0for (int i=3D0; i!=3D1024; ++i) > > =C2=A0 =C2=A0 x[i]=3Dy[i]*z[i]+w[i]; > > } > > > > void __attribute__ ((target("avx"))) foo() { > > =C2=A0for (int i=3D0; i!=3D1024; ++i) > > =C2=A0 =C2=A0 x[i]=3Dy[i]*z[i]+w[i]; > > } > > > > > > and see the three versions generated =C2=A0+ the "resolver". > > > > As you notice the source code is identical as I'm exploiting compiler > > autovectorization here. > > In this case I was hoping that a single declaration such as =C2=A0__att= ribute__ > > ((target("arch=3Dcorei7,avx"))) > > or =C2=A0__attribute__ ((target("arch=3Dcorei7),target("avx"))) would g= enerate the two > > versions w/o hang to duplicate the source code. > > Is this possible to support? >=20 > Yes, this is on the list of things to add. The front-end should clone > the bodies and tag the attributes appropriately. >=20 > Thanks, > -Sri, >=20 >=20 > > > > -- > > Configure bugmail: http://gcc.gnu.org/bugzilla/userprefs.cgi?tab=3Demail > > ------- You are receiving this mail because: ------- > > You are on the CC list for the bug.