aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/asm
diff options
context:
space:
mode:
authorPaul E. Murphy <murp@ibm.com>2021-03-09 16:55:11 -0600
committerLynn Boger <laboger@linux.vnet.ibm.com>2021-04-15 18:21:15 +0000
commitddd8d7c0a6859114f1f9bfbb3c56fb63f870badc (patch)
tree044ea6ef4c712a5c15ab689da98908ed42bd067d /src/cmd/asm
parent8009a81f7a44235001ce373fbc39391a894c86df (diff)
downloadgo-ddd8d7c0a6859114f1f9bfbb3c56fb63f870badc.tar.gz
go-ddd8d7c0a6859114f1f9bfbb3c56fb63f870badc.zip
cmd/internal/obj: consolidate AMOVW and AMOVWZ optab entries
This requires consolidating the register move operations into a single case entry in asmout. These moves are also used to sign/zero-extend register values. Combine the three asmout cases for register moves. This allows AMOVWZ and AMOVW to be handled with the same optab entries. Likewise, remove the diagnostic error for non-zero constant loads into R0 using the register move operations, it is not possible to match this asmout case with a non-zero constant. Finally, fix the load constant 0 via "MOV[BHW]{,Z} $0, Rx". These now generate "li Rx, $0" instead of a zero/sign-extend of the contents of R0. Change-Id: Ia4a263661582f10feda27ee21cb121e05ea931dc Reviewed-on: https://go-review.googlesource.com/c/go/+/308190 Run-TryBot: Paul Murphy <murp@ibm.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com> Reviewed-by: Carlos Eduardo Seo <carlos.seo@linaro.org> Trust: Carlos Eduardo Seo <carlos.seo@linaro.org>
Diffstat (limited to 'src/cmd/asm')
-rw-r--r--src/cmd/asm/internal/asm/testdata/ppc64.s9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/cmd/asm/internal/asm/testdata/ppc64.s b/src/cmd/asm/internal/asm/testdata/ppc64.s
index a818c0e789..eaec24b8b7 100644
--- a/src/cmd/asm/internal/asm/testdata/ppc64.s
+++ b/src/cmd/asm/internal/asm/testdata/ppc64.s
@@ -77,6 +77,15 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$0
MOVBU R4, 1(R3) // 9c830001
MOVBU R5, (R3)(R4) // 7ca419ee
+ MOVB $0, R4 // 38800000
+ MOVBZ $0, R4 // 38800000
+ MOVH $0, R4 // 38800000
+ MOVHZ $0, R4 // 38800000
+ MOVW $0, R4 // 38800000
+ MOVWZ $0, R4 // 38800000
+ MOVD $0, R4 // 38800000
+ MOVD $0, R0 // 38000000
+
ADD $1, R3 // 38630001
ADD $1, R3, R4 // 38830001
ADD $-1, R4 // 3884ffff