diff options
| author | Michael Munday <munday@ca.ibm.com> | 2017-04-30 14:25:57 -0400 |
|---|---|---|
| committer | Michael Munday <munday@ca.ibm.com> | 2017-05-02 17:43:31 +0000 |
| commit | 35cf3843a45d7ef774804bdbd32ece3916fe2bf1 (patch) | |
| tree | 0a05ede07974615f28ebe3c68336c7862f00fd1e /src/cmd/asm | |
| parent | e9702c0c85ea1d1f0de523594d645d255e7351b1 (diff) | |
| download | go-35cf3843a45d7ef774804bdbd32ece3916fe2bf1.tar.xz | |
cmd/{asm,compile}: avoid zeroAuto clobbering flags on s390x
This CL modifies how MOV[DWHB] instructions that store a constant to
memory are assembled to avoid them clobbering the condition code
(flags). It also modifies zeroAuto to use MOVD instructions instead of
CLEAR (which is assembled as XC).
MOV[DWHB]storeconst ops also no longer clobbers flags.
Note: this CL modifies the assembler so that it can no longer handle
immediates outside the range of an int16 or offsets from SB, which
reflects what the machine instructions support. The compiler doesn't
need this capability any more and I don't think this affects any existing
assembly, but it is easy to workaround if it does.
Fixes #20187.
Change-Id: Ie54947ff38367bd6a19962bf1a6d0296a4accffb
Reviewed-on: https://go-review.googlesource.com/42179
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/cmd/asm')
| -rw-r--r-- | src/cmd/asm/internal/asm/testdata/s390x.s | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/cmd/asm/internal/asm/testdata/s390x.s b/src/cmd/asm/internal/asm/testdata/s390x.s index d8688e7ba6..6cc129ccc5 100644 --- a/src/cmd/asm/internal/asm/testdata/s390x.s +++ b/src/cmd/asm/internal/asm/testdata/s390x.s @@ -47,10 +47,16 @@ TEXT main·foo(SB),DUPOK|NOSPLIT,$16-0 // TEXT main.foo(SB), DUPOK|NOSPLIT, $16- MOVH $-512, R3 // a739fe00 MOVB $-1, R4 // a749ffff - MOVD $-2147483648, n-8(SP) // c0b180000000e3b0f0100024 - MOVW $-131072, n-8(SP) // c0b1fffe0000e3b0f0100050 - MOVH $-512, n-8(SP) // e544f010fe00 + MOVD $32767, n-8(SP) // e548f0107fff + MOVD $-1, -524288(R1) // e3a010008071e548a000ffff + MOVW $32767, n-8(SP) // e54cf0107fff + MOVW $-32768, 4096(R2) // e3a020000171e54ca0008000 + MOVH $512, n-8(SP) // e544f0100200 + MOVH $-512, 524288(R3) // c0a10008000041aa3000e544a000fe00 MOVB $-1, n-8(SP) // 92fff010 + MOVB $255, 4096(R4) // ebff40000152 + MOVB $-128, -524288(R5) // eb8050008052 + MOVB $1, -524289(R6) // c0a1fff7ffff41aa60009201a000 ADD R1, R2 // b9e81022 ADD R1, R2, R3 // b9e81032 |
