aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/asm
diff options
context:
space:
mode:
authorPaul E. Murphy <murp@ibm.com>2023-10-26 09:23:12 -0500
committerPaul Murphy <murp@ibm.com>2023-11-06 19:16:25 +0000
commit7e5ed466bb63af4fcf0cae95f168ed1b4d4aa90c (patch)
treead931d4206fcf24f18588619ce1f701c7a9c7ddc /src/cmd/asm
parent8d2eb290f83bca7d3b5154c6a7b3ac7546df5e8a (diff)
downloadgo-7e5ed466bb63af4fcf0cae95f168ed1b4d4aa90c.tar.xz
cmd/internal/asm/ppc64: avoid generating exser nops
"OR $0, R31, R31" is the execution serializing nop called "exser" on ISA 3.1 processors such as Power10. In general, the "OR $0, Rx, Rx" where Rx != 0 form should be avoided unless used explicitly for the uarch side-effects. Change-Id: Id76e3a703c902676ba4a3ffb64dd90dad9a320bf Reviewed-on: https://go-review.googlesource.com/c/go/+/537855 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com> Reviewed-by: Cherry Mui <cherryyz@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Run-TryBot: Paul Murphy <murp@ibm.com> Reviewed-by: Heschi Kreinick <heschi@google.com>
Diffstat (limited to 'src/cmd/asm')
-rw-r--r--src/cmd/asm/internal/asm/testdata/ppc64.s11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/cmd/asm/internal/asm/testdata/ppc64.s b/src/cmd/asm/internal/asm/testdata/ppc64.s
index cc8d6c84d3..983a368a99 100644
--- a/src/cmd/asm/internal/asm/testdata/ppc64.s
+++ b/src/cmd/asm/internal/asm/testdata/ppc64.s
@@ -179,7 +179,9 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$0
ADD $-32768, R6 // 38c68000
ADD $-32768, R6, R5 // 38a68000
// Hex constant 0xFFFFFFFE00000000
- ADD $-8589934592, R5 // 3fe0fffe63ff00007bff83e463ff00007cbf2a14 or 0602000038a50000
+ ADD $-8589934592, R5 // 3fe0fffe600000007bff83e4600000007cbf2a14 or 0602000038a50000
+ // Hex constant 0xFFFFFFFE00010001
+ ADD $-8589869055, R5 // 3fe0fffe63ff00017bff83e463ff00017cbf2a14 or 0602000138a50001
//TODO: this compiles to add r5,r6,r0. It should be addi r5,r6,0.
// this is OK since r0 == $0, but the latter is preferred.
@@ -223,6 +225,8 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$0
OR $-32768, R6, R7 // 3be080007fe73378
OR $1234567, R5 // 641f001263ffd6877fe52b78
OR $1234567, R5, R3 // 641f001263ffd6877fe32b78
+ OR $2147483648, R5, R3 // 641f8000600000007fe32b78
+ OR $2147483649, R5, R3 // 641f800063ff00017fe32b78
ORIS $255, R3, R4
XOR $1, R3 // 68630001
@@ -249,7 +253,6 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$0
CMPB R3,R4,R4 // 7c6423f8
CMPEQB R3,R4,CR6 // 7f0321c0
- // TODO: constants for ADDC?
ADD R3, R4 // 7c841a14
ADD R3, R4, R5 // 7ca41a14
ADDC R3, R4 // 7c841814
@@ -262,6 +265,8 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$0
ADDV R3, R4 // 7c841e14
ADDVCC R3, R4 // 7c841e15
ADDCCC R3, R4, R5 // 7ca41815
+ ADDCCC $65536, R4, R5 // 641f0001600000007cbf2015
+ ADDCCC $65537, R4, R5 // 641f000163ff00017cbf2015
ADDME R3, R4 // 7c8301d4
ADDMECC R3, R4 // 7c8301d5
ADDMEV R3, R4 // 7c8305d4
@@ -315,6 +320,8 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$0
SUBECC R3, R4, R5 // 7ca32111
SUBEV R3, R4, R5 // 7ca32510
SUBEVCC R3, R4, R5 // 7ca32511
+ SUBC R3, $65536, R4 // 3fe00001600000007c83f810
+ SUBC R3, $65537, R4 // 3fe0000163ff00017c83f810
MULLW R3, R4 // 7c8419d6
MULLW R3, R4, R5 // 7ca419d6