Skip to content

Commit

Permalink
s390x/s390xasm: fix self-assignment error
Browse files Browse the repository at this point in the history
It removes all the argument self-assignments.

Change-Id: Ifabd0629a205211d5aaf8fc00847b70806e0ddc8
Reviewed-on: https://go-review.googlesource.com/c/arch/+/625875
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Vishwanatha HD <[email protected]>
Reviewed-by: Cherry Mui <[email protected]>
Reviewed-by: David Chase <[email protected]>
  • Loading branch information
srinivas-pokala authored and cherrymui committed Nov 6, 2024
1 parent ec82f99 commit f977c2e
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions s390x/s390xasm/plan9.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ func GoSyntax(inst Inst, pc uint64, symname func(uint64) (string, uint64)) strin
args[0], args[1] = args[2], args[0]
args = args[:2]
} else {
args[0], args[1], args[2] = args[2], args[1], args[0]
args[0], args[2] = args[2], args[0]
}
case AGHIK, AHIK, ALGHSIK:
num, err := strconv.ParseInt(args[2][1:], 10, 32)
Expand All @@ -269,7 +269,7 @@ func GoSyntax(inst Inst, pc uint64, symname func(uint64) (string, uint64)) strin
op = "ADDC"
}
}
args[0], args[1], args[2] = args[2], args[1], args[0]
args[0], args[2] = args[2], args[0]
case AGHI, AHI, AGFI, AFI, AR, ALCGR:
num, err := strconv.ParseInt(args[1][1:], 10, 32)
if err != nil {
Expand Down Expand Up @@ -344,7 +344,7 @@ func GoSyntax(inst Inst, pc uint64, symname func(uint64) (string, uint64)) strin
args[0], args[1] = args[2], args[0]
args = args[:2]
} else {
args[0], args[1], args[2] = args[2], args[1], args[0]
args[0], args[2] = args[2], args[0]
}
case SLBGR:
op = "SUBE"
Expand Down Expand Up @@ -399,7 +399,7 @@ func GoSyntax(inst Inst, pc uint64, symname func(uint64) (string, uint64)) strin
case SRAG:
op = "SRAD"
}
args[0], args[1], args[2] = args[2], args[1], args[0]
args[0], args[2] = args[2], args[0]
case TRAP2, SVC:
op = "SYSALL"
case CR, CLR, CGR, CLGR, KDBR, CDBR, CEBR, CGHI, CHI, CGFI, CLGFI, CFI, CLFI:
Expand Down Expand Up @@ -481,7 +481,7 @@ func GoSyntax(inst Inst, pc uint64, symname func(uint64) (string, uint64)) strin
args = args[:3]
}
case CLRJ, CRJ, CIJ, CLIJ:
args[0], args[1], args[2], args[3] = args[2], args[0], args[1], args[3]
args[0], args[1], args[2] = args[2], args[0], args[1]
case BRC, BRCL:
mask, err := strconv.Atoi(args[0][1:])
if err != nil {
Expand Down Expand Up @@ -541,7 +541,7 @@ func GoSyntax(inst Inst, pc uint64, symname func(uint64) (string, uint64)) strin
args[0], args[1] = args[1], args[0]
args = args[:2]
} else {
args[0], args[1], args[2] = args[2], args[1], args[0]
args[0], args[2] = args[2], args[0]
}
case BRASL:
op = "CALL" // BL
Expand Down Expand Up @@ -679,7 +679,7 @@ func GoSyntax(inst Inst, pc uint64, symname func(uint64) (string, uint64)) strin
case VREP, VERLLV, VESLV:
if val >= 0 && val < 4 {
op = op + vectorSize[val]
args[0], args[1], args[2] = args[2], args[1], args[0]
args[0], args[2] = args[2], args[0]
args = args[:3]
} else {
return fmt.Sprintf("specification exception is recognized for %q with mask value: %v \n", op, mask)
Expand Down Expand Up @@ -910,7 +910,7 @@ func GoSyntax(inst Inst, pc uint64, symname func(uint64) (string, uint64)) strin
} else {
return fmt.Sprintf("specification exception is recognized for %q with mask(m5) value: %v \n", op, m5)
}
args[0], args[1], args[2] = args[2], args[1], args[0]
args[0], args[2] = args[2], args[0]
args = args[:3]
case VAC, VACCC:
mask, err := strconv.Atoi(args[4][1:])
Expand Down Expand Up @@ -985,7 +985,7 @@ func GoSyntax(inst Inst, pc uint64, symname func(uint64) (string, uint64)) strin
args = args[:3]
default:
if args[0] == args[1] {
args[0], args[1] = args[2], args[1]
args[0] = args[2]
args = args[:2]
break
}
Expand Down

0 comments on commit f977c2e

Please sign in to comment.