This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

patch for MIPS profiling in mips.h



Ethan, thank you very much for the patch.  It took longer to
look at the patch than I expected, sorry.  (I've been hung up
on the mistaken believe that jal was _not_ a macro.  Doh!  Of
course it sometimes is a macro.)  

I've made a small change to your patch, and wondered if you'd
review it, and be sure it works for your favorite target(s).
I've removed the (no)reorder directives in the belief that this
is safe to do and allows the assembler to fill the jal delay
slot with the (d)subu in those cases where jal is not expanded
as a macro.

I've also simplified your ChangeLog entry.

OK?


                                    -gavin...



2000-05-09  Ethan Solomita  ethan@cs.columbia.edu

        * config/mips/mips.h (FUNCTION_PROFILER): Deal with
	the case where jal is expanded as a macro.

Index: mips.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/mips/mips.h,v
retrieving revision 1.98
diff -c -p -r1.98 mips.h
*** mips.h	2000/05/24 06:25:34	1.98
--- mips.h	2000/06/13 19:51:10
*************** typedef struct mips_args {
*** 2570,2587 ****
  {									\
    if (TARGET_MIPS16)							\
      sorry ("mips16 function profiling");				\
-   fprintf (FILE, "\t.set\tnoreorder\n");				\
    fprintf (FILE, "\t.set\tnoat\n");					\
    fprintf (FILE, "\tmove\t%s,%s\t\t# save current return address\n",	\
  	   reg_names[GP_REG_FIRST + 1], reg_names[GP_REG_FIRST + 31]);	\
-   fprintf (FILE, "\tjal\t_mcount\n");					\
    fprintf (FILE,							\
  	   "\t%s\t%s,%s,%d\t\t# _mcount pops 2 words from  stack\n",	\
  	   TARGET_64BIT ? "dsubu" : "subu",				\
  	   reg_names[STACK_POINTER_REGNUM],				\
  	   reg_names[STACK_POINTER_REGNUM],				\
  	   Pmode == DImode ? 16 : 8);					\
!   fprintf (FILE, "\t.set\treorder\n");					\
    fprintf (FILE, "\t.set\tat\n");					\
  }
  
--- 2570,2585 ----
  {									\
    if (TARGET_MIPS16)							\
      sorry ("mips16 function profiling");				\
    fprintf (FILE, "\t.set\tnoat\n");					\
    fprintf (FILE, "\tmove\t%s,%s\t\t# save current return address\n",	\
  	   reg_names[GP_REG_FIRST + 1], reg_names[GP_REG_FIRST + 31]);	\
    fprintf (FILE,							\
  	   "\t%s\t%s,%s,%d\t\t# _mcount pops 2 words from  stack\n",	\
  	   TARGET_64BIT ? "dsubu" : "subu",				\
  	   reg_names[STACK_POINTER_REGNUM],				\
  	   reg_names[STACK_POINTER_REGNUM],				\
  	   Pmode == DImode ? 16 : 8);					\
!   fprintf (FILE, "\tjal\t_mcount\n");					\
    fprintf (FILE, "\t.set\tat\n");					\
  }
  









Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]