This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

adding movz to machine description


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]