On Tue, Nov 20, 2012 at 7:36 AM, Stefan Kristiansson <[email protected]> wrote: > On Tue, Nov 20, 2012 at 09:23:30AM +0200, Stefan Kristiansson wrote: >> On Tue, Nov 20, 2012 at 08:08:01AM +0100, Jonas Bonn wrote: >> >> > Why did we choose r3 for the struct return location? >> > >> >> It was not so much "us" choosing it. >> gcc has done it all along, creating a "defacto" standard for it, >> now we are just documenting it. >> That said, I don't see using r3 as a bad choice, do you? >> > > After actually checking what had changed I understand your question, > that text was supposed to be _added_ to what already was in the > section "Functions Returning Structures or Unions", not replace it. > The new text clarifies structures returned by _value_ > > Julius, the section should be like this in it's whole: > > 16.2.5 Functions Returning Structures or Unions > > A function that returns a structure or union places the address of the > structure or > union in the general-purpose RV register. > > A function that returns a structure by value expects the location > where that > structure is to be placed to be supplied in function parameter word 0 (R3).
Whoops, my bad. Yeah, I see the page says the definition should be _extended_ not replaced. I'll fix it tonight. Cheers Julius _______________________________________________ OpenRISC mailing list [email protected] http://lists.openrisc.net/listinfo/openrisc
