avr.h (AVR_HAVE_LPMX): New macro.
* config/avr/avr.h (AVR_HAVE_LPMX): New macro. (AVR_ENHANCED): Rename to ... (AVR_HAVE_MUL): ... new. (avr_enhanced_p): Rename to ... (avr_have_mul_p): ... new. (TARGET_CPU_CPP_BUILTINS): Use 'avr_have_mul_p' instead of 'avr_enhanced_p' for "__AVR_ENHANCED__". Define "__AVR_HAVE_MUL__". * config/avr/avr.c (avr_enhanced_p): Rename to ... (avr_have_mul_p): ... new. (base_arch_s): Rename 'enhanced' to 'have_mul'. (avr_override_options): Use 'avr_have_mul_p' and 'have_mul' instead of 'avr_enhanced_p' and 'enhanced'. (ashlhi3_out, ashrhi3_out, lshrhi3_out, avr_rtx_costs): Use AVR_HAVE_MUL instead of AVR_ENHANCED. * avr.md (*tablejump_enh): Use AVR_HAVE_LPMX instead of AVR_ENHANCED. (mulqi3, *mulqi3_enh, *mulqi3_call, mulqihi3, umulqihi3, mulhi3, *mulhi3_enh, *mulhi3_call, mulsi3, *mulsi3_call): Use AVR_HAVE_MUL instead of AVR_ENHANCED. (*tablejump_enh): Use AVR_HAVE_LPMX instead of AVR_ENHANCED. * libgcc.S: Use __AVR_HAVE_MUL__ instead of __AVR_ENHANCED__. (__tablejump__): Use __AVR_HAVE_LPMX__ instead of __AVR_ENHANCED__. From-SVN: r120865
This commit is contained in:
parent
efb7e1e026
commit
dd6d1f8c3f
|
@ -1,3 +1,27 @@
|
|||
2007-01-17 Anatoly Sokolov <aesok@post.ru>
|
||||
|
||||
* config/avr/avr.h (AVR_HAVE_LPMX): New macro.
|
||||
(AVR_ENHANCED): Rename to ...
|
||||
(AVR_HAVE_MUL): ... new.
|
||||
(avr_enhanced_p): Rename to ...
|
||||
(avr_have_mul_p): ... new.
|
||||
(TARGET_CPU_CPP_BUILTINS): Use 'avr_have_mul_p' instead of
|
||||
'avr_enhanced_p' for "__AVR_ENHANCED__". Define "__AVR_HAVE_MUL__".
|
||||
* config/avr/avr.c (avr_enhanced_p): Rename to ...
|
||||
(avr_have_mul_p): ... new.
|
||||
(base_arch_s): Rename 'enhanced' to 'have_mul'.
|
||||
(avr_override_options): Use 'avr_have_mul_p' and 'have_mul' instead of
|
||||
'avr_enhanced_p' and 'enhanced'.
|
||||
(ashlhi3_out, ashrhi3_out, lshrhi3_out, avr_rtx_costs): Use
|
||||
AVR_HAVE_MUL instead of AVR_ENHANCED.
|
||||
* avr.md (*tablejump_enh): Use AVR_HAVE_LPMX instead of AVR_ENHANCED.
|
||||
(mulqi3, *mulqi3_enh, *mulqi3_call, mulqihi3, umulqihi3, mulhi3,
|
||||
*mulhi3_enh, *mulhi3_call, mulsi3, *mulsi3_call): Use AVR_HAVE_MUL
|
||||
instead of AVR_ENHANCED.
|
||||
(*tablejump_enh): Use AVR_HAVE_LPMX instead of AVR_ENHANCED.
|
||||
* libgcc.S: Use __AVR_HAVE_MUL__ instead of __AVR_ENHANCED__.
|
||||
(__tablejump__): Use __AVR_HAVE_LPMX__ instead of __AVR_ENHANCED__.
|
||||
|
||||
2007-01-17 Ian Lance Taylor <iant@google.com>
|
||||
|
||||
* vec.h (VEC_reserve_exact): Define.
|
||||
|
|
|
@ -120,8 +120,8 @@ section *progmem_section;
|
|||
/* More than 8K of program memory: use "call" and "jmp". */
|
||||
int avr_mega_p = 0;
|
||||
|
||||
/* Enhanced core: use "movw", "mul", ... */
|
||||
int avr_enhanced_p = 0;
|
||||
/* Core have 'MUL*' instructions. */
|
||||
int avr_have_mul_p = 0;
|
||||
|
||||
/* Assembler only. */
|
||||
int avr_asm_only_p = 0;
|
||||
|
@ -131,7 +131,7 @@ int avr_have_movw_lpmx_p = 0;
|
|||
|
||||
struct base_arch_s {
|
||||
int asm_only;
|
||||
int enhanced;
|
||||
int have_mul;
|
||||
int mega;
|
||||
int have_movw_lpmx;
|
||||
const char *const macro;
|
||||
|
@ -324,7 +324,7 @@ avr_override_options (void)
|
|||
|
||||
base = &avr_arch_types[t->arch];
|
||||
avr_asm_only_p = base->asm_only;
|
||||
avr_enhanced_p = base->enhanced;
|
||||
avr_have_mul_p = base->have_mul;
|
||||
avr_mega_p = base->mega;
|
||||
avr_have_movw_lpmx_p = base->have_movw_lpmx;
|
||||
avr_base_arch_macro = base->macro;
|
||||
|
@ -3170,7 +3170,7 @@ ashlhi3_out (rtx insn, rtx operands[], int *len)
|
|||
AS1 (lsl,%B0) CR_TAB
|
||||
AS2 (andi,%B0,0xe0));
|
||||
}
|
||||
if (AVR_ENHANCED && scratch)
|
||||
if (AVR_HAVE_MUL && scratch)
|
||||
{
|
||||
*len = 5;
|
||||
return (AS2 (ldi,%3,0x20) CR_TAB
|
||||
|
@ -3191,7 +3191,7 @@ ashlhi3_out (rtx insn, rtx operands[], int *len)
|
|||
AS2 (ldi,%3,0xe0) CR_TAB
|
||||
AS2 (and,%B0,%3));
|
||||
}
|
||||
if (AVR_ENHANCED)
|
||||
if (AVR_HAVE_MUL)
|
||||
{
|
||||
*len = 6;
|
||||
return ("set" CR_TAB
|
||||
|
@ -3211,7 +3211,7 @@ ashlhi3_out (rtx insn, rtx operands[], int *len)
|
|||
AS1 (lsl,%B0));
|
||||
|
||||
case 14:
|
||||
if (AVR_ENHANCED && ldi_ok)
|
||||
if (AVR_HAVE_MUL && ldi_ok)
|
||||
{
|
||||
*len = 5;
|
||||
return (AS2 (ldi,%B0,0x40) CR_TAB
|
||||
|
@ -3220,7 +3220,7 @@ ashlhi3_out (rtx insn, rtx operands[], int *len)
|
|||
AS1 (clr,%A0) CR_TAB
|
||||
AS1 (clr,__zero_reg__));
|
||||
}
|
||||
if (AVR_ENHANCED && scratch)
|
||||
if (AVR_HAVE_MUL && scratch)
|
||||
{
|
||||
*len = 5;
|
||||
return (AS2 (ldi,%3,0x40) CR_TAB
|
||||
|
@ -3500,7 +3500,7 @@ ashrhi3_out (rtx insn, rtx operands[], int *len)
|
|||
AS1 (asr,%A0));
|
||||
|
||||
case 11:
|
||||
if (AVR_ENHANCED && ldi_ok)
|
||||
if (AVR_HAVE_MUL && ldi_ok)
|
||||
{
|
||||
*len = 5;
|
||||
return (AS2 (ldi,%A0,0x20) CR_TAB
|
||||
|
@ -3520,7 +3520,7 @@ ashrhi3_out (rtx insn, rtx operands[], int *len)
|
|||
AS1 (asr,%A0));
|
||||
|
||||
case 12:
|
||||
if (AVR_ENHANCED && ldi_ok)
|
||||
if (AVR_HAVE_MUL && ldi_ok)
|
||||
{
|
||||
*len = 5;
|
||||
return (AS2 (ldi,%A0,0x10) CR_TAB
|
||||
|
@ -3541,7 +3541,7 @@ ashrhi3_out (rtx insn, rtx operands[], int *len)
|
|||
AS1 (asr,%A0));
|
||||
|
||||
case 13:
|
||||
if (AVR_ENHANCED && ldi_ok)
|
||||
if (AVR_HAVE_MUL && ldi_ok)
|
||||
{
|
||||
*len = 5;
|
||||
return (AS2 (ldi,%A0,0x08) CR_TAB
|
||||
|
@ -3947,7 +3947,7 @@ lshrhi3_out (rtx insn, rtx operands[], int *len)
|
|||
AS1 (lsr,%A0) CR_TAB
|
||||
AS2 (andi,%A0,0x07));
|
||||
}
|
||||
if (AVR_ENHANCED && scratch)
|
||||
if (AVR_HAVE_MUL && scratch)
|
||||
{
|
||||
*len = 5;
|
||||
return (AS2 (ldi,%3,0x08) CR_TAB
|
||||
|
@ -3968,7 +3968,7 @@ lshrhi3_out (rtx insn, rtx operands[], int *len)
|
|||
AS2 (ldi,%3,0x07) CR_TAB
|
||||
AS2 (and,%A0,%3));
|
||||
}
|
||||
if (AVR_ENHANCED)
|
||||
if (AVR_HAVE_MUL)
|
||||
{
|
||||
*len = 6;
|
||||
return ("set" CR_TAB
|
||||
|
@ -3988,7 +3988,7 @@ lshrhi3_out (rtx insn, rtx operands[], int *len)
|
|||
AS1 (lsr,%A0));
|
||||
|
||||
case 14:
|
||||
if (AVR_ENHANCED && ldi_ok)
|
||||
if (AVR_HAVE_MUL && ldi_ok)
|
||||
{
|
||||
*len = 5;
|
||||
return (AS2 (ldi,%A0,0x04) CR_TAB
|
||||
|
@ -3997,7 +3997,7 @@ lshrhi3_out (rtx insn, rtx operands[], int *len)
|
|||
AS1 (clr,%B0) CR_TAB
|
||||
AS1 (clr,__zero_reg__));
|
||||
}
|
||||
if (AVR_ENHANCED && scratch)
|
||||
if (AVR_HAVE_MUL && scratch)
|
||||
{
|
||||
*len = 5;
|
||||
return (AS2 (ldi,%3,0x04) CR_TAB
|
||||
|
@ -4983,7 +4983,7 @@ avr_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED, int *total)
|
|||
switch (mode)
|
||||
{
|
||||
case QImode:
|
||||
if (AVR_ENHANCED)
|
||||
if (AVR_HAVE_MUL)
|
||||
*total = COSTS_N_INSNS (optimize_size ? 3 : 4);
|
||||
else if (optimize_size)
|
||||
*total = COSTS_N_INSNS (AVR_MEGA ? 2 : 1);
|
||||
|
@ -4991,7 +4991,7 @@ avr_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED, int *total)
|
|||
return false;
|
||||
|
||||
case HImode:
|
||||
if (AVR_ENHANCED)
|
||||
if (AVR_HAVE_MUL)
|
||||
*total = COSTS_N_INSNS (optimize_size ? 7 : 10);
|
||||
else if (optimize_size)
|
||||
*total = COSTS_N_INSNS (AVR_MEGA ? 2 : 1);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* Definitions of target machine for GNU compiler,
|
||||
for ATMEL AVR at90s8515, ATmega103/103L, ATmega603/603L microcontrollers.
|
||||
Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
|
||||
Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
|
||||
Free Software Foundation, Inc.
|
||||
Contributed by Denis Chertykov (denisc@overta.ru)
|
||||
|
||||
|
@ -37,8 +37,10 @@ Boston, MA 02110-1301, USA. */
|
|||
builtin_define ("__AVR_HAVE_LPMX__"); \
|
||||
if (avr_asm_only_p) \
|
||||
builtin_define ("__AVR_ASM_ONLY__"); \
|
||||
if (avr_enhanced_p) \
|
||||
if (avr_have_mul_p) \
|
||||
builtin_define ("__AVR_ENHANCED__"); \
|
||||
if (avr_have_mul_p) \
|
||||
builtin_define ("__AVR_HAVE_MUL__"); \
|
||||
if (avr_mega_p) \
|
||||
builtin_define ("__AVR_MEGA__"); \
|
||||
if (TARGET_NO_INTERRUPTS) \
|
||||
|
@ -49,7 +51,7 @@ Boston, MA 02110-1301, USA. */
|
|||
extern const char *avr_base_arch_macro;
|
||||
extern const char *avr_extra_arch_macro;
|
||||
extern int avr_mega_p;
|
||||
extern int avr_enhanced_p;
|
||||
extern int avr_have_mul_p;
|
||||
extern int avr_asm_only_p;
|
||||
extern int avr_have_movw_lpmx_p;
|
||||
#ifndef IN_LIBGCC2
|
||||
|
@ -57,8 +59,9 @@ extern GTY(()) section *progmem_section;
|
|||
#endif
|
||||
|
||||
#define AVR_MEGA (avr_mega_p && !TARGET_SHORT_CALLS)
|
||||
#define AVR_ENHANCED (avr_enhanced_p)
|
||||
#define AVR_HAVE_MUL (avr_have_mul_p)
|
||||
#define AVR_HAVE_MOVW (avr_have_movw_lpmx_p)
|
||||
#define AVR_HAVE_LPMX (avr_have_movw_lpmx_p)
|
||||
|
||||
#define TARGET_VERSION fprintf (stderr, " (GNU assembler syntax)");
|
||||
|
||||
|
|
|
@ -707,7 +707,7 @@
|
|||
(match_operand:QI 2 "register_operand" "")))]
|
||||
""
|
||||
"{
|
||||
if (!AVR_ENHANCED)
|
||||
if (!AVR_HAVE_MUL)
|
||||
{
|
||||
emit_insn (gen_mulqi3_call (operands[0], operands[1], operands[2]));
|
||||
DONE;
|
||||
|
@ -718,7 +718,7 @@
|
|||
[(set (match_operand:QI 0 "register_operand" "=r")
|
||||
(mult:QI (match_operand:QI 1 "register_operand" "r")
|
||||
(match_operand:QI 2 "register_operand" "r")))]
|
||||
"AVR_ENHANCED"
|
||||
"AVR_HAVE_MUL"
|
||||
"mul %1,%2
|
||||
mov %0,r0
|
||||
clr r1"
|
||||
|
@ -737,7 +737,7 @@
|
|||
(define_insn "*mulqi3_call"
|
||||
[(set (reg:QI 24) (mult:QI (reg:QI 24) (reg:QI 22)))
|
||||
(clobber (reg:QI 22))]
|
||||
"!AVR_ENHANCED"
|
||||
"!AVR_HAVE_MUL"
|
||||
"%~call __mulqi3"
|
||||
[(set_attr "type" "xcall")
|
||||
(set_attr "cc" "clobber")])
|
||||
|
@ -746,7 +746,7 @@
|
|||
[(set (match_operand:HI 0 "register_operand" "=r")
|
||||
(mult:HI (sign_extend:HI (match_operand:QI 1 "register_operand" "d"))
|
||||
(sign_extend:HI (match_operand:QI 2 "register_operand" "d"))))]
|
||||
"AVR_ENHANCED"
|
||||
"AVR_HAVE_MUL"
|
||||
"muls %1,%2
|
||||
movw %0,r0
|
||||
clr r1"
|
||||
|
@ -757,7 +757,7 @@
|
|||
[(set (match_operand:HI 0 "register_operand" "=r")
|
||||
(mult:HI (zero_extend:HI (match_operand:QI 1 "register_operand" "r"))
|
||||
(zero_extend:HI (match_operand:QI 2 "register_operand" "r"))))]
|
||||
"AVR_ENHANCED"
|
||||
"AVR_HAVE_MUL"
|
||||
"mul %1,%2
|
||||
movw %0,r0
|
||||
clr r1"
|
||||
|
@ -771,7 +771,7 @@
|
|||
""
|
||||
"
|
||||
{
|
||||
if (!AVR_ENHANCED)
|
||||
if (!AVR_HAVE_MUL)
|
||||
{
|
||||
emit_insn (gen_mulhi3_call (operands[0], operands[1], operands[2]));
|
||||
DONE;
|
||||
|
@ -782,7 +782,7 @@
|
|||
[(set (match_operand:HI 0 "register_operand" "=&r")
|
||||
(mult:HI (match_operand:HI 1 "register_operand" "r")
|
||||
(match_operand:HI 2 "register_operand" "r")))]
|
||||
"AVR_ENHANCED"
|
||||
"AVR_HAVE_MUL"
|
||||
"mul %A1,%A2
|
||||
movw %0,r0
|
||||
mul %A1,%B2
|
||||
|
@ -807,7 +807,7 @@
|
|||
[(set (reg:HI 24) (mult:HI (reg:HI 24) (reg:HI 22)))
|
||||
(clobber (reg:HI 22))
|
||||
(clobber (reg:QI 21))]
|
||||
"!AVR_ENHANCED"
|
||||
"!AVR_HAVE_MUL"
|
||||
"%~call __mulhi3"
|
||||
[(set_attr "type" "xcall")
|
||||
(set_attr "cc" "clobber")])
|
||||
|
@ -821,14 +821,14 @@
|
|||
(clobber (reg:HI 26))
|
||||
(clobber (reg:HI 30))])
|
||||
(set (match_operand:SI 0 "register_operand" "") (reg:SI 22))]
|
||||
"AVR_ENHANCED"
|
||||
"AVR_HAVE_MUL"
|
||||
"")
|
||||
|
||||
(define_insn "*mulsi3_call"
|
||||
[(set (reg:SI 22) (mult:SI (reg:SI 22) (reg:SI 18)))
|
||||
(clobber (reg:HI 26))
|
||||
(clobber (reg:HI 30))]
|
||||
"AVR_ENHANCED"
|
||||
"AVR_HAVE_MUL"
|
||||
"%~call __mulsi3"
|
||||
[(set_attr "type" "xcall")
|
||||
(set_attr "cc" "clobber")])
|
||||
|
@ -2220,7 +2220,7 @@
|
|||
UNSPEC_INDEX_JMP))
|
||||
(use (label_ref (match_operand 1 "" "")))
|
||||
(clobber (match_dup 0))]
|
||||
"AVR_MEGA && AVR_ENHANCED"
|
||||
"AVR_MEGA && AVR_HAVE_LPMX"
|
||||
"lsl r30
|
||||
rol r31
|
||||
lpm __tmp_reg__,Z+
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* -*- Mode: Asm -*- */
|
||||
/* Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1998, 1999, 2000, 2007 Free Software Foundation, Inc.
|
||||
Contributed by Denis Chertykov <denisc@overta.ru>
|
||||
|
||||
This file is free software; you can redistribute it and/or modify it
|
||||
|
@ -56,7 +56,7 @@ Boston, MA 02110-1301, USA. */
|
|||
.endm
|
||||
|
||||
/* Note: mulqi3, mulhi3 are open-coded on the enhanced core. */
|
||||
#if !defined (__AVR_ENHANCED__)
|
||||
#if !defined (__AVR_HAVE_MUL__)
|
||||
/*******************************************************
|
||||
Multiplication 8 x 8
|
||||
*******************************************************/
|
||||
|
@ -159,7 +159,7 @@ __mulhi3_exit:
|
|||
|
||||
.endfunc
|
||||
#endif /* defined (L_mulhi3) */
|
||||
#endif /* !defined (__AVR_ENHANCED__) */
|
||||
#endif /* !defined (__AVR_HAVE_MUL__) */
|
||||
|
||||
#if defined (L_mulhisi3)
|
||||
.global __mulhisi3
|
||||
|
@ -217,7 +217,7 @@ __umulhisi3:
|
|||
.global __mulsi3
|
||||
.func __mulsi3
|
||||
__mulsi3:
|
||||
#if defined (__AVR_ENHANCED__)
|
||||
#if defined (__AVR_HAVE_MUL__)
|
||||
mul r_arg1L, r_arg2L
|
||||
movw r_resL, r0
|
||||
mul r_arg1H, r_arg2H
|
||||
|
@ -281,7 +281,7 @@ __mulsi3_exit:
|
|||
mov_h r_arg1H,r_resH
|
||||
mov_l r_arg1L,r_resL
|
||||
ret
|
||||
#endif /* !defined (__AVR_ENHANCED__) */
|
||||
#endif /* defined (__AVR_HAVE_MUL__) */
|
||||
#undef r_arg1L
|
||||
#undef r_arg1H
|
||||
#undef r_arg1HL
|
||||
|
@ -668,7 +668,7 @@ __tablejump2__:
|
|||
rol r31
|
||||
.global __tablejump__
|
||||
__tablejump__:
|
||||
#if defined (__AVR_ENHANCED__)
|
||||
#if defined (__AVR_HAVE_LPMX__)
|
||||
lpm __tmp_reg__, Z+
|
||||
lpm r31, Z
|
||||
mov r30, __tmp_reg__
|
||||
|
|
Loading…
Reference in New Issue