aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/avr/avr.h
diff options
context:
space:
mode:
authorMarek Michalkiewicz <marekm@linux.org.pl>2000-06-24 20:01:26 +0200
committerDenis Chertykov <denisc@gcc.gnu.org>2000-06-24 22:01:26 +0400
commit78cf8279acfb5c38229579af7d72ce3b9bfc511c (patch)
tree5ac9b8f3997175b76bbf24be11bb1c4e821c878a /gcc/config/avr/avr.h
parentf9f27ee563eb3741820d0fa91196900dd5621108 (diff)
downloadgcc-78cf8279acfb5c38229579af7d72ce3b9bfc511c.zip
gcc-78cf8279acfb5c38229579af7d72ce3b9bfc511c.tar.gz
gcc-78cf8279acfb5c38229579af7d72ce3b9bfc511c.tar.bz2
avr-protos.h (avr_hard_regno_mode_ok): New prototype.
* config/avr/avr-protos.h (avr_hard_regno_mode_ok): New prototype. * config/avr/avr.c (out_adj_frame_ptr, out_set_stack_ptr): New functions, common code moved from function_{prologue,epilogue} and extended to support the -mtiny-stack option. (function_prologue, function_epilogue): Use them. Use lo8/hi8 consistently for asm output readability. (avr_hard_regno_mode_ok): New function. * config/avr/avr.h (TARGET_SWITCHES): Fix typo. Add -mtiny-stack. (UNITS_PER_WORD): Define as 4 (not 1) when compiling libgcc2.c. (HARD_REGNO_MODE_OK): Call the avr_hard_regno_mode_ok function. * config/avr/avr.md (*mov_sp_r): Add support for -mtiny-stack. Write SPH before SPL. (*movqi): No need to disable interrupts for just one "out" in alternative 5. Change length attribute from 4 to 1. * config/avr/libgcc.S (__prologue_saves__, __epilogue_restores__): Write SPH before SPL. From-SVN: r34678
Diffstat (limited to 'gcc/config/avr/avr.h')
-rw-r--r--gcc/config/avr/avr.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/gcc/config/avr/avr.h b/gcc/config/avr/avr.h
index b357af5..0096629 100644
--- a/gcc/config/avr/avr.h
+++ b/gcc/config/avr/avr.h
@@ -52,6 +52,7 @@ extern int target_flags;
#define TARGET_NO_INTERRUPTS (target_flags & 0x20000)
#define TARGET_INSN_SIZE_DUMP (target_flags & 0x2000)
#define TARGET_CALL_PROLOGUES (target_flags & 0x40000)
+#define TARGET_TINY_STACK (target_flags & 0x80000)
/* Dump each assembler insn's rtl into the output file.
This is for debugging the compiler itself. */
@@ -87,7 +88,8 @@ extern int target_flags;
{"int8",0x10000,"Assume int to be 8 bit integer"}, \
{"no-interrupts",0x20000,"Don't output interrupt compatible code"}, \
{"call-prologues",0x40000, \
- "Use subroutines for functions prologeu/epilogue"}, \
+ "Use subroutines for functions prologue/epilogue"}, \
+ {"tiny-stack", 0x80000, "Change only low 8 bits of stack pointer"}, \
{"rtl",0x10, NULL}, \
{"size",0x2000,"Output instruction size's to the asm file"}, \
{"deb",0xfe0, NULL}, \
@@ -194,8 +196,13 @@ extern struct mcu_type_s *avr_mcu_type;
Note that this is not necessarily the width of data type `int'; */
#define BITS_PER_WORD 8
+#ifdef IN_LIBGCC2
+/* This is to get correct SI and DI modes in libgcc2.c (32 and 64 bits). */
+#define UNITS_PER_WORD 4
+#else
/* Width of a word, in units (bytes). */
#define UNITS_PER_WORD 1
+#endif
/* Width in bits of a pointer.
See also the macro `Pmode' defined below. */
@@ -452,9 +459,7 @@ extern struct mcu_type_s *avr_mcu_type;
((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) \
/ UNITS_PER_WORD)) */
-#define HARD_REGNO_MODE_OK(REGNO, MODE) (((REGNO) >= 24 && (MODE) != QImode) \
- ? ! ((REGNO) & 1) \
- : 1)
+#define HARD_REGNO_MODE_OK(REGNO, MODE) avr_hard_regno_mode_ok(REGNO, MODE)
/* A C expression that is nonzero if it is permissible to store a
value of mode MODE in hard register number REGNO (or in several
registers starting with that one). For a machine where all