The FP pseudoreg has been dropped from assembly output (on tip).  All 
offsets are from SP.  On previous versions the assembly output reported the 
base register as FP but the offset was from SP.
See https://github.com/golang/go/issues/19458 and referents.

On Friday, March 24, 2017 at 12:01:06 PM UTC-7, Rob 'Commander' Pike wrote:
>
> The assembly documentation in golang.org/doc/asm.html is accurate in this 
> respect, I believe. By "in this respect" I mean both what the assembler 
> accepts and interprets and what is intended.
>
> The compiler output for -S has not been brought to the same standard and 
> may well use SP when FP would be more correct.
>
> -rob
>
>
> On Fri, Mar 24, 2017 at 11:27 AM, Caleb Spare <[email protected] 
> <javascript:>> wrote:
>
>> I hope someone else knows. I've also been confused by the difference
>> in the offsets in the past, and when I asked about it I was told that
>> the output of go tool compile -S is just different than what you write
>> by hand. Unfortunately I don't think that the -S output is documented.
>> You might have to read source to figure it out.
>>
>> On Fri, Mar 24, 2017 at 4:39 AM,  <[email protected] <javascript:>> wrote:
>> > Should not the first parameter of a function be passed in 0(FP)? See 
>> this
>> > example assembly (produced by go tool compile -S), where 0(FP) gets 
>> skipped
>> > over and the argument is apparently loaded from 8(FP):
>> >
>> > https://drive.google.com/open?id=0B63rdrZtwIE9dHZqWmoxdXIzNnc
>> >
>> > Another confusing thing is that conditional jumps are sometimes invoked 
>> with
>> > two operands, see any of the 8 almost equal functions here:
>> >
>> > https://drive.google.com/open?id=0B63rdrZtwIE9R3M4cGxrSFhmT00
>> >
>> > (also, the first parameter is even further from 0(FP) now).
>> >
>> >
>> > Regards,
>> > Neven
>> >
>> > --
>> > You received this message because you are subscribed to the Google 
>> Groups
>> > "golang-nuts" group.
>> > To unsubscribe from this group and stop receiving emails from it, send 
>> an
>> > email to [email protected] <javascript:>.
>> > For more options, visit https://groups.google.com/d/optout.
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "golang-nuts" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to