An error occurred fetching the project authors.
  1. 04 Apr, 2019 1 commit
  2. 28 Mar, 2019 1 commit
  3. 14 Mar, 2019 1 commit
    • Richard Musiol's avatar
      math, math/bits: add intrinsics for wasm · 5ee1b849
      Richard Musiol authored
      This commit adds compiler intrinsics for the packages math and
      math/bits on the wasm architecture for better performance.
      
      benchmark                        old ns/op     new ns/op     delta
      BenchmarkCeil                    8.31          3.21          -61.37%
      BenchmarkCopysign                5.24          3.88          -25.95%
      BenchmarkAbs                     5.42          3.34          -38.38%
      BenchmarkFloor                   8.29          3.18          -61.64%
      BenchmarkRoundToEven             9.76          3.26          -66.60%
      BenchmarkSqrtLatency             8.13          4.88          -39.98%
      BenchmarkSqrtPrime               5246          3535          -32.62%
      BenchmarkTrunc                   8.29          3.15          -62.00%
      BenchmarkLeadingZeros            13.0          4.23          -67.46%
      BenchmarkLeadingZeros8           4.65          4.42          -4.95%
      BenchmarkLeadingZeros16          7.60          4.38          -42.37%
      BenchmarkLeadingZeros32          10.7          4.48          -58.13%
      BenchmarkLeadingZeros64          12.9          4.31          -66.59%
      BenchmarkTrailingZeros           6.52          4.04          -38.04%
      BenchmarkTrailingZeros8          4.57          4.14          -9.41%
      BenchmarkTrailingZeros16         6.69          4.16          -37.82%
      BenchmarkTrailingZeros32         6.97          4.23          -39.31%
      BenchmarkTrailingZeros64         6.59          4.00          -39.30%
      BenchmarkOnesCount               7.93          3.30          -58.39%
      BenchmarkOnesCount8              3.56          3.19          -10.39%
      BenchmarkOnesCount16             4.85          3.19          -34.23%
      BenchmarkOnesCount32             7.27          3.19          -56.12%
      BenchmarkOnesCount64             8.08          3.28          -59.41%
      BenchmarkRotateLeft              4.88          3.80          -22.13%
      BenchmarkRotateLeft64            5.03          3.63          -27.83%
      
      Change-Id: Ic1e0c2984878be8defb6eb7eb6ee63765c793222
      Reviewed-on: https://go-review.googlesource.com/c/go/+/165177
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarCherry Zhang <cherryyz@google.com>
      5ee1b849
  4. 03 Mar, 2019 1 commit
  5. 25 Feb, 2019 1 commit
  6. 28 Dec, 2018 1 commit
    • Keith Randall's avatar
      cmd/compile,runtime: redo mid-stack inlining tracebacks · 69c2c564
      Keith Randall authored
      Work involved in getting a stack trace is divided between
      runtime.Callers and runtime.CallersFrames.
      
      Before this CL, runtime.Callers returns a pc per runtime frame.
      runtime.CallersFrames is responsible for expanding a runtime frame
      into potentially multiple user frames.
      
      After this CL, runtime.Callers returns a pc per user frame.
      runtime.CallersFrames just maps those to user frame info.
      
      Entries in the result of runtime.Callers are now pcs
      of the calls (or of the inline marks), not of the instruction
      just after the call.
      
      Fixes #29007
      Fixes #28640
      Update #26320
      
      Change-Id: I1c9567596ff73dc73271311005097a9188c3406f
      Reviewed-on: https://go-review.googlesource.com/c/152537
      Run-TryBot: Keith Randall <khr@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarDavid Chase <drchase@google.com>
      69c2c564
  7. 27 Jun, 2018 1 commit
    • Cherry Zhang's avatar
      cmd/compile: fold offset into address on Wasm · 1d303a00
      Cherry Zhang authored
      On Wasm, the offset was not folded into LoweredAddr, so it was
      not rematerializeable. This led to the address-taken operation
      in some cases generated too early, before the local variable
      becoming live. The liveness code thinks the variable live when
      the address is taken, then backs it up to live at function
      entry, then complains about it, because nothing other than
      arguments should be live on entry.
      
      This CL folds the offset into the address operation, so it is
      rematerializeable and so generated right before use, after the
      variable actually becomes live.
      
      It might be possible to relax the liveness code not to think a
      variable live when its address being taken, but until the address
      actually being used. But it would be quite complicated. As we're
      late in Go 1.11 freeze, it would be better not to do it. Also,
      I think the address operation is rematerializeable now on all
      architectures, so this is probably less necessary.
      
      This may also be a slight optimization, as the address+offset is
      now rematerializeable, which can be generated on the Wasm stack,
      without using any "registers" which are emulated by local
      variables on Wasm. I don't know how to do benchmarks on Wasm. At
      least, cmd/go binary size shrinks 9K.
      
      Fixes #25966.
      
      Change-Id: I01e5869515d6a3942fccdcb857f924a866876e57
      Reviewed-on: https://go-review.googlesource.com/120599
      Run-TryBot: Cherry Zhang <cherryyz@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarRichard Musiol <neelance@gmail.com>
      1d303a00
  8. 23 May, 2018 1 commit
    • Richard Musiol's avatar
      cmd/compile: add wasm stack optimization · 482d2419
      Richard Musiol authored
      Go's SSA instructions only operate on registers. For example, an add
      instruction would read two registers, do the addition and then write
      to a register. WebAssembly's instructions, on the other hand, operate
      on the stack. The add instruction first pops two values from the stack,
      does the addition, then pushes the result to the stack. To fulfill
      Go's semantics, one needs to map Go's single add instruction to
      4 WebAssembly instructions:
      - Push the value of local variable A to the stack
      - Push the value of local variable B to the stack
      - Do addition
      - Write value from stack to local variable C
      
      Now consider that B was set to the constant 42 before the addition:
      - Push constant 42 to the stack
      - Write value from stack to local variable B
      
      This works, but is inefficient. Instead, the stack is used directly
      by inlining instructions if possible. With inlining it becomes:
      - Push the value of local variable A to the stack (add)
      - Push constant 42 to the stack (constant)
      - Do addition (add)
      - Write value from stack to local variable C (add)
      
      Note that the two SSA instructions can not be generated sequentially
      anymore, because their WebAssembly instructions are interleaved.
      
      Design doc: https://docs.google.com/document/d/131vjr4DH6JFnb-blm_uRdaC0_Nv3OUwjEY5qVCxCup4
      
      Updates #18892
      
      Change-Id: Ie35e1c0bebf4985fddda0d6330eb2066f9ad6dec
      Reviewed-on: https://go-review.googlesource.com/103535
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarCherry Zhang <cherryyz@google.com>
      482d2419
  9. 04 May, 2018 1 commit