1. 05 Apr, 2019 12 commits
  2. 04 Apr, 2019 8 commits
    • Filippo Valsorda's avatar
      math/big: do not panic in Exp when y < 0 and x doesn't have an inverse · ead89568
      Filippo Valsorda authored
      If x does not have an inverse modulo m, and a negative exponent is used,
      return nil just like ModInverse does now.
      
      Change-Id: I8fa72f7a851e8cf77c5fab529ede88408740626f
      Reviewed-on: https://go-review.googlesource.com/c/go/+/170757
      Run-TryBot: Filippo Valsorda <filippo@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
      ead89568
    • Keith Randall's avatar
      syscall: don't use INODE64 for fdopendir on darwin/386 · a8e83d2f
      Keith Randall authored
      The INODE64 variant only exists on 64-bit.
      
      Fixes #31262
      
      Change-Id: I528277c9b3312fdb15463ccbea0d537ff300f4ae
      Reviewed-on: https://go-review.googlesource.com/c/go/+/170837
      Run-TryBot: Keith Randall <khr@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      a8e83d2f
    • Austin Clements's avatar
      runtime: ring buffer for binary debug logging · 3ebb1ad9
      Austin Clements authored
      This adds an internal runtime debug log. It uses per-M time-stamped
      ring buffers of binary log records. On panic, these buffers are
      collected, interleaved, and printed.
      
      The entry-point to the debug log is a new "dlog" function. dlog is
      designed so it can be used even from very constrained corners of the
      runtime such as signal handlers or inside the write barrier.
      
      The facility is only enabled if the debuglog build tag is set.
      Otherwise, it compiles away to a no-op implementation.
      
      The debug log format is also designed so it would be reasonable to
      decode from a core dump, though this hasn't been implemented.
      
      Change-Id: I6e2737c286358e97a0d8091826498070b95b66a3
      Reviewed-on: https://go-review.googlesource.com/c/go/+/157997
      Run-TryBot: Austin Clements <austin@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarMichael Knyszek <mknyszek@google.com>
      3ebb1ad9
    • grant's avatar
      net: use libSystem bindings for DNS resolution on macos if cgo is unavailable · f6b42a53
      grant authored
      This change adds directives to link the res_search function in libSystem.
      The corresponding Go function is then used in `lookup_darwin.go` for
      resolution when cgo is disabled. This makes DNS resolution logic more
      reliable as macOS has some unique quirks such as the `/etc/resolver/`
      directory for specifying nameservers.
      
      Fixes #12524
      
      Change-Id: I367263c4951383965b3ef6491196152f78e614b1
      GitHub-Last-Rev: 3c3ff6bfa7e4811f206f3b119a867c841a016e10
      GitHub-Pull-Request: golang/go#30686
      Reviewed-on: https://go-review.googlesource.com/c/go/+/166297
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarKeith Randall <khr@golang.org>
      f6b42a53
    • Than McIntosh's avatar
      math/bits: add gccgo-friendly code for compiler bootstrap · bead3586
      Than McIntosh authored
      When building as part of the bootstrap process, avoid
      use of "go:linkname" applied to variables, since this
      feature is ill-defined/unsupported for gccgo.
      
      Updates #30771.
      
      Change-Id: Id44d01b5c98d292702e5075674117518cb59e2d0
      Reviewed-on: https://go-review.googlesource.com/c/go/+/170737Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      Reviewed-by: default avatarCherry Zhang <cherryyz@google.com>
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      bead3586
    • Richard Musiol's avatar
      cmd/compile: add saturating conversions on wasm · cf8cc7f6
      Richard Musiol authored
      This change adds the GOWASM option "satconv" to enable the generation
      of experimental saturating (non-trapping) float-to-int conversions.
      It improves the performance of the conversion by 42%.
      
      Previously the conversions had already been augmented with helper
      functions to have saturating behavior. Now Wasm.rules is always using
      the new operation names and wasm/ssa.go is falling back to the helpers
      if the feature is not enabled.
      
      The feature is in phase 4 of the WebAssembly proposal process:
      https://github.com/WebAssembly/meetings/blob/master/process/phases.md
      
      More information on the feature can be found at:
      https://github.com/WebAssembly/nontrapping-float-to-int-conversions/blob/master/proposals/nontrapping-float-to-int-conversion/Overview.md
      
      Change-Id: Ic6c3688017054ede804b02b6b0ffd4a02ef33ad7
      Reviewed-on: https://go-review.googlesource.com/c/go/+/170119Reviewed-by: default avatarCherry Zhang <cherryyz@google.com>
      Run-TryBot: Cherry Zhang <cherryyz@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      cf8cc7f6
    • Leo Antunes's avatar
      net: add KeepAlive field to ListenConfig · 1abf3aa5
      Leo Antunes authored
      This commit adds a KeepAlive field to ListenConfig and uses it
      analogously to Dialer.KeepAlive to set TCP KeepAlives per default on
      Accept()
      
      Fixes #23378
      
      Change-Id: I57eaf9508c979e7f0e2b8c5dd8e8901f6eb27fd6
      GitHub-Last-Rev: e9e035d53ee8aa3d899d12db08b293f599daecb6
      GitHub-Pull-Request: golang/go#31242
      Reviewed-on: https://go-review.googlesource.com/c/go/+/170678
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      1abf3aa5
    • Neven Sajko's avatar
      math/big: simplify shlVU_g and shrVU_g · 964fe4b8
      Neven Sajko authored
      Rewrote a few lines to be more idiomatic/less assembly-ish.
      
      Benchmarked with `go test -bench Float -tags math_big_pure_go`:
      
      name                  old time/op    new time/op    delta
      FloatString/100-8        751ns ± 0%     746ns ± 1%  -0.71%  (p=0.000 n=10+10)
      FloatString/1000-8      22.9µs ± 0%    22.9µs ± 0%    ~     (p=0.271 n=10+10)
      FloatString/10000-8     1.89ms ± 0%    1.89ms ± 0%    ~     (p=0.481 n=10+10)
      FloatString/100000-8     184ms ± 0%     184ms ± 0%    ~     (p=0.094 n=9+9)
      FloatAdd/10-8           56.4ns ± 1%    56.5ns ± 0%    ~     (p=0.170 n=9+9)
      FloatAdd/100-8          59.7ns ± 0%    59.3ns ± 0%  -0.70%  (p=0.000 n=8+9)
      FloatAdd/1000-8          101ns ± 0%      99ns ± 0%  -1.89%  (p=0.000 n=8+8)
      FloatAdd/10000-8         553ns ± 0%     536ns ± 0%  -3.00%  (p=0.000 n=9+10)
      FloatAdd/100000-8       4.94µs ± 0%    4.74µs ± 0%  -3.94%  (p=0.000 n=9+10)
      FloatSub/10-8           50.3ns ± 0%    50.5ns ± 0%  +0.52%  (p=0.000 n=8+8)
      FloatSub/100-8          52.0ns ± 0%    52.2ns ± 1%  +0.46%  (p=0.012 n=8+10)
      FloatSub/1000-8         77.9ns ± 0%    77.3ns ± 0%  -0.80%  (p=0.000 n=7+8)
      FloatSub/10000-8         371ns ± 0%     362ns ± 0%  -2.67%  (p=0.000 n=10+10)
      FloatSub/100000-8       3.20µs ± 0%    3.10µs ± 0%  -3.16%  (p=0.000 n=10+10)
      ParseFloatSmallExp-8    7.84µs ± 0%    7.82µs ± 0%  -0.17%  (p=0.037 n=9+9)
      ParseFloatLargeExp-8    29.3µs ± 1%    29.5µs ± 0%    ~     (p=0.059 n=9+8)
      FloatSqrt/64-8           516ns ± 0%     519ns ± 0%  +0.54%  (p=0.000 n=9+9)
      FloatSqrt/128-8         1.07µs ± 0%    1.07µs ± 0%    ~     (p=0.109 n=8+9)
      FloatSqrt/256-8         1.23µs ± 0%    1.23µs ± 0%  +0.50%  (p=0.000 n=9+9)
      FloatSqrt/1000-8        3.43µs ± 0%    3.44µs ± 0%  +0.53%  (p=0.000 n=9+8)
      FloatSqrt/10000-8       40.9µs ± 0%    40.7µs ± 0%  -0.39%  (p=0.000 n=9+8)
      FloatSqrt/100000-8      1.07ms ± 0%    1.07ms ± 0%  -0.10%  (p=0.017 n=10+9)
      FloatSqrt/1000000-8     89.3ms ± 0%    89.2ms ± 0%  -0.07%  (p=0.015 n=9+8)
      
      Change-Id: Ibf07c6142719d11bc7f329246957d87a9f3ba3d2
      GitHub-Last-Rev: 870a041ab7bb9c24be083114f53653a5f4eed611
      GitHub-Pull-Request: golang/go#31220
      Reviewed-on: https://go-review.googlesource.com/c/go/+/170449
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
      964fe4b8
  3. 03 Apr, 2019 17 commits
  4. 02 Apr, 2019 3 commits
    • Agniva De Sarker's avatar
      image/jpeg: reduce bound checks from idct and fdct · 64f22e4b
      Agniva De Sarker authored
      Before -
      $gotip build -gcflags="-d=ssa/check_bce/debug=1" fdct.go idct.go
      ./fdct.go:89:10: Found IsInBounds
      ./fdct.go:90:10: Found IsInBounds
      ./fdct.go:91:10: Found IsInBounds
      ./fdct.go:92:10: Found IsInBounds
      ./fdct.go:93:10: Found IsInBounds
      ./fdct.go:94:10: Found IsInBounds
      ./fdct.go:95:10: Found IsInBounds
      ./fdct.go:96:10: Found IsInBounds
      ./idct.go:77:9: Found IsInBounds
      ./idct.go:77:27: Found IsInBounds
      ./idct.go:77:45: Found IsInBounds
      ./idct.go:78:7: Found IsInBounds
      ./idct.go:78:25: Found IsInBounds
      ./idct.go:78:43: Found IsInBounds
      ./idct.go:78:61: Found IsInBounds
      ./idct.go:79:13: Found IsInBounds
      ./idct.go:92:13: Found IsInBounds
      ./idct.go:93:12: Found IsInBounds
      ./idct.go:94:12: Found IsInBounds
      ./idct.go:95:12: Found IsInBounds
      ./idct.go:97:12: Found IsInBounds
      ./idct.go:98:12: Found IsInBounds
      ./idct.go:99:12: Found IsInBounds
      
      After -
      $gotip build -gcflags="-d=ssa/check_bce/debug=1" fdct.go idct.go
      ./fdct.go:90:9: Found IsSliceInBounds
      ./idct.go:76:11: Found IsSliceInBounds
      ./idct.go:145:11: Found IsSliceInBounds
      
      name                 old time/op    new time/op    delta
      FDCT-4                 1.85µs ± 2%    1.74µs ± 1%  -5.95%  (p=0.000 n=10+10)
      IDCT-4                 1.94µs ± 2%    1.89µs ± 1%  -2.67%  (p=0.000 n=10+9)
      DecodeBaseline-4       1.45ms ± 2%    1.46ms ± 1%    ~     (p=0.156 n=9+10)
      DecodeProgressive-4    2.21ms ± 1%    2.21ms ± 1%    ~     (p=0.796 n=10+10)
      EncodeRGBA-4           24.9ms ± 1%    25.0ms ± 1%    ~     (p=0.075 n=10+10)
      EncodeYCbCr-4          26.1ms ± 1%    26.2ms ± 1%    ~     (p=0.573 n=8+10)
      
      name                 old speed      new speed      delta
      DecodeBaseline-4     42.5MB/s ± 2%  42.4MB/s ± 1%    ~     (p=0.162 n=9+10)
      DecodeProgressive-4  27.9MB/s ± 1%  27.9MB/s ± 1%    ~     (p=0.796 n=10+10)
      EncodeRGBA-4         49.4MB/s ± 1%  49.1MB/s ± 1%    ~     (p=0.066 n=10+10)
      EncodeYCbCr-4        35.3MB/s ± 1%  35.2MB/s ± 1%    ~     (p=0.586 n=8+10)
      
      name                 old alloc/op   new alloc/op   delta
      DecodeBaseline-4       63.0kB ± 0%    63.0kB ± 0%    ~     (all equal)
      DecodeProgressive-4     260kB ± 0%     260kB ± 0%    ~     (all equal)
      EncodeRGBA-4           4.40kB ± 0%    4.40kB ± 0%    ~     (all equal)
      EncodeYCbCr-4          4.40kB ± 0%    4.40kB ± 0%    ~     (all equal)
      
      name                 old allocs/op  new allocs/op  delta
      DecodeBaseline-4         5.00 ± 0%      5.00 ± 0%    ~     (all equal)
      DecodeProgressive-4      13.0 ± 0%      13.0 ± 0%    ~     (all equal)
      EncodeRGBA-4             4.00 ± 0%      4.00 ± 0%    ~     (all equal)
      EncodeYCbCr-4            4.00 ± 0%      4.00 ± 0%    ~     (all equal)
      
      Updates #24499
      
      Change-Id: I6828d077b851817503a7c1a08235763f81bdadf9
      Reviewed-on: https://go-review.googlesource.com/c/go/+/167417
      Run-TryBot: Agniva De Sarker <agniva.quicksilver@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarNigel Tao <nigeltao@golang.org>
      64f22e4b
    • Ian Lance Taylor's avatar
      misc/cgo/testcarchive: skip TestSignalForwardingExternal on darwin/amd64 · 2da96591
      Ian Lance Taylor authored
      On darwin/amd64 the runtime method sigctxt.fixsigcode changes SIGSEGV
      signals so that they are never marked SI_USER. CL 169120 changed the
      signal handler to call fixsigcode even when the signal is delivered to
      a non-Go thread. This breaks TestSignalForwardingExternal, so skip it.
      
      Change-Id: I6740fb5a8f4f854ca69793537a983a696da3b495
      Reviewed-on: https://go-review.googlesource.com/c/go/+/170446
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      2da96591
    • Elias Naur's avatar
      runtime/cgo: look for android_get_device_api_level in libc.so · fc7ac2e8
      Elias Naur authored
      The presence of the android_get_device_api_level symbol is used to
      detect Android Q or later. Use the suggestion by Ryan Prichard and
      look for it in libc.so and not in the entire program where someone
      else might have defined it.
      
      Manually tested on an Android Q amd64 emulator and arm64 Pixel.
      
      Updates #29674
      
      Change-Id: Iaef35d8f8910037b3690aa21f319e216a05a9a73
      Reviewed-on: https://go-review.googlesource.com/c/go/+/170127
      Run-TryBot: Elias Naur <mail@eliasnaur.com>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      fc7ac2e8