--- gcc/config/h8300/h8300.h 2018/04/24 18:21:42 1.1.1.3 +++ gcc/config/h8300/h8300.h 2018/04/24 18:29:12 1.1.1.4 @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler. Hitachi H8/300 version generating coff - Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. + Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc. Contributed by Steve Chamberlain (sac@cygnus.com), Jim Wilson (wilson@cygnus.com), and Doug Evans (dje@cygnus.com). @@ -18,7 +18,8 @@ GNU General Public License for more deta You should have received a copy of the GNU General Public License along with GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ /* Which cpu to compile for. We use int for CPU_TYPE to avoid lots of casts. */ @@ -98,8 +99,15 @@ extern int target_flags; {"exp",8192}, \ { "", TARGET_DEFAULT}} +/* Merge the meaning of -mdouble64 and -fshort-double. + ??? Unfortunately, there's no way to detect -fno-short-double + (our default is the opposite of theirs). + Also do other things that must be done once at start up. */ + #define OVERRIDE_OPTIONS \ { \ + /*extern int flag_short_double; \ + flag_short_double = TARGET_DOUBLE32;*/ \ h8300_init_once (); \ } @@ -151,7 +159,7 @@ extern int target_flags; /* Width of a word, in units (bytes). */ #define UNITS_PER_WORD (TARGET_H8300H ? 4 : 2) -#define MAX_UNITS_PER_WORD 4 +#define MIN_UNITS_PER_WORD 2 /* Width in bits of a pointer. See also the macro `Pmode' defined below. */ @@ -245,7 +253,7 @@ extern int target_flags; MODE. H8/300: If an even reg, then anything goes. Otherwise the mode must be QI - or HI. + or HI. H8/300H: Anything goes. */ #define HARD_REGNO_MODE_OK(REGNO, MODE) \ @@ -281,7 +289,7 @@ extern int target_flags; #define ARG_POINTER_REGNUM 8 /* Register in which static-chain is passed to a function. */ -#define STATIC_CHAIN_REGNUM 4 +#define STATIC_CHAIN_REGNUM 3 /* Define the classes of registers for register constraints in the machine description. Also define ranges of constants. @@ -446,13 +454,14 @@ enum reg_class { NO_REGS, LONG_REGS, GE /* Value is the number of bytes of arguments automatically popped when returning from a subroutine call. + FUNDECL is the declaration node of the function (as a tree), FUNTYPE is the data type of the function (as a tree), or for a library call it is an identifier node for the subroutine name. SIZE is the number of bytes of arguments passed on the stack. On the H8 the return does not pop anything. */ -#define RETURN_POPS_ARGS(FUNTYPE,SIZE) 0 +#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) 0 /* Definitions for register eliminations. @@ -657,14 +666,14 @@ extern int current_function_anonymous_ar H8/300 vvvv context - 1 0000 79001234 mov.w #0x1234,r4 - 2 0004 5A000000 jmp @0x1234 + 1 0000 7900xxxx mov.w #0x1234,r3 + 2 0004 5A00xxxx jmp @0x1234 ^^^^ function H8/300H vvvvvvvv context - 2 0000 7A0012345678 mov.l #0x12345678,er4 - 3 0006 5A000000 jmp @0x12345678 + 2 0000 7A00xxxxxxxx mov.l #0x12345678,er3 + 3 0006 5Axxxxxx jmp @0x123456 ^^^^^^ function */ @@ -672,12 +681,12 @@ extern int current_function_anonymous_ar do { \ if (TARGET_H8300) \ { \ - fprintf (FILE, "\tmov.w #0x1234,r4\n"); \ + fprintf (FILE, "\tmov.w #0x1234,r3\n"); \ fprintf (FILE, "\tjmp @0x1234\n"); \ } \ else \ { \ - fprintf (FILE, "\tmov.l #0x12345678,er4\n"); \ + fprintf (FILE, "\tmov.l #0x12345678,er3\n"); \ fprintf (FILE, "\tjmp @0x123456\n"); \ } \ } while (0) @@ -1022,14 +1031,9 @@ dtors_section() \ } \ } \ -#if 0 -#define ASM_OUTPUT_CONSTRUCTOR(FILE, NAME) \ - do { named_section(".init"); fprintf(FILE,"\t.word\t%s\n", NAME); } while (0) -#else #define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \ do { ctors_section(); \ fprintf(FILE, "\t%s\t_%s\n", ASM_WORD_OP, NAME); } while (0) -#endif #define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \ do { dtors_section(); \ @@ -1042,9 +1046,9 @@ dtors_section() \ extern pfunc __ctors[]; \ extern pfunc __ctors_end[]; \ pfunc *p; \ - for (p = __ctors; p < __ctors_end; p++) \ + for (p = __ctors_end; p > __ctors; ) \ { \ - (*p)(); \ + (*--p)(); \ } \ } @@ -1065,25 +1069,33 @@ dtors_section() \ This sequence is indexed by compiler's hard-register-number (see above). */ #define REGISTER_NAMES \ -{ "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "ap"} +{ "r0", "r1", "r2", "r3", "r4", "r5", "r6", "sp", "ap"} + +#define ADDITIONAL_REGISTER_NAMES { { "r7", 7 } } /* How to renumber registers for dbx and gdb. H8/300 needs no change in the numeration. */ #define DBX_REGISTER_NUMBER(REGNO) (REGNO) -/* Vax specific: which type character is used for type double? */ - -#define ASM_DOUBLE_CHAR ('g') - #define SDB_DEBUGGING_INFO #define SDB_DELIM "\n" -/* Assemble generic sections. - This is currently only used to support section attributes. */ +/* Output DBX (stabs) debugging information if doing -gstabs. */ + +#define DBX_DEBUGGING_INFO + +/* Generate SDB debugging information by default. */ + +#define PREFERRED_DEBUGGING_TYPE SDB_DEBUG + +/* A C statement to output something to the assembler file to switch to section + NAME for object DECL which is either a FUNCTION_DECL, a VAR_DECL or + NULL_TREE. Some target formats do not support arbitrary sections. Do not + define this macro in such cases. */ -#define ASM_OUTPUT_SECTION_NAME(FILE, NAME) \ - fprintf (FILE, ".section\t%s\n", NAME) +#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME) \ + fprintf (FILE, "\t.section %s\n", NAME) /* This is how to output the definition of a user-level label named NAME, such as the label on a static function or variable NAME. */ @@ -1190,7 +1202,7 @@ do { char dstr[30]; \ #define ASM_OUTPUT_ALIGN(FILE,LOG) \ if ((LOG) != 0) \ - fprintf (FILE, "\t.align %d\n", 1 << (LOG)) + fprintf (FILE, "\t.align %d\n", (LOG)) /* This is how to output an assembler line that says to advance the location counter by SIZE bytes. */