]> Cypherpunks repositories - gostls13.git/commit
cmd/internal/obj/asm64: add support for moving BITCON to RSP
authoreric fang <eric.fang@arm.com>
Mon, 1 Feb 2021 07:47:06 +0000 (07:47 +0000)
committereric fang <eric.fang@arm.com>
Thu, 4 Mar 2021 01:28:21 +0000 (01:28 +0000)
commit355c3a037edd8107bc4f1918d7a84764039ac6d1
treef6b900de933826cf6ee6a3e30c582916ff727385
parent726d704c32acf99a9ed44d81c99adb22d4759241
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>
src/cmd/asm/internal/asm/testdata/arm64.s
src/cmd/internal/obj/arm64/asm7.go
src/cmd/internal/obj/arm64/obj7.go