It don't think it does. For instance, an int16 will be spilled to a 2-byte 
slot in the stack frame.
Can you show us what you are seeing? This is what I tried:

package main

func f(p, q *int16) {
x := *p
y := *q
g()
*p = y
*q = x
}
func g()

go tool compile -S tmp.go

0x001d 00029 (tmp1.go:4) MOVQ "".p+24(SP), AX
0x0022 00034 (tmp1.go:4) MOVWLZX (AX), CX
0x0025 00037 (tmp1.go:4) MOVW CX, "".x+6(SP)
0x002a 00042 (tmp1.go:5) MOVQ "".q+32(SP), DX
0x002f 00047 (tmp1.go:5) MOVWLZX (DX), BX
0x0032 00050 (tmp1.go:5) MOVW BX, "".y+4(SP)
0x0037 00055 (tmp1.go:6) CALL "".g(SB)
0x003c 00060 (tmp1.go:7) MOVWLZX "".y+4(SP), AX
0x0041 00065 (tmp1.go:7) MOVQ "".p+24(SP), CX
0x0046 00070 (tmp1.go:7) MOVW AX, (CX)
0x0049 00073 (tmp1.go:8) MOVWLZX "".x+6(SP), AX
0x004e 00078 (tmp1.go:8) MOVQ "".q+32(SP), CX
0x0053 00083 (tmp1.go:8) MOVW AX, (CX)


On Monday, November 2, 2020 at 3:29:49 AM UTC-8 eric...@arm.com wrote:

> Hi,
>
> Can someone tell me why does OpStoreReg of type int16, int32, etc. occupy 
> 8 bytes on the stack? And where is this handled ? Thanks.
>

-- 
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 golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/7a99e909-2602-4906-add4-fda59992a99bn%40googlegroups.com.

Reply via email to