public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jamie Prescott <jpresss@yahoo.com>
To: Michael Meissner <meissner@linux.vnet.ibm.com>
Cc: gcc@gcc.gnu.org
Subject: Re: Seeking suggestion
Date: Mon, 25 May 2009 22:52:00 -0000	[thread overview]
Message-ID: <52774.56901.qm@web111609.mail.gq1.yahoo.com> (raw)
In-Reply-To: <20090524205719.GA14936@hungry-tiger.westford.ibm.com>


> From: Michael Meissner <meissner@linux.vnet.ibm.com>
> To: Jamie Prescott <jpresss@yahoo.com>
> Cc: gcc@gcc.gnu.org
> Sent: Sunday, May 24, 2009 1:57:19 PM
> Subject: Re: Seeking suggestion
> 
> One way is to use match_scratch, and different register classes for the two
> cases.
> 
> (define_insn "add3"
>   [(set (match_operand:SI 0 "register_operand" "=x,y")
>     (plus:SI (match_operand:SI 1 "register_operand" "%x,y")
>          (match_operand:SI 2 "register_operand" "x,y")))
>    (clobber (match_scratch:CC 3 "=X,z"))]
>   ""
>   "add %0,%1,%2")
> 
> 
> (define_register_constraint "x" "TARGET_MACHINE ? GENERAL_REGS : NO_REGS"
>   "@internal")
> 
> (define_register_constraint "y" "!TARGET_MACHINE ? GENERAL_REGS : NO_REGS"
>   "@internal")
> 
> (define_register_constraint "z" CR_REGS "@interal")
> 
> This assumes you have a register class for the condition code register.  Most
> machines however, use the normal define_expand with two different insns.
> 
> In theory, you could define a second condition code register that doesn't
> actually exist in the machine, and change the clobber from the main CC to the
> fake one.

Hmm, interesting. Thanks Michael.
Though, as you were saying, I'll probably leave them as separate insns. These should
have been two separate targets probably, but I'm too lazy to split them up ATM.



> > But now I get and invalid rtx sharing from the push/pop parallels:
> > 
> > 
> > xxxx.c: In function 'test_dashr':
> > xxxx.c:32: error: invalid rtl sharing found in the insn
> > (insn 26 3 28 2 xxxx.c:26 (parallel [
> >             (insn/f 25 0 0 (set (reg/f:SI 51 SP)
> >                     (minus:SI (reg/f:SI 51 SP)
> >                         (const_int 4 [0x4]))) -1 (nil))
> >             (set/f (mem:SI (reg/f:SI 51 SP) [0 S4 A8])
> >                 (reg:SI 8 r8))
> >         ]) -1 (nil))
> > xxxx.c:32: error: shared rtx
> > (insn/f 25 0 0 (set (reg/f:SI 51 SP)
> >         (minus:SI (reg/f:SI 51 SP)
> >             (const_int 4 [0x4]))) -1 (nil))
> > xxxx.c:32: internal compiler error: internal consistency failure
> 
> I suspect you don't have the proper guards on the push/pop insns, and the
> combiner is eliminating the clobber.  You probably need to have parallel insns
> for the push and pop.

Dunno exactly what was happening. The push/pop were generated with a parallel,
but I was issuing a gen_addsi3() directly, and this somehow was creating the problem.
Once I open coded that with SET(SP, PLUS(SP, SIZE)), the issue disappeared.


- Jamie


      

      reply	other threads:[~2009-05-25 19:02 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-23  0:04 Jamie Prescott
2009-05-23 13:41 ` Jamie Prescott
2009-05-23 14:17   ` Ian Lance Taylor
2009-05-23 17:09     ` Jamie Prescott
2009-05-24  0:35       ` Georg-Johann Lay
2009-05-24  2:18         ` Jamie Prescott
2009-05-24 10:23           ` Georg-Johann Lay
2009-05-27 14:42           ` Jim Wilson
2009-05-27 18:56             ` Jamie Prescott
2009-05-27 19:11               ` Jamie Prescott
2009-05-27 19:28               ` Eric Botcazou
2009-05-28  4:56                 ` Jamie Prescott
2009-05-28  5:16                   ` Georg-Johann Lay
2009-05-28  5:33                     ` Jamie Prescott
2009-05-25  3:23   ` Michael Meissner
2009-05-25 22:52     ` Jamie Prescott [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=52774.56901.qm@web111609.mail.gq1.yahoo.com \
    --to=jpresss@yahoo.com \
    --cc=gcc@gcc.gnu.org \
    --cc=meissner@linux.vnet.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).