aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/ssa/rewritedec.go
diff options
context:
space:
mode:
authorBen Shi <powerman1st@163.com>2017-01-24 09:48:58 +0000
committerCherry Zhang <cherryyz@google.com>2017-03-31 15:10:24 +0000
commit8577f81a10f4e5b5736119cdd960c44a5ad600f5 (patch)
tree05249e6f6e1fe9052d785b5973a1220221ec2c64 /src/cmd/compile/internal/ssa/rewritedec.go
parent4a1140472b3093edf9cd653666242393d7f4c2bd (diff)
downloadgo-8577f81a10f4e5b5736119cdd960c44a5ad600f5.tar.gz
go-8577f81a10f4e5b5736119cdd960c44a5ad600f5.zip
cmd/compile/internal: Optimization with RBIT and REV
By checking GOARM in ssa/gen/ARM.rules, each intermediate operator can be implemented via different instruction serials. It is up to the user to choose between compitability and efficiency. The Bswap32(x) is optimized to REV(x) when GOARM >= 6. The CTZ(x) is optimized to CLZ(RBIT x) when GOARM == 7. Change-Id: Ie9ee645fa39333fa79ad84ed4d1cefac30422814 Reviewed-on: https://go-review.googlesource.com/35610 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'src/cmd/compile/internal/ssa/rewritedec.go')
-rw-r--r--src/cmd/compile/internal/ssa/rewritedec.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/ssa/rewritedec.go b/src/cmd/compile/internal/ssa/rewritedec.go
index 2782316c7e..f82a26a417 100644
--- a/src/cmd/compile/internal/ssa/rewritedec.go
+++ b/src/cmd/compile/internal/ssa/rewritedec.go
@@ -4,8 +4,10 @@
package ssa
import "math"
+import "cmd/internal/obj"
var _ = math.MinInt8 // in case not otherwise used
+var _ = obj.ANOP // in case not otherwise used
func rewriteValuedec(v *Value) bool {
switch v.Op {
case OpComplexImag: