diff options
author | diaxu01 <dianhong.xu@arm.com> | 2020-06-05 03:53:53 +0000 |
---|---|---|
committer | Cherry Zhang <cherryyz@google.com> | 2020-08-19 16:47:14 +0000 |
commit | 01aad9ea939fed313d5c51778485349435302ead (patch) | |
tree | ff4a04cdddecb54036a0c9d11c8654c85349ede3 /test/codegen | |
parent | 8d91d736e2eb518e0a95eb47ae463c0dd80827c4 (diff) | |
download | go-01aad9ea939fed313d5c51778485349435302ead.tar.gz go-01aad9ea939fed313d5c51778485349435302ead.zip |
cmd/compile: Optimize ARM64's code with EON
This patch fuses pattern '(MVN (XOR x y))' into '(EON x y)'.
Change-Id: I269c98ce198d51a4945ce8bd0e1024acbd1b7609
Reviewed-on: https://go-review.googlesource.com/c/go/+/239638
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'test/codegen')
-rw-r--r-- | test/codegen/bits.go | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/test/codegen/bits.go b/test/codegen/bits.go index 0a5428b55a..398dd84e9e 100644 --- a/test/codegen/bits.go +++ b/test/codegen/bits.go @@ -310,9 +310,18 @@ func op_bic(x, y uint32) uint32 { return x &^ y } -func op_eon(x, y uint32) uint32 { +func op_eon(x, y, z uint32, a []uint32, n, m uint64) uint64 { + // arm64:`EON\t`,-`EOR`,-`MVN` + a[0] = x ^ (y ^ 0xffffffff) + + // arm64:`EON\t`,-`EOR`,-`MVN` + a[1] = ^(y ^ z) + // arm64:`EON\t`,-`XOR` - return x ^ ^y + a[2] = x ^ ^z + + // arm64:`EON\t`,-`EOR`,-`MVN` + return n ^ (m ^ 0xffffffffffffffff) } func op_orn(x, y uint32) uint32 { |