- 23 Mar, 2016 5 commits
-
-
Martin Möhrmann authored
Make a fast path for format strings that do not use precision or width specifications or argument indices. Only check and enforce the restriction to not pad left with zeros in code paths that change either f.minus or f.zero. Consolidate the if chains at the end of the main doPrintf loop into a switch statement. Move error printing into extra functions to reduce size of this switch statement. name old time/op new time/op delta SprintfPadding-2 234ns ± 1% 233ns ± 1% -0.54% (p=0.010 n=19+19) SprintfEmpty-2 37.0ns ± 3% 39.1ns ±14% ~ (p=0.501 n=17+20) SprintfString-2 112ns ± 1% 101ns ± 1% -9.21% (p=0.000 n=19+20) SprintfTruncateString-2 139ns ± 1% 139ns ± 0% +0.57% (p=0.000 n=19+19) SprintfQuoteString-2 402ns ± 0% 392ns ± 0% -2.35% (p=0.000 n=19+20) SprintfInt-2 114ns ± 1% 102ns ± 2% -10.92% (p=0.000 n=20+20) SprintfIntInt-2 177ns ± 2% 155ns ± 2% -12.67% (p=0.000 n=18+18) SprintfPrefixedInt-2 260ns ± 3% 249ns ± 3% -4.55% (p=0.000 n=20+20) SprintfFloat-2 190ns ± 1% 178ns ± 2% -6.54% (p=0.000 n=20+20) SprintfComplex-2 533ns ± 1% 517ns ± 3% -2.95% (p=0.000 n=20+20) SprintfBoolean-2 102ns ± 1% 93ns ± 2% -9.30% (p=0.000 n=20+20) SprintfHexString-2 176ns ± 0% 168ns ± 2% -4.49% (p=0.000 n=16+19) SprintfHexBytes-2 181ns ± 1% 174ns ± 2% -4.27% (p=0.000 n=20+20) SprintfBytes-2 326ns ± 1% 311ns ± 1% -4.51% (p=0.000 n=20+20) ManyArgs-2 540ns ± 2% 497ns ± 1% -8.08% (p=0.000 n=18+16) FprintInt-2 150ns ± 0% 149ns ± 0% -0.33% (p=0.000 n=20+18) FprintfBytes-2 185ns ± 0% 165ns ± 0% -10.98% (p=0.000 n=20+18) FprintIntNoAlloc-2 113ns ± 0% 112ns ± 0% -0.88% (p=0.000 n=20+20) Change-Id: I9ada8faa1f46aa67ea116a94ab3f4ad3e405c8fe Reviewed-on: https://go-review.googlesource.com/20919 Run-TryBot: Rob Pike <r@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Rob Pike <r@golang.org>
-
Tamir Duberstein authored
The exclusion of string from IsScanValue prevents driver authors from writing their drivers in such a way that would allow users to distinguish between strings and byte arrays returned from a database. Such drivers are possible today, but require their authors to deviate from the guidance provided by the standard library. This exclusion has been in place since the birth of this package in https://github.com/golang/go/commit/357f2cb1a385f4d1418e48856f9abe0cce, but the fakedb implementation shipped in the same commit violates the exclusion! Strictly speaking this is a breaking change, but it increases the set of permissible Scan types, and should not cause breakage in practice. No test changes are necessary because fakedb already exercises this. Fixes #6497. Change-Id: I69dbd3a59d90464bcae8c852d7ec6c97bfd120f8 Reviewed-on: https://go-review.googlesource.com/19439 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Ian Lance Taylor authored
This is to support https://golang.org/cl/18057, which is going to add Windows support to this directory. Better to write the test in Go then to have both test.bash and test.bat. Update #13494. Change-Id: I4af7004416309e885049ee60b9470926282f210d Reviewed-on: https://go-review.googlesource.com/20892 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Mikio Hara authored
Updates #14544. Change-Id: I24ab8e6f9ad9d290a672216fc2f50f78c3ed8812 Reviewed-on: https://go-review.googlesource.com/21014 Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Keith Randall authored
No need to have both ops when they do the same thing. Just declare MOVBload to zero extend and we can get rid of MOVBQZXload. Same for W and L. Kind of a followon cleanup for https://go-review.googlesource.com/c/19506/ Should enable an easier fix for #14920 Change-Id: I7cfac909a8ba387f433a6ae75c050740ebb34d42 Reviewed-on: https://go-review.googlesource.com/21004 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
- 22 Mar, 2016 18 commits
-
-
Michael Munday authored
Change-Id: Ib44c6b1ce07aa8fb67033cf21e177a90fd4005dc Reviewed-on: https://go-review.googlesource.com/21002Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Shahar Kohanim authored
Speeds up linking cmd/go by 1.7% name old s/op new s/op delta LinkCmdGo 0.58 ± 4% 0.57 ± 5% -1.74% (p=0.000 n=96+97) Change-Id: I7844cf4e2eeac260318de2b6ddf52ce07a6e00f5 Reviewed-on: https://go-review.googlesource.com/20915 TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Crawshaw <crawshaw@golang.org>
-
Keith Randall authored
They are kind of useless and are cluttering up https://go-review.googlesource.com/c/21000/ Change-Id: Iafdec75ada11c7ebdc40540d251fdc514bb00d3d Reviewed-on: https://go-review.googlesource.com/21001Reviewed-by: Minux Ma <minux@golang.org>
-
Robert Griesemer authored
This makes the rounding bug fix in math/big for issue 14651 available to the compiler. - changes to cmd/compile/internal/big fully automatic via script - added test case for issue - updated old test case with correct test data Fixes #14651. Change-Id: Iea37a2cd8d3a75f8c96193748b66156a987bbe40 Reviewed-on: https://go-review.googlesource.com/20818Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Robert Griesemer authored
Change-Id: Iab0add7aee51a8c72a81f51d980d22d2fd612f5c Reviewed-on: https://go-review.googlesource.com/20817Reviewed-by: Alan Donovan <adonovan@google.com>
-
Alexandru Moșoi authored
Shows up occassionally, especially after p = p[:8:len(p)] Updates #14905 Change-Id: Iab35ef2eac57817e6a10c6aaeeb84709e8021641 Reviewed-on: https://go-review.googlesource.com/21025 Run-TryBot: Alexandru Moșoi <alexandru@mosoi.ro> Reviewed-by: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Marcel van Lohuizen authored
Fixes #12166 Change-Id: Ie62cba2c39beb5732447ba3688c93c08ef12abb5 Reviewed-on: https://go-review.googlesource.com/18898Reviewed-by: Russ Cox <rsc@golang.org> Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
-
Marcel van Lohuizen authored
The matcher is responsible for sanitizing and uniquing the test and benchmark names and thus needs to be included before the API can be exposed. Matching currently uses the regexp to only match the top-level tests/benchmarks. Support for subtest matching is for another CL. Change-Id: I7c8464068faef7ebc179b03a7fe3d01122cc4f0b Reviewed-on: https://go-review.googlesource.com/18897Reviewed-by: Russ Cox <rsc@golang.org> Run-TryBot: Marcel van Lohuizen <mpvl@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Josh Bleecher Snyder authored
Escape analysis has a hard time with tree-like structures (see #13493 and #14858). This is unlikely to change. As a result, when invoking a function that accepts a **Node parameter, we usually allocate a *Node on the heap. This happens a whole lot. This CL changes functions from taking a **Node to acting more like append: It both modifies the input and returns a replacement for it. Because of the cascading nature of escape analysis, in order to get the benefits, I had to modify almost all such functions. The remaining functions are in racewalk and the backend. I would be happy to update them as well in a separate CL. This CL was created by manually updating the function signatures and the directly impacted bits of code. The callsites were then automatically updated using a bespoke script: https://gist.github.com/josharian/046b1be7aceae244de39 For ease of reviewing and future understanding, this CL is also broken down into four CLs, mailed separately, which show the manual and the automated changes separately. They are CLs 20990, 20991, 20992, and 20993. Passes toolstash -cmp. name old time/op new time/op delta Template 335ms ± 5% 324ms ± 5% -3.35% (p=0.000 n=23+24) Unicode 176ms ± 9% 165ms ± 6% -6.12% (p=0.000 n=23+24) GoTypes 1.10s ± 4% 1.07s ± 2% -2.77% (p=0.000 n=24+24) Compiler 5.31s ± 3% 5.15s ± 3% -2.95% (p=0.000 n=24+24) MakeBash 41.6s ± 1% 41.7s ± 2% ~ (p=0.586 n=23+23) name old alloc/op new alloc/op delta Template 63.3MB ± 0% 62.4MB ± 0% -1.36% (p=0.000 n=25+23) Unicode 42.4MB ± 0% 41.6MB ± 0% -1.99% (p=0.000 n=24+25) GoTypes 220MB ± 0% 217MB ± 0% -1.11% (p=0.000 n=25+25) Compiler 994MB ± 0% 973MB ± 0% -2.08% (p=0.000 n=24+25) name old allocs/op new allocs/op delta Template 681k ± 0% 574k ± 0% -15.71% (p=0.000 n=24+25) Unicode 518k ± 0% 413k ± 0% -20.34% (p=0.000 n=25+24) GoTypes 2.08M ± 0% 1.78M ± 0% -14.62% (p=0.000 n=25+25) Compiler 9.26M ± 0% 7.64M ± 0% -17.48% (p=0.000 n=25+25) name old text-bytes new text-bytes delta HelloSize 578k ± 0% 578k ± 0% ~ (all samples are equal) CmdGoSize 6.46M ± 0% 6.46M ± 0% ~ (all samples are equal) name old data-bytes new data-bytes delta HelloSize 128k ± 0% 128k ± 0% ~ (all samples are equal) CmdGoSize 281k ± 0% 281k ± 0% ~ (all samples are equal) name old exe-bytes new exe-bytes delta HelloSize 921k ± 0% 921k ± 0% ~ (all samples are equal) CmdGoSize 9.86M ± 0% 9.86M ± 0% ~ (all samples are equal) Change-Id: I277d95bd56d51c166ef7f560647aeaa092f3f475 Reviewed-on: https://go-review.googlesource.com/20959Reviewed-by: Dave Cheney <dave@cheney.net> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Ian Lance Taylor authored
These new methods help find the compilation unit to pass to the LineReader method in order to find the line information for a PC. The Ranges method also helps identify the specific function for a PC, needed to determine the function name. This uses the .debug.ranges section if necessary, and changes the object file format packages to pass in the section contents if available. Change-Id: I5ebc3d27faaf1a126ffb17a1e6027efdf64af836 Reviewed-on: https://go-review.googlesource.com/20769Reviewed-by: Austin Clements <austin@google.com> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Dominik Honnef authored
Change-Id: I64dd09e76d811000a914776fdad47808e3895690 Reviewed-on: https://go-review.googlesource.com/20989Reviewed-by: Dave Cheney <dave@cheney.net>
-
Michael Munday authored
Required to pass the issue9400 test. Change-Id: I595223c403b12faade54e2e46510f8537150af39 Reviewed-on: https://go-review.googlesource.com/20940Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Michael Munday authored
Change-Id: I81376f524e76db25fd52cc5bec2c80fbf618a0c5 Reviewed-on: https://go-review.googlesource.com/20877Reviewed-by: Minux Ma <minux@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Michael Munday authored
Adds a new R_PCRELDBL relocation for 2-byte aligned relative relocations on s390x. Should be removed once #14218 is implemented. Change-Id: I79dd2d8e746ba8cbc26c570faccfdd691e8161e8 Reviewed-on: https://go-review.googlesource.com/20941Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Keith Randall authored
There is a special case for slicing s[i:j] when the resulting slice has zero capacity, to prevent pointing to the next object in memory. Change this special case code from: rptr := rcap == 0 ? ptr : ptr+i*elemsize to rptr := ptr + (rcap == 0 ? 0 : i) * elemsize This change leads to slightly smaller generated code, replacing a load with a register zero. old: 0x002e 00046 (slice.go:8) CMPQ BX, $0 0x0032 00050 (slice.go:8) JEQ $0, 78 0x0034 00052 (slice.go:8) MOVQ "".a+8(FP), BP 0x0039 00057 (slice.go:8) LEAQ (BP)(CX*8), AX 0x003e 00062 ... rest of function ... 0x004e 00078 (slice.go:7) MOVQ "".a+8(FP), AX 0x0053 00083 (slice.go:8) JMP 62 new: 0x002e 00046 (slice.go:8) CMPQ BX, $0 0x0032 00050 (slice.go:8) JEQ $0, 78 0x0034 00052 (slice.go:8) MOVQ "".a+8(FP), BP 0x0039 00057 (slice.go:8) LEAQ (BP)(CX*8), AX 0x003e 00062 ... rest of function... 0x004e 00078 (slice.go:8) MOVQ $0, CX 0x0050 00080 (slice.go:8) JMP 52 Change-Id: I2a396616b0d7b090c226a47c92a7ba14b128401f Reviewed-on: https://go-review.googlesource.com/20994Reviewed-by: David Chase <drchase@google.com>
-
David Crawshaw authored
Fixes #14901 Change-Id: Ia32e09767374a341c9a36c5d977d47d7d1a82315 Reviewed-on: https://go-review.googlesource.com/20967Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: David Crawshaw <crawshaw@golang.org>
-
Michael Munday authored
Should let the s390x builder progress a little further. Change-Id: I5eab5f384b0b039f8e246ba69ecfb24de08625d2 Reviewed-on: https://go-review.googlesource.com/20965Reviewed-by: Minux Ma <minux@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Keith Randall authored
Allow names to be used for subexpressions of match rules. For example: (OpA x:(OpB y)) -> ..use x here to refer to the OpB value.. This gets rid of the .Args[0].Args[0]... way of naming we used to use. While we're here, give all subexpression matches names instead of recomputing them with .Args[i] sequences each time they are referenced. Makes the generated rule code a bit smaller. Change-Id: Ie42139f6f208933b75bd2ae8bd34e95419bc0e4e Reviewed-on: https://go-review.googlesource.com/20997 Run-TryBot: Todd Neal <todd@tneal.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Todd Neal <todd@tneal.org>
-
- 21 Mar, 2016 17 commits
-
-
Keith Randall authored
Don't write back parts of a slicing operation if they are unchanged from the source of the slice. For example: x.s = x.s[0:5] // don't write back pointer or cap x.s = x.s[:5] // don't write back pointer or cap x.s = x.s[:5:7] // don't write back pointer There is more to be done here, for example: x.s = x.s[:len(x.s):7] // don't write back ptr or len This CL can't handle that one yet. Fixes #14855 Change-Id: Id1e1a4fa7f3076dc1a76924a7f1cd791b81909bb Reviewed-on: https://go-review.googlesource.com/20954Reviewed-by: Austin Clements <austin@google.com> Run-TryBot: Keith Randall <khr@golang.org>
-
Alexandru Moșoi authored
For the following example, but there are a few more in the stdlib: func histogram(b []byte, h *[256]int32) { for _, t := range b { h[t]++ } } Change-Id: I56615f341ae52e02ef34025588dc6d1c52122295 Reviewed-on: https://go-review.googlesource.com/20924Reviewed-by: Keith Randall <khr@golang.org> Run-TryBot: Alexandru Moșoi <alexandru@mosoi.ro> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Todd Neal authored
Allow inlining of functions with switch statements as long as they don't contain a break or type switch. Fixes #13071 Change-Id: I057be351ea4584def1a744ee87eafa5df47a7f6d Reviewed-on: https://go-review.googlesource.com/20824Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Robert Griesemer authored
Converting a big.Float value x to a float32/64 value did not correctly round x up to the smallest denormal float32/64 if x was smaller than the smallest denormal float32/64, but larger than 0.5 of a smallest denormal float32/64. Handle this case explicitly and simplify some code in the turn. For #14651. Change-Id: I025e24bf8f0e671581a7de0abf7c1cd7e6403a6c Reviewed-on: https://go-review.googlesource.com/20816 Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Alan Donovan <adonovan@google.com>
-
Alexandru Moșoi authored
The inserted early bound checks cause the slice to expand beyond the original length of the slice. Change-Id: Ib38891605f4a9a12d3b9e2071a5f77640b083d2d Reviewed-on: https://go-review.googlesource.com/20981Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Minux Ma <minux@golang.org>
-
Keith Randall authored
MOVSB is quite a bit faster for unaligned moves. Possibly we should use MOVSB all of the time, but Intel folks say it might be a bit faster to use MOVSQ on some processors (but not any I have access to at the moment). benchmark old ns/op new ns/op delta BenchmarkMemmove4096-8 93.9 93.2 -0.75% BenchmarkMemmoveUnalignedDst4096-8 256 151 -41.02% BenchmarkMemmoveUnalignedSrc4096-8 175 90.5 -48.29% Fixes #14630 Change-Id: I568e6d6590eb3615e6a699fb474020596be665ff Reviewed-on: https://go-review.googlesource.com/20293Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Josh Bleecher Snyder authored
Passes toolstash -cmp. Change-Id: I8725dee490778be9c1fd31990a6b27df9713c3c9 Reviewed-on: https://go-review.googlesource.com/20957Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Josh Bleecher Snyder authored
Left over from CL 20931. Change-Id: I3b8dd9ef748bcbf70b5118da28135aaa1e5ba3a8 Reviewed-on: https://go-review.googlesource.com/20955 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Minux Ma <minux@golang.org>
-
Robert Griesemer authored
Constant comparisons against 0 are reasonably common. Special-case and avoid allocating a new zero value each time. Change-Id: I6c526c8ab30ef7f0fef59110133c764b7b90ba05 Reviewed-on: https://go-review.googlesource.com/20956Reviewed-by: Alan Donovan <adonovan@google.com>
-
Matthew Dempsky authored
Also give them more idiomatic Go names. Adding godocs is outside the scope of this CL. (Besides, the method names almost all directly parallel an underlying math/big.Int or math/big.Float method.) CL prepared mechanically with sed (for rewriting mpint.go/mpfloat.go) and gofmt (for rewriting call sites). Passes toolstash -cmp. Change-Id: Id76f4aee476ba740f48db33162463e7978c2083d Reviewed-on: https://go-review.googlesource.com/20909 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
-
Marcel van Lohuizen authored
Fixed bug that slipped probably slipped in after rebasing and explain why it failed on nacl/netbsd/plan9, which set default maxparallelism to 1. Change-Id: I4d59682fb2843d138b320334189f53fcdda5b2f6 Reviewed-on: https://go-review.googlesource.com/20980 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
-
Robert Griesemer authored
Fixes #14890. Change-Id: Ie790276b0e2ef94c92db3a777042d750269f876a Reviewed-on: https://go-review.googlesource.com/20953Reviewed-by: Alan Donovan <adonovan@google.com>
-
Michael Munday authored
The Linux ABI takes arguments in a different order on s390x. Change-Id: Ic9cfcc22a5ea3d8ef77d4dd0b915fc266ff3e5f7 Reviewed-on: https://go-review.googlesource.com/20960Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
-
Michael Munday authored
Minimum architecture of z196 required so that GCC can assemble gcc_s390x.S in runtime/cgo. Change-Id: I603ed2edd39f826fb8193740ece5bd11d18c3dc5 Reviewed-on: https://go-review.googlesource.com/20876Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Brad Fitzpatrick authored
Updates #10848 Change-Id: I8353100ed01cb0e8fc19225157f5709bae388612 Reviewed-on: https://go-review.googlesource.com/20975Reviewed-by: Rob Pike <r@golang.org>
-
Michael Munday authored
Fixes this test on s390x. Change-Id: Ie5b70e8191169867765ec9248d827ca12c6405f4 Reviewed-on: https://go-review.googlesource.com/20964Reviewed-by: Minux Ma <minux@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Michael Munday authored
Change-Id: I928532b406a3457d2c5f75f4de7d46a3f795192e Reviewed-on: https://go-review.googlesource.com/20939Reviewed-by: Minux Ma <minux@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
-