Commit eed2bb71 authored by Michael Munday's avatar Michael Munday

cmd/vet: fix go vet on s390x assembly

Test adapted from the mips64 test.

Fixes #15454.

Change-Id: If890c2d18a4a03a08faaa2e674edd7223af60290
Reviewed-on: https://go-review.googlesource.com/22472
Run-TryBot: Michael Munday <munday@ca.ibm.com>
Reviewed-by: 's avatarRuss Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent bcc02473
......@@ -77,6 +77,7 @@ var (
asmArchMips64LE = asmArch{"mips64le", size88, false, "R29", true}
asmArchPpc64 = asmArch{"ppc64", size88, true, "R1", true}
asmArchPpc64LE = asmArch{"ppc64le", size88, false, "R1", true}
asmArchS390X = asmArch{"s390x", size88, true, "R15", true}
arches = []*asmArch{
&asmArch386,
......@@ -88,6 +89,7 @@ var (
&asmArchMips64LE,
&asmArchPpc64,
&asmArchPpc64LE,
&asmArchS390X,
}
)
......@@ -648,6 +650,17 @@ func asmCheckVar(badf func(string, ...interface{}), fn *asmFunc, line, expr stri
case "MOVV", "MOVD":
src = 8
}
case "s390x":
switch op {
case "MOVB", "MOVBZ":
src = 1
case "MOVH", "MOVHZ":
src = 2
case "MOVW", "MOVWZ", "FMOVS":
src = 4
case "MOVD", "FMOVD":
src = 8
}
}
}
if dst == 0 {
......
This diff is collapsed.
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