aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/asm
diff options
context:
space:
mode:
authoreric fang <eric.fang@arm.com>2021-02-01 07:47:06 +0000
committereric fang <eric.fang@arm.com>2021-03-04 01:28:21 +0000
commit355c3a037edd8107bc4f1918d7a84764039ac6d1 (patch)
treef6b900de933826cf6ee6a3e30c582916ff727385 /src/cmd/asm
parent726d704c32acf99a9ed44d81c99adb22d4759241 (diff)
downloadgo-355c3a037edd8107bc4f1918d7a84764039ac6d1.tar.gz
go-355c3a037edd8107bc4f1918d7a84764039ac6d1.zip
cmd/internal/obj/asm64: add support for moving BITCON to RSP
Constant of BITCON type can be moved into RSP by MOVD or MOVW instructions directly, this CL enables this format of these two instructions. For 32-bit ADDWop instructions with constant, rewrite the high 32-bit to be a repetition of the low 32-bit, just as ANDWop instructions do, so that we can optimize ADDW $bitcon, Rn, Rt as: MOVW $bitcon, Rtmp ADDW Rtmp, Rn, Rt The original code is: MOVZ $bitcon_low, Rtmp MOVK $bitcon_high,Rtmp ADDW Rtmp, Rn, Rt Change-Id: I30e71972bcfd6470a8b6e6ffbacaee79d523805a Reviewed-on: https://go-review.googlesource.com/c/go/+/289649 Trust: eric fang <eric.fang@arm.com> Run-TryBot: eric fang <eric.fang@arm.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: eric fang <eric.fang@arm.com> Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'src/cmd/asm')
-rw-r--r--src/cmd/asm/internal/asm/testdata/arm64.s3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/cmd/asm/internal/asm/testdata/arm64.s b/src/cmd/asm/internal/asm/testdata/arm64.s
index c1385a13ab..17ecd9b2b8 100644
--- a/src/cmd/asm/internal/asm/testdata/arm64.s
+++ b/src/cmd/asm/internal/asm/testdata/arm64.s
@@ -364,6 +364,9 @@ TEXT foo(SB), DUPOK|NOSPLIT, $-8
MOVD $1, ZR
MOVD $1, R1
MOVK $1, R1
+ MOVD $0x1000100010001000, RSP // MOVD $1152939097061330944, RSP // ff8304b2
+ MOVW $0x10001000, RSP // MOVW $268439552, RSP // ff830432
+ ADDW $0x10001000, R1 // ADDW $268439552, R1 // fb83043221001b0b
// move a large constant to a Vd.
VMOVS $0x80402010, V11 // VMOVS $2151686160, V11