1
0
mirror of https://github.com/golang/go synced 2024-11-12 13:10:33 -07:00
go/src
isharipo 8c67f210a1 cmd/internal/obj: change Prog.From3 to RestArgs ([]Addr)
This change makes it easier to express instructions
with arbitrary number of operands.

Rationale: previous approach with operand "hiding" does
not scale well, AVX and especially AVX512 have many
instructions with 3+ operands.

x86 asm backend is updated to handle up to 6 explicit operands.
It also fixes issue with 4-th immediate operand type checks.
All `ytab` tables are updated accordingly.

Changes to non-x86 backends only include these patterns:
`p.From3 = X` => `p.SetFrom3(X)`
`p.From3.X = Y` => `p.GetFrom3().X = Y`

Over time, other backends can adapt Prog.RestArgs
and reduce the amount of workarounds.

-- Performance --

x/benchmark/build:

$ benchstat upstream.bench patched.bench
name      old time/op                 new time/op                 delta
Build-48                  21.7s ± 2%                  21.8s ± 2%   ~     (p=0.218 n=10+10)

name      old binary-size             new binary-size             delta
Build-48                  10.3M ± 0%                  10.3M ± 0%   ~     (all equal)

name      old build-time/op           new build-time/op           delta
Build-48                  21.7s ± 2%                  21.8s ± 2%   ~     (p=0.218 n=10+10)

name      old build-peak-RSS-bytes    new build-peak-RSS-bytes    delta
Build-48                  145MB ± 5%                  148MB ± 5%   ~     (p=0.218 n=10+10)

name      old build-user+sys-time/op  new build-user+sys-time/op  delta
Build-48                  21.0s ± 2%                  21.2s ± 2%   ~     (p=0.075 n=10+10)

Microbenchmark shows a slight slowdown.

name        old time/op  new time/op  delta
AMD64asm-4  49.5ms ± 1%  49.9ms ± 1%  +0.67%  (p=0.001 n=23+15)

func BenchmarkAMD64asm(b *testing.B) {
  for i := 0; i < b.N; i++ {
    TestAMD64EndToEnd(nil)
    TestAMD64Encoder(nil)
  }
}

Change-Id: I4f1d37b5c2c966da3f2127705ccac9bff0038183
Reviewed-on: https://go-review.googlesource.com/63490
Run-TryBot: Iskander Sharipov <iskander.sharipov@intel.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2017-09-15 21:05:03 +00:00
..
archive all: fix article typos 2017-09-15 02:39:16 +00:00
bufio
builtin
bytes
cmd cmd/internal/obj: change Prog.From3 to RestArgs ([]Addr) 2017-09-15 21:05:03 +00:00
compress all: fix article typos 2017-09-15 02:39:16 +00:00
container container/heap: call t.Helper() in verify() 2017-09-13 17:22:00 +00:00
context all: fix article typos 2017-09-15 02:39:16 +00:00
crypto all: fix article typos 2017-09-15 02:39:16 +00:00
database/sql database/sql: fix Conn's doc typo 2017-09-08 13:49:40 +00:00
debug
encoding all: fix article typos 2017-09-15 02:39:16 +00:00
errors
expvar expvar: make (*Map).Init clear existing keys 2017-09-11 21:31:51 +00:00
flag flag: simplify arg logic in parseOne 2017-09-05 20:31:44 +00:00
fmt
go go/*: use sort.Slice to simplify some code 2017-09-12 14:59:39 +00:00
hash
html
image all: fix article typos 2017-09-15 02:39:16 +00:00
index/suffixarray
internal cmd/compile: add TestIntendedInlining from runtime 2017-09-13 18:10:31 +00:00
io
log log: move Ldate doc to general declaration 2017-09-10 09:44:30 +00:00
math math/rand: fix comment for Shuffle 2017-09-14 03:41:35 +00:00
mime
net all: fix article typos 2017-09-15 02:39:16 +00:00
os all: fix article typos 2017-09-15 02:39:16 +00:00
path all: remove strings.Contains check around Replace 2017-09-12 08:58:28 +00:00
plugin runtime, plugin: error not throw on duplicate open 2017-09-09 16:26:33 +00:00
reflect all: fix article typos 2017-09-15 02:39:16 +00:00
regexp all: fix article typos 2017-09-15 02:39:16 +00:00
runtime runtime: return deltimer early if timer.timersBucket is unset 2017-09-15 19:55:10 +00:00
sort
strconv all: fix article typos 2017-09-15 02:39:16 +00:00
strings
sync
syscall runtime: improve timers scalability on multi-CPU systems 2017-09-12 16:52:23 +00:00
testing testing: use time.Since instead of time.Now().Sub 2017-09-06 19:47:37 +00:00
text text/template: check ignored error in a test 2017-09-13 15:06:31 +00:00
time runtime: return deltimer early if timer.timersBucket is unset 2017-09-15 19:55:10 +00:00
unicode unicode: speed-up is16/is32 2017-09-12 21:32:50 +00:00
unsafe
vendor/golang_org/x
all.bash
all.bat
all.rc
androidtest.bash
bootstrap.bash
buildall.bash
clean.bash
clean.bat
clean.rc
cmp.bash
iostest.bash
make.bash
make.bat
Make.dist
make.rc
naclmake.bash
nacltest.bash
race.bash
race.bat
run.bash
run.bat
run.rc