This is the mail archive of the gcc@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]
Other format: [Raw text]

MIPS stack frame question


Hi.

I'm trying to figure out the structure of MIPS stack frame and how to
write .frame / .mask properly.  Since gcc/config/mips/mips.c was
rewritten by Richard Sandiford, it got clearer that what GCC does
(thanks for that).

- In gcc/config/mips/mips.c:mips_compute_frame_info() you do

	  /* Move above the GPR save area.  */
	  if (frame->num_gp > 0)
	    {
	      offset += MIPS_STACK_ALIGN (frame->num_gp * UNITS_PER_WORD);
	      frame->gp_sp_offset = offset - UNITS_PER_WORD;
	    }

  So what is "- UNITS_PER_WORD" for?

- Why do you put MIPS_STACK_ALIGN in many places?  The only constraint
  I know is that MIPSpro Assembly Language Programmer's Guide [1] says
  "The stack framesize must be a multiple of 16".

- Could you document / comment the reason / source of such
  specifications about all of these? :)

Thanks in advance.

Masao

[1] http://techpubs.sgi.com/library/tpl/cgi-bin/download.cgi?coll=0650&db=bks&docnumber=007-2418-006


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