mirror of
https://github.com/golang/go
synced 2024-11-11 23:40:22 -07:00
cmd/vet: teach asm checker about PEXTRD’s op size
Fixes #15271 Change-Id: I28e3fb5bde1e6fd5b263b1434873b8ce051aee97 Reviewed-on: https://go-review.googlesource.com/22083 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Rob Pike <r@golang.org>
This commit is contained in:
parent
045411e6f2
commit
67cdec00c2
@ -559,6 +559,11 @@ func asmCheckVar(badf func(string, ...interface{}), fn *asmFunc, line, expr stri
|
||||
src = 8
|
||||
break
|
||||
}
|
||||
if strings.HasPrefix(op, "P") && strings.HasSuffix(op, "RD") {
|
||||
// PINSRD, PEXTRD, etc
|
||||
src = 4
|
||||
break
|
||||
}
|
||||
if strings.HasPrefix(op, "F") && (strings.HasSuffix(op, "F") || strings.HasSuffix(op, "FP")) {
|
||||
// FMOVFP, FXCHF, etc
|
||||
src = 4
|
||||
|
2
src/cmd/vet/testdata/asm.go
vendored
2
src/cmd/vet/testdata/asm.go
vendored
@ -31,3 +31,5 @@ func nosplit(x int)
|
||||
func rodata(x int)
|
||||
func noptr(x int)
|
||||
func wrapper(x int)
|
||||
|
||||
func f15271() (x uint32)
|
||||
|
11
src/cmd/vet/testdata/asm1.s
vendored
11
src/cmd/vet/testdata/asm1.s
vendored
@ -252,3 +252,14 @@ TEXT ·returnnamed(SB),0,$0-41
|
||||
|
||||
TEXT ·returnintmissing(SB),0,$0-8
|
||||
RET // ERROR "RET without writing to 8-byte ret\+0\(FP\)"
|
||||
|
||||
|
||||
// issue 15271
|
||||
TEXT ·f15271(SB), NOSPLIT, $0-4
|
||||
// Stick 123 into the low 32 bits of X0.
|
||||
MOVQ $123, AX
|
||||
PINSRD $0, AX, X0
|
||||
|
||||
// Return them.
|
||||
PEXTRD $0, X0, x+0(FP)
|
||||
RET
|
||||
|
Loading…
Reference in New Issue
Block a user