public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: rth@redhat.com (Richard Henderson)
Cc: Andreas.Krebbel@de.ibm.com, gcc-patches@gcc.gnu.org
Subject: Re: [CFT] s390: Convert from sync to atomic optabs
Date: Mon, 30 Jul 2012 15:51:00 -0000	[thread overview]
Message-ID: <201207301540.q6UFe3tk027386@d06av02.portsmouth.uk.ibm.com> (raw)
In-Reply-To: <5016A2E4.1050705@redhat.com> from "Richard Henderson" at Jul 30, 2012 08:06:12 AM

Richard Henderson wrote:
> On 2012-07-30 07:09, Ulrich Weigand wrote:
> > This seems to disable use of ICM / STCM to perform byte or
> > aligned halfword access.  Why is this necessary?  Those operations
> > are supposed to provide the required operand consistency ...
> 
> Because MEM_P for cmp and new_rtx are always false.  The expander
> always requests register_operand for those.  I suppose I could back
> out merging those cases into the macro.

Right, that's one of the reasons why we had two separate macros
for sync_compare_and_swap ...

> I presume a good test case to examine for ICM is with such an operand
> coming from a global.  What about STCM?  I don't see the output from
> sync_compare_and_swap ever being allowed in memory...

Actually, it's only ICM that is of interest here; it should get used when
either the comparison value or the "new" value come from a memory location,
e.g. a global.  Sorry, I was confused about STCM ...

> > This seems to force DImode accesses through floating-point
> > registers, which is quite inefficient.  Why not allow LM/STM?
> > Those are supposed to provide doubleword consistency if the
> > operand is sufficiently aligned ...
> 
> ... because I only looked at the definition of LM which itself
> doesn't mention consistency, and the definition of LPQ which talks
> about LM not being suitable for quadword consistency, and came to
> the wrong conclusion.
> 
> So now, looking at movdi_31, I see two problems that prevent just
> using a "normal" move for the atomic_load/store_di: the o/d and d/b
> alternatives which are split.  Is there some specific goodness that
> those alternatives provide that is not had by reloading into the
> Q/S memory patterns?

Well, they are there as splitters because reload assumes all moves
are handled somewhere, either by the mov pattern or else via a
secondary reload.  I've implemented all moves that *can* be
implemented without an extra register via splitters on the
mov pattern, and only those that absolute require the extra
register via secondary reload ...

Given that, it's probably best to use a separate instruction for
the DImode atomic moves after all, but allow GPRs using LM/STM.
(Only for Q/S constraint type addresses.  For those instructions,
we have to reload the address instead of performing two moves.)

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com

  reply	other threads:[~2012-07-30 15:40 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-29 21:32 Richard Henderson
2012-07-30 14:19 ` Ulrich Weigand
2012-07-30 15:12   ` Richard Henderson
2012-07-30 15:51     ` Ulrich Weigand [this message]
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
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=201207301540.q6UFe3tk027386@d06av02.portsmouth.uk.ibm.com \
    --to=uweigand@de.ibm.com \
    --cc=Andreas.Krebbel@de.ibm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --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).