]> Cypherpunks repositories - gostls13.git/commit
cmd/compile/internal/amd64: add ADD[Q|L]constmem
authorIlya Tocar <ilya.tocar@intel.com>
Wed, 9 Aug 2017 20:43:25 +0000 (15:43 -0500)
committerIlya Tocar <ilya.tocar@intel.com>
Fri, 18 Aug 2017 18:55:44 +0000 (18:55 +0000)
commitac29f4d01ce6891cad6865eda5b16efed8ef231f
treec78fb0ce72e345a4aea399b0021e396d37b1acb0
parent943dd0fe332ebc72a4b02b2a9b6e4344e4cda340
cmd/compile/internal/amd64: add ADD[Q|L]constmem

We can add a constant to loaction in memory with 1 instruction,
as opposed to load+add+store, so add a new op and relevent ssa rules.
Triggers in e. g. encoding/json isValidNumber:
NumberIsValid-6          36.4ns ± 0%    35.2ns ± 1%  -3.32%  (p=0.000 n=6+10)
Shaves ~2.5 kb from go tool.

Change-Id: I7ba576676c2522432360f77b290cecb9574a93c3
Reviewed-on: https://go-review.googlesource.com/54431
Run-TryBot: Ilya Tocar <ilya.tocar@intel.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/amd64/ssa.go
src/cmd/compile/internal/ssa/gen/AMD64.rules
src/cmd/compile/internal/ssa/gen/AMD64Ops.go
src/cmd/compile/internal/ssa/opGen.go
src/cmd/compile/internal/ssa/rewriteAMD64.go