1. 09 Oct, 2018 5 commits
    • Brad Fitzpatrick's avatar
      net/http/httputil: rewrite flushing code, disable on Server-Sent Events · 5440bfc2
      Brad Fitzpatrick authored
      * Rewrite the flushing code to not use a persistent goroutine, which
        also simplifies testing.
      * Define the meaning of a negative flush interval. Its meaning doesn't
        change, but now it's locked in, and then we can use it to optimize
        the performance of the non-buffered case to avoid use of an AfterFunc.
      * Support (internal-only) special casing of FlushInterval values per
        request/response.
      * For now, treat Server-Sent Event responses as unbuffered. (or rather,
        immediately flushed from the buffer per-write)
      
      Fixes #27816
      
      Change-Id: Ie0f975c997daa3db539504137c741a96d7022665
      Reviewed-on: https://go-review.googlesource.com/c/137335
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarDmitri Shuralyov <dmitshur@golang.org>
      5440bfc2
    • Qais Patankar's avatar
      cmd/compile: fix Compiler Directives typo · ffc7bc55
      Qais Patankar authored
      Change-Id: I098b3c627c2142affd4e800a2c1f37e00f3775c5
      Reviewed-on: https://go-review.googlesource.com/c/140777Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      ffc7bc55
    • Marten Seemann's avatar
      crypto/tls: fix ServerHello SCT test · 465d1c61
      Marten Seemann authored
      According to https://tools.ietf.org/html/rfc6962#section-3.3, the SCT
      must be at least one byte long. The parsing code correctly checks for
      this condition, but rarely the test does generate an empty SCT.
      
      Change-Id: If36a34985b4470a5a9f96affc159195c04f6bfad
      Reviewed-on: https://go-review.googlesource.com/c/129755Reviewed-by: default avatarFilippo Valsorda <filippo@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      465d1c61
    • Ben Shi's avatar
      cmd/compile: combine similar code in amd64's assembly generator · ccc337d8
      Ben Shi authored
      BSFQ/BSRQ/BSFL/BSRL/SQRTSD have similar logic in amd64's assembly
      generator. This CL combines them together while does not impact
      generated amd64 code. The total size of
      pkg/linux_amd64/cmd/compile/internal decreases about 1.8KB.
      
      Change-Id: I5f3210c5178c20ac9108877c69f17234baf5b6b7
      Reviewed-on: https://go-review.googlesource.com/c/140438
      Run-TryBot: Ben Shi <powerman1st@163.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarKeith Randall <khr@golang.org>
      ccc337d8
    • Ben Shi's avatar
      cmd/compile: add indexed form for several 386 instructions · 39333025
      Ben Shi authored
      This CL implements indexed memory operands for the following instructions.
      (ADD|SUB|MUL|AND|OR|XOR)Lload -> (ADD|SUB|MUL|AND|OR|XOR)Lloadidx4
      (ADD|SUB|AND|OR|XOR)Lmodify -> (ADD|SUB|AND|OR|XOR)Lmodifyidx4
      (ADD|AND|OR|XOR)Lconstmodify -> (ADD|AND|OR|XOR)Lconstmodifyidx4
      
      1. The total size of pkg/linux_386/ decreases about 2.5KB, excluding
      cmd/compile/ .
      
      2. There is little regression in the go1 benchmark test, excluding noise.
      name                     old time/op    new time/op    delta
      BinaryTree17-4              3.25s ± 3%     3.25s ± 3%    ~     (p=0.218 n=40+40)
      Fannkuch11-4                3.53s ± 1%     3.53s ± 1%    ~     (p=0.303 n=40+40)
      FmtFprintfEmpty-4          44.9ns ± 3%    45.6ns ± 3%  +1.48%  (p=0.030 n=40+36)
      FmtFprintfString-4         78.7ns ± 5%    80.1ns ± 7%    ~     (p=0.217 n=36+40)
      FmtFprintfInt-4            90.2ns ± 6%    89.8ns ± 5%    ~     (p=0.659 n=40+38)
      FmtFprintfIntInt-4          140ns ± 5%     141ns ± 5%  +1.00%  (p=0.027 n=40+40)
      FmtFprintfPrefixedInt-4     185ns ± 3%     183ns ± 3%    ~     (p=0.104 n=40+40)
      FmtFprintfFloat-4           411ns ± 4%     406ns ± 3%  -1.37%  (p=0.005 n=40+40)
      FmtManyArgs-4               590ns ± 4%     598ns ± 4%  +1.35%  (p=0.008 n=40+40)
      GobDecode-4                7.16ms ± 5%    7.10ms ± 5%    ~     (p=0.335 n=40+40)
      GobEncode-4                6.85ms ± 7%    6.74ms ± 9%    ~     (p=0.058 n=38+40)
      Gzip-4                      400ms ± 4%     399ms ± 2%  -0.34%  (p=0.003 n=40+33)
      Gunzip-4                   41.4ms ± 3%    41.4ms ± 4%  -0.12%  (p=0.020 n=40+40)
      HTTPClientServer-4         64.1µs ± 4%    63.5µs ± 2%  -1.07%  (p=0.000 n=39+37)
      JSONEncode-4               15.9ms ± 2%    15.9ms ± 3%    ~     (p=0.103 n=40+40)
      JSONDecode-4               62.2ms ± 4%    61.6ms ± 3%  -0.98%  (p=0.006 n=39+40)
      Mandelbrot200-4            5.18ms ± 3%    5.14ms ± 4%    ~     (p=0.125 n=40+40)
      GoParse-4                  3.29ms ± 2%    3.27ms ± 2%  -0.66%  (p=0.006 n=40+40)
      RegexpMatchEasy0_32-4       103ns ± 4%     103ns ± 4%    ~     (p=0.632 n=40+40)
      RegexpMatchEasy0_1K-4       830ns ± 3%     828ns ± 3%    ~     (p=0.563 n=40+40)
      RegexpMatchEasy1_32-4       113ns ± 4%     113ns ± 4%    ~     (p=0.494 n=40+40)
      RegexpMatchEasy1_1K-4      1.03µs ± 4%    1.03µs ± 4%    ~     (p=0.665 n=40+40)
      RegexpMatchMedium_32-4      130ns ± 4%     129ns ± 3%    ~     (p=0.458 n=40+40)
      RegexpMatchMedium_1K-4     39.4µs ± 3%    39.7µs ± 3%    ~     (p=0.825 n=40+40)
      RegexpMatchHard_32-4       2.16µs ± 4%    2.15µs ± 4%    ~     (p=0.137 n=40+40)
      RegexpMatchHard_1K-4       65.2µs ± 3%    65.4µs ± 4%    ~     (p=0.160 n=40+40)
      Revcomp-4                   1.87s ± 2%     1.87s ± 1%  +0.17%  (p=0.019 n=33+33)
      Template-4                 69.4ms ± 3%    69.8ms ± 3%  +0.60%  (p=0.009 n=40+40)
      TimeParse-4                 437ns ± 4%     438ns ± 4%    ~     (p=0.234 n=40+40)
      TimeFormat-4                408ns ± 3%     408ns ± 3%    ~     (p=0.904 n=40+40)
      [Geo mean]                 65.7µs         65.6µs       -0.08%
      
      name                     old speed      new speed      delta
      GobDecode-4               107MB/s ± 5%   108MB/s ± 5%    ~     (p=0.336 n=40+40)
      GobEncode-4               112MB/s ± 6%   114MB/s ± 9%  +1.95%  (p=0.036 n=37+40)
      Gzip-4                   48.5MB/s ± 4%  48.6MB/s ± 2%  +0.28%  (p=0.003 n=40+33)
      Gunzip-4                  469MB/s ± 4%   469MB/s ± 4%  +0.11%  (p=0.021 n=40+40)
      JSONEncode-4              122MB/s ± 2%   122MB/s ± 3%    ~     (p=0.105 n=40+40)
      JSONDecode-4             31.2MB/s ± 4%  31.5MB/s ± 4%  +0.99%  (p=0.007 n=39+40)
      GoParse-4                17.6MB/s ± 2%  17.7MB/s ± 2%  +0.66%  (p=0.007 n=40+40)
      RegexpMatchEasy0_32-4     310MB/s ± 4%   310MB/s ± 4%    ~     (p=0.384 n=40+40)
      RegexpMatchEasy0_1K-4    1.23GB/s ± 3%  1.24GB/s ± 3%    ~     (p=0.186 n=40+40)
      RegexpMatchEasy1_32-4     283MB/s ± 3%   281MB/s ± 4%    ~     (p=0.855 n=40+40)
      RegexpMatchEasy1_1K-4    1.00GB/s ± 4%  1.00GB/s ± 4%    ~     (p=0.665 n=40+40)
      RegexpMatchMedium_32-4   7.68MB/s ± 4%  7.73MB/s ± 3%    ~     (p=0.359 n=40+40)
      RegexpMatchMedium_1K-4   26.0MB/s ± 3%  25.8MB/s ± 3%    ~     (p=0.825 n=40+40)
      RegexpMatchHard_32-4     14.8MB/s ± 3%  14.9MB/s ± 4%    ~     (p=0.136 n=40+40)
      RegexpMatchHard_1K-4     15.7MB/s ± 3%  15.7MB/s ± 4%    ~     (p=0.150 n=40+40)
      Revcomp-4                 136MB/s ± 1%   136MB/s ± 1%  -0.09%  (p=0.028 n=32+33)
      Template-4               28.0MB/s ± 3%  27.8MB/s ± 3%  -0.59%  (p=0.010 n=40+40)
      [Geo mean]               82.1MB/s       82.3MB/s       +0.25%
      
      Change-Id: Ifa387a251056678326d3508aa02753b70bf7e5d0
      Reviewed-on: https://go-review.googlesource.com/c/140303
      Run-TryBot: Ben Shi <powerman1st@163.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarKeith Randall <khr@golang.org>
      39333025
  2. 08 Oct, 2018 5 commits
  3. 07 Oct, 2018 1 commit
  4. 06 Oct, 2018 11 commits
  5. 05 Oct, 2018 15 commits
    • Alberto Donizetti's avatar
      runtime: revert "skip TestLldbPython when lldb is too old" · 430b9cb9
      Alberto Donizetti authored
      This reverts commit d2170040.
      
      Reason for revert: It broke all the darwin builders; it's also not
      obvious how the weird darwin versions (900, 1000) relate to the > 3.9
      requisite, so I'm not sure how to decide about skipping in a robust
      way. It's better to revert the check for now.
      
      Fixes #28028
      
      Change-Id: Ibbcb7bf7cd2136e0851ebd097a2bc4dec9f0ee18
      Reviewed-on: https://go-review.googlesource.com/c/140217Reviewed-by: default avatarKeith Randall <khr@golang.org>
      430b9cb9
    • Mikio Hara's avatar
      vendor: update golang_org/x/net/route from upstream · 9d907160
      Mikio Hara authored
      Updates the route package to git rev 146acd2 for:
      - 146acd2 don't run NET_RT_IFLIST vs. NET_RT_IFLISTL test in 386 emulation (again)
      
      Change-Id: I24de1eb31b2ca0e24cb9ab1648f7a71b5067cf97
      Reviewed-on: https://go-review.googlesource.com/c/139937Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      9d907160
    • Yuval Pavel Zholkover's avatar
      syscall: FreeBSD 12 ino64 support · dc6eb200
      Yuval Pavel Zholkover authored
      This is similar to CL 136816 for x/sys/unix, changing the FreeBSD ABI to use 64-bit inodes in
      Stat_t, Statfs_t, and Dirent types.
      
      The changes are forward compatible, that is FreeBSD 10.x, 11.x continue to use their current sysnum numbers.
      The affected types are converted to the new layout (with some overhead).
      Thus the same statically linked binary should work using the native sysnums (without any conversion) on FreeBSD 12.
      
      Breaking API changes in package syscall are:
      Mknod takes a uint64 (C dev_t) instead of int.
      Stat_t: Dev, Ino, Nlink, Rdev, Gen became uint64.
        Atimespec, Mtimespec, Ctimespec, Birthtimespec renamed to Atim, Mtim, Ctim, Birthtim respectively.
      
      Statfs_t: Mntonname and Mntfromname changed from [88]int8 to [1024]int8 arrays.
      
      Dirent: Fileno became uint64, Namlen uint16 and an additional field Off int64 (currently unused) was added.
      
      The following commands were run to generate ztypes_* and zsyscall_* on FreeBSD-12.0-ALPHA6 systems (GOARCH=386 were run on the same amd64 host):
      GOOS=freebsd GOARCH=amd64 ./mksyscall.pl -tags freebsd,amd64 syscall_bsd.go syscall_freebsd.go syscall_freebsd_amd64.go |gofmt >zsyscall_freebsd_amd64.go
      GOOS=freebsd GOARCH=amd64 go tool cgo -godefs types_freebsd.go | GOOS=freebsd GOARCH=amd64 go run mkpost.go >ztypes_freebsd_amd64.go
      
      GOOS=freebsd GOARCH=386 ./mksyscall.pl -l32 -tags freebsd,386 syscall_bsd.go syscall_freebsd.go syscall_freebsd_386.go |gofmt >zsyscall_freebsd_386.go
      GOOS=freebsd GOARCH=386 go tool cgo -godefs types_freebsd.go | GOOS=freebsd GOARCH=386 go run mkpost.go >ztypes_freebsd_386.go
      
      GOOS=freebsd GOARCH=arm ./mksyscall.pl -l32 -arm -tags freebsd,arm syscall_bsd.go syscall_freebsd.go syscall_freebsd_arm.go |gofmt >zsyscall_freebsd_arm.go
      GOOS=freebsd GOARCH=arm go tool cgo -godefs -- -fsigned-char types_freebsd.go | GOOS=freebsd GOARCH=arm go run mkpost.go >ztypes_freebsd_arm.go
      
      The Kevent struct was changed to use the FREEBSD_COMPAT11 version always (requiring the COMPAT_FREEBSD11 kernel option FreeBSD-12, this is the default).
      
      The definitions of ifData were not updated, their functionality in has have been replaced by vendored golang.org/x/net/route.
      
      freebsdVersion initialization was dropped from init() in favor of a sync.Once based wrapper - supportsABI().
      
      Updates #22448.
      
      Change-Id: I359b756e2849c036d7ed7f75dbd6ec836e0b90b4
      Reviewed-on: https://go-review.googlesource.com/c/138595Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      dc6eb200
    • Jordan Rhee's avatar
      debug/pe: fix TestDWARF to work with relocations · 3d19d959
      Jordan Rhee authored
      Fixes #27904
      
      Change-Id: Ie2aad20cd66785b6cc1018c0048824382cb39f8c
      Reviewed-on: https://go-review.googlesource.com/c/140158
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      3d19d959
    • Tobias Klauser's avatar
      runtime: remove unused armArch · 68d52969
      Tobias Klauser authored
      runtime.armArch is unused on linux/arm since CL 93637. The new code in
      runtime/internal/atomic (added by CL 111315) only checks runtime.goarm.
      
      Change-Id: Ic097ee6750e39abb20f45770a1c7c2d925f02408
      Reviewed-on: https://go-review.googlesource.com/c/140077
      Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      68d52969
    • Robert Griesemer's avatar
      go/types: remove a TODO, enable a test · 497fd2c0
      Robert Griesemer authored
      1) Scopes do have a comment field for documentation (debugging output).
         No need to do anything extra.
      
      2) The testcase in expr3.src has ok error messages. Enabled.
      
      Change-Id: Ic1a03bfec0a6a70d876aa6cfb936973abe58fe6c
      Reviewed-on: https://go-review.googlesource.com/c/139902Reviewed-by: default avatarAlan Donovan <adonovan@google.com>
      497fd2c0
    • Robert Griesemer's avatar
      go/types: remove work-around for issue #26390 · 71d40c49
      Robert Griesemer authored
      This work-around is not needed anymore now that method
      signatures are type-checked separately from their receiver
      base types: no artificial cycles are introduced anymore
      and so there is no need to artificially cut them.
      
      Fixes #26854.
      
      Change-Id: I2ef15ceeaa0b486f65f6cdc466d0cf06246c74d7
      Reviewed-on: https://go-review.googlesource.com/c/139900Reviewed-by: default avatarAlan Donovan <adonovan@google.com>
      71d40c49
    • Robert Griesemer's avatar
      go/types: remove work-around for issue #26124 · 6d51dd1e
      Robert Griesemer authored
      This work-around is not needed anymore now that method
      signatures are type-checked separately from their receiver
      base types: no artificial cycles are introduced anymore
      and so there is no need to artificially cut them.
      
      Updates #26124.
      
      Change-Id: I9d50171f12dd8977116a5d3f63ac39a06b1cd492
      Reviewed-on: https://go-review.googlesource.com/c/139899Reviewed-by: default avatarAlan Donovan <adonovan@google.com>
      6d51dd1e
    • Robert Griesemer's avatar
      go/types: don't type-check method signatures eagerly anymore · 8ae8576a
      Robert Griesemer authored
      As a side-effect we also get slightly clearer errors for some
      pathological cyclic method declarations.
      
      Fixes #23203.
      Updates #26854.
      
      Change-Id: I30bd6634ac6be26d3f4ef8c7b32e5c1bf76987dd
      Reviewed-on: https://go-review.googlesource.com/c/139897Reviewed-by: default avatarAlan Donovan <adonovan@google.com>
      8ae8576a
    • Robert Griesemer's avatar
      go/types: prepare for delayed type-checking of methods to when they are used · bf924068
      Robert Griesemer authored
      Remove assumption that methods associated to concrete (non-interface)
      types have a fully set up signature. Such methods are found through
      LookupFieldOrMethod or lookupMethod, or indexed method access from
      a Named type. Make sure that the method's signature is type-checked
      before use in those cases.
      
      (MethodSets also hold methods but the type checker is not using
      them but for internal verification. API clients will be using it
      after all methods have been type-checked.)
      
      Some functions such as MissingMethod may now have to type-check a
      method and for that they need a *Checker. Add helper functions as
      necessary to provide the additional (receiver) parameter but permit
      it to be nil if the respective functions are invoked through the API
      (at which point we know that all methods have a proper signature and
      thus we don't need the delayed type-check).
      
      Since all package-level objects eventually are type-checked through
      the top-level loop in Checker.packageObjects we are guaranteed that
      all methods will be type-checked as well.
      
      Updates #23203.
      Updates #26854.
      
      Change-Id: I6e48f0016cefd498aa70b776e84a48215a9042c5
      Reviewed-on: https://go-review.googlesource.com/c/139425Reviewed-by: default avatarAlan Donovan <adonovan@google.com>
      bf924068
    • Robert Griesemer's avatar
      go/types: fix recvPtr helper (follow-up on https://golang.org/cl/139422) · f2c1c7ac
      Robert Griesemer authored
      The prior CL prepared go/types for the situation where methods might
      not have a type-checked signature when being looked up. The respective
      adjustments to recvPtr were not correct (but because so far method
      signatures are type-checked in time, the bug didn't manifest itself).
      
      Updates #23203.
      Updates #26854.
      
      Change-Id: I796691d11e6aac84396bdef802ad30715755fcc6
      Reviewed-on: https://go-review.googlesource.com/c/139721Reviewed-by: default avatarAlan Donovan <adonovan@google.com>
      f2c1c7ac
    • Meng Zhuo's avatar
      cmd/api: explicit tagKey with GOOS and GOARCH · 28fa1da9
      Meng Zhuo authored
      The origin tagKey is just dirname if no tags input which will cause
      pkgCache missmatch if other imported pkg explicit on GOARCH or GOOS
      
      This CL will add GOOS and GOARCH to tagKey
      
      Fixes #8425
      Fixes #21181
      
      Change-Id: Ifc189cf6746d753ad7c7e5bb60621297fc0a4e35
      Reviewed-on: https://go-review.googlesource.com/c/138315Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
      28fa1da9
    • Austin Clements's avatar
      runtime: improve mheap.alloc doc and let compiler check system stack · 415e948e
      Austin Clements authored
      The alloc_m documentation refers to concepts that don't exist (and
      maybe never did?). alloc_m is also not the API entry point to span
      allocation.
      
      Hence, rewrite the documentation for alloc and alloc_m. While we're
      here, document why alloc_m must run on the system stack and replace
      alloc_m's hand-implemented system stack check with a go:systemstack
      annotation.
      
      Change-Id: I30e263d8e53c2774a6614e1b44df5464838cef09
      Reviewed-on: https://go-review.googlesource.com/c/139459
      Run-TryBot: Austin Clements <austin@google.com>
      Reviewed-by: default avatarMichael Knyszek <mknyszek@google.com>
      Reviewed-by: default avatarKeith Randall <khr@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      415e948e
    • Alex Brainman's avatar
      cmd/link: move .rel symbol from .rdata into .text · 8256bcda
      Alex Brainman authored
      .rel symbol type is sym.SELFROSECT, and that makes .rel written
      into .rdata section. But .rel stores code - jump table used for
      external C functions. So we have to mark whole .rdata section
      as executable (IMAGE_SCN_MEM_EXECUTE), because of .rel presence
      in it.
      
      Move .rel into .text section, and make .rdata section non executable.
      
      I also had to move code that adjusted the size of .rel symbol
      before calling textaddress, otherwise textaddress would not
      calculate size of .text section correctly.
      
      Fixes #25926
      
      Change-Id: I4962f5de7b367410154c8709adfcd8472de9ac1a
      Reviewed-on: https://go-review.googlesource.com/c/125455
      Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      8256bcda
    • Keith Randall's avatar
      cmd/link: fix deferreturn location on wasm · 48e22da1
      Keith Randall authored
      On wasm, pcln tables are indexed by "resumption point ID" instead of
      by pc offset. When finding a deferreturn call, we must find the
      associated resumption point ID for the deferreturn call.
      
      Update #27518
      Fixes wasm bug introduced in CL 134637.
      
      Change-Id: I3d178a3f5203a06c0180a1aa2309bfb7f3014f0f
      Reviewed-on: https://go-review.googlesource.com/c/139898Reviewed-by: default avatarCherry Zhang <cherryyz@google.com>
      48e22da1
  6. 04 Oct, 2018 3 commits
    • Jason Keene's avatar
      cmd/go: ensure git attributes are set · 1bca6cec
      Jason Keene authored
      This change disables the export-subst and export-ignore attributes when
      creating zip files for modules. This is done to prevent the ziphash for
      a given repo/revision from differing based on variables such as git
      version or size of repo. The full rational for this change is detailed
      here:
      
          https://github.com/golang/go/issues/27153#issuecomment-420763082
      
      Fixes #27153
      
      Change-Id: Ib33f525d91d2581fa0b5d26e70d29620c7e685e9
      Reviewed-on: https://go-review.googlesource.com/c/135175
      Run-TryBot: Bryan C. Mills <bcmills@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBryan C. Mills <bcmills@google.com>
      1bca6cec
    • Mikio Hara's avatar
      vendor: update golang_org/x/net/route from upstream · fa179eb8
      Mikio Hara authored
      Updates the route package to git rev 68fc911 for:
      - 68fc911 re-adjust routing message alignment for FreeBSD 386 emulation
      - 4dfa261 fix typos in comments
      - ae89d30 avoid unnecessary type conversions
      
      Change-Id: I915e614e464acf85a8fc80f36f05a85a9246bb01
      Reviewed-on: https://go-review.googlesource.com/c/139817
      Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      fa179eb8
    • Ben Shi's avatar
      cmd/internal/obj/arm64: simplify ADD and SUB · 80818620
      Ben Shi authored
      Currently "ADD $0x123456, Rs, Rd" will load pre-stored 0x123456
      from the constant pool and use it for the addition. Total 12 bytes
      are cost. And so does SUB.
      
      This CL breaks it to "ADD 0x123000, Rs, Rd" + "ADD 0x000456, Rd, Rd".
      Both "0x123000" and "0x000456" can be directly encoded into the
      instruction binary code. So 4 bytes are saved.
      
      1. The total size of pkg/android_arm64 decreases about 0.3KB.
      
      2. The go1 benchmark show little regression (excluding noise).
      
      name                     old time/op    new time/op    delta
      BinaryTree17-4              15.9s ± 0%     15.9s ± 1%  +0.10%  (p=0.044 n=29+29)
      Fannkuch11-4                8.72s ± 0%     8.75s ± 0%  +0.34%  (p=0.000 n=30+24)
      FmtFprintfEmpty-4           173ns ± 0%     173ns ± 0%    ~     (all equal)
      FmtFprintfString-4          368ns ± 0%     368ns ± 0%    ~     (p=0.593 n=30+30)
      FmtFprintfInt-4             417ns ± 0%     417ns ± 0%    ~     (all equal)
      FmtFprintfIntInt-4          673ns ± 0%     661ns ± 1%  -1.70%  (p=0.000 n=30+30)
      FmtFprintfPrefixedInt-4     805ns ± 0%     805ns ± 0%  +0.10%  (p=0.011 n=30+30)
      FmtFprintfFloat-4          1.09µs ± 0%    1.09µs ± 0%    ~     (p=0.125 n=30+29)
      FmtManyArgs-4              2.68µs ± 0%    2.68µs ± 0%  +0.07%  (p=0.004 n=30+30)
      GobDecode-4                32.9ms ± 0%    33.2ms ± 1%  +1.07%  (p=0.000 n=29+29)
      GobEncode-4                29.5ms ± 0%    29.6ms ± 0%  +0.26%  (p=0.000 n=28+28)
      Gzip-4                      1.38s ± 1%     1.35s ± 3%  -1.94%  (p=0.000 n=28+30)
      Gunzip-4                    139ms ± 0%     139ms ± 0%  +0.10%  (p=0.000 n=28+29)
      HTTPClientServer-4          745µs ± 5%     742µs ± 3%    ~     (p=0.405 n=28+29)
      JSONEncode-4               49.5ms ± 1%    49.9ms ± 0%  +0.89%  (p=0.000 n=30+30)
      JSONDecode-4                264ms ± 1%     264ms ± 0%  +0.25%  (p=0.001 n=30+30)
      Mandelbrot200-4            16.6ms ± 0%    16.6ms ± 0%    ~     (p=0.507 n=29+29)
      GoParse-4                  15.9ms ± 0%    16.0ms ± 1%  +0.91%  (p=0.002 n=23+30)
      RegexpMatchEasy0_32-4       379ns ± 0%     379ns ± 0%    ~     (all equal)
      RegexpMatchEasy0_1K-4      1.31µs ± 0%    1.31µs ± 0%  +0.09%  (p=0.008 n=27+30)
      RegexpMatchEasy1_32-4       357ns ± 0%     358ns ± 0%  +0.28%  (p=0.000 n=28+29)
      RegexpMatchEasy1_1K-4      2.04µs ± 0%    2.04µs ± 0%    ~     (p=0.850 n=30+30)
      RegexpMatchMedium_32-4      587ns ± 0%     589ns ± 0%  +0.33%  (p=0.000 n=30+30)
      RegexpMatchMedium_1K-4      162µs ± 0%     163µs ± 0%    ~     (p=0.351 n=30+29)
      RegexpMatchHard_32-4       9.54µs ± 0%    9.60µs ± 0%  +0.59%  (p=0.000 n=28+30)
      RegexpMatchHard_1K-4        287µs ± 0%     287µs ± 0%  +0.11%  (p=0.000 n=26+29)
      Revcomp-4                   2.50s ± 0%     2.50s ± 0%  -0.13%  (p=0.012 n=28+27)
      Template-4                  312ms ± 1%     312ms ± 1%  +0.20%  (p=0.015 n=27+30)
      TimeParse-4                1.68µs ± 0%    1.68µs ± 0%  -0.35%  (p=0.000 n=30+30)
      TimeFormat-4               1.66µs ± 0%    1.64µs ± 0%  -1.20%  (p=0.000 n=25+29)
      [Geo mean]                  246µs          246µs       -0.00%
      
      name                     old speed      new speed      delta
      GobDecode-4              23.3MB/s ± 0%  23.1MB/s ± 1%  -1.05%  (p=0.000 n=29+29)
      GobEncode-4              26.0MB/s ± 0%  25.9MB/s ± 0%  -0.25%  (p=0.000 n=29+28)
      Gzip-4                   14.1MB/s ± 1%  14.4MB/s ± 3%  +1.94%  (p=0.000 n=27+30)
      Gunzip-4                  139MB/s ± 0%   139MB/s ± 0%  -0.10%  (p=0.000 n=28+29)
      JSONEncode-4             39.2MB/s ± 1%  38.9MB/s ± 0%  -0.88%  (p=0.000 n=30+30)
      JSONDecode-4             7.37MB/s ± 0%  7.35MB/s ± 0%  -0.26%  (p=0.001 n=30+30)
      GoParse-4                3.65MB/s ± 0%  3.62MB/s ± 1%  -0.86%  (p=0.001 n=23+30)
      RegexpMatchEasy0_32-4    84.3MB/s ± 0%  84.3MB/s ± 0%    ~     (p=0.126 n=27+26)
      RegexpMatchEasy0_1K-4     784MB/s ± 0%   783MB/s ± 0%  -0.10%  (p=0.003 n=27+30)
      RegexpMatchEasy1_32-4    89.5MB/s ± 0%  89.3MB/s ± 0%  -0.20%  (p=0.000 n=27+29)
      RegexpMatchEasy1_1K-4     502MB/s ± 0%   502MB/s ± 0%    ~     (p=0.858 n=30+28)
      RegexpMatchMedium_32-4   1.70MB/s ± 0%  1.70MB/s ± 0%  -0.25%  (p=0.000 n=30+30)
      RegexpMatchMedium_1K-4   6.30MB/s ± 0%  6.30MB/s ± 0%    ~     (all equal)
      RegexpMatchHard_32-4     3.35MB/s ± 0%  3.33MB/s ± 0%  -0.47%  (p=0.000 n=30+30)
      RegexpMatchHard_1K-4     3.57MB/s ± 0%  3.56MB/s ± 0%  -0.20%  (p=0.000 n=27+30)
      Revcomp-4                 102MB/s ± 0%   102MB/s ± 0%  +0.14%  (p=0.008 n=28+28)
      Template-4               6.23MB/s ± 0%  6.21MB/s ± 1%  -0.21%  (p=0.009 n=21+30)
      [Geo mean]               24.1MB/s       24.0MB/s       -0.16%
      
      Change-Id: Ifcef3edb667540e2d86e586c23afcfbc2cf1340b
      Reviewed-on: https://go-review.googlesource.com/c/134536
      Run-TryBot: Ben Shi <powerman1st@163.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarCherry Zhang <cherryyz@google.com>
      80818620