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