From: Richard Guenther <rguenther@suse.de>
To: Richard Henderson <rth@redhat.com>
Cc: uweigand@de.ibm.com, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH 0/2] Convert s390 to atomic optabs, v2
Date: Wed, 01 Aug 2012 17:14:00 -0000 [thread overview]
Message-ID: <alpine.LNX.2.00.1208011906080.17088@jbgna.fhfr.qr> (raw)
In-Reply-To: <5019524D.8070300@redhat.com>
On Wed, 1 Aug 2012, Richard Henderson wrote:
> On 08/01/2012 01:40 AM, Richard Guenther wrote:
> > I see. So your issue is that you don't get the knowledge
> > that the address is even more aligned than required by the
> > builtin.
>
> Yes. Very helpful for quite a few targets that only have word-sized atomic operations, and we emulate char/short via bit-fiddling. That's where MEM_ALIGN as an align+ofs pair would come in doubly helpful...
>
> > So we only use type information when seeing an actual memory
> > reference where we make sure to keep alignment info correct
> > (which we don't bother to do for addresses).
>
> How hard would it be to include (some) builtins in "actual memory reference"? Since it seems likely at this point that gimple_atomic will make it in for 4.8?
Actually it would not help you at all. As far as I understand
the testcase is equivalent from an alignment perspective to
struct S { int x; unsigned short y; } g_s;
void bad (S *p_s)
{
short *p = (short *)&p_s->y;
*(short *)p = 0;
}
so the builtin is a memory access to a short. We cannot derive
any alignment for p_s from this alone unless we change the way
the middle-end constrains pointer type usage (which in turn
means that pointer conversions cannot be dropped on the floor
like we do now).
If you said
p_s->y = 0;
then we can exploit the fact that you dereference p_s and derive
bigger alignment. But I don't see how we can massage the
builtin to preserve such form. Well, put in a memory reference
in the argument, __builtin_compare_exchange (p_s->y, ...), but
that fails foul of GIMPLE requirements to use a temporary for
register type function arguments, which we may be able to
overcome with some special flags.
Richard.
next prev parent reply other threads:[~2012-08-01 17:14 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-29 21:32 [CFT] s390: Convert from sync to atomic optabs Richard Henderson
2012-07-30 14:19 ` Ulrich Weigand
2012-07-30 15:12 ` Richard Henderson
2012-07-30 15:51 ` Ulrich Weigand
2012-07-30 18:53 ` Richard Henderson
2012-07-30 22:33 ` [PATCH 0/2] Convert s390 to atomic optabs, v2 Richard Henderson
2012-07-30 22:33 ` [PATCH 1/2] s390: Reorg s390_expand_insv Richard Henderson
2012-07-30 22:36 ` [PATCH 2/2] s390: Convert from sync to atomic optabs Richard Henderson
2012-08-06 18:34 ` Ulrich Weigand
2012-08-06 18:51 ` Richard Henderson
2012-08-06 19:45 ` Richard Henderson
2012-08-06 22:40 ` s390: Avoid CAS boolean output inefficiency Richard Henderson
2012-08-07 17:02 ` Ulrich Weigand
2012-08-07 22:13 ` Richard Henderson
2012-08-08 18:05 ` Ulrich Weigand
2012-08-09 16:55 ` Eric Botcazou
2012-07-31 9:11 ` [PATCH 0/2] Convert s390 to atomic optabs, v2 Richard Guenther
2012-07-31 15:27 ` Andrew MacLeod
2012-07-31 16:07 ` Richard Henderson
2012-08-01 8:41 ` Richard Guenther
2012-08-01 15:59 ` Richard Henderson
2012-08-01 17:14 ` Richard Guenther [this message]
2012-08-01 19:42 ` Richard Henderson
2012-07-31 18:36 ` Ulrich Weigand
2012-07-31 19:54 ` Richard Henderson
2012-08-01 23:23 ` Richard Henderson
2012-08-03 12:20 ` Ulrich Weigand
2012-08-03 14:21 ` Ulrich Weigand
2012-08-06 16:44 ` Ulrich Weigand
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=alpine.LNX.2.00.1208011906080.17088@jbgna.fhfr.qr \
--to=rguenther@suse.de \
--cc=gcc-patches@gcc.gnu.org \
--cc=rth@redhat.com \
--cc=uweigand@de.ibm.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).