1. 23 Sep, 2019 11 commits
  2. 22 Sep, 2019 1 commit
    • Robert Griesemer's avatar
      go/types: don't clone interface methods when embedding them · 20f0bcb0
      Robert Griesemer authored
      https://golang.org/cl/191257 significantly changed (and simplified)
      the computation of interface method sets with embedded interfaces.
      Specifically, when adding methods from an embedded interface, those
      method objects (Func Objects) were cloned so that they could have a
      different source position (the embedding position rather than the
      original method position) for better error messages.
      
      This causes problems for code that depends on the identity of method
      objects that represent the same method, embedded or not.
      
      This CL avoids the cloning. Instead, while computing the method set
      of an interface, a position map is carried along that tracks
      embedding positions. The map is not needed anymore after type-
      checking.
      
      Updates #34421.
      
      Change-Id: I8ce188136c76fa70fba686711167db29a049f46d
      Reviewed-on: https://go-review.googlesource.com/c/go/+/196561Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      20f0bcb0
  3. 21 Sep, 2019 5 commits
    • Andrew Medvedev's avatar
      strings, bytes: clarify usage of EqualFolds · 78e5288b
      Andrew Medvedev authored
      This clarifies meaning of "case folding" Unicode equality with more familiar "case insensitive" wording.
      For case folding properties see ftp://ftp.unicode.org/Public/UNIDATA/CaseFolding.txt.
      
      Fixes #33447
      
      Change-Id: I6ee85ab398679bf2a0b7d18693985ff0979d6c5a
      GitHub-Last-Rev: accc9159330c61e046d77f77beac62b38bf72c19
      GitHub-Pull-Request: golang/go#34434
      Reviewed-on: https://go-review.googlesource.com/c/go/+/196717Reviewed-by: default avatarRob Pike <r@golang.org>
      78e5288b
    • two's avatar
      runtime/type: change fieldalign to use mixedCaps · 9c0e56bf
      two authored
      All spelling in source code is "fieldAlign", except this place, so change
      "fieldalign" to use mixedCaps.
      
      Change-Id: Icbd9b9d23d9b4f756174e9a3cc4b25776fd90def
      GitHub-Last-Rev: 44a4fe140a4a473a234ceb5bd927109cbc35bb30
      GitHub-Pull-Request: golang/go#34441
      Reviewed-on: https://go-review.googlesource.com/c/go/+/196757
      Run-TryBot: Andrew Bonventre <andybons@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarDaniel Martí <mvdan@mvdan.cc>
      9c0e56bf
    • Martin Möhrmann's avatar
      compile: prefer an AND instead of SHR+SHL instructions · 4e2b84ff
      Martin Möhrmann authored
      On modern 64bit CPUs a SHR, SHL or AND instruction take 1 cycle to execute.
      A pair of shifts that operate on the same register will take 2 cycles
      and needs to wait for the input register value to be available.
      
      Large constants used to mask the high bits of a register with an AND
      instruction can not be encoded as an immediate in the AND instruction
      on amd64 and therefore need to be loaded into a register with a MOV
      instruction.
      
      However that MOV instruction is not dependent on the output register and
      on many CPUs does not compete with the AND or shift instructions for
      execution ports.
      
      Using a pair of shifts to mask high bits instead of an AND to mask high
      bits of a register has a shorter encoding and uses one less general
      purpose register but is slower due to taking one clock cycle longer
      if there is no register pressure that would make the AND variant need to
      generate a spill.
      
      For example the instructions emitted for (x & 1 << 63) before this CL are:
      48c1ea3f                SHRQ $0x3f, DX
      48c1e23f                SHLQ $0x3f, DX
      
      after this CL the instructions are the same as GCC and LLVM use:
      48b80000000000000080    MOVQ $0x8000000000000000, AX
      4821d0                  ANDQ DX, AX
      
      Some platforms such as arm64 already have SSA optimization rules to fuse
      two shift instructions back into an AND.
      
      Removing the general rule to rewrite AND to SHR+SHL speeds up this benchmark:
      
          var GlobalU uint
      
          func BenchmarkAndHighBits(b *testing.B) {
              x := uint(0)
              for i := 0; i < b.N; i++ {
                      x &= 1 << 63
              }
              GlobalU = x
          }
      
      amd64/darwin on Intel(R) Core(TM) i7-3520M CPU @ 2.90GHz:
      name           old time/op  new time/op  delta
      AndHighBits-4  0.61ns ± 6%  0.42ns ± 6%  -31.42%  (p=0.000 n=25+25):
      
      'go run run.go -all_codegen -v codegen' passes  with following adjustments:
      
      ARM64: The BFXIL pattern ((x << lc) >> rc | y & ac) needed adjustment
             since ORshiftRL generation fusing '>> rc' and '|' interferes
             with matching ((x << lc) >> rc) to generate UBFX. Previously
             ORshiftLL was created first using the shifts generated for (y & ac).
      
      S390X: Add rules for abs and copysign to match use of AND instead of SHIFTs.
      
      Updates #33826
      Updates #32781
      
      Change-Id: I43227da76b625de03fbc51117162b23b9c678cdb
      Reviewed-on: https://go-review.googlesource.com/c/go/+/194297
      Run-TryBot: Martin Möhrmann <martisch@uos.de>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarCherry Zhang <cherryyz@google.com>
      4e2b84ff
    • Agniva De Sarker's avatar
      test/codegen: fix wasm codegen breakage · ecc7dd54
      Agniva De Sarker authored
      i32.eqz instructions don't appear unless needed in if conditions anymore
      after CL 195204. I forgot to run the codegen tests while submitting the CL.
      
      Thanks to @martisch for catching it.
      
      Fixes #34442
      
      Change-Id: I177b064b389be48e39d564849714d7a8839be13e
      Reviewed-on: https://go-review.googlesource.com/c/go/+/196580
      Run-TryBot: Agniva De Sarker <agniva.quicksilver@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarMartin Möhrmann <moehrmann@google.com>
      ecc7dd54
    • Agniva De Sarker's avatar
      cmd/compile: optimize ssa if blocks for wasm architecture · 9c384cc5
      Agniva De Sarker authored
      Check for the next block and accordingly place the successor blocks.
      This saves an additional jump instruction if the next block is any one
      of the successor blocks.
      
      While at it, inline the logic of goToBlock.
      
      Reduces the size of pkg/js_wasm by 264 bytes.
      
      Change-Id: I671ac4322e6edcb0d7e590dcca27e074268068d5
      Reviewed-on: https://go-review.googlesource.com/c/go/+/195204
      Run-TryBot: Agniva De Sarker <agniva.quicksilver@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarRichard Musiol <neelance@gmail.com>
      9c384cc5
  4. 20 Sep, 2019 6 commits
  5. 19 Sep, 2019 12 commits
  6. 18 Sep, 2019 5 commits