public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Petar Bajic" <petar.bajic@micronasnit.com>
To: <gcc-help@gcc.gnu.org>
Subject: adding movz to machine description
Date: Fri, 07 Jul 2006 14:24:00 -0000	[thread overview]
Message-ID: <006801c6a1d1$265f3b90$4900a8c0@niit.micronasnit.com> (raw)
In-Reply-To: <5fb1c7f40607070654y4999cdbfnd390ba8f134c86f2@mail.gmail.com>

I need to add conditional move instructions to gcc dlx port.
I found implemented pattern 'movmodecc' for conditional move instruction 
that look like this:
if (condition)
    a = b;
else
   a = c;

but my "movz" look like this

if (c == 0)
    a = b;

or asm: movz r1, r2, r3  ;; ((if r3 == 0, move r2 to r1))

there is no 'else'  branch.

In md file it's easy to describe first case:

(define_insn "movsicc_internal"
  [(set (match_operand:SI 0 "register_operand" "=d,d")
  (if_then_else:SI
  (match_operator 1 "comparison_operator" [(match_operand:SI 4 
"register_operand" "=d,d") (const_int 0)])
  (match_operand:SI 2 "register_operand" "=d,d")
  (match_operand:SI 3 "register_operand" "=d,d")))]

"movc\\t%0, %2, %3, %1" ;;theoretic conditional move with else branch
[(set_attr "mode" "SI")]

But I can't seem to describe what I need: conditional move without else 
branch.
Any help is appreciated. Im new here.

Petar 

  reply	other threads:[~2006-07-07 14:24 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-07 13:54 Help required for c to VCG GDL flow chart Sharad Pratap
2006-07-07 14:24 ` Petar Bajic [this message]
2006-07-07 17:39   ` adding movz to machine description 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
2006-07-21  9:55 Petar Bajic
2006-07-21 16:30 ` Ian Lance Taylor
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

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='006801c6a1d1$265f3b90$4900a8c0@niit.micronasnit.com' \
    --to=petar.bajic@micronasnit.com \
    --cc=gcc-help@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).