public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andrew MacLeod <amacleod@redhat.com>
To: "Joseph S. Myers" <joseph@codesourcery.com>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>,
	hp@bitrange.com,        Richard Henderson <rth@redhat.com>
Subject: Re: [PATCH] Add atomic type qualifier
Date: Mon, 29 Jul 2013 18:20:00 -0000	[thread overview]
Message-ID: <51F6A802.2070703@redhat.com> (raw)
In-Reply-To: <Pine.LNX.4.64.1307291641140.12248@digraph.polyomino.org.uk>

On 07/29/2013 12:42 PM, Joseph S. Myers wrote:
> On Mon, 29 Jul 2013, Andrew MacLeod wrote:
>
>> complex I hadn't thought about until just now, I'll have to look.  I know we
>> can deal with parts on complex sometimes.   Hopefully at gimplification time
>> we still have the whole complex reference and if we just take care of that
>> with the atomic builtins, we'll maintain the entire thing as we need.
> You have things in a fairly complicated form, building up COMPLEX_EXPRs
> out of operations on the individual parts of the complex operands.
>
I tried:

   __complex__ double d;
int main (void)
{

   d = 0;
   d = d + 5;
}

and it seems to break it into:
d = __complex__ (0.0, 0.0);

and
d.1 = d;
   d.0 = d.1;
   D.1723 = REALPART_EXPR <d.0>;
   D.1724 = D.1723 + 5.0e+0;
   D.1725 = IMAGPART_EXPR <d.0>;
   d.2 = COMPLEX_EXPR <D.1724, D.1725>;
   d = d.2;

so again the loads and stores to (D) appear to be completely wrap the 
entire complex operation, so this should be handle-able the same way...

So you really should be able to key into the atomic load from D followed 
by the store to D and look at whats in between.

I thini is is straightforward in the gimplifier, we ought to have the d 
=d op V expression at some point and be able to detect that d is the 
same and atomic, and check op.   but if it turns out not to be, then I 
could simply turn those atomic loads and stores into atomic loads and 
stores  in the gimplifier and stop there., Then have a very early 
always-run SSA pass pattern match looking for atomic stores fed from 
atomic loads, and examine the operations in between, looking for 
patterns that match  d = d op v, and then turning the loads/store and 
intermediate bits into the specified compare_exchange loops...

I'll get to this shortly.

Andrew

  reply	other threads:[~2013-07-29 17:36 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-26 17:18 Andrew MacLeod
2013-07-26 19:24 ` Andi Kleen
2013-07-26 19:34   ` Andrew MacLeod
2013-07-26 21:14     ` Andi Kleen
2013-07-26 22:29       ` Andrew MacLeod
2013-07-26 20:42 ` Hans-Peter Nilsson
2013-07-26 23:58 ` Joseph S. Myers
2013-07-27  1:15   ` Andrew MacLeod
2013-08-01 21:54   ` Andrew MacLeod
2013-07-28 21:15 ` Joseph S. Myers
2013-07-29 15:47   ` Andrew MacLeod
2013-07-29 16:12     ` Joseph S. Myers
2013-07-29 16:30       ` Andrew MacLeod
2013-07-29 16:48         ` Joseph S. Myers
2013-07-29 18:20           ` Andrew MacLeod [this message]
2013-07-29 23:24       ` Andrew MacLeod
2013-07-30 12:03         ` Joseph S. Myers
2013-07-30 12:38           ` Andrew MacLeod
2013-07-30 13:25             ` Joseph S. Myers
2013-07-30 13:58               ` Andrew MacLeod
2013-07-31 12:19                 ` Andrew MacLeod
2013-07-29 16:24     ` Andrew MacLeod
2013-07-30 16:56 ` [PATCH 0/5] Atomic " Andrew MacLeod
2013-07-30 17:13   ` [PATCH 2/5] Atomic type qualifier - Add atomic type to tree node Andrew MacLeod
2013-07-30 17:14   ` [PATCH 4/5] Atomic type qualifier - Change built-in function types Andrew MacLeod
2013-07-30 17:14   ` [PATCH 3/5] Atomic type qualifier - front end changes Andrew MacLeod
2013-08-09  0:06     ` Joseph S. Myers
2013-07-30 17:14   ` [PATCH 1/5] Atomic type qualifier - Add type alignment override hook Andrew MacLeod
2013-07-30 17:32   ` [PATCH 5/5] Atomic type qualifier - Use atomic objects Andrew MacLeod
2013-08-02 19:22   ` [PATCH] - C11 expressions and stdatomic.h - Just for current state Andrew MacLeod
2013-08-07 23:06     ` Joseph S. Myers

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=51F6A802.2070703@redhat.com \
    --to=amacleod@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hp@bitrange.com \
    --cc=joseph@codesourcery.com \
    --cc=rth@redhat.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).