]> Cypherpunks repositories - gostls13.git/commit
[dev.ssa] cmd/compile: strength-reduce 64-bit constant divides
authorKeith Randall <khr@golang.org>
Sat, 6 Feb 2016 04:26:18 +0000 (20:26 -0800)
committerKeith Randall <khr@golang.org>
Sat, 6 Feb 2016 16:52:57 +0000 (16:52 +0000)
commita3055af45e655cce1070f6f346a3ed76e01039e2
treed75bff17fa6ba71869adf2097c722238eacbe256
parentaebf6611dfba195d15c5119e14d6f5b708adbdfb
[dev.ssa] cmd/compile: strength-reduce 64-bit constant divides

The frontend does this for 32 bits and below, but SSA needs
to do it for 64 bits.  The algorithms are all copied from
cgen.go:cgen_div.

Speeds up TimeFormat substantially: ~40% slower to ~10% slower.

Change-Id: I023ea2eb6040df98ccd9105e15ca6ea695610a7a
Reviewed-on: https://go-review.googlesource.com/19302
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Todd Neal <todd@tneal.org>
src/cmd/compile/internal/gc/ssa.go
src/cmd/compile/internal/ssa/gen/AMD64.rules
src/cmd/compile/internal/ssa/gen/AMD64Ops.go
src/cmd/compile/internal/ssa/gen/generic.rules
src/cmd/compile/internal/ssa/gen/genericOps.go
src/cmd/compile/internal/ssa/magic.go [new file with mode: 0644]
src/cmd/compile/internal/ssa/opGen.go
src/cmd/compile/internal/ssa/rewriteAMD64.go
src/cmd/compile/internal/ssa/rewritegeneric.go