Commit 213ee3d2 authored by Matthew Dempsky's avatar Matthew Dempsky

go/types: match cmd/compile's alignment for complex64

Fixes #17584.

Change-Id: I3af31cc1f2e9c906f3b73e77f3b092624ba78fbe
Reviewed-on: https://go-review.googlesource.com/31939
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
parent 1986a450
......@@ -42,3 +42,4 @@ func noptr(x int)
func wrapper(x int)
func f15271() (x uint32)
func f17584(x float32, y complex64)
......@@ -306,3 +306,10 @@ TEXT ·f15271(SB), NOSPLIT, $0-4
// Return them.
PEXTRD $0, X0, x+0(FP)
RET
// issue 17584
TEXT ·f17584(SB), NOSPLIT, $12
MOVSS x+0(FP), X0
MOVSS y_real+4(FP), X0
MOVSS y_imag+8(FP), X0
RET
......@@ -79,6 +79,10 @@ func (s *StdSizes) Alignof(T Type) int64 {
if a < 1 {
return 1
}
// complex{64,128} are aligned like [2]float{32,64}.
if isComplex(T) {
a /= 2
}
if a > s.MaxAlign {
return s.MaxAlign
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment