diff options
author | Jim Wilson <wilson@gcc.gnu.org> | 1994-07-12 10:15:53 -0700 |
---|---|---|
committer | Jim Wilson <wilson@gcc.gnu.org> | 1994-07-12 10:15:53 -0700 |
commit | 7947717fc2169eb9a7c5b99ca7f5f9cc8bd423ca (patch) | |
tree | 44a2ab227a02d44918421b25c3677eecdfe90536 /gcc | |
parent | 96a7ba6fef3ca027876a377f10a5fb21d5372f9f (diff) | |
download | gcc-7947717fc2169eb9a7c5b99ca7f5f9cc8bd423ca.zip gcc-7947717fc2169eb9a7c5b99ca7f5f9cc8bd423ca.tar.gz gcc-7947717fc2169eb9a7c5b99ca7f5f9cc8bd423ca.tar.bz2 |
(FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER): Define.
From-SVN: r7748
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/config/sparc/sysv4.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/gcc/config/sparc/sysv4.h b/gcc/config/sparc/sysv4.h index 651c408..411dd38 100644 --- a/gcc/config/sparc/sysv4.h +++ b/gcc/config/sparc/sysv4.h @@ -225,3 +225,34 @@ do { long value[4]; \ fprintf((FILE), "\t.long\t0x%x\n", value[2]); \ fprintf((FILE), "\t.long\t0x%x\n", value[3]); \ } while (0) + +/* Output assembler code to FILE to initialize this source file's + basic block profiling info, if that has not already been done. */ + +#undef FUNCTION_BLOCK_PROFILER +#define FUNCTION_BLOCK_PROFILER(FILE, LABELNO) \ + do { \ + if (TARGET_MEDANY) \ + fprintf (FILE, "\tsethi %%hi(.LLPBX0),%%o0\n\tor %%0,%%lo(.LLPBX0),%%o0\n\tld [%s+%%o0],%%o1\n\ttst %%o1\n\tbne .LLPY%d\n\tadd %%o0,%s,%%o0\n\tcall __bb_init_func\n\tnop\nLPY%d:\n", \ + MEDANY_BASE_REG, (LABELNO), MEDANY_BASE_REG, (LABELNO)); \ + else \ + fprintf (FILE, "\tsethi %%hi(.LLPBX0),%%o0\n\tld [%%lo(.LLPBX0)+%%o0],%%o1\n\ttst %%o1\n\tbne LPY%d\n\tadd %%o0,%%lo(.LLPBX0),%%o0\n\tcall __bb_init_func\n\tnop\nLPY%d:\n", \ + (LABELNO), (LABELNO)); \ + } while (0) + +/* Output assembler code to FILE to increment the entry-count for + the BLOCKNO'th basic block in this source file. */ + +#undef BLOCK_PROFILER +#define BLOCK_PROFILER(FILE, BLOCKNO) \ +{ \ + int blockn = (BLOCKNO); \ + if (TARGET_MEDANY) \ + fprintf (FILE, "\tsethi %%hi(.LLPBX2+%d),%%g1\n\tor %%g1,%%lo(.LLPBX2+%d),%%g1\n\tld [%%g1+%s],%%g2\n\tadd %%g2,1,%%g2\n\tst %%g2,[%%g1+%s]\n", \ + 4 * blockn, 4 * blockn, MEDANY_BASE_REG, MEDANY_BASE_REG); \ + else \ + fprintf (FILE, "\tsethi %%hi(.LLPBX2+%d),%%g1\n\tld [%%lo(.LLPBX2+%d)+%%g1],%%g2\n\ +\tadd %%g2,1,%%g2\n\tst %%g2,[%%lo(.LLPBX2+%d)+%%g1]\n", \ + 4 * blockn, 4 * blockn, 4 * blockn); \ +} + |