This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: AVR: CC0 to CCmode conversion
- From: Paul Schlie <schlie at comcast dot net>
- To: Denis Chertykov <denisc at overta dot ru>
- Cc: <gcc at gcc dot gnu dot org>,Jan-Benedict Glaw <jbglaw at lug-owl dot de>
- Date: Sat, 19 Mar 2005 12:50:53 -0500
- Subject: Re: AVR: CC0 to CCmode conversion
Sorry meant denote the setting of FLAG_REGS based solely on it's result,
which should be implied by operand 0, the target of 3-operand instructions;
with the exception of compare, as it's effective target are the FLAGS_REGS.
corrected below:
> From: Paul Schlie <schlie@comcast.net>
> - possibly something like: ?
(define_insn "*minushi3"
[(set (match_operand:HI 0 ...)
(minus:HI (match_operand:HI 1 ...)
(match_operand:HI 2 ...)))
(set (reg ZCMP_FLAGS)
(compare:HI (match_dup 0) (const_int 0)))
(set (reg CARRY_FLAGS)
(compare:HI (match_dup 0) (const_int 0)))]
""
"@ add %A0,%A2\;adc %B0,%B2
..."
[(set_attr "length" "2, ...")])
(define_insn "*andhi3"
[(set (match_operand:HI 0 ...)
(and:HI (match_operand:HI 1 ...)
(match_operand:HI 2 ...)))
(set (reg ZCMP_FLAGS)
(compare:HI (match_dup 0) (const_int 0)))]
""
"@ and %A0,%A2\;and %B0,%B2
..."
[(set_attr "length" "2, ...")])
(define_insn "*comparehi"
[(set (reg ZCMP_FLAGS)
(compare:HI (minus:HI (match_operand:HI 1 ...)
(match_operand:HI 2 ...))
(const_int 0)))
(set (reg CARRY_FLAGS)
(compare:HI (minus:HI (match_operand:HI 1 ...)
(match_operand:HI 2 ...))
(const_int 0)))]
""
"@ cp %A0,%A0\;cpc %B0,%B1
..."
[(set_attr "length" "2, ...")])
(define_insn "branch"
[(set (pc)
(if_then_else (condition (reg ZCMP_FLAGS) (match_operand 1 ...))
(label_ref (match_operand 0 ...))
(pc)))]
"* return ret_cond_branch (operands);
..."
[(set_attr "type" "branch")])