]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: remove redundant constant shift rules
authorCherry Zhang <cherryyz@google.com>
Wed, 30 Aug 2017 16:11:29 +0000 (12:11 -0400)
committerCherry Zhang <cherryyz@google.com>
Thu, 31 Aug 2017 02:08:48 +0000 (02:08 +0000)
commit7846500a5a7659615051fe46dee481bde623989f
treee8166346b65d2aeb77c02a05823108256b744bf9
parenta9216a0ade61ae3c3a45f9cd358a8a38c5d241a5
cmd/compile: remove redundant constant shift rules

Normal shift rules plus constant folding are enough to generate
efficient shift-by-constant instructions.

Add test to make sure we don't generate comparisons for constant
shifts.

TODO: there are still constant shift rules on PPC64. If they
are removed, the constant folding rules are not enough to remove
all the test and mask stuff for constant shifts. Leave them in
for now.

Fixes #20663.

Change-Id: I724cc324aa8607762d0c8aacf9bfa641bda5c2a1
Reviewed-on: https://go-review.googlesource.com/60330
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/gc/asm_test.go
src/cmd/compile/internal/ssa/gen/ARM64.rules
src/cmd/compile/internal/ssa/gen/MIPS64.rules
src/cmd/compile/internal/ssa/rewriteARM64.go
src/cmd/compile/internal/ssa/rewriteMIPS64.go