> From: Georg-Johann Lay <a...@gjlay.de>
> To: Jamie Prescott <jpre...@yahoo.com>
> Cc: Ian Lance Taylor <i...@google.com>; gcc@gcc.gnu.org
> Sent: Saturday, May 23, 2009 12:05:09 AM
> Subject: Re: Seeking suggestion
> 
> Jamie Prescott schrieb:
> 
> > Is the implementation I posted the only one, or there are shorter/better 
> > ones?
> 
> You could use insn attribute to express insns' effects on cc_status.
> Have a look at the avr backend.

AVR uses CC0, while I just switched to CCmode.
Is there a reason why something like this would not work?

(define_insn "addsi3_nc"
  [(set (match_operand:SI 0 "fullreg_operand" "=r")
        (plus:SI (match_operand:SI 1 "fullreg_operand" "r")
                 (match_operand:SI 2 "fullreg_or_imm_operand" "rn")))]
  ""
  "..."
)

(define_expand "addsi3"
  [(set (match_operand:SI 0 "fullreg_operand" "=r")
        (plus:SI (match_operand:SI 1 "fullreg_operand" "r")
                 (match_operand:SI 2 "fullreg_or_imm_operand" "rn")))]
  ""
  {
    if (!TARGET_XXX2)
      emit_clobber(gen_rtx_REG(CCmode, CC_REGNUM));
    emit_insn(gen_addsi3_nc(operands[0], operands[1], operands[2]));
    DONE;
  }
)

That would limit to two instructions per basic insns, instead of the current 
three.
Thanks,

- Jamie


      

Reply via email to