summaryrefslogtreecommitdiffstats
path: root/gcc/config/rs6000/rs6000.c
diff options
context:
space:
mode:
authoramodra <amodra@138bc75d-0d04-0410-961f-82ee72b054a4>2003-03-18 02:28:46 +0000
committeramodra <amodra@138bc75d-0d04-0410-961f-82ee72b054a4>2003-03-18 02:28:46 +0000
commit3c6669f7c86e13b29f9bd7583a1af4ca65b7263c (patch)
treef6c20c7ef890974dd12683dcabb182145fb1a63b /gcc/config/rs6000/rs6000.c
parente33ecec345318b3d3d39d8c88f90ff303e9fa8b9 (diff)
downloadppe42-gcc-3c6669f7c86e13b29f9bd7583a1af4ca65b7263c.tar.gz
ppe42-gcc-3c6669f7c86e13b29f9bd7583a1af4ca65b7263c.zip
* config/rs6000/linux64.h (MASK_PROFILE_KERNEL): Define.
(TARGET_PROFILE_KERNEL): Define. (SUBTARGET_SWITCHES): Handle -mprofile-kernel. (PROFILE_BEFORE_PROLOGUE): Don't define. (PROFILE_KERNEL): Remove hacks. * config/rs6000/rs6000.c (TARGET_PROFILE_KERNEL): Define default. (rs6000_stack_info): No need to save lr if just for profiling when TARGET_KERNEL_PROFILE. (output_profile_hook): Output nothing when TARGET_KERNEL_PROFILE. (output_function_profiler): Localize label generation. Emit code for kernel profiling. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@64519 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/rs6000/rs6000.c')
-rw-r--r--gcc/config/rs6000/rs6000.c36
1 files changed, 33 insertions, 3 deletions
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 85730fc23b6..4b7fefd6650 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -335,6 +335,9 @@ static const char alt_reg_names[][8] =
#ifndef MASK_STRICT_ALIGN
#define MASK_STRICT_ALIGN 0
#endif
+#ifndef TARGET_PROFILE_KERNEL
+#define TARGET_PROFILE_KERNEL 0
+#endif
/* The VRSAVE bitmask puts bit %v0 as the most significant bit. */
#define ALTIVEC_REG_BIT(REGNO) (0x80000000 >> ((REGNO) - FIRST_ALTIVEC_REGNO))
@@ -9225,7 +9228,9 @@ rs6000_stack_info ()
/* Determine if we need to save the link register. */
if (rs6000_ra_ever_killed ()
- || (DEFAULT_ABI == ABI_AIX && current_function_profile)
+ || (DEFAULT_ABI == ABI_AIX
+ && current_function_profile
+ && !TARGET_PROFILE_KERNEL)
#ifdef TARGET_RELOCATABLE
|| (TARGET_RELOCATABLE && (get_pool_size () != 0))
#endif
@@ -12234,6 +12239,9 @@ void
output_profile_hook (labelno)
int labelno ATTRIBUTE_UNUSED;
{
+ if (TARGET_PROFILE_KERNEL)
+ return;
+
if (DEFAULT_ABI == ABI_AIX)
{
#ifdef NO_PROFILE_COUNTERS
@@ -12285,7 +12293,6 @@ output_function_profiler (file, labelno)
char buf[100];
int save_lr = 8;
- ASM_GENERATE_INTERNAL_LABEL (buf, "LP", labelno);
switch (DEFAULT_ABI)
{
default:
@@ -12301,6 +12308,7 @@ output_function_profiler (file, labelno)
warning ("no profiling of 64-bit code for this ABI");
return;
}
+ ASM_GENERATE_INTERNAL_LABEL (buf, "LP", labelno);
fprintf (file, "\tmflr %s\n", reg_names[0]);
if (flag_pic == 1)
{
@@ -12355,7 +12363,29 @@ output_function_profiler (file, labelno)
case ABI_AIX:
case ABI_DARWIN:
- /* Don't do anything, done in output_profile_hook (). */
+ if (!TARGET_PROFILE_KERNEL)
+ {
+ /* Don't do anything, done in output_profile_hook (). */
+ }
+ else
+ {
+ if (TARGET_32BIT)
+ abort ();
+
+ asm_fprintf (file, "\tmflr %s\n", reg_names[0]);
+ asm_fprintf (file, "\tstd %s,16(%s)\n", reg_names[0], reg_names[1]);
+
+ if (current_function_needs_context)
+ {
+ asm_fprintf (file, "\tstd %s,24(%s)\n",
+ reg_names[STATIC_CHAIN_REGNUM], reg_names[1]);
+ fprintf (file, "\tbl %s\n", RS6000_MCOUNT);
+ asm_fprintf (file, "\tld %s,24(%s)\n",
+ reg_names[STATIC_CHAIN_REGNUM], reg_names[1]);
+ }
+ else
+ fprintf (file, "\tbl %s\n", RS6000_MCOUNT);
+ }
break;
}
}
OpenPOWER on IntegriCloud