public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: David Wohlferd <dw@LimeGreenSocks.com>
To: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Cc: Richard Henderson <rth@redhat.com>,
	Sandra Loosemore <sandra@codesourcery.com>,
	Joseph Myers <joseph@codesourcery.com>,
	David Wohlferd <dw@LimeGreenSocks.com>
Subject: Re: [DOC Patch] Add sample for @cc constraint
Date: Wed, 23 Mar 2016 07:02:00 -0000	[thread overview]
Message-ID: <56F1F24D.9080304@LimeGreenSocks.com> (raw)
In-Reply-To: <56E4E5D6.4030500@LimeGreenSocks.com>

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  <dw@LimeGreenSocks.com>
>
>     * 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

  reply	other threads:[~2016-03-23  1:33 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-13  4:01 David Wohlferd
2016-03-23  7:02 ` David Wohlferd [this message]
2016-03-24 15:21 ` Bernd Schmidt
2016-03-24 17:59   ` Sandra Loosemore
2016-03-27 22:34   ` David Wohlferd
2016-03-29 12:10     ` Bernd Schmidt
2016-04-01 23:39       ` David Wohlferd
2016-04-11 22:49         ` David Wohlferd
2016-04-12 13:06           ` Bernd Schmidt
2016-04-15 23:13             ` David Wohlferd
2016-04-25  9:51               ` Bernd Schmidt
2016-04-26  0:16                 ` David Wohlferd

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56F1F24D.9080304@LimeGreenSocks.com \
    --to=dw@limegreensocks.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=joseph@codesourcery.com \
    --cc=rth@redhat.com \
    --cc=sandra@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).