1. 09 Apr, 2018 12 commits
  2. 08 Apr, 2018 2 commits
  3. 07 Apr, 2018 4 commits
  4. 06 Apr, 2018 17 commits
  5. 05 Apr, 2018 5 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