* config/ia64/ia64.h (FUNCTION_PROFILER): Move implementation ...
* config/ia64/ia64.c (ia64_output_function_profiler): ... here; add
unwind markup.
* config/ia64/ia64-protos.h (ia64_output_function_profiler): Declare.
From-SVN: r100774
+2005-06-08 Richard Henderson <rth@redhat.com>
+
+ * config/ia64/ia64.h (FUNCTION_PROFILER): Move implementation ...
+ * config/ia64/ia64.c (ia64_output_function_profiler): ... here; add
+ unwind markup.
+ * config/ia64/ia64-protos.h (ia64_output_function_profiler): Declare.
+
2005-06-08 Joseph S. Myers <joseph@codesourcery.com>
* config/sol2-c.c (cmn_err_char_table): Allow width for %b
#endif /* ARGS_SIZE_RTX */
extern void ia64_hpux_handle_builtin_pragma (struct cpp_reader *);
+extern void ia64_output_function_profiler (FILE *, int);
}
}
+void
+ia64_output_function_profiler (FILE *file, int labelno)
+{
+ char buf[20];
+ ASM_GENERATE_INTERNAL_LABEL (buf, "LP", labelno);
+
+ if (TARGET_GNU_AS)
+ fputs ("\t.prologue 4, r40\n", file);
+ else
+ fputs ("\t.prologue\n\t.save ar.pfs, r40\n", file);
+ fputs ("\talloc out0 = ar.pfs, 8, 0, 4, 0\n", file);
+ fputs ("\t.save rp, r42\n", file);
+ fputs ("\tmov out2 = b0\n\t;;\n", file);
+ fputs ("\t.body\n", file);
+ if (TARGET_AUTO_PIC)
+ fputs ("\tmovl out3 = @gprel(", file);
+ else
+ fputs ("\taddl out3 = @ltoff(", file);
+ assemble_name (file, buf);
+ if (TARGET_AUTO_PIC)
+ fputs (")\n", file);
+ else
+ fputs ("), r1\n", file);
+ fputs ("\tmov out1 = r1\n", file);
+ fputs ("\tbr.call.sptk.many b0 = _mcount\n\t;;\n", file);
+}
+
#include "gt-ia64.h"
call the profiling subroutine `mcount'. */
#undef FUNCTION_PROFILER
-#define FUNCTION_PROFILER(FILE, LABELNO) \
-do { \
- char buf[20]; \
- ASM_GENERATE_INTERNAL_LABEL (buf, "LP", LABELNO); \
- fputs ("\talloc out0 = ar.pfs, 8, 0, 4, 0\n", FILE); \
- if (TARGET_AUTO_PIC) \
- fputs ("\tmovl out3 = @gprel(", FILE); \
- else \
- fputs ("\taddl out3 = @ltoff(", FILE); \
- assemble_name (FILE, buf); \
- if (TARGET_AUTO_PIC) \
- fputs (");;\n", FILE); \
- else \
- fputs ("), r1;;\n", FILE); \
- fputs ("\tmov out1 = r1\n", FILE); \
- fputs ("\tmov out2 = b0\n", FILE); \
- fputs ("\tbr.call.sptk.many b0 = _mcount;;\n", FILE); \
-} while (0)
+#define FUNCTION_PROFILER(FILE, LABELNO) \
+ ia64_output_function_profiler(FILE, LABELNO)
\f
/* Trampolines for Nested Functions. */