Commit 5dc77808 by Anatoly Sokolov Committed by Anatoly Sokolov

avr.h (avr_mega_p): Remove declaration.

	* config/avr/avr.h (avr_mega_p): Remove declaration.
	(AVR_MEGA): Remove macro.
	* config/avr/avr.c (avr_mega_p): Remove variable.
	(avr_override_options): Remove inicializion of avr_mega_p.
	Use AVR_HAVE_JMP_CALL instead of AVR_MEGA.
	(print_operand): Use AVR_HAVE_JMP_CALL instead of AVR_MEGA.
	(avr_jump_mode): (Ditto.).
	(avr_output_progmem_section_asm_op): (Ditto.).
	(avr_asm_init_sections): (Ditto.).
	(avr_asm_init_sections): (Ditto.).
	(avr_rtx_costs): (Ditto.).
	* config/avr/avr.md: (Ditto.).
	* config/avr/avr.h: Use '__AVR_HAVE_JMP_CALL__' instead of 
	'__AVR_MEGA__'.

From-SVN: r133966
parent 679d9637
2008-04-06 Anatoly Sokolov <aesok@post.ru>
* config/avr/avr.h (avr_mega_p): Remove declaration.
(AVR_MEGA): Remove macro.
* config/avr/avr.c (avr_mega_p): Remove variable.
(avr_override_options): Remove inicializion of avr_mega_p.
Use AVR_HAVE_JMP_CALL instead of AVR_MEGA.
(print_operand): Use AVR_HAVE_JMP_CALL instead of AVR_MEGA.
(avr_jump_mode): (Ditto.).
(avr_output_progmem_section_asm_op): (Ditto.).
(avr_asm_init_sections): (Ditto.).
(avr_asm_init_sections): (Ditto.).
(avr_rtx_costs): (Ditto.).
* config/avr/avr.md: (Ditto.).
* config/avr/avr.h: Use '__AVR_HAVE_JMP_CALL__' instead of
'__AVR_MEGA__'.
2008-04-06 Richard Guenther <rguenther@suse.de> 2008-04-06 Richard Guenther <rguenther@suse.de>
PR tree-optimization/35842 PR tree-optimization/35842
......
...@@ -105,9 +105,6 @@ const struct base_arch_s *avr_current_arch; ...@@ -105,9 +105,6 @@ const struct base_arch_s *avr_current_arch;
section *progmem_section; section *progmem_section;
/* More than 8K of program memory: use "call" and "jmp". */
int avr_mega_p = 0;
/* Core have 'MUL*' instructions. */ /* Core have 'MUL*' instructions. */
int avr_have_mul_p = 0; int avr_have_mul_p = 0;
...@@ -360,13 +357,13 @@ avr_override_options (void) ...@@ -360,13 +357,13 @@ avr_override_options (void)
base = &avr_arch_types[t->arch]; base = &avr_arch_types[t->arch];
avr_asm_only_p = base->asm_only; avr_asm_only_p = base->asm_only;
avr_have_mul_p = base->have_mul; avr_have_mul_p = base->have_mul;
avr_mega_p = base->have_jmp_call;
avr_have_movw_lpmx_p = base->have_movw_lpmx; avr_have_movw_lpmx_p = base->have_movw_lpmx;
avr_base_arch_macro = base->macro; avr_base_arch_macro = base->macro;
avr_extra_arch_macro = t->macro; avr_extra_arch_macro = t->macro;
if (optimize && !TARGET_NO_TABLEJUMP) if (optimize && !TARGET_NO_TABLEJUMP)
avr_case_values_threshold = (!AVR_MEGA || TARGET_CALL_PROLOGUES) ? 8 : 17; avr_case_values_threshold =
(!AVR_HAVE_JMP_CALL || TARGET_CALL_PROLOGUES) ? 8 : 17;
tmp_reg_rtx = gen_rtx_REG (QImode, TMP_REGNO); tmp_reg_rtx = gen_rtx_REG (QImode, TMP_REGNO);
zero_reg_rtx = gen_rtx_REG (QImode, ZERO_REGNO); zero_reg_rtx = gen_rtx_REG (QImode, ZERO_REGNO);
...@@ -1148,7 +1145,7 @@ print_operand (FILE *file, rtx x, int code) ...@@ -1148,7 +1145,7 @@ print_operand (FILE *file, rtx x, int code)
if (code == '~') if (code == '~')
{ {
if (!AVR_MEGA) if (!AVR_HAVE_JMP_CALL)
fputc ('r', file); fputc ('r', file);
} }
else if (code == '!') else if (code == '!')
...@@ -1323,7 +1320,7 @@ avr_jump_mode (rtx x, rtx insn) ...@@ -1323,7 +1320,7 @@ avr_jump_mode (rtx x, rtx insn)
return 1; return 1;
else if (-2046 <= jump_distance && jump_distance <= 2045) else if (-2046 <= jump_distance && jump_distance <= 2045)
return 2; return 2;
else if (AVR_MEGA) else if (AVR_HAVE_JMP_CALL)
return 3; return 3;
return 2; return 2;
...@@ -4773,7 +4770,7 @@ avr_output_progmem_section_asm_op (const void *arg ATTRIBUTE_UNUSED) ...@@ -4773,7 +4770,7 @@ avr_output_progmem_section_asm_op (const void *arg ATTRIBUTE_UNUSED)
{ {
fprintf (asm_out_file, fprintf (asm_out_file,
"\t.section .progmem.gcc_sw_table, \"%s\", @progbits\n", "\t.section .progmem.gcc_sw_table, \"%s\", @progbits\n",
AVR_MEGA ? "a" : "ax"); AVR_HAVE_JMP_CALL ? "a" : "ax");
/* Should already be aligned, this is just to be safe if it isn't. */ /* Should already be aligned, this is just to be safe if it isn't. */
fprintf (asm_out_file, "\t.p2align 1\n"); fprintf (asm_out_file, "\t.p2align 1\n");
} }
...@@ -4783,7 +4780,7 @@ avr_output_progmem_section_asm_op (const void *arg ATTRIBUTE_UNUSED) ...@@ -4783,7 +4780,7 @@ avr_output_progmem_section_asm_op (const void *arg ATTRIBUTE_UNUSED)
static void static void
avr_asm_init_sections (void) avr_asm_init_sections (void)
{ {
progmem_section = get_unnamed_section (AVR_MEGA ? 0 : SECTION_CODE, progmem_section = get_unnamed_section (AVR_HAVE_JMP_CALL ? 0 : SECTION_CODE,
avr_output_progmem_section_asm_op, avr_output_progmem_section_asm_op,
NULL); NULL);
readonly_data_section = data_section; readonly_data_section = data_section;
...@@ -5068,7 +5065,7 @@ avr_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED, int *total) ...@@ -5068,7 +5065,7 @@ avr_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED, int *total)
if (AVR_HAVE_MUL) if (AVR_HAVE_MUL)
*total = COSTS_N_INSNS (optimize_size ? 3 : 4); *total = COSTS_N_INSNS (optimize_size ? 3 : 4);
else if (optimize_size) else if (optimize_size)
*total = COSTS_N_INSNS (AVR_MEGA ? 2 : 1); *total = COSTS_N_INSNS (AVR_HAVE_JMP_CALL ? 2 : 1);
else else
return false; return false;
break; break;
...@@ -5077,7 +5074,7 @@ avr_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED, int *total) ...@@ -5077,7 +5074,7 @@ avr_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED, int *total)
if (AVR_HAVE_MUL) if (AVR_HAVE_MUL)
*total = COSTS_N_INSNS (optimize_size ? 7 : 10); *total = COSTS_N_INSNS (optimize_size ? 7 : 10);
else if (optimize_size) else if (optimize_size)
*total = COSTS_N_INSNS (AVR_MEGA ? 2 : 1); *total = COSTS_N_INSNS (AVR_HAVE_JMP_CALL ? 2 : 1);
else else
return false; return false;
break; break;
...@@ -5094,7 +5091,7 @@ avr_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED, int *total) ...@@ -5094,7 +5091,7 @@ avr_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED, int *total)
case UDIV: case UDIV:
case UMOD: case UMOD:
if (optimize_size) if (optimize_size)
*total = COSTS_N_INSNS (AVR_MEGA ? 2 : 1); *total = COSTS_N_INSNS (AVR_HAVE_JMP_CALL ? 2 : 1);
else else
return false; return false;
*total += avr_operand_rtx_cost (XEXP (x, 0), mode, code); *total += avr_operand_rtx_cost (XEXP (x, 0), mode, code);
......
...@@ -96,7 +96,6 @@ extern const struct base_arch_s *avr_current_arch; ...@@ -96,7 +96,6 @@ extern const struct base_arch_s *avr_current_arch;
extern const char *avr_base_arch_macro; extern const char *avr_base_arch_macro;
extern const char *avr_extra_arch_macro; extern const char *avr_extra_arch_macro;
extern int avr_mega_p;
extern int avr_have_mul_p; extern int avr_have_mul_p;
extern int avr_asm_only_p; extern int avr_asm_only_p;
extern int avr_have_movw_lpmx_p; extern int avr_have_movw_lpmx_p;
...@@ -104,7 +103,6 @@ extern int avr_have_movw_lpmx_p; ...@@ -104,7 +103,6 @@ extern int avr_have_movw_lpmx_p;
extern GTY(()) section *progmem_section; extern GTY(()) section *progmem_section;
#endif #endif
#define AVR_MEGA (avr_mega_p && !TARGET_SHORT_CALLS)
#define AVR_HAVE_JMP_CALL (avr_current_arch->have_jmp_call && !TARGET_SHORT_CALLS) #define AVR_HAVE_JMP_CALL (avr_current_arch->have_jmp_call && !TARGET_SHORT_CALLS)
#define AVR_HAVE_MUL (avr_have_mul_p) #define AVR_HAVE_MUL (avr_have_mul_p)
#define AVR_HAVE_MOVW (avr_have_movw_lpmx_p) #define AVR_HAVE_MOVW (avr_have_movw_lpmx_p)
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
;; o Displacement for (mem (plus (reg) (const_int))) operands. ;; o Displacement for (mem (plus (reg) (const_int))) operands.
;; p POST_INC or PRE_DEC address as a pointer (X, Y, Z) ;; p POST_INC or PRE_DEC address as a pointer (X, Y, Z)
;; r POST_INC or PRE_DEC address as a register (r26, r28, r30) ;; r POST_INC or PRE_DEC address as a register (r26, r28, r30)
;; ~ Output 'r' if not AVR_MEGA. ;; ~ Output 'r' if not AVR_HAVE_JMP_CALL.
;; ! Output 'e' if AVR_HAVE_EIJMP_EICALL. ;; ! Output 'e' if AVR_HAVE_EIJMP_EICALL.
;; UNSPEC usage: ;; UNSPEC usage:
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
(const_string "no")))) (const_string "no"))))
(define_attr "mcu_mega" "yes,no" (define_attr "mcu_mega" "yes,no"
(const (if_then_else (symbol_ref "AVR_MEGA") (const (if_then_else (symbol_ref "AVR_HAVE_JMP_CALL")
(const_string "yes") (const_string "yes")
(const_string "no")))) (const_string "no"))))
...@@ -2260,7 +2260,7 @@ ...@@ -2260,7 +2260,7 @@
(label_ref (match_operand 0 "" "")))] (label_ref (match_operand 0 "" "")))]
"" ""
"*{ "*{
if (AVR_MEGA && get_attr_length (insn) != 1) if (AVR_HAVE_JMP_CALL && get_attr_length (insn) != 1)
return AS1 (jmp,%0); return AS1 (jmp,%0);
return AS1 (rjmp,%0); return AS1 (rjmp,%0);
}" }"
...@@ -2412,7 +2412,7 @@ ...@@ -2412,7 +2412,7 @@
UNSPEC_INDEX_JMP)) UNSPEC_INDEX_JMP))
(use (label_ref (match_operand 1 "" ""))) (use (label_ref (match_operand 1 "" "")))
(clobber (match_dup 0))] (clobber (match_dup 0))]
"AVR_MEGA && TARGET_CALL_PROLOGUES" "AVR_HAVE_JMP_CALL && TARGET_CALL_PROLOGUES"
"jmp __tablejump2__" "jmp __tablejump2__"
[(set_attr "length" "2") [(set_attr "length" "2")
(set_attr "cc" "clobber")]) (set_attr "cc" "clobber")])
...@@ -2422,7 +2422,7 @@ ...@@ -2422,7 +2422,7 @@
UNSPEC_INDEX_JMP)) UNSPEC_INDEX_JMP))
(use (label_ref (match_operand 1 "" ""))) (use (label_ref (match_operand 1 "" "")))
(clobber (match_dup 0))] (clobber (match_dup 0))]
"AVR_MEGA && AVR_HAVE_LPMX" "AVR_HAVE_JMP_CALL && AVR_HAVE_LPMX"
"lsl r30 "lsl r30
rol r31 rol r31
lpm __tmp_reg__,Z+ lpm __tmp_reg__,Z+
......
...@@ -784,7 +784,7 @@ __do_clear_bss: ...@@ -784,7 +784,7 @@ __do_clear_bss:
/* __do_global_ctors and __do_global_dtors are only necessary /* __do_global_ctors and __do_global_dtors are only necessary
if there are any constructors/destructors. */ if there are any constructors/destructors. */
#if defined (__AVR_MEGA__) #if defined (__AVR_HAVE_JMP_CALL__)
#define XCALL call #define XCALL call
#else #else
#define XCALL rcall #define XCALL rcall
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment