1. 09 Apr, 2018 6 commits
  2. 08 Apr, 2018 2 commits
  3. 07 Apr, 2018 4 commits
  4. 06 Apr, 2018 17 commits
  5. 05 Apr, 2018 11 commits
    • Josh Bleecher Snyder's avatar
      cmd/compile: rewrite a & 1 != 1 into a & 1 == 0 on amd64 · 3f483e65
      Josh Bleecher Snyder authored
      These rules trigger 190 times during make.bash.
      
      Change-Id: I20d1688db5d8c904a7237c08635c6c9d8bd58b1c
      Reviewed-on: https://go-review.googlesource.com/105037
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarGiovanni Bajo <rasky@develer.com>
      3f483e65
    • Brian Kessler's avatar
      math/big: clean up z.div(z, x, y) calls · 7818b82f
      Brian Kessler authored
      Updates #22830
      
      Due to not checking if the output slices alias in divLarge,
      calls of the form z.div(z, x, y) caused the slice z
      to attempt to be used to store both the quotient and the
      remainder of the division.  CL 78995 applies an alias
      check to correct that error.  This CL cleans up the
      additional div calls that attempt to supply the same slice
      to hold both the quotient and remainder.
      
      Note that the call in expNN was responsible for the reported
      error in r.Exp(x, 1, m) when r was initialized to a non-zero value.
      
      The second instance in expNNMontgomery did not result in an error
      due to the size of the arguments.
      
      	// RR = 2**(2*_W*len(m)) mod m
      	RR := nat(nil).setWord(1)
      	zz := nat(nil).shl(RR, uint(2*numWords*_W))
      	_, RR = RR.div(RR, zz, m)
      
      Specifically,
      
      cap(RR) == 5 after setWord(1) due to const e = 4 in z.make(1)
      len(zz) == 2*len(m) + 1 after shifting left, numWords = len(m)
      
      Reusing the backing array for z and z2 in div was only triggered if
      cap(RR) >= len(zz) + 1 and len(m) > 1 so that divLarge was called.
      
      But, 5 < 2*len(m) + 2 if len(m) > 1, so new arrays were allocated
      and the error was never triggered in this case.
      
      Change-Id: Iedac80dbbde13216c94659e84d28f6f4be3aaf24
      Reviewed-on: https://go-review.googlesource.com/81055
      Run-TryBot: Robert Griesemer <gri@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarRobert Griesemer <gri@golang.org>
      7818b82f
    • Matthew Dempsky's avatar
      cmd/compile: cleanup method symbol creation · 638f112d
      Matthew Dempsky authored
      There were multiple ad hoc ways to create method symbols, with subtle
      and confusing differences between them. This CL unifies them into a
      single well-documented encoding and implementation.
      
      This introduces some inconsequential changes to symbol format for the
      sake of simplicity and consistency. Two notable changes:
      
      1) Symbol construction is now insensitive to the package currently
      being compiled. Previously, non-exported methods on anonymous types
      received different method symbols depending on whether the method was
      local or imported.
      
      2) Symbols for method values parenthesized non-pointer receiver types
      and non-exported method names, and also always package-qualified
      non-exported method names. Now they use the same rules as normal
      method symbols.
      
      The methodSym function is also now stricter about rejecting
      non-sensical method/receiver combinations. Notably, this means that
      typecheckfunc needs to call addmethod to validate the method before
      calling declare, which also means we no longer emit errors about
      redeclaring bogus methods.
      
      Change-Id: I9501c7a53dd70ef60e5c74603974e5ecc06e2003
      Reviewed-on: https://go-review.googlesource.com/104876Reviewed-by: 's avatarRobert Griesemer <gri@golang.org>
      638f112d
    • Josh Bleecher Snyder's avatar
      runtime: avoid calling adjustpointers unnecessarily · 2e7e5777
      Josh Bleecher Snyder authored
      adjustpointers loops over a bitmap.
      If the length of that bitmap is zero,
      we can skip making the call entirely.
      This speeds up stack copying when there are
      no pointers present in either args or locals.
      
      name                old time/op  new time/op  delta
      StackCopyPtr-8       101ms ± 4%    90ms ± 4%  -10.95%  (p=0.000 n=87+93)
      StackCopy-8         80.1ms ± 4%  72.6ms ± 4%   -9.41%  (p=0.000 n=98+100)
      StackCopyNoCache-8   121ms ± 3%   113ms ± 3%   -6.57%  (p=0.000 n=98+97)
      
      Change-Id: I7a272e19bc9a14fa3e3318771ebd082dc6247d25
      Reviewed-on: https://go-review.googlesource.com/104737
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarAustin Clements <austin@google.com>
      2e7e5777
    • Richard Musiol's avatar
      cmd/compile/internal/gc: factor out beginning of SSAGenState.Call · 533fdfd0
      Richard Musiol authored
      This commit does not change the semantics of the Call method. Its
      purpose is to avoid duplication of code by making PrepareCall available
      for separate use by the wasm backend.
      
      Updates #18892
      
      Change-Id: I04a3098f56ebf0d995791c5375dd4c03b6a202a3
      Reviewed-on: https://go-review.googlesource.com/103275Reviewed-by: 's avatarJosh Bleecher Snyder <josharian@gmail.com>
      533fdfd0
    • Hana Kim's avatar
      cmd/trace: include taskless spans in /usertasks. · 8e351ae3
      Hana Kim authored
      Change-Id: Id4e3407ba497a018d5ace92813ba8e9653d0ac7d
      Reviewed-on: https://go-review.googlesource.com/104976Reviewed-by: 's avatarHeschi Kreinick <heschi@google.com>
      Run-TryBot: Heschi Kreinick <heschi@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      8e351ae3
    • Carlos Eduardo Seo's avatar
      math/big: improve performance on ppc64x by unrolling loops · fc8967e3
      Carlos Eduardo Seo authored
      This change improves performance of addVV, subVV and mulAddVWW
      by unrolling the loops, with improvements up to 1.45x.
      
      benchmark                    old ns/op     new ns/op     delta
      BenchmarkAddVV/1-16          5.79          5.85          +1.04%
      BenchmarkAddVV/2-16          6.41          6.62          +3.28%
      BenchmarkAddVV/3-16          6.89          7.35          +6.68%
      BenchmarkAddVV/4-16          7.47          8.26          +10.58%
      BenchmarkAddVV/5-16          8.04          8.18          +1.74%
      BenchmarkAddVV/10-16         10.9          11.2          +2.75%
      BenchmarkAddVV/100-16        81.7          57.0          -30.23%
      BenchmarkAddVV/1000-16       714           500           -29.97%
      BenchmarkAddVV/10000-16      7088          4946          -30.22%
      BenchmarkAddVV/100000-16     71514         49364         -30.97%
      BenchmarkSubVV/1-16          5.94          5.89          -0.84%
      BenchmarkSubVV/2-16          12.9          6.82          -47.13%
      BenchmarkSubVV/3-16          7.03          7.34          +4.41%
      BenchmarkSubVV/4-16          7.58          8.23          +8.58%
      BenchmarkSubVV/5-16          8.15          8.19          +0.49%
      BenchmarkSubVV/10-16         11.2          11.4          +1.79%
      BenchmarkSubVV/100-16        82.4          57.0          -30.83%
      BenchmarkSubVV/1000-16       715           499           -30.21%
      BenchmarkSubVV/10000-16      7089          4947          -30.22%
      BenchmarkSubVV/100000-16     71568         49378         -31.01%
      
      benchmark                    old MB/s     new MB/s      speedup
      BenchmarkAddVV/1-16          11048.49     10939.92      0.99x
      BenchmarkAddVV/2-16          19973.41     19323.60      0.97x
      BenchmarkAddVV/3-16          27847.09     26123.06      0.94x
      BenchmarkAddVV/4-16          34276.46     30976.54      0.90x
      BenchmarkAddVV/5-16          39781.92     39140.68      0.98x
      BenchmarkAddVV/10-16         58559.29     56894.68      0.97x
      BenchmarkAddVV/100-16        78354.88     112243.69     1.43x
      BenchmarkAddVV/1000-16       89592.74     127889.04     1.43x
      BenchmarkAddVV/10000-16      90292.39     129387.06     1.43x
      BenchmarkAddVV/100000-16     89492.92     129647.78     1.45x
      BenchmarkSubVV/1-16          10781.03     10861.22      1.01x
      BenchmarkSubVV/2-16          9949.27      18760.21      1.89x
      BenchmarkSubVV/3-16          27319.40     26166.01      0.96x
      BenchmarkSubVV/4-16          33764.35     31123.02      0.92x
      BenchmarkSubVV/5-16          39272.40     39050.31      0.99x
      BenchmarkSubVV/10-16         57262.87     56206.33      0.98x
      BenchmarkSubVV/100-16        77641.78     112280.86     1.45x
      BenchmarkSubVV/1000-16       89486.27     128064.08     1.43x
      BenchmarkSubVV/10000-16      90274.37     129356.59     1.43x
      BenchmarkSubVV/100000-16     89424.42     129610.50     1.45x
      
      Change-Id: I2795a82134d1e3b75e2634c76b8ca165a723ec7b
      Reviewed-on: https://go-review.googlesource.com/103495
      Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarLynn Boger <laboger@linux.vnet.ibm.com>
      fc8967e3
    • Joel Sing's avatar
      runtime: fix/improve exitThread on openbsd · a7bb8d3e
      Joel Sing authored
      OpenBSD's __threxit syscall takes a pointer to a 32-bit value that will be
      zeroed immediately before the thread exits. Make use of this instead of
      zeroing freeWait from the exitThread assembly and using hacks like switching
      to a static stack, so this works on 386.
      
      Change-Id: I3ec5ead82b6496404834d148f713794d5d9da723
      Reviewed-on: https://go-review.googlesource.com/105055Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      Reviewed-by: 's avatarAustin Clements <austin@google.com>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      a7bb8d3e
    • Ilya Tocar's avatar
      cmd/compile/internal/ssa: fix GO386=387 build · d3026dd3
      Ilya Tocar authored
      Don't generate FP ops with 1 operand in memory for 387.
      
      Change-Id: I23b49dfa2a1e60c8778c920230e64785a3ddfbd1
      Reviewed-on: https://go-review.googlesource.com/105035
      Run-TryBot: Ilya Tocar <ilya.tocar@intel.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      d3026dd3
    • Matthew Dempsky's avatar
      cmd/compile: drop legacy code for generating iface wrappers · 6703adde
      Matthew Dempsky authored
      Originally, scalar values were directly stored within interface values
      as long as they fit into a pointer-sized slot of memory. And since
      interface method calls always pass the full pointer-sized value as the
      receiver argument, value-narrowing wrappers were necessary to adapt to
      the calling convention for methods with smaller receiver types.
      
      However, for precise garbage collection, we now only store actual
      pointers within interface values, so these wrappers are no longer
      necessary.
      
      Passes toolstash-check.
      
      Change-Id: I5303bfeb8d0f11db619b5a5d06b37ac898588670
      Reviewed-on: https://go-review.googlesource.com/104875
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      Reviewed-by: 's avatarAustin Clements <austin@google.com>
      6703adde
    • Daniel Martí's avatar
      cmd/internal/obj: various code cleanups · e8aa9a53
      Daniel Martí authored
      Mostly replacing C-Style loops with range expressions, but also other
      simplifications like the introduction of writeBool and unindenting some
      code.
      
      Passes toolstash -cmp on std cmd.
      
      Change-Id: I799bccd4e5d411428dcf122b8588a564a9217e7c
      Reviewed-on: https://go-review.googlesource.com/104936
      Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarMarvin Stenger <marvin.stenger94@gmail.com>
      Reviewed-by: 's avatarIlya Tocar <ilya.tocar@intel.com>
      e8aa9a53