public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ian Lance Taylor <iant@google.com>
To: "Petar Bajic" <petar.bajic@micronasnit.com>
Cc: <gcc-help@gcc.gnu.org>
Subject: Re: adding movz to machine description
Date: Fri, 21 Jul 2006 16:30:00 -0000	[thread overview]
Message-ID: <m38xmmrkec.fsf@dhcp-172-18-108-229.corp.google.com> (raw)
In-Reply-To: <001c01c6acab$dac77e50$4900a8c0@niit.micronasnit.com>

"Petar Bajic" <petar.bajic@micronasnit.com> writes:

> > It's not generated, like it's not in the asm code. Instead, movsi_insn is
> > used and bad asm code is generated.
> >
> > for c code :
> > if (in1 == 0)
> >    out = in2;
> > return out;
> >
> > I expect asm to look like this
> > lw r2,4(r30)  ; in2
> > lw r16,(r30)  ; in1
> > movz r1, r2, r16
> >
> > instead, code looks like this
> >
> > lw r2,4(r30)
> > lw r16,(r30)
> > movz r1,r2,r16
> > movn r1,r16,r16
> >
> > expand debug file is in attach, I don't see that movsicc_expand is used...
> > (although this is my first time to look at expand files)
> > movsicc_insn first appears in short.c.11.ce1
> >
> > can you see why pattern is not matched with expand?

Looking back at your earlier message, you had this:

(define_expand "movsicc"
  [(set (match_operand:SI 0 "register_operand" "=d,d")
     (if_then_else:SI (eq:SI (match_operand:SI 2 "register_operand" "=d,d") (const_int 0))
       (match_operand:SI 1 "register_operand" "=d,d")
       (match_dup 0)))]

The match_dup suggests that the first and last operands must be the
same, in which case "movz r1,r2,r16" is not permitted.

It may be correct for the pattern to not be matched with expand.  It's
OK if the if-conversion pass picks it up, which seems to be what is
happening for you.

If the generated code you are getting is wrong, then problem is likely
in the define_insn patterns somewhere.  They don't correct represent
what the instruction does, or they don't correctly implement it.

Ian

  reply	other threads:[~2006-07-21 16:30 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-21  9:55 Petar Bajic
2006-07-21 16:30 ` Ian Lance Taylor [this message]
2006-07-25 10:09   ` Petar Bajic
2006-07-25 13:39     ` Ian Lance Taylor
2006-07-25 14:10       ` Petar Bajic
2006-07-25 14:56         ` Ian Lance Taylor
2006-08-11 12:07       ` Petar Bajic
  -- strict thread matches above, loose matches on Subject: below --
2006-07-07 13:54 Help required for c to VCG GDL flow chart Sharad Pratap
2006-07-07 14:24 ` adding movz to machine description Petar Bajic
2006-07-07 17:39   ` Ian Lance Taylor
2006-07-12 11:10     ` Petar Bajic
2006-07-13  7:52       ` Ian Lance Taylor
2006-07-18 12:06         ` Petar Bajic
2006-07-18 14:35           ` Ian Lance Taylor
2006-07-25 18:25   ` Rask Ingemann Lambertsen

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=m38xmmrkec.fsf@dhcp-172-18-108-229.corp.google.com \
    --to=iant@google.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=petar.bajic@micronasnit.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).