1. 18 Aug, 2017 8 commits
  2. 17 Aug, 2017 18 commits
  3. 16 Aug, 2017 14 commits
    • Hiroshi Ioka's avatar
      debug/macho: rearrange code · 78984d39
      Hiroshi Ioka authored
      * group load command structs.
      * use hex literal for LoadCommand.
        Decimal number is not a proper representation for some commands.
        (e.g. LC_RPATH = 0x8000001c)
      * move Symbol struct from macho.go to file.go.
        Symbol is a high level representation, not in Mach-O.
      
      Change-Id: I3c69923cb464fb1211f2e766c02e1b537e0b5de2
      Reviewed-on: https://go-review.googlesource.com/56130Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      78984d39
    • Kyle Shannon's avatar
      cmd/go: add support for Fossil SCM to go get · 3ce05d2d
      Kyle Shannon authored
      Fixes #10010.
      
      Change-Id: Ib13ac28eafed72c456d8b5b6549015cdf5fdda94
      Reviewed-on: https://go-review.googlesource.com/56190Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      3ce05d2d
    • Michael Steinert's avatar
      cmd/cgo: unify cgo output for gc and gccgo · ee714947
      Michael Steinert authored
      When calling a Go function that returns multiple values from C, cgo
      generates a structure to hold the values. According to the documentation
      this structure is called `struct <function-name>_return`. When compiling
      for gccgo the generated structure name is `struct <function-name>_result`.
      This change updates the output for gccgo to match the documentation and
      output for gc.
      
      Fixes #20910
      
      Change-Id: Iaea8030a695a7aaf9d9f317447fc05615d8e4adc
      Reviewed-on: https://go-review.googlesource.com/49350Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      ee714947
    • Ian Lance Taylor's avatar
      cmd/dist: update deps.go for current dependencies · b70adbf2
      Ian Lance Taylor authored
      Fixes #21456
      
      Change-Id: Iba7bc608686536b2d4fe3d23409fa84b59cea640
      Reviewed-on: https://go-review.googlesource.com/55971Reviewed-by: default avatarJoe Tsai <joetsai@google.com>
      b70adbf2
    • Bryan C. Mills's avatar
      bytes: avoid overflow in (*Buffer).Grow and ReadFrom · 6a34ffa0
      Bryan C. Mills authored
      fixes #21481
      
      Change-Id: I26717876a1c0ee25a86c81159c6b3c59563dfec6
      Reviewed-on: https://go-review.googlesource.com/56230Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      6a34ffa0
    • Agniva De Sarker's avatar
      archive/tar: add reader/writer benchmarks · d9606e55
      Agniva De Sarker authored
      According to the discussion on golang.org/cl/55210,
      adding benchmarks for reading from and writing to tar archives.
      
      Splitting the benchmarks into 3 sections of USTAR, GNU, PAX each.
      
      Results ran with -cpu=1 -count=10 on an amd64 machine (i5-5200U CPU @ 2.20GHz)
      name           time/op
      /Writer/USTAR  5.31µs ± 0%
      /Writer/GNU    5.01µs ± 1%
      /Writer/PAX    11.0µs ± 2%
      /Reader/USTAR  3.22µs ± 1%
      /Reader/GNU    3.04µs ± 1%
      /Reader/PAX    7.48µs ± 1%
      
      name           alloc/op
      /Writer/USTAR  1.20kB ± 0%
      /Writer/GNU    1.15kB ± 0%
      /Writer/PAX    2.61kB ± 0%
      /Reader/USTAR  1.38kB ± 0%
      /Reader/GNU    1.35kB ± 0%
      /Reader/PAX    4.91kB ± 0%
      
      name           allocs/op
      /Writer/USTAR    53.0 ± 0%
      /Writer/GNU      47.0 ± 0%
      /Writer/PAX       107 ± 0%
      /Reader/USTAR    32.0 ± 0%
      /Reader/GNU      30.0 ± 0%
      /Reader/PAX      67.0 ± 0%
      
      Change-Id: I58b1b85b52e58cbd566736aae4d722a3ddf2395b
      Reviewed-on: https://go-review.googlesource.com/55254Reviewed-by: default avatarJoe Tsai <thebrokentoaster@gmail.com>
      Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      d9606e55
    • David du Colombier's avatar
      cmd/link: skip TestFieldOverlap on Plan 9 · 8127dbf7
      David du Colombier authored
      TestSizes has been added in CL 50170. This test is
      failing on Plan 9 because executables don't have
      a DWARF symbol table.
      
      Fixes #21480.
      
      Change-Id: I51079abdc18ad944617bdbcfe2dad970a0cea0f2
      Reviewed-on: https://go-review.googlesource.com/56210
      Run-TryBot: David du Colombier <0intro@gmail.com>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      8127dbf7
    • Bryan C. Mills's avatar
      runtime/cgo: defeat inlining in x_cgo_yield · e0545faf
      Bryan C. Mills authored
      We use a call to strncpy to work around a TSAN bug (wherein TSAN only
      delivers asynchronous signals when the thread receiving the signal
      calls a libc function). Unfortunately, GCC 7 inlines the call,
      avoiding the TSAN libc trap entirely.
      
      Per Ian's suggestion, use global variables as strncpy arguments: that
      way, the compiler can't make any assumptions about the concrete values
      and can't inline the call away.
      
      fixes #21196
      
      Change-Id: Ie95f1feaf9af1a8056f924f49c29cfc8515385d7
      Reviewed-on: https://go-review.googlesource.com/55872Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      e0545faf
    • Blain Smith's avatar
      fmt: add Stringer example · 58f84fdf
      Blain Smith authored
      Change-Id: I901f995f8aedee47c48252745816e53192d4b7e4
      Reviewed-on: https://go-review.googlesource.com/49090Reviewed-by: default avatarSam Whited <sam@samwhited.com>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      Run-TryBot: Sam Whited <sam@samwhited.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      58f84fdf
    • Cherry Zhang's avatar
      misc/nacl: add cmd/vendor/golang.org/x/arch/arm64/arm64asm testdata · e82e1204
      Cherry Zhang authored
      This should fix NaCl build failure for CL 49530.
      
      Change-Id: Id9a54f0c81b1b5db5b5efb12a2ad6509c4ab42b3
      Reviewed-on: https://go-review.googlesource.com/55770Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      e82e1204
    • Wei Xiao's avatar
      cmd/vendor/golang.org/x/arch: pull updates from x repo · 56b62c7c
      Wei Xiao authored
      Vendor from golang.org/x/arch (commit f185940).
      
      Implements #19157
      
      Updates #12840
      Updates #20762
      Updates #20897
      Updates #20096
      Updates #20766
      Updates #20752
      Updates #20096
      Updates #19142
      
      Change-Id: Idefb8ba2c355dc07f3b9e8dcf5f00173256a0f0f
      Reviewed-on: https://go-review.googlesource.com/49530Reviewed-by: default avatarCherry Zhang <cherryyz@google.com>
      56b62c7c
    • Alberto Donizetti's avatar
      cmd/compile: combine x*n + y*n into (x+y)*n · a0453a18
      Alberto Donizetti authored
      There are a few cases where this can be useful. Apart from the obvious
      (and silly)
      
        100*n + 200*n
      
      where we generate one IMUL instead of two, consider:
      
        15*n + 31*n
      
      Currently, the compiler strength-reduces both imuls, generating:
      
          0x0000 00000	MOVQ	"".n+8(SP), AX
      	0x0005 00005 	MOVQ	AX, CX
      	0x0008 00008 	SHLQ	$4, AX
      	0x000c 00012 	SUBQ	CX, AX
      	0x000f 00015 	MOVQ	CX, DX
      	0x0012 00018 	SHLQ	$5, CX
      	0x0016 00022 	SUBQ	DX, CX
      	0x0019 00025 	ADDQ	CX, AX
      	0x001c 00028 	MOVQ	AX, "".~r1+16(SP)
      	0x0021 00033 	RET
      
      But combining the imuls is both faster and shorter:
      
      	0x0000 00000	MOVQ	"".n+8(SP), AX
      	0x0005 00005 	IMULQ	$46, AX
      	0x0009 00009	MOVQ	AX, "".~r1+16(SP)
      	0x000e 00014 	RET
      
      even without strength-reduction.
      
      Moreover, consider:
      
        5*n + 7*(n+1) + 11*(n+2)
      
      We already have a rule that rewrites 7(n+1) into 7n+7, so the
      generated code (without imuls merging) looks like this:
      
      	0x0000 00000 	MOVQ	"".n+8(SP), AX
      	0x0005 00005 	LEAQ	(AX)(AX*4), CX
      	0x0009 00009 	MOVQ	AX, DX
      	0x000c 00012 	NEGQ	AX
      	0x000f 00015 	LEAQ	(AX)(DX*8), AX
      	0x0013 00019 	ADDQ	CX, AX
      	0x0016 00022 	LEAQ	(DX)(CX*2), CX
      	0x001a 00026 	LEAQ	29(AX)(CX*1), AX
      	0x001f 00031 	MOVQ	AX, "".~r1+16(SP)
      
      But with imuls merging, the 5n, 7n and 11n factors get merged, and the
      generated code looks like this:
      
      	0x0000 00000 	MOVQ	"".n+8(SP), AX
      	0x0005 00005 	IMULQ	$23, AX
      	0x0009 00009 	ADDQ	$29, AX
      	0x000d 00013 	MOVQ	AX, "".~r1+16(SP)
      	0x0012 00018 	RET
      
      Which is both faster and shorter; that's also the exact same code that
      clang and the intel c compiler generate for the above expression.
      
      Change-Id: Ib4d5503f05d2f2efe31a1be14e2fe6cac33730a9
      Reviewed-on: https://go-review.googlesource.com/55143Reviewed-by: default avatarKeith Randall <khr@golang.org>
      a0453a18
    • Keith Randall's avatar
      cmd/link: fix bad dwarf for sudog<T> · e70fae8a
      Keith Randall authored
      The DWARF entries for type-specific sudog entries used the
      channel value type instead of a pointer-to-value type for the elem field.
      
      Fixes #21094
      
      R=go1.10
      
      Change-Id: I3f63a5664f42b571f729931309f2c9f6f38ab031
      Reviewed-on: https://go-review.googlesource.com/50170Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      e70fae8a
    • Ilya Tocar's avatar
      cmd/compile/internal/ssa: use sse to zero on amd64 · df709828
      Ilya Tocar authored
      Use 16-byte stores instead of 8-byte stores to zero small blocks.
      Also switch to duffzero for 65+ bytes only, because for each
      duffzero call we also save/restore BP, so call requires 4 instructions
      and replacing it with 4 sse stores doesn't cause code-bloat.
      Also switch duffzero to use leaq, instead of addq to avoid clobbering flags.
      
      ClearFat8-6     0.54ns ± 0%  0.54ns ± 0%     ~     (all equal)
      ClearFat12-6    1.07ns ± 0%  1.07ns ± 0%     ~     (all equal)
      ClearFat16-6    1.07ns ± 0%  0.69ns ± 0%  -35.51%  (p=0.001 n=8+9)
      ClearFat24-6    1.61ns ± 1%  1.07ns ± 0%  -33.33%  (p=0.000 n=10+10)
      ClearFat32-6    2.14ns ± 0%  1.07ns ± 0%  -50.00%  (p=0.001 n=8+9)
      ClearFat40-6    2.67ns ± 1%  1.61ns ± 0%  -39.72%  (p=0.000 n=10+8)
      ClearFat48-6    3.75ns ± 0%  2.68ns ± 0%  -28.59%  (p=0.000 n=9+9)
      ClearFat56-6    4.29ns ± 0%  3.22ns ± 0%  -25.10%  (p=0.000 n=9+9)
      ClearFat64-6    4.30ns ± 0%  3.22ns ± 0%  -25.15%  (p=0.000 n=8+8)
      ClearFat128-6   7.50ns ± 1%  7.51ns ± 0%     ~     (p=0.767 n=10+9)
      ClearFat256-6   13.9ns ± 1%  13.9ns ± 1%     ~     (p=0.257 n=10+10)
      ClearFat512-6   26.8ns ± 0%  26.8ns ± 0%     ~     (p=0.467 n=8+8)
      ClearFat1024-6  52.5ns ± 0%  52.5ns ± 0%     ~     (p=1.000 n=8+8)
      
      Also shaves ~20kb from go tool:
      
      go_old 10384994
      go_new 10364514 [-20480 bytes]
      
      section differences
      global text (code) = -20585 bytes (-0.532047%)
      read-only data = -302 bytes (-0.018101%)
      Total difference -20887 bytes (-0.348731%)
      
      Change-Id: I15854e87544545c1af24775df895e38e16e12694
      Reviewed-on: https://go-review.googlesource.com/54410
      Run-TryBot: Ilya Tocar <ilya.tocar@intel.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarKeith Randall <khr@golang.org>
      df709828