From patchwork Thu Jun 22 12:42:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Martin_Li=C5=A1ka?= X-Patchwork-Id: 779476 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wth7g61kyz9sDB for ; Thu, 22 Jun 2017 22:42:54 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="mVsiVeTv"; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :subject:to:message-id:date:mime-version:content-type; q=dns; s= default; b=bmFonJgakLTRenjz8ncCOVeBtkcBJO5kJdclftyVDnTPeij2cDJYj 4q8iy9mo4gGBGUEUtfT1Qey3+P8w2L0xvnKpueFdOeOm9LpgHfCpshMZgysIvewA y1w7vJQQMM3LTGCxaaXUU04u3TwVkFOPsWeU7z5W3X6yhQfl0TtrzE= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :subject:to:message-id:date:mime-version:content-type; s= default; bh=sVx/y8CbqKckgXrZ8BN/Ro6Qj0k=; b=mVsiVeTvQ0dA21RYiamR ovEe0GbuEc79eyrE2zYjijYqe+GEm+pCgqPWpk8QT9NLo5Ulo8V/MdrJn4uwfoax uEyeb+1HeGlYRkyv6MigGGKu6hiy9tSFcGHszJ3Va3oMsY2FNt/XAx63XI/6LubB pOnEvKJ/W/Snam2QxzAv21I= Received: (qmail 5552 invoked by alias); 22 Jun 2017 12:42:47 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 5537 invoked by uid 89); 22 Jun 2017 12:42:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 22 Jun 2017 12:42:45 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 052AEABF4 for ; Thu, 22 Jun 2017 12:42:42 +0000 (UTC) From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Subject: [PATCH][DOC] Enhance target_clones documentation (PR other/78366). To: gcc-patches@gcc.gnu.org Message-ID: <5a01df88-a425-ed52-fae0-3850201174d5@suse.cz> Date: Thu, 22 Jun 2017 14:42:42 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 X-IsSubscribed: yes Hi. As mentioned in the PR, we only generate a resolver function when there's a usage of a function with target_clones attribute. Let's document the behavior. Ready to be installed? Martin gcc/ChangeLog: 2017-06-22 Martin Liska PR other/78366 * doc/extend.texi: Document when a resolver function is generated for target_clones. --- gcc/doc/extend.texi | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index 43f9ecf2466..24a9672fc2e 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -3278,16 +3278,16 @@ are the same as for @code{target} attribute. For instance, on an x86, you could compile a function with @code{target_clones("sse4.1,avx")}. GCC creates two function clones, one compiled with @option{-msse4.1} and another with @option{-mavx}. -It also creates a resolver function (see the @code{ifunc} attribute -above) that dynamically selects a clone suitable for current -architecture. On a PowerPC, you can compile a function with @code{target_clones("cpu=power9,default")}. GCC will create two function clones, one compiled with @option{-mcpu=power9} and another -with the default options. It also creates a resolver function (see +with the default options. + +It also creates a resolver function (see the @code{ifunc} attribute above) that dynamically selects a clone -suitable for current architecture. +suitable for current architecture. The resolver is created only if there +is a usage of a function with @code{target_clones} attribute. @item unused @cindex @code{unused} function attribute