: simplify_gen_subreg (int_mode_for_mode (mode).require (), x, mode, 0);
}
+
+/* Return true if hard register REG supports the ADIW and SBIW instructions. */
+
+bool
+avr_adiw_reg_p (rtx reg)
+{
+ return (AVR_HAVE_ADIW
+ && test_hard_reg_class (ADDW_REGS, reg));
+}
+
+
namespace {
static const pass_data avr_pass_data_recompute_notes =
/* Word registers >= R24 can use SBIW/ADIW with 0..63. */
if (i == 0
- && test_hard_reg_class (ADDW_REGS, reg8))
+ && avr_adiw_reg_p (reg8))
{
int val16 = trunc_int_for_mode (INTVAL (xval), HImode);
if (!started
&& i % 2 == 0
&& i + 2 <= n_bytes
- && test_hard_reg_class (ADDW_REGS, reg8))
+ && avr_adiw_reg_p (reg8))
{
rtx xval16 = simplify_gen_subreg (HImode, xval, imode, i);
unsigned int val16 = UINTVAL (xval16) & GET_MODE_MASK (HImode);
}
if (n_bytes == 2
- && test_hard_reg_class (ADDW_REGS, xreg)
+ && avr_adiw_reg_p (xreg)
&& IN_RANGE (INTVAL (xval), 1, 63))
{
// Add 16-bit value in [1..63] to a w register.
if (i == 0
&& n_bytes >= 2
- && test_hard_reg_class (ADDW_REGS, op[0]))
+ && avr_adiw_reg_p (op[0]))
{
op[1] = simplify_gen_subreg (HImode, xval, mode, 0);
if (IN_RANGE (INTVAL (op[1]), 0, 63))
reg_alloc_order[i] = tiny_reg_alloc_order[i];
}
- CLEAR_HARD_REG_SET (reg_class_contents[(int) ADDW_REGS]);
CLEAR_HARD_REG_SET (reg_class_contents[(int) NO_LD_REGS]);
}
}
{
addr_space_t as = (addr_space_t) INTVAL (op[0]);
machine_mode loop_mode = GET_MODE (op[1]);
- bool sbiw_p = test_hard_reg_class (ADDW_REGS, op[1]);
+ bool sbiw_p = avr_adiw_reg_p (op[1]);
rtx xop[3];
if (plen)
;; lpm : ISA has no LPMX lpmx : ISA has LPMX
;; elpm : ISA has ELPM but no ELPMX elpmx : ISA has ELPMX
;; no_xmega: non-XMEGA core xmega : XMEGA core
-;; no_tiny: non-TINY core tiny : TINY core
+;; no_adiw: ISA has no ADIW, SBIW adiw : ISA has ADIW, SBIW
(define_attr "isa"
- "mov,movw, rjmp,jmp, ijmp,eijmp, lpm,lpmx, elpm,elpmx, no_xmega,xmega, no_tiny,tiny,
+ "mov,movw, rjmp,jmp, ijmp,eijmp, lpm,lpmx, elpm,elpmx, no_xmega,xmega,
+ no_adiw,adiw,
standard"
(const_string "standard"))
(match_test "AVR_XMEGA"))
(const_int 1)
- (and (eq_attr "isa" "tiny")
- (match_test "AVR_TINY"))
- (const_int 1)
-
(and (eq_attr "isa" "no_xmega")
(match_test "!AVR_XMEGA"))
(const_int 1)
- (and (eq_attr "isa" "no_tiny")
- (match_test "!AVR_TINY"))
+ (and (eq_attr "isa" "adiw")
+ (match_test "AVR_HAVE_ADIW"))
+ (const_int 1)
+
+ (and (eq_attr "isa" "no_adiw")
+ (match_test "!AVR_HAVE_ADIW"))
(const_int 1)
] (const_int 0)))
(use (match_dup 2))
(clobber (match_dup 3))
(clobber (match_dup 4))
- (clobber (reg:CC REG_CC))])])
+ (clobber (reg:CC REG_CC))])]
+ ""
+ [(set_attr "isa" "adiw,*")])
(define_insn "*clrmemhi"
"@
0:\;st %a0+,__zero_reg__\;sbiw %A1,1\;brne 0b
0:\;st %a0+,__zero_reg__\;subi %A1,1\;sbci %B1,0\;brne 0b"
- [(set_attr "length" "3,4")])
+ [(set_attr "length" "3,4")
+ (set_attr "isa" "adiw,*")])
(define_expand "strlenhi"
[(set (match_dup 4)
[(parallel [(set (match_dup 0)
(plus:ALL2 (match_dup 1)
(match_dup 2)))
- (clobber (reg:CC REG_CC))])])
+ (clobber (reg:CC REG_CC))])]
+ ""
+ [(set_attr "isa" "*,*,adiw,*")])
(define_insn "*add<mode>3"
[(set (match_operand:ALL2 0 "register_operand" "=??r,d,!w ,d")
return avr_out_plus (insn, operands);
}
[(set_attr "length" "2")
+ (set_attr "isa" "*,*,adiw,*")
(set_attr "adjust_len" "plus")])
;; Adding a constant to NO_LD_REGS might have lead to a reload of
(const_int 0))
(match_dup 2)))
(clobber (match_dup 3))
- (clobber (reg:CC REG_CC))])])
+ (clobber (reg:CC REG_CC))])]
+ ""
+ [(set_attr "isa" "adiw,*")])
(define_insn "*addhi3.lt0"
[(set (match_operand:HI 0 "register_operand" "=w,r")
"@
sbrc %1,7\;adiw %0,1
lsl %1\;adc %A0,__zero_reg__\;adc %B0,__zero_reg__"
- [(set_attr "length" "2,3")])
+ [(set_attr "length" "2,3")
+ (set_attr "isa" "adiw,*")])
(define_insn_and_split "*addpsi3.lt0_split"
[(set (match_operand:PSI 0 "register_operand" "=r")
return avr_out_compare (insn, operands, NULL);
}
[(set_attr "length" "2,2,2,3,4,2,4")
+ (set_attr "isa" "adiw,*,*,*,*,*,*")
(set_attr "adjust_len" "tsthi,tsthi,*,*,*,compare,compare")])
(define_insn "*cmppsi"
{
const char *op;
int jump_mode;
- if (test_hard_reg_class (ADDW_REGS, operands[0]))
+ if (avr_adiw_reg_p (operands[0]))
output_asm_insn ("sbiw %0,1" CR_TAB
"sbc %C0,__zero_reg__" CR_TAB
"sbc %D0,__zero_reg__", operands);
{
const char *op;
int jump_mode;
- if (test_hard_reg_class (ADDW_REGS, operands[0]))
+ if (avr_adiw_reg_p (operands[0]))
output_asm_insn ("sbiw %0,1", operands);
else
output_asm_insn ("subi %A0,1" CR_TAB
{
const char *op;
int jump_mode;
- if (test_hard_reg_class (ADDW_REGS, operands[0]))
+ if (avr_adiw_reg_p (operands[0]))
output_asm_insn ("sbiw %0,1", operands);
else
output_asm_insn ("subi %A0,1" CR_TAB
(clobber (match_dup 2))
(clobber (reg:CC REG_CC))])]
""
- [(set_attr "isa" "no_tiny,tiny")])
+ [(set_attr "isa" "adiw,no_adiw")])
(define_insn "*delay_cycles_2"
[(unspec_volatile [(match_operand:HI 0 "const_int_operand" "n,n")
ldi %A2,lo8(%0)\;ldi %B2,hi8(%0)\n1: sbiw %A2,1\;brne 1b
ldi %A2,lo8(%0)\;ldi %B2,hi8(%0)\n1: subi %A2,1\;sbci %B2,0\;brne 1b"
[(set_attr "length" "4,5")
- (set_attr "isa" "no_tiny,tiny")])
+ (set_attr "isa" "adiw,no_adiw")])
(define_insn_and_split "delay_cycles_3"
[(unspec_volatile [(match_operand:SI 0 "const_int_operand" "n")