1. 27 Nov, 2018 4 commits
    • Brian Kessler's avatar
      math/bits: define Div to panic when y<=hi · 979d9027
      Brian Kessler authored
      Div panics when y<=hi because either the quotient overflows
      the size of the output or division by zero occurs when y==0.
      This provides a uniform behavior for all implementations.
      
      Fixes #28316
      
      Change-Id: If23aeb10e0709ee1a60b7d614afc9103d674a980
      Reviewed-on: https://go-review.googlesource.com/c/149517Reviewed-by: 's avatarRobert Griesemer <gri@golang.org>
      979d9027
    • Brian Kessler's avatar
      cmd/compile: intrinsify math/bits.Div on amd64 · 319787a5
      Brian Kessler authored
      Note that the intrinsic implementation panics separately for overflow and
      divide by zero, which matches the behavior of the pure go implementation.
      There is a modest performance improvement after intrinsic implementation.
      
      name     old time/op  new time/op  delta
      Div-4    53.0ns ± 1%  47.0ns ± 0%  -11.28%  (p=0.008 n=5+5)
      Div32-4  18.4ns ± 0%  18.5ns ± 1%     ~     (p=0.444 n=5+5)
      Div64-4  53.3ns ± 0%  47.5ns ± 4%  -10.77%  (p=0.008 n=5+5)
      
      Updates #28273
      
      Change-Id: Ic1688ecc0964acace2e91bf44ef16f5fb6b6bc82
      Reviewed-on: https://go-review.googlesource.com/c/144378
      Run-TryBot: Keith Randall <khr@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarKeith Randall <khr@golang.org>
      319787a5
    • Brian Kessler's avatar
      math/bits: panic when y<=hi in Div · ead5d1e3
      Brian Kessler authored
      Explicitly check for divide-by-zero/overflow and panic with the appropriate
      runtime error.  The additional checks have basically no effect on performance
      since the branch is easily predicted.
      
      name     old time/op  new time/op  delta
      Div-4    53.9ns ± 1%  53.0ns ± 1%  -1.59%  (p=0.016 n=4+5)
      Div32-4  17.9ns ± 0%  18.4ns ± 0%  +2.56%  (p=0.008 n=5+5)
      Div64-4  53.5ns ± 0%  53.3ns ± 0%    ~     (p=0.095 n=5+5)
      
      Updates #28316
      
      Change-Id: I36297ee9946cbbc57fefb44d1730283b049ecf57
      Reviewed-on: https://go-review.googlesource.com/c/144377
      Run-TryBot: Keith Randall <khr@golang.org>
      Reviewed-by: 's avatarKeith Randall <khr@golang.org>
      ead5d1e3
    • Keith Randall's avatar
      cmd/compile: don't convert non-Go-constants to OLITERALs · eb6c433e
      Keith Randall authored
      Don't convert values that aren't Go constants, like
      uintptr(unsafe.Pointer(nil)), to a literal constant. This avoids
      assuming they are constants for things like indexing, array sizes,
      case duplication, etc.
      
      Also, nil is an allowed duplicate in switches. CTNILs aren't Go constants.
      
      Fixes #28078
      Fixes #28079
      
      Change-Id: I9ab8af47098651ea09ef10481787eae2ae2fb445
      Reviewed-on: https://go-review.googlesource.com/c/151320
      Run-TryBot: Keith Randall <khr@golang.org>
      Reviewed-by: 's avatarMatthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      eb6c433e
  2. 26 Nov, 2018 13 commits
  3. 24 Nov, 2018 1 commit
    • Alex Brainman's avatar
      debug/pe: use kernel32.dll in TestImportTableInUnknownSection · 048c9164
      Alex Brainman authored
      TestImportTableInUnknownSection was introduced in CL 110555 to
      test PE executable with import table located in section other than
      ".idata". We used atmfd.dll for that purpose, but it seems
      atmfd.dll is not present on some systems.
      
      Use kernel32.dll instead. kernel32.dll import table is located in
      ".rdata" section, so it should do the job. And every Windows
      system has kernel32.dll file.
      
      Also make TestImportTableInUnknownSection run on windows-arm,
      since windows-arm should also have kernel32.dll file.
      
      Updates #27904
      
      Change-Id: Ie005ee10e46ae0c06e83929d581e89f86c051eea
      Reviewed-on: https://go-review.googlesource.com/c/151137
      Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      048c9164
  4. 23 Nov, 2018 4 commits
  5. 22 Nov, 2018 2 commits
  6. 21 Nov, 2018 8 commits
  7. 20 Nov, 2018 8 commits