aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2005-06-08 19:23:07 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2005-06-08 19:23:07 +0000
commit2a76106fae4d38b698490cf451deb1e7cbd1ceae (patch)
treeb176ccf80d5227f85de3efbbad732274e5b8ccd1 /gcc/config
parentec722c30b1eaeca10b587bb3972ce0f3d25db37d (diff)
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100774 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/ia64/ia64-protos.h1
-rw-r--r--gcc/config/ia64/ia64.c27
-rw-r--r--gcc/config/ia64/ia64.h20
3 files changed, 30 insertions, 18 deletions
diff --git a/gcc/config/ia64/ia64-protos.h b/gcc/config/ia64/ia64-protos.h
index 31b854ce475..7b097bf56c4 100644
--- a/gcc/config/ia64/ia64-protos.h
+++ b/gcc/config/ia64/ia64-protos.h
@@ -113,3 +113,4 @@ extern enum direction ia64_hpux_function_arg_padding (enum machine_mode, tree);
#endif /* ARGS_SIZE_RTX */
extern void ia64_hpux_handle_builtin_pragma (struct cpp_reader *);
+extern void ia64_output_function_profiler (FILE *, int);
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index d175a842ae6..5297f5efe79 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -8551,4 +8551,31 @@ ia64_vector_mode_supported_p (enum machine_mode mode)
}
}
+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"
diff --git a/gcc/config/ia64/ia64.h b/gcc/config/ia64/ia64.h
index 3bef0d3a937..b9b431a8c4f 100644
--- a/gcc/config/ia64/ia64.h
+++ b/gcc/config/ia64/ia64.h
@@ -1265,24 +1265,8 @@ do { \
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)
/* Trampolines for Nested Functions. */