From 189931296f6b56090d9d7f49b7936b817189d87d Mon Sep 17 00:00:00 2001 From: Michael Munday Date: Tue, 10 Nov 2020 02:31:28 -0800 Subject: [PATCH] cmd/internal/obj/s390x: fix SYNC instruction encoding SYNC is supposed to correspond to 'fast-BCR-serialization' which is encoded as 'bcr 14,0'. In CL 197178 I accidentally modified the encoding to 'bcr 7,0' which is a no-op. This CL reverses that change. Fixes #42479. Change-Id: I9918d93d720f5e12acc3014cde20d2d32cc87ee5 Reviewed-on: https://go-review.googlesource.com/c/go/+/268797 Run-TryBot: Michael Munday Trust: Michael Munday TryBot-Result: Go Bot Reviewed-by: Cherry Zhang --- src/cmd/asm/internal/asm/testdata/s390x.s | 2 ++ src/cmd/internal/obj/s390x/asmz.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cmd/asm/internal/asm/testdata/s390x.s b/src/cmd/asm/internal/asm/testdata/s390x.s index 03b84cfa62..7c5d26be33 100644 --- a/src/cmd/asm/internal/asm/testdata/s390x.s +++ b/src/cmd/asm/internal/asm/testdata/s390x.s @@ -412,6 +412,8 @@ TEXT main·foo(SB),DUPOK|NOSPLIT,$16-0 // TEXT main.foo(SB), DUPOK|NOSPLIT, $16- UNDEF // 00000000 NOPH // 0700 + SYNC // 07e0 + // vector add and sub instructions VAB V3, V4, V4 // e743400000f3 VAH V3, V4, V4 // e743400010f3 diff --git a/src/cmd/internal/obj/s390x/asmz.go b/src/cmd/internal/obj/s390x/asmz.go index f0f9d5cefc..06921085c9 100644 --- a/src/cmd/internal/obj/s390x/asmz.go +++ b/src/cmd/internal/obj/s390x/asmz.go @@ -3700,7 +3700,7 @@ func (c *ctxtz) asmout(p *obj.Prog, asm *[]byte) { } case 80: // sync - zRR(op_BCR, uint32(NotEqual), 0, asm) + zRR(op_BCR, 14, 0, asm) // fast-BCR-serialization case 81: // float to fixed and fixed to float moves (no conversion) switch p.As { -- 2.48.1