From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22750 invoked by alias); 27 Apr 2012 14:35:54 -0000 Received: (qmail 22401 invoked by uid 22791); 27 Apr 2012 14:35:52 -0000 X-SWARE-Spam-Status: No, hits=-5.3 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-gy0-f175.google.com (HELO mail-gy0-f175.google.com) (209.85.160.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 27 Apr 2012 14:35:37 +0000 Received: by ghbz2 with SMTP id z2so446803ghb.20 for ; Fri, 27 Apr 2012 07:35:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding:x-system-of-record :x-gm-message-state; bh=9eEtuvSuQqrBHbLnqApMDL5Zu3n7qriUaAb3mJ8DeDY=; b=iHt7W3bq04qgkwSqdzE39IiUOA4GmmoC9UzVc4ls62+Ga85oPMgMRx4ESCOnYoC/tk n5Smr9ye6Vr5EHoppy7wdpV/WeADQi+rO1R2ExlGYsuzP6lrH43kPY1si8Q2Zhe8jpKU 97IMECvlr7wyOA8QfyEnV3W5qLaAXloMOUvnfk1Qo6Hv4ZxPfLIBqjIQJbArIzmu8/KF 3xBzykiyYmZ3I82Z5lJIt3g67DkH1B0CSn/0Pq8ogIy/Yj/oTAqWPZsr0s3TQ5USiVy9 mKdKKfnK7zhlREsJWgjjgFsouO6V1tYnlYs1L37wVhDqPIiz2x2bou5YTs+XLGg22cjc xJdA== Received: by 10.60.27.170 with SMTP id u10mr15150420oeg.50.1335537336608; Fri, 27 Apr 2012 07:35:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.60.27.170 with SMTP id u10mr15150399oeg.50.1335537336498; Fri, 27 Apr 2012 07:35:36 -0700 (PDT) Received: by 10.182.147.104 with HTTP; Fri, 27 Apr 2012 07:35:36 -0700 (PDT) In-Reply-To: References: <20120307004630.A503DB21B6@azwildcat.mtv.corp.google.com> Date: Fri, 27 Apr 2012 14:35:00 -0000 Message-ID: Subject: Re: User directed Function Multiversioning via Function Overloading (issue5752064) From: Sriraman Tallam To: "H.J. Lu" Cc: Richard Guenther , Jan Hubicka , Uros Bizjak , reply@codereview.appspotmail.com, gcc-patches@gcc.gnu.org, David Li Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true X-Gm-Message-State: ALoCoQmO1cv8+1VsKYNNFS+fpZ6nr5H8+35NpzDUTFcjJE2lxaXY3MryFmxPwuzaqb61vaJOjfdlfQJDpCLAkenKSdbYBpSbuuz+ehwKBEF1g4Kcy2DuKdqIfJ9OLneYsNRCNUdzvfqfBy9iUIEYS4VS/PI6ai8efg== X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2012-04/txt/msg01774.txt.bz2 On Fri, Apr 27, 2012 at 6:38 AM, H.J. Lu wrote: > On Thu, Apr 26, 2012 at 10:08 PM, Sriraman Tallam w= rote: >> Hi, >> >> =A0 I have made the following changes in this new patch which is attache= d: >> >> * Use target attribute itself to create function versions. >> * Handle any number of ISA names and arch=3D =A0args to target attribute, >> generating the right dispatchers. >> * Integrate with the CPU runtime detection checked in this week. >> * Overload resolution: If the caller's target matches any of the >> version function's target, then a direct call to the version is >> generated, no need to go through the dispatching. >> >> Patch also available for review here: >> http://codereview.appspot.com/5752064 >> > > Does it work with > > int foo (); > int foo () __attribute__ ((targetv("arch=3Dcorei7"))); > > int (*foo_p) () =3D foo? Yes, this will work. foo_p will be the address of the dispatcher function and hence doing (*foo_p)() will call the right version. > > Does it support C++? Partially, no support for virtual function versioning yet. I will add it in the next iteration. Thanks, -Sri. > > Thanks. > > -- > H.J.