vax.c (vax_output_function_prologue): Use REGISTER_PREFIX.

2002-06-21  Matt Thomas  <matt@3am-software.com>

* config/vax/vax.c (vax_output_function_prologue): Use
REGISTER_PREFIX.  Fix some indentation.
* config/vax/vax.h (FUNCTION_PROFILER): Use reg_names[].
(VAX_ISTREAM_SYNC): Define.
(INITIALIZE_TRAMPOLINE): Use VAX_ISTREAM_SYNC.  Move the
i-stream sync to the end.
(REGISTER_PREFIX): Define as "".
(ASM_OUTPUT_MI_THUNK): Use REGISTER_PREFIX.

From-SVN: r54894
This commit is contained in:
Matt Thomas 2002-06-21 23:58:47 +00:00 committed by Jason Thorpe
parent 1c655a0dcc
commit 2336109344
3 changed files with 36 additions and 18 deletions

View File

@ -1,3 +1,14 @@
2002-06-21 Matt Thomas <matt@3am-software.com>
* config/vax/vax.c (vax_output_function_prologue): Use
REGISTER_PREFIX. Fix some indentation.
* config/vax/vax.h (FUNCTION_PROFILER): Use reg_names[].
(VAX_ISTREAM_SYNC): Define.
(INITIALIZE_TRAMPOLINE): Use VAX_ISTREAM_SYNC. Move the
i-stream sync to the end.
(REGISTER_PREFIX): Define as "".
(ASM_OUTPUT_MI_THUNK): Use REGISTER_PREFIX.
2002-06-21 Jason Thorpe <thorpej@wasabisystems.com> 2002-06-21 Jason Thorpe <thorpej@wasabisystems.com>
* config.gcc (ns32k-*-netbsd*): Remove from list of obsolete * config.gcc (ns32k-*-netbsd*): Remove from list of obsolete

View File

@ -120,14 +120,16 @@ vax_output_function_prologue (file, size)
} }
if (is_main) if (is_main)
fprintf (file, "\t%s\n\t%s\n", "clrl -(sp)", "jsb _C$MAIN_ARGS"); fprintf (file, "\tclrl -(%ssp)\n\tjsb _C$MAIN_ARGS\n",
REGISTER_PREFIX);
} }
size -= STARTING_FRAME_OFFSET; size -= STARTING_FRAME_OFFSET;
if (size >= 64) if (size >= 64)
fprintf (file, "\tmovab %d(sp),sp\n", -size); fprintf (file, "\tmovab %d(%ssp),%ssp\n", -size, REGISTER_PREFIX,
else if (size) REGISTER_PREFIX);
fprintf (file, "\tsubl2 $%d,sp\n", size); else if (size)
fprintf (file, "\tsubl2 $%d,%ssp\n", size, REGISTER_PREFIX);
} }
/* This is like nonimmediate_operand with a restriction on the type of MEM. */ /* This is like nonimmediate_operand with a restriction on the type of MEM. */

View File

@ -456,7 +456,8 @@ enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES };
for profiling a function entry. */ for profiling a function entry. */
#define FUNCTION_PROFILER(FILE, LABELNO) \ #define FUNCTION_PROFILER(FILE, LABELNO) \
fprintf (FILE, "\tmovab LP%d,r0\n\tjsb mcount\n", (LABELNO)); fprintf (FILE, "\tmovab LP%d,%s\n\tjsb mcount\n", (LABELNO), \
reg_names[0]);
/* EXIT_IGNORE_STACK should be nonzero if, when returning from a function, /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
the stack pointer does not matter. The value is tested only in the stack pointer does not matter. The value is tested only in
@ -501,17 +502,19 @@ enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES };
FNADDR is an RTX for the address of the function's pure code. FNADDR is an RTX for the address of the function's pure code.
CXT is an RTX for the static chain value for the function. */ CXT is an RTX for the static chain value for the function. */
/* Allow this be overriden with the correct register prefixes. */
#define VAX_ISTREAM_SYNC "movpsl -(sp)\n\tpushal 1(pc)\n\trei"
/* We copy the register-mask from the function's pure code /* We copy the register-mask from the function's pure code
to the start of the trampoline. */ to the start of the trampoline. */
#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \ #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
{ \ { \
emit_insn (gen_rtx_ASM_INPUT (VOIDmode, \
"movpsl -(sp)\n\tpushal 1(pc)\n\trei")); \
emit_move_insn (gen_rtx_MEM (HImode, TRAMP), \ emit_move_insn (gen_rtx_MEM (HImode, TRAMP), \
gen_rtx_MEM (HImode, FNADDR)); \ gen_rtx_MEM (HImode, FNADDR)); \
emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 4)), CXT);\ emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 4)), CXT); \
emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 11)), \ emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 11)), \
plus_constant (FNADDR, 2)); \ plus_constant (FNADDR, 2)); \
emit_insn (gen_rtx_ASM_INPUT (VOIDmode, VAX_ISTREAM_SYNC)); \
} }
/* Byte offset of return address in a stack frame. The "saved PC" field /* Byte offset of return address in a stack frame. The "saved PC" field
@ -1015,8 +1018,10 @@ enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES };
#define DATA_SECTION_ASM_OP "\t.data" #define DATA_SECTION_ASM_OP "\t.data"
/* How to refer to registers in assembler output. /* How to refer to registers in assembler output.
This sequence is indexed by compiler's hard-register-number (see above). */ This sequence is indexed by compiler's hard-register-number (see above).
The register names will be prefixed by REGISTER_PREFIX, if any. */
#define REGISTER_PREFIX ""
#define REGISTER_NAMES \ #define REGISTER_NAMES \
{"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", \ {"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", \
"r9", "r10", "r11", "ap", "fp", "sp", "pc"} "r9", "r10", "r11", "ap", "fp", "sp", "pc"}
@ -1143,13 +1148,13 @@ enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES };
addl2 $DELTA, 4(ap) #adjust first argument addl2 $DELTA, 4(ap) #adjust first argument
jmp FUNCTION+2 #jump beyond FUNCTION's entry mask jmp FUNCTION+2 #jump beyond FUNCTION's entry mask
*/ */
#define ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) \ #define ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) \
do { \ do { \
fprintf (FILE, "\t.word 0x0ffc\n"); \ fprintf (FILE, "\t.word 0x0ffc\n"); \
fprintf (FILE, "\taddl2 $%d,4(ap)\n", DELTA); \ fprintf (FILE, "\taddl2 $%d,4(%sap)\n", DELTA, REGISTER_PREFIX); \
fprintf (FILE, "\tjmp "); \ fprintf (FILE, "\tjmp "); \
assemble_name (FILE, XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0)); \ assemble_name (FILE, XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0)); \
fprintf (FILE, "+2\n"); \ fprintf (FILE, "+2\n"); \
} while (0) } while (0)
/* Print an instruction operand X on file FILE. /* Print an instruction operand X on file FILE.