public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Richard Biener <rguenther@suse.de>
Cc: Kyrill Tkachov <kyrylo.tkachov@foss.arm.com>,
	       Uros Bizjak <ubizjak@gmail.com>,
	GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH][v3] GIMPLE store merging pass
Date: Wed, 07 Sep 2016 20:47:00 -0000	[thread overview]
Message-ID: <20160907204410.GB21831@laptop.zalov.cz> (raw)
In-Reply-To: <alpine.LSU.2.11.1609071010210.26629@t29.fhfr.qr>

On Wed, Sep 07, 2016 at 10:19:11AM +0200, Richard Biener wrote:
> > If you want a 64-bit store, you'd need to merge the two, and that would be
> > even more expensive.  It is a matter of say:
> > 	movl $0x12345678, (%rsp)
> > 	movl $0x09abcdef, 4(%rsp)
> > vs.
> > 	movabsq $0x09abcdef12345678, %rax
> > 	movq %rax, (%rsp)
> > vs.
> > 	movl $0x09abcdef, %eax
> > 	salq $32, %rax
> > 	orq $0x12345678, %rax
> > 	movq $rax, (%rsp)
> 
> vs.
> 
>         movq $LC0, (%rsp)

You don't want to store the address, so you'd use
	movq .LC0, %rax
	movq %rax, (%rsp)

> I think the important part to notice is that it should be straight forward
> for a target / the expander to split a large store from an immediate
> into any of the above but very hard to do the opposite.  Thus from a
> GIMPLE side "canonicalizing" to large stores (that are eventually
> supported and well-aligned) seems best to me.

I bet many programs assume that say 64-bit aligned store in the source is
atomic in 64-bit apps, without using __atomic_store (..., __ATOMIC_RELAXED);
So such a change would break that.

	Jakub

  parent reply	other threads:[~2016-09-07 20:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-06 15:16 Kyrill Tkachov
2016-09-06 15:33 ` Jakub Jelinek
2016-09-06 16:21   ` Kyrill Tkachov
2016-09-06 16:34     ` Jakub Jelinek
2016-09-06 16:38       ` Kyrill Tkachov
2016-09-07  9:11       ` Richard Biener
2016-09-07 12:43         ` Jeff Law
2016-09-07 13:32         ` Bernd Schmidt
2016-09-07 20:47         ` Jakub Jelinek [this message]
2016-09-07 20:44 ` Bernhard Reutner-Fischer
2016-09-08  8:54   ` Kyrill Tkachov
2016-09-08 15:47     ` Bernhard Reutner-Fischer
2016-09-13  9:47       ` Kyrill Tkachov

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=20160907204410.GB21831@laptop.zalov.cz \
    --to=jakub@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=kyrylo.tkachov@foss.arm.com \
    --cc=rguenther@suse.de \
    --cc=ubizjak@gmail.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).