1. 29 Sep, 2016 16 commits
  2. 28 Sep, 2016 8 commits
  3. 27 Sep, 2016 16 commits
    • Keith Randall's avatar
      cmd/compile: remove duplicate nilchecks · 98938189
      Keith Randall authored
      Mark nil check operations as faulting if their arg is zero.
      This lets the late nilcheck pass remove duplicates.
      
      Fixes #17242.
      
      Change-Id: I4c9938d8a5a1e43edd85b4a66f0b34004860bcd9
      Reviewed-on: https://go-review.googlesource.com/29952
      Run-TryBot: Keith Randall <khr@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarCherry Zhang <cherryyz@google.com>
      98938189
    • Cherry Zhang's avatar
      math: add some assembly implementations on ARM64 · ba94dd34
      Cherry Zhang authored
      Also add GP<->FP move addressing mode to FMOVS, FMOVD
      instructions.
      
      Ceil-8                 37.1ns ± 0%   7.9ns ± 0%  -78.64%          (p=0.000 n=4+5)
      Dim-8                  20.9ns ± 1%  11.3ns ± 0%  -45.93%          (p=0.008 n=5+5)
      Floor-8                22.9ns ± 0%   7.9ns ± 0%  -65.41%          (p=0.029 n=4+4)
      Gamma-8                 117ns ± 0%    94ns ± 1%  -19.50%          (p=0.016 n=4+5)
      PowInt-8                121ns ± 0%   108ns ± 1%  -11.07%          (p=0.008 n=5+5)
      PowFrac-8               331ns ± 0%   318ns ± 0%   -3.93%          (p=0.000 n=5+4)
      Trunc-8                18.8ns ± 0%   7.9ns ± 0%  -57.83%          (p=0.016 n=4+5)
      
      Change-Id: I709b7f1a914b28adc27414522db551e2630cfb92
      Reviewed-on: https://go-review.googlesource.com/29734
      Run-TryBot: Cherry Zhang <cherryyz@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarDavid Chase <drchase@google.com>
      ba94dd34
    • Brad Fitzpatrick's avatar
      net/http: add more IDNA2008 tests and fix some omissions · a73020f8
      Brad Fitzpatrick authored
      It wasn't lowercasing the string, folding widths, and putting strings
      into NFC form. Do those.
      
      Fixes #13835
      
      Change-Id: Ia3de6159417cacec203b48e206e51d79f945df58
      Reviewed-on: https://go-review.googlesource.com/29860
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarMarcel van Lohuizen <mpvl@golang.org>
      a73020f8
    • Brad Fitzpatrick's avatar
      vendor: add golang.org/x/text/unicode/norm + x/test/width for IDNA support · 36c164ec
      Brad Fitzpatrick authored
      Add golang.org/x/text/unicode/norm from x/text git rev a7c02369.
      
      Needed by net/http for IDNA normalization.
      
      Updates #13835
      
      Change-Id: I8b024e179d573f2b093c209a4b9e4f71f7d4a1f2
      Reviewed-on: https://go-review.googlesource.com/29859
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarMarcel van Lohuizen <mpvl@golang.org>
      36c164ec
    • mike andrews's avatar
      encoding/json: fix a bug in the documentation · 15b4d187
      mike andrews authored
          Documentation made reference to an unknown entity "DisableHTMLEscaping,"
          but I think it actually meant the method "Encoder.SetEscapeHTML."
      
          Fixes #17255
      
      Change-Id: I18fda76f8066110caef85fd33698de83d632e646
      Reviewed-on: https://go-review.googlesource.com/29931Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      15b4d187
    • Ian Lance Taylor's avatar
      runtime: remove sigmask type, use sigset instead · fdc16716
      Ian Lance Taylor authored
      The OS-independent sigmask type was not pulling its weight. Replace it
      with the OS-dependent sigset type. This requires adding an OS-specific
      sigaddset function, but permits removing the OS-specific sigmaskToSigset
      function.
      
      Change-Id: I43307b512b0264ec291baadaea902f05ce212305
      Reviewed-on: https://go-review.googlesource.com/29950
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      fdc16716
    • Daniel Theophanes's avatar
      database/sql: add context methods · e13df02e
      Daniel Theophanes authored
      Add context methods to sql and sql/driver methods. If
      the driver doesn't implement context methods the connection
      pool will still handle timeouts when a query fails to return
      in time or when a connection is not available from the pool
      in time.
      
      There will be a follow-up CL that will add support for
      context values that specify transaction levels and modes
      that a driver can use.
      
      Fixes #15123
      
      Change-Id: Ia99f3957aa3f177b23044dd99d4ec217491a30a7
      Reviewed-on: https://go-review.googlesource.com/29381Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      e13df02e
    • Luigi Riefolo's avatar
      go/doc: add IsPredeclared function · 54a72d90
      Luigi Riefolo authored
      IsPredeclared allows simplifying src/golang.org/x/tools/godoc/linkify.go
      
      Change-Id: I56b3223896f844630bc2e940255572d1682f0d06
      Reviewed-on: https://go-review.googlesource.com/29870Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
      54a72d90
    • Ian Lance Taylor's avatar
      runtime: simplify signalstack by dropping nil as argument · 097a581d
      Ian Lance Taylor authored
      Change the two calls to signalstack(nil) to inline the code
      instead (it's two lines).
      
      Change-Id: Ie92a05494f924f279e40ac159f1b677fda18f281
      Reviewed-on: https://go-review.googlesource.com/29854
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      097a581d
    • Elias Naur's avatar
      runtime: relax SetFinalizer documentation to allow &local · 60482d8a
      Elias Naur authored
      The SetFinalizer documentation states that
      
      "The argument obj must be a pointer to an object allocated by calling
      new or by taking the address of a composite literal."
      
      which precludes pointers to local variables. According to a comment
      on #6591, this case is expected to work. This CL updates the documentation
      for SetFinalizer accordingly.
      
      Fixes #6591
      
      Change-Id: Id861b3436bc1c9521361ea2d51c1ce74a121c1af
      Reviewed-on: https://go-review.googlesource.com/29592
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarAustin Clements <austin@google.com>
      60482d8a
    • Michael Munday's avatar
      cmd/asm: fix parsing of the s390x VLE{G,F,H,B} instructions · 413f1ef4
      Michael Munday authored
      This commit makes the assembler frontend reorder the operands so that
      they are in the order the backend expects. The index should be first
      for consistency with the other vector instructions.
      
      Before this commit no operand order would have been accepted so this
      isn't a breaking change.
      
      Change-Id: I188d57eeb338d27fa1fa6845de0d6d1521b7a6c3
      Reviewed-on: https://go-review.googlesource.com/29855
      Run-TryBot: Michael Munday <munday@ca.ibm.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBill O'Farrell <billotosyr@gmail.com>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      413f1ef4
    • Michael Munday's avatar
      cmd/asm: add s390x instructions BLTU and BLEU · a30b5a3d
      Michael Munday authored
      These instructions are the same as BLT and BLE except that they
      also branch if the 'unordered' bit is set in the condition code.
      
      They are already used by the SSA backend. This change allows them
      to be used in hand-written assembly code.
      
      Change-Id: Ie9b5985a5e87ea22e8043567a286e09dce16a2db
      Reviewed-on: https://go-review.googlesource.com/29930
      Run-TryBot: Michael Munday <munday@ca.ibm.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBill O'Farrell <billotosyr@gmail.com>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      a30b5a3d
    • Michael Munday's avatar
      cmd/asm, cmd/internal/obj/s390x: improve add/multiply-immediate codegen · 17a8ec2c
      Michael Munday authored
      Use the A{,G}HI instructions where possible (4 bytes instead of 6 bytes
      for A{,G}FI). Also, use 32-bit operations where appropriate for
      multiplication.
      
      Change-Id: I4041781cda26be52b54e4804a9e71552310762d0
      Reviewed-on: https://go-review.googlesource.com/29733
      Run-TryBot: Michael Munday <munday@ca.ibm.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBill O'Farrell <billotosyr@gmail.com>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      17a8ec2c
    • Michael Munday's avatar
      reflect, runtime: optimize Value.Call on s390x and add benchmark · 3436f077
      Michael Munday authored
      Use an MVC loop to copy arguments in runtime.call* rather than copying
      bytes individually.
      
      I've added the benchmark CallArgCopy to test the speed of Value.Call
      for various argument sizes.
      
      name                    old speed      new speed       delta
      CallArgCopy/size=128     439MB/s ± 1%    582MB/s ± 1%   +32.41%  (p=0.000 n=10+10)
      CallArgCopy/size=256     695MB/s ± 1%   1172MB/s ± 1%   +68.67%  (p=0.000 n=10+10)
      CallArgCopy/size=1024    573MB/s ± 8%   4175MB/s ± 2%  +628.11%  (p=0.000 n=10+10)
      CallArgCopy/size=4096   1.46GB/s ± 2%  10.19GB/s ± 1%  +600.52%  (p=0.000 n=10+10)
      CallArgCopy/size=65536  1.51GB/s ± 0%  12.30GB/s ± 1%  +716.30%   (p=0.000 n=9+10)
      
      Change-Id: I87dae4809330e7964f6cb4a9e40e5b3254dd519d
      Reviewed-on: https://go-review.googlesource.com/28096
      Run-TryBot: Michael Munday <munday@ca.ibm.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBill O'Farrell <billotosyr@gmail.com>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      3436f077
    • Alberto Donizetti's avatar
      cmd/compile: remove commented-out old c code · 6c43c0c2
      Alberto Donizetti authored
      Change-Id: I9b2e6c45f7e83543a06d0aafd08a911f7b6485fd
      Reviewed-on: https://go-review.googlesource.com/29874Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      6c43c0c2
    • Cherry Zhang's avatar
      cmd/compile: move value around before kick it out of register · f876fb9b
      Cherry Zhang authored
      When allocating registers, before kicking out the existing value,
      copy it to a spare register if there is one. So later use of this
      value can be found in register instead of reload from spill. This
      is very helpful for instructions of which the input and/or output
      can only be in specific registers, e.g. DIV on x86, MUL/DIV on
      MIPS. May also be helpful in general.
      
      For "go build -a cmd/go" on AMD64, reduce "spilled value remains"
      by 1% (not including args, which almost certainly remain).
      
      For the code in issue #16061 on AMD64:
      MaxRem-12   111µs ± 1%    94µs ± 0%  -15.38%  (p=0.008 n=5+5)
      
      Go1 benchmark on AMD64:
      BinaryTree17-12              2.32s ± 2%     2.30s ± 1%    ~     (p=0.421 n=5+5)
      Fannkuch11-12                2.52s ± 0%     2.44s ± 0%  -3.44%  (p=0.008 n=5+5)
      FmtFprintfEmpty-12          39.9ns ± 3%    39.8ns ± 0%    ~     (p=0.635 n=5+4)
      FmtFprintfString-12          114ns ± 1%     113ns ± 1%    ~     (p=0.905 n=5+5)
      FmtFprintfInt-12             102ns ± 6%      98ns ± 1%    ~     (p=0.087 n=5+5)
      FmtFprintfIntInt-12          146ns ± 5%     147ns ± 1%    ~     (p=0.238 n=5+5)
      FmtFprintfPrefixedInt-12     155ns ± 2%     151ns ± 1%  -2.58%  (p=0.008 n=5+5)
      FmtFprintfFloat-12           231ns ± 1%     232ns ± 1%    ~     (p=0.286 n=5+5)
      FmtManyArgs-12               657ns ± 1%     649ns ± 0%  -1.31%  (p=0.008 n=5+5)
      GobDecode-12                6.35ms ± 0%    6.29ms ± 1%    ~     (p=0.056 n=5+5)
      GobEncode-12                5.38ms ± 1%    5.45ms ± 1%    ~     (p=0.056 n=5+5)
      Gzip-12                      209ms ± 0%     209ms ± 1%    ~     (p=0.690 n=5+5)
      Gunzip-12                   31.2ms ± 1%    31.1ms ± 1%    ~     (p=0.548 n=5+5)
      HTTPClientServer-12          123µs ± 4%     130µs ± 8%    ~     (p=0.151 n=5+5)
      JSONEncode-12               14.0ms ± 1%    14.0ms ± 1%    ~     (p=0.421 n=5+5)
      JSONDecode-12               41.2ms ± 1%    41.1ms ± 2%    ~     (p=0.421 n=5+5)
      Mandelbrot200-12            3.96ms ± 1%    3.98ms ± 0%    ~     (p=0.421 n=5+5)
      GoParse-12                  2.88ms ± 1%    2.88ms ± 1%    ~     (p=0.841 n=5+5)
      RegexpMatchEasy0_32-12      68.0ns ± 3%    66.6ns ± 1%  -2.00%  (p=0.024 n=5+5)
      RegexpMatchEasy0_1K-12       728ns ± 8%     682ns ± 1%  -6.26%  (p=0.008 n=5+5)
      RegexpMatchEasy1_32-12      66.8ns ± 2%    66.0ns ± 1%    ~     (p=0.302 n=5+5)
      RegexpMatchEasy1_1K-12       291ns ± 2%     288ns ± 1%    ~     (p=0.111 n=5+5)
      RegexpMatchMedium_32-12      103ns ± 2%     100ns ± 0%  -2.53%  (p=0.016 n=5+4)
      RegexpMatchMedium_1K-12     31.9µs ± 1%    31.3µs ± 0%  -1.75%  (p=0.008 n=5+5)
      RegexpMatchHard_32-12       1.59µs ± 2%    1.59µs ± 1%    ~     (p=0.548 n=5+5)
      RegexpMatchHard_1K-12       48.3µs ± 2%    47.7µs ± 1%    ~     (p=0.222 n=5+5)
      Revcomp-12                   340ms ± 1%     338ms ± 1%    ~     (p=0.421 n=5+5)
      Template-12                 46.3ms ± 1%    46.5ms ± 1%    ~     (p=0.690 n=5+5)
      TimeParse-12                 252ns ± 1%     247ns ± 0%  -1.91%  (p=0.000 n=5+4)
      TimeFormat-12                277ns ± 1%     267ns ± 0%  -3.82%  (p=0.008 n=5+5)
      [Geo mean]                  48.8µs         48.3µs       -0.93%
      
      It has very little effect on binary size and compiler speed.
      compilebench:
      Template       230ms ±10%      231ms ± 8%    ~             (p=0.546 n=9+9)
      Unicode        123ms ± 6%      124ms ± 9%    ~           (p=0.481 n=10+10)
      GoTypes        742ms ± 6%      755ms ± 3%    ~           (p=0.123 n=10+10)
      Compiler       3.10s ± 3%      3.08s ± 1%    ~           (p=0.631 n=10+10)
      
      Fixes #16061.
      
      Change-Id: Id99cdc7a182ee10a704fa0f04e8e0d0809b2ac56
      Reviewed-on: https://go-review.googlesource.com/29732
      Run-TryBot: Cherry Zhang <cherryyz@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarDavid Chase <drchase@google.com>
      f876fb9b