public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: William Tambe <tambewilliam@gmail.com>
Cc: gcc-help <gcc-help@gcc.gnu.org>
Subject: Re: prevent zero-extension when using a memory load instruction
Date: Mon, 20 Apr 2020 10:47:17 -0500	[thread overview]
Message-ID: <20200420154717.GR26902@gate.crashing.org> (raw)
In-Reply-To: <CAF8i9mOJ9sHs=B6apvR8+Mc=xwT03dKNpw+dD6HdLLmak9Ex1Q@mail.gmail.com>

Hi!

On Mon, Apr 20, 2020 at 10:36:35AM -0400, William Tambe via Gcc-help wrote:
> > > In the machine description file, is there a way to tell GCC that a
> > > memory load instruction already zero-extend such that it does not try
> > > to apply zero-extension ?
> >
> > At least on a load-store architecture (like a usual RISC), you get best
> > results if you make a separate pattern for that, and then let combine
> > combine the zero_extend with the load.
> 
> I tried creating zero_extend pattern that could move data from memory
> to a register (aka memory load), however GCC never used it and
> preferred using memory load followed by a zero-extend.

Use -dap and look at the dump files; see what happened?  You often get
it done by expand already (which isn't such a great idea, but hey), but
some cases are done by combine as well.  If you get separate load and
extend insns generated, you can look at the combine dump to see why
those insns didn't combine there.


Segher

      reply	other threads:[~2020-04-20 15:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-18 15:12 William Tambe
2020-04-18 15:32 ` Marc Glisse
2020-04-18 18:36   ` William Tambe
2020-04-18 18:45     ` Jeff Law
2020-04-20  9:50 ` Segher Boessenkool
2020-04-20 14:36   ` William Tambe
2020-04-20 15:47     ` Segher Boessenkool [this message]

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=20200420154717.GR26902@gate.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=gcc-help@gcc.gnu.org \
    --cc=tambewilliam@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).