--- gcc/config/m68ksgs.h 2018/04/24 17:54:28 1.1.1.2 +++ gcc/config/m68ksgs.h 2018/04/24 18:05:10 1.1.1.4 @@ -38,6 +38,7 @@ the Free Software Foundation, 675 Mass A #define LONG_ASM_OP ".long" #define SPACE_ASM_OP ".space" #define ALIGN_ASM_OP ".align" +#undef GLOBAL_ASM_OP #define GLOBAL_ASM_OP ".global" #define SWBEG_ASM_OP ".swbeg" #define SET_ASM_OP ".set" @@ -199,16 +200,14 @@ do { union { float f; long l;} tem; \ #undef TARGET_VERSION #define TARGET_VERSION fprintf (stderr, " (68k, SGS/AT&T syntax)"); -/* This is how to output a command to make the user-level label named NAME - defined for reference from other files. */ - -#undef ASM_GLOBALIZE_LABEL -#define ASM_GLOBALIZE_LABEL(FILE,NAME) \ - do { \ - fprintf ((FILE), "\t%s ", GLOBAL_ASM_OP); \ - assemble_name ((FILE), NAME); \ - fputs ("\n", FILE); \ - } while (0) +/* Use proper assembler syntax for these macros. */ +#undef ASM_OUTPUT_REG_PUSH +#define ASM_OUTPUT_REG_PUSH(FILE,REGNO) \ + asm_fprintf (FILE, "\t%Omove.l %s,-(%Rsp)\n", reg_names[REGNO]) + +#undef ASM_OUTPUT_REG_POP +#define ASM_OUTPUT_REG_POP(FILE,REGNO) \ + asm_fprintf (FILE, "\t%Omove.l (%Rsp)+,%s\n", reg_names[REGNO]) #undef PRINT_OPERAND_PRINT_FLOAT #define PRINT_OPERAND_PRINT_FLOAT(CODE,FILE) \ @@ -216,7 +215,9 @@ do { union { float f; long l;} tem; \ #undef ASM_OUTPUT_DOUBLE_OPERAND #define ASM_OUTPUT_DOUBLE_OPERAND(FILE,VALUE) \ - asm_fprintf ((FILE),"%I0x%x%08x", u.i[0], u.i[1]); + do { union real_extract u; \ + u.d = (VALUE); \ + asm_fprintf ((FILE),"%I0x%x%08x", u.i[0], u.i[1]); } while (0) /* How to output a block of SIZE zero bytes. Note that the `space' pseudo, when used in the text segment, causes SGS assemblers to output nop insns @@ -386,23 +387,31 @@ do { union { float f; long l;} tem; \ size to be inserted into the object code so that disassemblers, for example, can identify that it is the start of a switch table. */ +#define ASM_OUTPUT_BEFORE_CASE_LABEL(FILE,PREFIX,NUM,TABLE) \ + fprintf ((FILE), "\t%s &%d\n", SWBEG_ASM_OP, XVECLEN (PATTERN (TABLE), 1)); + #define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,TABLE) \ - fprintf ((FILE), "\t%s &%d\n", SWBEG_ASM_OP, XVECLEN (PATTERN (TABLE), 1)); \ - ASM_OUTPUT_INTERNAL_LABEL((FILE),(PREFIX),(NUM)); + do { \ + ASM_OUTPUT_BEFORE_CASE_LABEL((FILE),(PREFIX),(NUM),(TABLE)); \ + ASM_OUTPUT_INTERNAL_LABEL((FILE),(PREFIX),(NUM)); \ + } while (0) /* At end of a switch table, define LDnnn iff the symbol LInnn was defined. Some SGS assemblers have a bug such that "Lnnn-LInnn-2.b(pc,d0.l*2)" - fails to assemble. Luckily "Lnnn(pc,d0.l*2)" produces the results - we want. This difference can be accommodated by using an assembler + fails to assemble. Luckily "LDnnn(pc,d0.l*2)" produces the results + we want. This difference can be accommodated by making the assembler define such "LDnnn" to be either "Lnnn-LInnn-2.b", "Lnnn", or any other string, as necessary. This is accomplished via the ASM_OUTPUT_CASE_END macro. */ #undef ASM_OUTPUT_CASE_END #define ASM_OUTPUT_CASE_END(FILE,NUM,TABLE) \ - if (RTX_INTEGRATED_P (TABLE)) \ +{ if (switch_table_difference_label_flag) \ asm_fprintf (FILE, "\t%s %LLD%d,%LL%d-%LLI%d-2.b\n",\ - SET_ASM_OP, (NUM), (NUM), (NUM)) + SET_ASM_OP, (NUM), (NUM), (NUM)) \ + switch_table_difference_label_flag = 0; } + +int switch_table_difference_label_flag; /* This is how to output an element of a case-vector that is relative. */