]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: don't use R25 as input for LoweredMove on ARM64
authorCherry Mui <cherryyz@google.com>
Fri, 9 Sep 2022 22:43:08 +0000 (18:43 -0400)
committerCherry Mui <cherryyz@google.com>
Tue, 13 Sep 2022 17:43:40 +0000 (17:43 +0000)
The rule uses R25 as a scratch register. If the input is R25 it
will be clobbered on the way, causing wrong result.

Change-Id: I464eadbdef0f3a5e90f9ef8c818393baa4335b87
Reviewed-on: https://go-review.googlesource.com/c/go/+/430015
Run-TryBot: Cherry Mui <cherryyz@google.com>
Reviewed-by: Jenny Rakoczy <jenny@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Eric Fang <eric.fang@arm.com>
src/cmd/compile/internal/ssa/gen/ARM64Ops.go
src/cmd/compile/internal/ssa/opGen.go

index 5aeaf3ad96f433490c4f822b84da81389208e3ef..0e6e6e4a5f3dbf95522b4a09b16a762aee206241 100644 (file)
@@ -593,7 +593,7 @@ func init() {
                        name:      "LoweredMove",
                        argLength: 4,
                        reg: regInfo{
-                               inputs:   []regMask{buildReg("R17"), buildReg("R16"), gp},
+                               inputs:   []regMask{buildReg("R17"), buildReg("R16"), gp &^ buildReg("R25")},
                                clobbers: buildReg("R16 R17 R25"),
                        },
                        clobberFlags:   true,
index 7755ee3c15439e882d53dd921bf3c4a7bee22f5d..4a3abc2b6ae109efa484cfb13a5803402e0554a6 100644 (file)
@@ -22309,7 +22309,7 @@ var opcodeTable = [...]opInfo{
                        inputs: []inputInfo{
                                {0, 131072},    // R17
                                {1, 65536},     // R16
-                               {2, 670826495}, // R0 R1 R2 R3 R4 R5 R6 R7 R8 R9 R10 R11 R12 R13 R14 R15 R16 R17 R19 R20 R21 R22 R23 R24 R25 R26 R30
+                               {2, 637272063}, // R0 R1 R2 R3 R4 R5 R6 R7 R8 R9 R10 R11 R12 R13 R14 R15 R16 R17 R19 R20 R21 R22 R23 R24 R26 R30
                        },
                        clobbers: 33751040, // R16 R17 R25
                },