public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Paulo J. Matos" <paulo@matos-sorge.com>
To: gcc@gcc.gnu.org
Subject: Re: Use of FLAGS_REGNUM clashes with generates insn
Date: Fri, 23 Sep 2011 14:12:00 -0000	[thread overview]
Message-ID: <j5i43e$u6c$1@dough.gmane.org> (raw)
In-Reply-To: <20110923093048.wseh2gn400s8000g-nzlynne@webmail.spamcop.net>

On Fri, 23 Sep 2011 09:30:48 -0400, amylaar wrote:

> Hiding the flags register would mean it is not represented in the rtl at
> all.  You can have combined compare-branch instructions. Of course,
> going that route would mean that the model you present to GCC is even
> further from the hardware than one that uses cc0.
>

Got it! That seems that it would go against the whole point of replacing 
cc0 for CC_REGNUM in my specific case. Oh well...
 
>> What I currently have in mind is to have a backend macro listing all
>> the move for which a move clobber CC_REG, then whenever GCC generates a
>> move, it queries the macro to know if the move requires clobbering and
>> emits the clobber if required. However, I am unsure how deep the rabbit
>> hole goes.
> 
> Oh, so you do have variants that can do without the clobber. 

Actually I don't... My explanation was supposed to be referring to a 
general solution. In my case, the macro would list all moves since all 
moves clobber CC.

> If you can
> make all the reloads without introducing explicit flag clobbers, that it
> should work.

Unfortunately I can't.

> But you can't just pull a flag clobber out of thin air.  

Understood.

> You should have
> some way to generate valid code when the flags register is unavailable /
> must be saved.  Then you can use peephole2 to add flag clobbers where
> the flags register is available.
> 
> Or you can use machine_dependent_reorg or another machine-specific pass
> inserted with the pass manager to rewrite clobber-free instructions into
> ones that have a hardware equivalent; but you must make sure that your
> data flow remains sound in the process.

I think your last suggestion of having a pass to rewrite the clobber free 
instructions into one with a hardware equivalent seems the one to go for 
me. 

Thanks for the suggestions,

-- 
PMatos

  reply	other threads:[~2011-09-23 14:12 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-22 18:35 Paulo J. Matos
2011-09-23  7:21 ` Joern Rennecke
2011-09-23 12:17   ` Paulo J. Matos
2011-09-23 13:31     ` amylaar
2011-09-23 14:12       ` Paulo J. Matos [this message]
2011-10-17 10:50   ` Hans-Peter Nilsson
2011-10-18 13:57     ` amylaar
2011-10-26  2:58       ` Impact assessment of dse.c:emit_inc_dec_insn_before (Was: Re: Use of FLAGS_REGNUM clashes with generates insn) Joern Rennecke
2011-10-26  3:00         ` DJ Delorie
2011-10-26  3:53           ` Joern Rennecke
2011-10-26 13:18             ` DJ Delorie
2011-10-26 15:38               ` Joern Rennecke

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='j5i43e$u6c$1@dough.gmane.org' \
    --to=paulo@matos-sorge.com \
    --cc=gcc@gcc.gnu.org \
    /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).