Commit 191fe2bb by Jason Thorpe Committed by Jason Thorpe

vax.c (vax_output_function_prologue): Use asm_fprintf.

* config/vax/vax.c (vax_output_function_prologue): Use asm_fprintf.
* config/vax/vax.h (VAX_FUNCTION_PROFILER_NAME): New.
(FUNCTION_PROFILER): Rewrite to use ASM_GENERATE_INTERNAL_LABEL,
assemble_name, asm_fprintf, and VAX_FUNCTION_PROFILER_NAME.
(ASM_OUTPUT_MI_THUNK): Use asm_fprintf instead of REGISTER_PREFIX.
(PRINT_OPERAND_PUNCT_VALID_P): Fix comment.
* config/vax/elf.h (FUNCTION_PROFILER): Remove.
(VAX_FUNCTION_PROFILER_NAME): Redefine as "__mcount".

From-SVN: r57801
parent bd9bb3d2
2002-10-03 Jason Thorpe <thorpej@wasabisystems.com>
* config/vax/vax.c (vax_output_function_prologue): Use asm_fprintf.
* config/vax/vax.h (VAX_FUNCTION_PROFILER_NAME): New.
(FUNCTION_PROFILER): Rewrite to use ASM_GENERATE_INTERNAL_LABEL,
assemble_name, asm_fprintf, and VAX_FUNCTION_PROFILER_NAME.
(ASM_OUTPUT_MI_THUNK): Use asm_fprintf instead of REGISTER_PREFIX.
(PRINT_OPERAND_PUNCT_VALID_P): Fix comment.
* config/vax/elf.h (FUNCTION_PROFILER): Remove.
(VAX_FUNCTION_PROFILER_NAME): Redefine as "__mcount".
2002-10-03 Mark Mitchell <mark@codesourcery.com>
* doc/invoke.texi (-Wabi): Document mangling bug.
......
......@@ -33,11 +33,9 @@ Boston, MA 02111-1307, USA. */
#define PTRDIFF_TYPE "long int"
/* Profiling routine. */
#undef FUNCTION_PROFILER
#define FUNCTION_PROFILER(FILE, LABELNO) \
fprintf (FILE, "\tmovab .LP%d,%sr0\n\tjsb __mcount\n", (LABELNO), \
REGISTER_PREFIX)
#undef VAX_FUNCTION_PROFILER_NAME
#define VAX_FUNCTION_PROFILER_NAME "__mcount"
/* Let's be re-entrant. */
#undef PCC_STATIC_STRUCT_RETURN
......
......@@ -127,16 +127,14 @@ vax_output_function_prologue (file, size)
will end up adding them right back again, but don't bother. */
if (MAIN_NAME_P (DECL_NAME (current_function_decl)))
fprintf (file, "\tclrl -(%ssp)\n\tjsb _C$MAIN_ARGS\n",
REGISTER_PREFIX);
asm_fprintf (file, "\tclrl -(%Rsp)\n\tjsb _C$MAIN_ARGS\n");
}
size -= STARTING_FRAME_OFFSET;
if (size >= 64)
fprintf (file, "\tmovab %d(%ssp),%ssp\n", -size, REGISTER_PREFIX,
REGISTER_PREFIX);
asm_fprintf (file, "\tmovab %d(%Rsp),%Rsp\n", -size);
else if (size)
fprintf (file, "\tsubl2 $%d,%ssp\n", size, REGISTER_PREFIX);
asm_fprintf (file, "\tsubl2 $%d,%Rsp\n", size);
}
/* This is like nonimmediate_operand with a restriction on the type of MEM. */
......
......@@ -470,9 +470,18 @@ enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES };
/* Output assembler code to FILE to increment profiler label # LABELNO
for profiling a function entry. */
#define FUNCTION_PROFILER(FILE, LABELNO) \
fprintf (FILE, "\tmovab LP%d,%s\n\tjsb mcount\n", (LABELNO), \
reg_names[0]);
#define VAX_FUNCTION_PROFILER_NAME "mcount"
#define FUNCTION_PROFILER(FILE, LABELNO) \
do \
{ \
char label[256]; \
ASM_GENERATE_INTERNAL_LABEL (label, "LP", (LABELNO)); \
fprintf (FILE, "\tmovab "); \
assemble_name (FILE, label); \
asm_fprintf (FILE, ",%Rr0\n\tjsb %s\n", \
VAX_FUNCTION_PROFILER_NAME); \
} \
while (0)
/* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
the stack pointer does not matter. The value is tested only in
......@@ -1155,7 +1164,7 @@ enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES };
#define ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) \
do { \
fprintf (FILE, "\t.word 0x0ffc\n"); \
fprintf (FILE, "\taddl2 $%d,4(%sap)\n", DELTA, REGISTER_PREFIX); \
asm_fprintf (FILE, "\taddl2 $%d,4(%Rap)\n", DELTA); \
fprintf (FILE, "\tjmp "); \
assemble_name (FILE, XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0)); \
fprintf (FILE, "+2\n"); \
......@@ -1178,7 +1187,8 @@ VAX operand formatting codes:
R 32 - constant operand
b the low 8 bits of a negated constant operand
h the low 16 bits of a negated constant operand
# 'd' or 'g' depending on whether dfloat or gfloat is used */
# 'd' or 'g' depending on whether dfloat or gfloat is used
| register prefix */
/* The purpose of D is to get around a quirk or bug in VAX assembler
whereby -1 in a 64-bit immediate operand means 0x00000000ffffffff,
......
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