From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17910 invoked by alias); 23 Mar 2016 01:33:34 -0000 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 Received: (qmail 17874 invoked by uid 89); 23 Mar 2016 01:33:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=DOC, jne, testb, H*r:esmtpa X-HELO: bosmailout04.eigbox.net Received: from bosmailout04.eigbox.net (HELO bosmailout04.eigbox.net) (66.96.186.4) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Wed, 23 Mar 2016 01:33:22 +0000 Received: from bosmailscan03.eigbox.net ([10.20.15.3]) by bosmailout04.eigbox.net with esmtp (Exim) id 1aiXfk-0004TP-NF for gcc-patches@gcc.gnu.org; Tue, 22 Mar 2016 21:33:20 -0400 Received: from [10.115.3.32] (helo=bosimpout12) by bosmailscan03.eigbox.net with esmtp (Exim) id 1aiXfi-00054S-Vt for gcc-patches@gcc.gnu.org; Tue, 22 Mar 2016 21:33:18 -0400 Received: from bosauthsmtp09.yourhostingaccount.com ([10.20.18.9]) by bosimpout12 with id ZDZD1s00j0BkY8i01DZGJC; Tue, 22 Mar 2016 21:33:18 -0400 X-Authority-Analysis: v=2.1 cv=MoXc6gqe c=1 sm=1 tr=0 a=+tcVrJynzLVJ9yqDAOBWjQ==:117 a=sZx1nW7oDdbgogxTPqu5Xw==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=88b2x-oFWvEA:10 a=IkcTkHD0fZMA:10 a=7OsogOcEt9IA:10 a=mDV3o1hIAAAA:8 a=C8F9KGFtAAAA:8 a=_FMRWcM4CaWm4kpNRrUA:9 a=QEXdDO2ut3YA:10 a=uI404Wb0gMAA:10 Received: from [207.118.20.56] (port=50363 helo=[192.168.1.160]) by bosauthsmtp09.eigbox.net with esmtpa (Exim) id 1aiXfd-000573-Ax; Tue, 22 Mar 2016 21:33:13 -0400 Subject: Re: [DOC Patch] Add sample for @cc constraint To: "gcc-patches@gcc.gnu.org" References: <56E4E5D6.4030500@LimeGreenSocks.com> Cc: Richard Henderson , Sandra Loosemore , Joseph Myers , David Wohlferd From: David Wohlferd Message-ID: <56F1F24D.9080304@LimeGreenSocks.com> Date: Wed, 23 Mar 2016 07:02:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <56E4E5D6.4030500@LimeGreenSocks.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-EN-UserInfo: 97390230d6758ac7ebdf93f8c6197d31:931c98230c6409dcc37fa7e93b490c27 X-EN-AuthUser: dw@limegreensocks.com X-EN-OrigIP: 207.118.20.56 X-EN-OrigHost: unknown X-SW-Source: 2016-03/txt/msg01280.txt.bz2 Ping? (link to original post: https://gcc.gnu.org/ml/gcc-patches/2016-03/msg00743.html ) This patch adds a sample for a new-to-v6 feature. Is this not the right time for doc improvements? I considered adding some assembler output. Something like: ------------------------ Before this feature, you had to write code like this: asm("bt $0, %1 ; setc %0" : "=q" (a) : "r" (value) : "cc"); if (a) This would generate code like this: bt $0, %ebx setc %al <--------- Convert flags to byte testb %al, %al <------ Convert byte back to flags jne .L5 Using @cc, this code asm("bt $0, %1" : "=@ccc" (a) : "r" (value) ); if (a) produces this output: bt $0, %ebx jc .L5 <--------- Use the flags directly ---------------- While this helps show the benefit of the feature, it just seemed like too much detail. Showing people the c code and reminding them to enable optimizations (what the current patch does) seems like it should be sufficient. dw On 3/12/2016 8:00 PM, David Wohlferd wrote: > The docs for the new(-ish) @cc constraint need an example. Attached. > > ChangeLog: > > 2016-03-12 David Wohlferd > > * doc/extend.texi: Add sample for @cc constraint > > Note that while I have a release on file with FSF, I don't have write > access to SVN. > > dw