-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Description
TL;DR: Do we anticipate ever supporting architectures with IntSize != PtrSize again? (Note: This is different from supporting PtrSize != RegSize architectures like amd64p32.)
The Go spec allows int
and pointers to be independently sized, and for Go 1.0, amd64 had 64-bit pointers but 32-bit int
s. However, since Go 1.1, all supported architectures have had identically sized int
s and pointers.
There's still vestigial code within the toolchain to support IntSize != PtrSize architectures, but it's not always used correctly. For example, ssa/gen/dec.rules and gc.(*ssafn).SplitSlice both calculate the cap
field's offset as 2*Widthptr
, when it should be Widthptr+Widthint
. ld.textsectionmap assumes IntSize==PtrSize by using IntSize to populate uintptr
fields.
I'm inclined to remove all the Int-named variables and just use the Ptr-named ones everywhere. As precedence, runtime/internal/sys only has PtrSize and RegSize, and go/types.StdSizes only has WordSize (with the same meaning as PtrSize).