]> Cypherpunks repositories - gostls13.git/log
gostls13.git
9 years ago[dev.ssa] cmd/compile: fix build
Josh Bleecher Snyder [Sun, 6 Sep 2015 22:04:46 +0000 (15:04 -0700)]
[dev.ssa] cmd/compile: fix build

CL 14337 made SSA support fixedbugs/issue9604b.go.
That test contains > 40k blocks.
This made the O(n^2) dom algorithm fail to terminate
in a reasonable length of time, breaking the build.

For the moment, cap the number of blocks
to fix the build.

This will be reverted when a more efficient
dom algorithm is put in place,
which will be soon.

Change-Id: Ia66c2629481d29d06655ec54d1deff076b0422c6
Reviewed-on: https://go-review.googlesource.com/14342
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years ago[dev.ssa] cmd/compile: implement OPLUS
Josh Bleecher Snyder [Sun, 6 Sep 2015 02:28:00 +0000 (19:28 -0700)]
[dev.ssa] cmd/compile: implement OPLUS

Change-Id: Iaf282211a717e38b05e5d2661d400d465decad50
Reviewed-on: https://go-review.googlesource.com/14337
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile/internal/gc: implement go and defer
Keith Randall [Sat, 29 Aug 2015 05:51:01 +0000 (22:51 -0700)]
[dev.ssa] cmd/compile/internal/gc: implement go and defer

TODO: for now, just function calls.  Do method and interface calls.

Change-Id: Ib262dfa31cb753996cde899beaad4dc2e66705ac
Reviewed-on: https://go-review.googlesource.com/14035
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years ago[dev.ssa] cmd/compile: run std tests with SSA codegen as part of all.bash
Josh Bleecher Snyder [Fri, 4 Sep 2015 15:50:28 +0000 (08:50 -0700)]
[dev.ssa] cmd/compile: run std tests with SSA codegen as part of all.bash

Todd Neal has made all the stdlib tests pass.
Now the trybots and build dashboard can
help us keep them passing.

All of this code will be unwound bit by bit
as SSA matures and then becomes the default.

Change-Id: I52ac7e72a87d329ccce974d6671c054374828d11
Reviewed-on: https://go-review.googlesource.com/14294
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years ago[dev.ssa] cmd/runtime: generate gc bitmaps for SSA-compiled code
Keith Randall [Mon, 24 Aug 2015 09:16:19 +0000 (02:16 -0700)]
[dev.ssa] cmd/runtime: generate gc bitmaps for SSA-compiled code

This change is all about leveraging the gc bitmap generation
that is already done by the current compiler.  We rearrange how
stack allocation is done so that we generate a variable declaration
for each spill.  We also reorganize how args/locals are recorded
during SSA.  Then we can use the existing allocauto/defframe to
allocate the stack frame and liveness to make the gc bitmaps.

With this change, stack copying works correctly and we no longer
need hacks in runtime/stack*.go to make tests work.  GC is close
to working, it just needs write barriers.

Change-Id: I990fb4e3fbe98850c6be35c3185a1c85d9e1a6ba
Reviewed-on: https://go-review.googlesource.com/13894
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years ago[dev.ssa] cmd/compile: cleanup fp conversions in ssa.go
David Chase [Tue, 1 Sep 2015 21:09:00 +0000 (17:09 -0400)]
[dev.ssa] cmd/compile: cleanup fp conversions in ssa.go

Change to table-driven instead of branchy code; leads to
net reduction in lines, easier to understand what happens,
easier to modify code if we want option to exclude generation
of branchy cases.

Doesn't appear to scale for 8x8 case of integer types.

Change-Id: Ib40104b149d30bb329c5782f6cac45c75743e768
Reviewed-on: https://go-review.googlesource.com/14163
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: add allocs to pass stats
Josh Bleecher Snyder [Sat, 5 Sep 2015 00:33:56 +0000 (17:33 -0700)]
[dev.ssa] cmd/compile: add allocs to pass stats

Also, improve HTML formatting.

Change-Id: I07e2482a30862e2091707f260a2c43d6e9a85d97
Reviewed-on: https://go-review.googlesource.com/14333
Reviewed-by: Todd Neal <todd@tneal.org>
9 years ago[dev.ssa] cmd/compile: minor code cleanup
Josh Bleecher Snyder [Sat, 5 Sep 2015 00:33:32 +0000 (17:33 -0700)]
[dev.ssa] cmd/compile: minor code cleanup

Change-Id: I9c84f5ca18745fb2358494c6944bf7ddd05cf8f0
Reviewed-on: https://go-review.googlesource.com/14332
Reviewed-by: Todd Neal <todd@tneal.org>
9 years ago[dev.ssa] cmd/compile: rewrite user nil check as OpIsNonNil
Todd Neal [Mon, 31 Aug 2015 02:19:20 +0000 (21:19 -0500)]
[dev.ssa] cmd/compile: rewrite user nil check as OpIsNonNil

Rewite user nil checks as OpIsNonNil so our nil check elimination pass
can take advantage and remove redundant checks.

With make.bash this removes 10% more nilchecks (34110 vs 31088).

Change-Id: Ifb01d1b6d2d759f5e2a5aaa0470e1d5a2a680212
Reviewed-on: https://go-review.googlesource.com/14321
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years ago[dev.ssa] cmd/compile: teach live variable analysis about LEAW
Keith Randall [Fri, 4 Sep 2015 20:16:07 +0000 (13:16 -0700)]
[dev.ssa] cmd/compile: teach live variable analysis about LEAW

SSA uses this opcode, the old compiler doesn't.

Change-Id: Ic3dde6216496b4b89d570584d34cb0971fdf379d
Reviewed-on: https://go-review.googlesource.com/14330
Reviewed-by: Minux Ma <minux@golang.org>
9 years ago[dev.ssa] cmd/compile/ssa: add timing to compiler passes
Todd Neal [Tue, 11 Aug 2015 00:00:34 +0000 (19:00 -0500)]
[dev.ssa] cmd/compile/ssa: add timing to compiler passes

Add timing/allocation information to each compiler pass for both the
console and html output.

Change-Id: I75833003b806a09b4fb1bbf63983258612cdb7b0
Reviewed-on: https://go-review.googlesource.com/14277
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: store floats in AuxInt
Todd Neal [Fri, 4 Sep 2015 11:33:56 +0000 (06:33 -0500)]
[dev.ssa] cmd/compile: store floats in AuxInt

Store floats in AuxInt to reduce allocations.

Change-Id: I101e6322530b4a0b2ea3591593ad022c992e8df8
Reviewed-on: https://go-review.googlesource.com/14320
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: store bools in AuxInt
Todd Neal [Thu, 3 Sep 2015 23:24:22 +0000 (18:24 -0500)]
[dev.ssa] cmd/compile: store bools in AuxInt

Store bools in AuxInt to reduce allocations.

Change-Id: Ibd26db67fca5e1e2803f53d7ef094897968b704b
Reviewed-on: https://go-review.googlesource.com/14276
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile/internal/ssa: fix fallthrough return
Keith Randall [Thu, 3 Sep 2015 21:28:52 +0000 (14:28 -0700)]
[dev.ssa] cmd/compile/internal/ssa: fix fallthrough return

Fallthrough return needs to be a return block before jumping
to the exit block.

Change-Id: I994de2064da5c326c9cade2c33cbb15bdbce5acb
Reviewed-on: https://go-review.googlesource.com/14256
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years ago[dev.ssa] cmd/compile/internal/ssa: distinguish exit and return blocks
Keith Randall [Thu, 3 Sep 2015 16:09:59 +0000 (09:09 -0700)]
[dev.ssa] cmd/compile/internal/ssa: distinguish exit and return blocks

It is confusing to have exceptional edges jump back into
real code.  Distinguish return blocks, which execute acutal
code, and the exit block, which is a merge point for the regular
and exceptional return flow.

Prevent critical edge insertion from adding blocks on edges
into the exit block.  These added blocks serve no purpose and
add a bunch of dead jumps to the assembly output.  Furthermore,
live variable analysis is confused by these jumps.

Change-Id: Ifd69e6c00e90338ed147e7cb351b5100dc0364df
Reviewed-on: https://go-review.googlesource.com/14254
Reviewed-by: David Chase <drchase@google.com>
9 years ago[dev.ssa] cmd/compile: add pxor to list of instructions analyzeable by liveness analysis
Keith Randall [Thu, 3 Sep 2015 03:36:47 +0000 (20:36 -0700)]
[dev.ssa] cmd/compile: add pxor to list of instructions analyzeable by liveness analysis

Change-Id: I6ea0a3482d8813b8555b16fe6c377cad33554619
Reviewed-on: https://go-review.googlesource.com/14247
Reviewed-by: David Chase <drchase@google.com>
9 years ago[dev.ssa] cmd/compile: cse should treat -0.0 and 0.0 as different
Todd Neal [Thu, 3 Sep 2015 01:17:47 +0000 (20:17 -0500)]
[dev.ssa] cmd/compile: cse should treat -0.0 and 0.0 as different

cse was incorrectly classifying -0.0 and 0.0 as equivalent. This lead
to invalid code as ssa uses PXOR -0.0, reg to negate a floating point.

Fixes math.

Change-Id: Id7eb10c71749eaed897f29b02c33891cf5820acf
Reviewed-on: https://go-review.googlesource.com/14205
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: fix complex128
Todd Neal [Thu, 3 Sep 2015 02:11:32 +0000 (21:11 -0500)]
[dev.ssa] cmd/compile: fix complex128

complex128 was being treated as a complex64

Fixes math/cmplx.

Change-Id: I2996915b4cb6b94198d41cf08a30bd8531b9fec5
Reviewed-on: https://go-review.googlesource.com/14206
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: fix liblink rewrite of -0.0
Todd Neal [Wed, 2 Sep 2015 02:25:24 +0000 (21:25 -0500)]
[dev.ssa] cmd/compile: fix liblink rewrite of -0.0

liblink was rewriting xor by a negative zero (used by SSA
for negation) as XORPS reg,reg.

Fixes strconv.

Change-Id: I627a0a7366618e6b07ba8f0ad0db0e102340c5e3
Reviewed-on: https://go-review.googlesource.com/14200
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: truncate when converting floats to ints
Todd Neal [Wed, 2 Sep 2015 00:05:44 +0000 (19:05 -0500)]
[dev.ssa] cmd/compile: truncate when converting floats to ints

Modified to use the truncating conversion.

Fixes reflect.

Change-Id: I47bf3200abc2d2c662939a2a2351e2ff84168f4a
Reviewed-on: https://go-review.googlesource.com/14167
Reviewed-by: David Chase <drchase@google.com>
9 years ago[dev.ssa] cmd/compile: make REPSTOSQ clobber flags
Todd Neal [Tue, 1 Sep 2015 22:56:37 +0000 (17:56 -0500)]
[dev.ssa] cmd/compile: make REPSTOSQ clobber flags

It does a XOR internally and clobbers flags.

Change-Id: Id6ef9219c4e6c3a2b5fc79c8d52bcfa30c148617
Reviewed-on: https://go-review.googlesource.com/14165
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile/internal/ssa: make SETEQF and SETNEF clobber flags
Keith Randall [Tue, 1 Sep 2015 22:18:01 +0000 (15:18 -0700)]
[dev.ssa] cmd/compile/internal/ssa: make SETEQF and SETNEF clobber flags

They do an AND or an OR internally, so they clobber flags.

Fixes #12441

Change-Id: I6c843bd268496bc13fc7e3c561d76619e961e8ad
Reviewed-on: https://go-review.googlesource.com/14180
Reviewed-by: Todd Neal <todd@tneal.org>
9 years ago[dev.ssa] cmd/compile: fix rare issue caused by liblink rewrite
Todd Neal [Sat, 29 Aug 2015 20:41:57 +0000 (15:41 -0500)]
[dev.ssa] cmd/compile: fix rare issue caused by liblink rewrite

liblink rewrites MOV $0, reg into XOR reg, reg. Make MOVxconst clobber
flags so we don't generate invalid code in the unlikely case that it
matters.  In testing, this change leads to no additional regenerated
flags due to a scheduling fix in CL14042.

Change-Id: I7bc1cfee94ef83beb2f97c31ec6a97e19872fb89
Reviewed-on: https://go-review.googlesource.com/14043
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: add complex arithmetic
David Chase [Fri, 28 Aug 2015 18:24:10 +0000 (14:24 -0400)]
[dev.ssa] cmd/compile: add complex arithmetic

Still to do:
details, more testing corner cases. (e.g. negative zero)
Includes small cleanups for previous CL.

Note: complex division is currently done in the runtime,
so the division code here is apparently not yet necessary
and also not tested.  Seems likely better to open code
division and expose the widening/narrowing to optimization.

Complex64 multiplication and division is done in wide
format to avoid cancellation errors; for division, this
also happens to be compatible with pre-SSA practice
(which uses a single complex128 division function).

It would-be-nice to widen for complex128 multiplication
intermediates as well, but that is trickier to implement
without a handy wider-precision format.

Change-Id: I595a4300f68868fb7641852a54674c6b2b78855e
Reviewed-on: https://go-review.googlesource.com/14028
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile/internal/ssa: allow ops to have a default type
Keith Randall [Tue, 1 Sep 2015 16:16:58 +0000 (09:16 -0700)]
[dev.ssa] cmd/compile/internal/ssa: allow ops to have a default type

Specifying types in rewrites for all subexpressions gets verbose
quickly.  Allow opcodes to specify a default type which is used when
none is supplied explicitly.

Provide default types for a few easy opcodes.  There are probably more
we can do, but this is a good start.

Change-Id: Iedc2a1a423cc3e2d4472640433982f9aa76a9f18
Reviewed-on: https://go-review.googlesource.com/14128
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years ago[dev.ssa] cmd/compile: add more specific regalloc logging
Todd Neal [Tue, 1 Sep 2015 01:42:04 +0000 (20:42 -0500)]
[dev.ssa] cmd/compile: add more specific regalloc logging

Change-Id: Ib0ea4b9c245f3d551e0f703826caa6b444b56a2d
Reviewed-on: https://go-review.googlesource.com/14136
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years ago[dev.ssa] cmd/compile: schedule values dependent on the control later
Todd Neal [Sat, 29 Aug 2015 17:51:04 +0000 (12:51 -0500)]
[dev.ssa] cmd/compile: schedule values dependent on the control later

To reduce the number of spills, give any non-phi values whose argument
is the control the same priority as the control.

With mask.bash, this reduces regenerated flags from 603 to 240.

Change-Id: I26883d69e80357c56b343428fb528102b3f26e7a
Reviewed-on: https://go-review.googlesource.com/14042
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: fix typo in log
Todd Neal [Mon, 31 Aug 2015 03:04:38 +0000 (22:04 -0500)]
[dev.ssa] cmd/compile: fix typo in log

Change-Id: Ic7be8fa3a89e46a93df181df3163ec1bf7e96a23
Reviewed-on: https://go-review.googlesource.com/14076
Reviewed-by: Minux Ma <minux@golang.org>
9 years ago[dev.ssa] cmd/compile: add instrumentation to regalloc
Todd Neal [Mon, 31 Aug 2015 02:39:25 +0000 (21:39 -0500)]
[dev.ssa] cmd/compile: add instrumentation to regalloc

Change-Id: Ice206f7e94af4a148d9dd9a7570f5ed21722bedc
Reviewed-on: https://go-review.googlesource.com/14075
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years ago[dev.ssa] cmd/compile: make test panic on failure
Todd Neal [Mon, 31 Aug 2015 02:21:44 +0000 (21:21 -0500)]
[dev.ssa] cmd/compile: make test panic on failure

Change-Id: Ia5483d23fe0b5dd0b6cfe2099e9b475184742716
Reviewed-on: https://go-review.googlesource.com/14074
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years ago[dev.ssa] cmd/compile: map EQ/NE intptr to OpEqPtr/OpNeqPtr
Todd Neal [Mon, 31 Aug 2015 01:47:26 +0000 (20:47 -0500)]
[dev.ssa] cmd/compile: map EQ/NE intptr to OpEqPtr/OpNeqPtr

Change-Id: I8fd3727763c812297967c8069847833fc8516ff2
Reviewed-on: https://go-review.googlesource.com/14073
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years ago[dev.ssa] cmd/compile/internal/ssa: handle dead code a different way
Keith Randall [Fri, 28 Aug 2015 23:45:17 +0000 (16:45 -0700)]
[dev.ssa] cmd/compile/internal/ssa: handle dead code a different way

Instead of trying to delete dead code as soon as we find it, just
mark it as dead using a PlainAndDead block kind.  The deadcode pass
will do the real removal.

This way is somewhat more efficient because we don't need to mess
with successor and predecessor lists of all the dead blocks.

Fixes #12347

Change-Id: Ia42d6b5f9cdb3215a51737b3eb117c00bd439b13
Reviewed-on: https://go-review.googlesource.com/14033
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years ago[dev.ssa] cmd/compile: implement PPARAMREF
Josh Bleecher Snyder [Fri, 28 Aug 2015 20:35:32 +0000 (13:35 -0700)]
[dev.ssa] cmd/compile: implement PPARAMREF

This also fixes the encoding/gob TestTopLevelNilPointer failure.

Change-Id: I9b29a6fddffd51af305c685f3a8e2a0594bfeeab
Reviewed-on: https://go-review.googlesource.com/14032
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: move addEdge function to ssa
Todd Neal [Sat, 29 Aug 2015 02:36:29 +0000 (21:36 -0500)]
[dev.ssa] cmd/compile: move addEdge function to ssa

addEdge had two identical implementations so make it an exported method
on Block.

Change-Id: I8c21655a9dc5074fefd7f63b2f5b51897571e608
Reviewed-on: https://go-review.googlesource.com/14040
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: implement OFALL
Todd Neal [Sat, 29 Aug 2015 02:19:40 +0000 (21:19 -0500)]
[dev.ssa] cmd/compile: implement OFALL

Frontend has already rewriten fallthrough statements, we just need to
ignore them.

Change-Id: Iadf89b06a9f8f9e6e2e1e87c934f31add77a19a1
Reviewed-on: https://go-review.googlesource.com/14029
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years ago[dev.ssa] cmd/compile: implement len/cap(chan)
Todd Neal [Fri, 28 Aug 2015 20:56:43 +0000 (15:56 -0500)]
[dev.ssa] cmd/compile: implement len/cap(chan)

Change-Id: I1453ba226376ccd4d79780fc0686876d6dde01ee
Reviewed-on: https://go-review.googlesource.com/14027
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: added floating point to [u]int conversions
David Chase [Wed, 26 Aug 2015 18:25:40 +0000 (14:25 -0400)]
[dev.ssa] cmd/compile: added floating point to [u]int conversions

Change-Id: I8dee400aef07165f911750de2615b8757f826000
Reviewed-on: https://go-review.googlesource.com/13945
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile/internal/ssa: allocate complex zero in the entry block
Keith Randall [Fri, 28 Aug 2015 20:52:26 +0000 (13:52 -0700)]
[dev.ssa] cmd/compile/internal/ssa: allocate complex zero in the entry block

Fixes build.  There may be no current block.

Change-Id: I0da8bab133dc207124556927698e7cd682e64ef5
Reviewed-on: https://go-review.googlesource.com/13989
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: fix type of nil ptr in check
Todd Neal [Fri, 28 Aug 2015 20:20:54 +0000 (15:20 -0500)]
[dev.ssa] cmd/compile: fix type of nil ptr in check

Change-Id: If7a6ab6b1336dbacb006f562be7f153eb93e7253
Reviewed-on: https://go-review.googlesource.com/14025
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile/internal/ssa: add arg-dominating check, fix phielim
Keith Randall [Fri, 28 Aug 2015 19:53:41 +0000 (12:53 -0700)]
[dev.ssa] cmd/compile/internal/ssa: add arg-dominating check, fix phielim

Add a check to make sure value arguments dominate the value.

Phi elim output used to fail this test.  When eliminating
redundant phis, phi elim was using one of the args and not
the ultimate source.  For example:

          b1: x = ...
          -> b2 b3

b2: y = Copy x        b3: z = Copy x
-> b4                 -> b4

          b4: w = phi y z

Phi elim eliminates w, but it used to replace w with (Copy y).
That's bad as b2 does not dominate b4.  Instead we should
replace w with (Copy x).

Fixes #12347

Change-Id: I9f340cdabcda8e2e90359fb4f9250877b1fffe98
Reviewed-on: https://go-review.googlesource.com/13986
Reviewed-by: David Chase <drchase@google.com>
9 years ago[dev.ssa] cmd/compile: add compose/decompose for complex, phi, constants
David Chase [Fri, 28 Aug 2015 18:24:10 +0000 (14:24 -0400)]
[dev.ssa] cmd/compile: add compose/decompose for complex, phi, constants

Still to do: arithmetic

Change-Id: I31fd23b34980c9ed4b4e304b8597134b2ba6ca5c
Reviewed-on: https://go-review.googlesource.com/14024
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: implement len(map)
Todd Neal [Wed, 26 Aug 2015 23:40:52 +0000 (18:40 -0500)]
[dev.ssa] cmd/compile: implement len(map)

Implement len(map) values.

Change-Id: If92be96ec9a7a86aeb3ce566d6758aab01c2fa7d
Reviewed-on: https://go-review.googlesource.com/13961
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: make block kinds clickable in html
Josh Bleecher Snyder [Thu, 27 Aug 2015 17:29:01 +0000 (10:29 -0700)]
[dev.ssa] cmd/compile: make block kinds clickable in html

Change-Id: I113c07caf504cee66a81730da8830de6de098e49
Reviewed-on: https://go-review.googlesource.com/13981
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years ago[dev.ssa] cmd/compile: fix OANDAND and OOROR type
Josh Bleecher Snyder [Thu, 27 Aug 2015 17:11:08 +0000 (10:11 -0700)]
[dev.ssa] cmd/compile: fix OANDAND and OOROR type

The old backend doesn't like ideal types,
and we want to reuse its stackmap generation.

OOROR and OANDAND expressions have ideal type.
The old backend didn't care,
because those expressions got rewritten away into
jumps before stackmap generation.

Fix the type during conversion.

Change-Id: I488e7499298d9aec71da39c202f6a7235935bc8d
Reviewed-on: https://go-review.googlesource.com/13980
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years ago[dev.ssa] cmd/compile: fix phi floats
Todd Neal [Wed, 26 Aug 2015 03:49:59 +0000 (22:49 -0500)]
[dev.ssa] cmd/compile: fix phi floats

The code previously always used AX causing errors.  For now, just
switch off the type in order to at least generate valid code.

Change-Id: Iaf13120a24b62456b9b33c04ab31f2d5104b381b
Reviewed-on: https://go-review.googlesource.com/13943
Reviewed-by: David Chase <drchase@google.com>
9 years ago[dev.ssa] cmd/compile: support float zeroing
Todd Neal [Wed, 26 Aug 2015 00:21:45 +0000 (19:21 -0500)]
[dev.ssa] cmd/compile: support float zeroing

Change-Id: Iacd302350cf0a8a8164d937e5c4ac55e6a07d380
Reviewed-on: https://go-review.googlesource.com/13942
Reviewed-by: David Chase <drchase@google.com>
9 years ago[dev.ssa] Merge remote-tracking branch 'origin/master' into mergebranch
Keith Randall [Tue, 25 Aug 2015 21:45:41 +0000 (14:45 -0700)]
[dev.ssa] Merge remote-tracking branch 'origin/master' into mergebranch

Semi-regular merge of master into dev.ssa.

Change-Id: Ia7f2e29dfdea7618141efcfcf6f6c7c8b5553dfa

9 years ago[dev.ssa] cmd/compile/internal/ssa: add more critical edges
Keith Randall [Tue, 25 Aug 2015 21:02:30 +0000 (14:02 -0700)]
[dev.ssa] cmd/compile/internal/ssa: add more critical edges

Add blocks to remove critical edges, even when it looks like
there's no phi that requires it.  Regalloc still likes to have
critical-edge-free graphs for other reasons.

Change-Id: I69f8eaecbc5d79ab9f2a257c2e289d60b18e43c8
Reviewed-on: https://go-review.googlesource.com/13933
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years agocmd/compile: fix register allocation for == operator
Ulrich Kunitz [Thu, 20 Aug 2015 16:56:18 +0000 (18:56 +0200)]
cmd/compile: fix register allocation for == operator

The issue 12226 has been caused by the allocation of the same register
for the equality check of two byte values. The code in cgen.go freed the
register for the second operand before the allocation of the register
for the first operand.

Fixes #12226

Change-Id: Ie4dc33a488bd48a17f8ae9b497fd63c1ae390555
Reviewed-on: https://go-review.googlesource.com/13771
Reviewed-by: Russ Cox <rsc@golang.org>
9 years ago[dev.ssa] cmd/compile/internal/ssa: update TODO and comments
Keith Randall [Tue, 25 Aug 2015 17:39:23 +0000 (10:39 -0700)]
[dev.ssa] cmd/compile/internal/ssa: update TODO and comments

Change-Id: I3c598faff8af18530ae863b9e72f0cef379b4a1f
Reviewed-on: https://go-review.googlesource.com/13909
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years ago[dev.ssa] cmd/compile: implement OSLICESTR
Keith Randall [Tue, 25 Aug 2015 06:52:03 +0000 (23:52 -0700)]
[dev.ssa] cmd/compile: implement OSLICESTR

Add a new function and generic operation to handle
bounds checking for slices. Unlike the index
bounds checking the index can be equal to the upper
bound.

Do gc-friendly slicing that generates proper code for
0-length result slices.

This is a takeover of Alexandru's original change,
(https://go-review.googlesource.com/#/c/12764/)
submittable now that the decompose phase is in.

Change-Id: I17d164cf42ed7839f84ca949c6ad3289269c9160
Reviewed-on: https://go-review.googlesource.com/13903
Reviewed-by: David Chase <drchase@google.com>
9 years ago[dev.ssa] cmd/compile: add FP comparison ops
David Chase [Tue, 18 Aug 2015 18:39:26 +0000 (14:39 -0400)]
[dev.ssa] cmd/compile: add FP comparison ops

Basic ops, no particular optimization in the pattern
matching yet (e.g. x!=x for Nan detection, x cmp constant,
etc.)

Change-Id: I0043564081d6dc0eede876c4a9eb3c33cbd1521c
Reviewed-on: https://go-review.googlesource.com/13704
Reviewed-by: Keith Randall <khr@golang.org>
9 years agocmd/compile: fix uninitialized memory in compare of interface value
Austin Clements [Mon, 24 Aug 2015 17:35:49 +0000 (13:35 -0400)]
cmd/compile: fix uninitialized memory in compare of interface value

A comparison of the form l == r where l is an interface and r is
concrete performs a type assertion on l to convert it to r's type.
However, the compiler fails to zero the temporary where the result of
the type assertion is written, so if the type is a pointer type and a
stack scan occurs while in the type assertion, it may see an invalid
pointer on the stack.

Fix this by zeroing the temporary. This is equivalent to the fix for
type switches from c4092ac.

Fixes #12253.

Change-Id: Iaf205d456b856c056b317b4e888ce892f0c555b9
Reviewed-on: https://go-review.googlesource.com/13872
Reviewed-by: Russ Cox <rsc@golang.org>
9 years ago[dev.ssa] cmd/compile: add [u]int and FP to FP conversions
David Chase [Thu, 20 Aug 2015 19:14:20 +0000 (15:14 -0400)]
[dev.ssa] cmd/compile: add [u]int and FP to FP conversions

Change-Id: I8c17f706a3e0f1fa2d754bfb4ccd1f7a027cb3db
Reviewed-on: https://go-review.googlesource.com/13744
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: make sure to keep offset and sym of MOV opcodes.
Keith Randall [Mon, 24 Aug 2015 04:14:25 +0000 (21:14 -0700)]
[dev.ssa] cmd/compile: make sure to keep offset and sym of MOV opcodes.

MOVXload and MOVXstore opcodes have both an auxint offset
and an aux offset (a symbol name, like a local or arg or global).
Make sure we keep those values during rewrites.

Change-Id: Ic9fd61bf295b5d1457784c281079a4fb38f7ad3b
Reviewed-on: https://go-review.googlesource.com/13849
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years agoruntime: check pointer equality in arm64 cmpbody
Dave Cheney [Tue, 25 Aug 2015 03:12:32 +0000 (13:12 +1000)]
runtime: check pointer equality in arm64 cmpbody

Updates #11336

Follow the lead of amd64 by doing a pointer equality check
before comparing string/byte contents on arm64.

BenchmarkCompareBytesEqual-8               25.8           26.3           +1.94%
BenchmarkCompareBytesToNil-8               9.59           9.59           +0.00%
BenchmarkCompareBytesEmpty-8               9.59           9.17           -4.38%
BenchmarkCompareBytesIdentical-8           26.3           9.17           -65.13%
BenchmarkCompareBytesSameLength-8          16.3           16.3           +0.00%
BenchmarkCompareBytesDifferentLength-8     16.3           16.3           +0.00%
BenchmarkCompareBytesBigUnaligned-8        1132038        1131409        -0.06%
BenchmarkCompareBytesBig-8                 1126758        1128470        +0.15%
BenchmarkCompareBytesBigIdentical-8        1084366        9.17           -100.00%

Change-Id: Id7125c31957eff1ddb78897d4511bd50e79af3f7
Reviewed-on: https://go-review.googlesource.com/13885
Reviewed-by: Keith Randall <khr@golang.org>
9 years agoruntime: fix nmspinning comparison
Todd Neal [Tue, 25 Aug 2015 00:11:35 +0000 (19:11 -0500)]
runtime: fix nmspinning comparison

nmspinning has a value range of [0, 2^31-1].  Update the comment to
indicate this and fix the comparison so it's not always false.

Fixes #11280

Change-Id: Iedaf0654dcba5e2c800645f26b26a1a781ea1991
Reviewed-on: https://go-review.googlesource.com/13877
Reviewed-by: Minux Ma <minux@golang.org>
9 years agoruntime: add a missing hex conversion
Shenghou Ma [Tue, 25 Aug 2015 01:24:23 +0000 (21:24 -0400)]
runtime: add a missing hex conversion

gobuf.g is a guintptr, so without hex(), it will be printed as
a decimal, which is not very helpful and inconsistent with how
other pointers are printed.

Change-Id: I7c0432e9709e90a5c3b3e22ce799551a6242d017
Reviewed-on: https://go-review.googlesource.com/13879
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agodebug/elf: map/slice literals janitoring
Didier Spezia [Sun, 23 Aug 2015 13:59:00 +0000 (13:59 +0000)]
debug/elf: map/slice literals janitoring

Simplify slice/map literal expressions.
Caught with gofmt -d -s, fixed with gofmt -w -s
Reformatted some expressions to improve readability.

Change-Id: Iaf123e6bd49162ec45c59297ad3b002ca59443bc
Reviewed-on: https://go-review.googlesource.com/13850
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agocmd/go: skip test using external linking on linux/ppc64 too
Shenghou Ma [Tue, 25 Aug 2015 01:17:04 +0000 (21:17 -0400)]
cmd/go: skip test using external linking on linux/ppc64 too

While we're at it, also fix a typo.

Change-Id: Id436f33cffa5683e2a8450cce5b545960cf2877e
Reviewed-on: https://go-review.googlesource.com/13878
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agoencoding/gob: remove always false comparison
Todd Neal [Mon, 24 Aug 2015 23:30:53 +0000 (18:30 -0500)]
encoding/gob: remove always false comparison

This is not a functional change. nr is a uint64 and can never be less
than zero, remove the no-op comparison.

Fixes #11279

Change-Id: Iebb36cc8fe97428b503e65d01b5e67d2b2bc7369
Reviewed-on: https://go-review.googlesource.com/13876
Run-TryBot: Todd Neal <todd@tneal.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agoos/signal: skip the nohup test on darwin when running in tmux.
Aaron Jacobs [Mon, 24 Aug 2015 22:53:42 +0000 (08:53 +1000)]
os/signal: skip the nohup test on darwin when running in tmux.

The nohup command doesn't work in tmux on darwin.

Fixes #5135.

Change-Id: I1c21073d8bd54b49dd6b0bad86ef088d6d8e7a5f
Reviewed-on: https://go-review.googlesource.com/13883
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years ago[dev.ssa] cmd/compile: streamline unimplemented strings
Josh Bleecher Snyder [Mon, 24 Aug 2015 03:29:43 +0000 (20:29 -0700)]
[dev.ssa] cmd/compile: streamline unimplemented strings

This aids in making sense of the aggregate set of work outstanding.
Interest in the details of any particular implementation failure
is better handled locally anyway.

In my local tree, running make.bash after this CL yields:

 14.85%  1811 SSA unimplemented: unhandled expr SLICEARR
 13.84%  1687 SSA unimplemented: unhandled expr CALLINTER
 11.84%  1444 SSA unimplemented: unhandled stmt RETJMP
 10.24%  1249 SSA unimplemented: unhandled expr EFACE
  8.52%  1039 SSA unimplemented: unhandled expr SLICE
  4.92%   600 SSA unimplemented: local variable with class PAUTO,heap unimplemented
  4.90%   598 SSA unimplemented: unhandled expr SLICESTR
  3.91%   477 SSA unimplemented: local variable with class PFUNC unimplemented
  3.45%   421 SSA unimplemented: not lowered: IMake INTER PTR64 PTR64
  3.42%   417 SSA unimplemented: unhandled expr APPEND
  3.21%   391 SSA unimplemented: unhandled expr CLOSUREVAR
  3.06%   373 SSA unimplemented: unhandled stmt DEFER
  3.04%   371 SSA unimplemented: unhandled stmt AS2DOTTYPE
  1.61%   196 SSA unimplemented: unhandled expr DOTTYPE
  1.56%   190 SSA unimplemented: not lowered: Load STRUCT PTR64 mem
  0.79%    96 SSA unimplemented: not lowered: StringMake STRING PTR64 UINTPTR
  0.69%    84 SSA unimplemented: unhandled binary op NE FLOAT64
  0.53%    65 SSA unimplemented: unhandled expr STRUCTLIT
  0.50%    61 SSA unimplemented: not lowered: SliceMake ARRAY PTR64 UINTPTR UINTPTR
  0.45%    55 SSA unimplemented: zero for type float64 not implemented
  0.44%    54 SSA unimplemented: unhandled addr CLOSUREVAR
  0.38%    46 SSA unimplemented: unhandled binary op EQ FLOAT64
  0.35%    43 SSA unimplemented: unhandled binary op LT FLOAT64
  0.34%    42 SSA unimplemented: unhandled len(map)
  0.33%    40 SSA unimplemented: unhandled stmt FALL
  0.23%    28 SSA unimplemented: CONVNOP closure
  0.21%    25 SSA unimplemented: local variable with class PPARAM,heap unimplemented
  0.21%    25 SSA unimplemented: unhandled binary op GT FLOAT64
  0.18%    22 SSA unimplemented: unhandled OCONV FLOAT32 -> FLOAT64
  0.18%    22 SSA unimplemented: unhandled expr REAL
  0.16%    20 SSA unimplemented: unhandled stmt PROC
  0.16%    19 SSA unimplemented: unhandled closure arg
  0.15%    18 SSA unimplemented: unhandled OCONV INT64 -> FLOAT64
  0.12%    15 SSA unimplemented: unhandled expr CFUNC
  0.10%    12 SSA unimplemented: unhandled OCONV UINT64 -> FLOAT64
  0.09%    11 SSA unimplemented: unhandled OLITERAL 4
  0.09%    11 SSA unimplemented: unhandled expr IMAG
  0.07%     9 SSA unimplemented: unhandled binary op GE FLOAT64
  0.07%     9 SSA unimplemented: unhandled binary op MINUS FLOAT64
  0.06%     7 SSA unimplemented: unhandled OCONV FLOAT64 -> FLOAT32
  0.06%     7 SSA unimplemented: unhandled binary op NE FLOAT32
  0.06%     7 SSA unimplemented: variable address class 5 not implemented
  0.05%     6 SSA unimplemented: not lowered: Load COMPLEX128 PTR64 mem
  0.05%     6 SSA unimplemented: unhandled expr SLICE3ARR
  0.04%     5 SSA unimplemented: unhandled binary op LE FLOAT64
  0.03%     4 SSA unimplemented: unhandled OCONV UINTPTR -> FLOAT64
  0.03%     4 SSA unimplemented: unhandled binary op EQ COMPLEX128
  0.03%     4 SSA unimplemented: unhandled binary op EQ FLOAT32
  0.03%     4 SSA unimplemented: unhandled expr COMPLEX
  0.02%     3 SSA unimplemented: local variable with class PPARAMOUT,heap unimplemented
  0.02%     3 SSA unimplemented: not lowered: Load ARRAY PTR64 mem
  0.02%     3 SSA unimplemented: unhandled OCONV INT32 -> FLOAT64
  0.02%     3 SSA unimplemented: unhandled OCONV INT64 -> FLOAT32
  0.02%     3 SSA unimplemented: unhandled expr SLICE3
  0.02%     2 SSA unimplemented: unhandled OCONV COMPLEX64 -> COMPLEX128
  0.02%     2 SSA unimplemented: unhandled OCONV FLOAT64 -> INT64
  0.02%     2 SSA unimplemented: unhandled OCONV FLOAT64 -> UINT64
  0.02%     2 SSA unimplemented: unhandled OCONV INT -> FLOAT64
  0.02%     2 SSA unimplemented: unhandled OCONV UINT64 -> FLOAT32
  0.02%     2 SSA unimplemented: unhandled binary op EQ COMPLEX64
  0.02%     2 SSA unimplemented: unhandled binary op MINUS FLOAT32
  0.02%     2 SSA unimplemented: zero for type complex128 not implemented
  0.02%     2 SSA unimplemented: zero for type complex64 not implemented
  0.02%     2 SSA unimplemented: zero for type float32 not implemented
  0.01%     1 SSA unimplemented: not lowered: EqFat BOOL INTER INTER
  0.01%     1 SSA unimplemented: not lowered: Store mem UINTPTR COMPLEX128 mem
  0.01%     1 SSA unimplemented: unhandled OCONV UINT32 -> FLOAT64
  0.01%     1 SSA unimplemented: unhandled cap(chan)
  0.01%     1 SSA unimplemented: unhandled expr ARRAYLIT
  0.01%     1 SSA unimplemented: unhandled expr PLUS
  0.01%     1 SSA unimplemented: unhandled stmt CHECKNIL

Change-Id: I43474fe6d6ec22a9f57239090136f6e97eebfdf2
Reviewed-on: https://go-review.googlesource.com/13848
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: support spilling and loading flags
Josh Bleecher Snyder [Sun, 23 Aug 2015 02:38:12 +0000 (19:38 -0700)]
[dev.ssa] cmd/compile: support spilling and loading flags

This CL takes a simple approach to spilling and loading flags.
We never spill. When a load is needed, we recalculate,
loading the arguments as needed.

This is simple and architecture-independent.
It is not very efficient, but as of this CL,
there are fewer than 200 flag spills during make.bash.

This was tested by manually reverting CLs 13813 and 13843,
causing SETcc, MOV, and LEA instructions to clobber flags,
which dramatically increases the number of flags spills.
With that done, all stdlib tests that used to pass
still pass.

For future reference, here are some other, more efficient
amd64-only schemes that we could adapt in the future if needed.

(1) Spill exactly the flags needed.

For example, if we know that the flags will be needed
by a SETcc or Jcc op later, we could use SETcc to
extract just the relevant flag. When needed,
we could use TESTB and change the op to JNE/SETNE.
(Alternatively, we could leave the op unaltered
and prepare an appropriate CMPB instruction
to produce the desired flag.)

However, this requires separate handling for every
instruction that uses the flags register,
including (say) SBBQcarrymask.

We could enable this on an ad hoc basis for common cases
and fall back to recalculation for other cases.

(2) Spill all flags with PUSHF and POPF

This modifies SP, which the runtime won't like.
It also requires coordination with stackalloc to
make sure that we have a stack slot ready for use.

(3) Spill almost all flags with LAHF, SETO, and SAHF

See http://blog.freearrow.com/archives/396
for details. This would handle all the flags we currently
use. However, LAHF and SAHF are not universally available
and it requires arranging for AX to be free.

Change-Id: Ie36600fd8e807ef2bee83e2e2ae3685112a7f276
Reviewed-on: https://go-review.googlesource.com/13844
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: mark LEA and MOV instructions as not clobbering flags
Josh Bleecher Snyder [Sat, 22 Aug 2015 16:52:36 +0000 (09:52 -0700)]
[dev.ssa] cmd/compile: mark LEA and MOV instructions as not clobbering flags

This further reduces the number of flags spills
during make.bash by about 50%.

Note that GetG is implemented by one or two MOVs,
which is why it does not clobber flags.

Change-Id: I6fede8c027b7dc340e00d1e15df1b87bf2b2d9ec
Reviewed-on: https://go-review.googlesource.com/13843
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: make "*Value".String more robust
Josh Bleecher Snyder [Sat, 22 Aug 2015 20:30:45 +0000 (13:30 -0700)]
[dev.ssa] cmd/compile: make "*Value".String more robust

Change-Id: I4ae38440a33574421c9e3e350701e86e8a224b92
Reviewed-on: https://go-review.googlesource.com/13842
Reviewed-by: Todd Neal <todd@tneal.org>
Reviewed-by: Keith Randall <khr@golang.org>
9 years agohash/fnv: fix wiki url
Joe Tsai [Thu, 6 Aug 2015 08:49:00 +0000 (01:49 -0700)]
hash/fnv: fix wiki url

The URL is shown on go docs and is an eye-sore.

For go1.6.

Change-Id: I8b8ea3751200d06ed36acfe22f47ebb38107f8db
Reviewed-on: https://go-review.googlesource.com/13282
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agoruntime: check pointer equality in arm cmpbody
Dave Cheney [Mon, 24 Aug 2015 05:07:58 +0000 (15:07 +1000)]
runtime: check pointer equality in arm cmpbody

Updates #11336

Follow the lead of amd64 do a pointer equality check
before comparing string/byte contents on arm.

BenchmarkCompareBytesEqual-4               208             211             +1.44%
BenchmarkCompareBytesToNil-4               83.6            81.8            -2.15%
BenchmarkCompareBytesEmpty-4               80.2            75.2            -6.23%
BenchmarkCompareBytesIdentical-4           208             75.2            -63.85%
BenchmarkCompareBytesSameLength-4          126             128             +1.59%
BenchmarkCompareBytesDifferentLength-4     128             130             +1.56%
BenchmarkCompareBytesBigUnaligned-4        14192804        14060971        -0.93%
BenchmarkCompareBytesBig-4                 12277313        12128193        -1.21%
BenchmarkCompareBytesBigIdentical-4        9385046         78.5            -100.00%

Change-Id: I5b24620018688c5fe04b6ff6743a24c4ce225788
Reviewed-on: https://go-review.googlesource.com/13881
Reviewed-by: Keith Randall <khr@golang.org>
9 years agofmt: in Scanf, %c can scan a space, so don't skip spaces at %c
Rob Pike [Sun, 23 Aug 2015 07:45:58 +0000 (17:45 +1000)]
fmt: in Scanf, %c can scan a space, so don't skip spaces at %c

In short, %c should just give you the next rune, period.
Apparently this is the design. I use the term loosely.

Fixes #12275

Change-Id: I6f30bed442c0e88eac2244d465c7d151b29cf393
Reviewed-on: https://go-review.googlesource.com/13821
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years agodoc: remove mention of defunct golang-bugs mailing list
Andrew Gerrand [Mon, 24 Aug 2015 19:43:54 +0000 (05:43 +1000)]
doc: remove mention of defunct golang-bugs mailing list

Fixes #12299

Change-Id: Id7b73d2935c9f7c0952f833613973ef455d02b0d
Reviewed-on: https://go-review.googlesource.com/13858
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agoencoding/asn1: fix unused assignments
Tarmigan Casebolt [Mon, 24 Aug 2015 02:51:22 +0000 (19:51 -0700)]
encoding/asn1: fix unused assignments

Unused assignment for `err` encoding/asn1/marshal.go:622:3
Unused assignment for `err` encoding/asn1/marshal.go:650:5

Change-Id: I4226238645ce3640f25124cb405444e61439fd3f
Reviewed-on: https://go-review.googlesource.com/13847
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agonet: allow ParseMAC to parse 20-octet IPoIB link-layer address
Matt Layher [Fri, 17 Jul 2015 21:28:42 +0000 (17:28 -0400)]
net: allow ParseMAC to parse 20-octet IPoIB link-layer address

Fixes #11763

Change-Id: Ie291b36a8c29694e80940836d7e6fd96d2d76494
Reviewed-on: https://go-review.googlesource.com/12382
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>

9 years agoimage/gif: avoid unused assignment
Tarmigan Casebolt [Mon, 24 Aug 2015 02:51:28 +0000 (19:51 -0700)]
image/gif: avoid unused assignment

Change-Id: Iaaecd8be9268c923f40cf0e5153cbf79f7015b8d
Reviewed-on: https://go-review.googlesource.com/13892
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agounicode: include rune 0 in RangeTables.
Marcel van Lohuizen [Wed, 19 Aug 2015 18:28:18 +0000 (20:28 +0200)]
unicode: include rune 0 in RangeTables.

All of Go passes. No changes for the text repo.

Fixes #10153

Change-Id: I313369bf471c8974390a6d42075e5c54f6a81750
Reviewed-on: https://go-review.googlesource.com/13667
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
9 years agogo/internal/gcimporter: remove unused assignment
Tarmigan Casebolt [Mon, 24 Aug 2015 02:51:24 +0000 (19:51 -0700)]
go/internal/gcimporter: remove unused assignment

Change-Id: I0b19731a46e4e67a7dd503dd133cafc7678760a7
Reviewed-on: https://go-review.googlesource.com/13890
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agomath: avoid unused assignment in jn.go
Tarmigan Casebolt [Mon, 24 Aug 2015 02:51:33 +0000 (19:51 -0700)]
math: avoid unused assignment in jn.go

Change-Id: Ie4f21bcd5849e994c63ec5bbda2dee6f3ec4da12
Reviewed-on: https://go-review.googlesource.com/13891
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agointernal/syscall/windows/registry: remove debugging dreg
Alex Brainman [Mon, 24 Aug 2015 03:49:30 +0000 (13:49 +1000)]
internal/syscall/windows/registry: remove debugging dreg

Change-Id: I1b9f6ad322a7f68fa160c4f09d7fb56815e505a7
Reviewed-on: https://go-review.googlesource.com/13828
Reviewed-by: Rob Pike <r@golang.org>
9 years agomake.bash: abort if $GOROOT_BOOTSTRAP == $GOROOT
Dave Cheney [Thu, 20 Aug 2015 02:28:51 +0000 (12:28 +1000)]
make.bash: abort if $GOROOT_BOOTSTRAP == $GOROOT

Fixes #12214

Change-Id: I82586b54ac7b9c0c71055bb66b921e3efbf4977c
Reviewed-on: https://go-review.googlesource.com/13719
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years agocmd/internal/obj: delete Debugzerostack dead code
Josh Bleecher Snyder [Sun, 23 Aug 2015 03:31:55 +0000 (20:31 -0700)]
cmd/internal/obj: delete Debugzerostack dead code

Fixes #11060

Change-Id: I4c6647fc2f103015b67e30dc2cdb6f771526c139
Reviewed-on: https://go-review.googlesource.com/13840
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agonet: drop redundant domain name length check
Mikio Hara [Sat, 22 Aug 2015 02:03:11 +0000 (11:03 +0900)]
net: drop redundant domain name length check

It is already validated by isDoaminName.

Change-Id: I7a955b632a5143e16b012641cf12bad452900753
Reviewed-on: https://go-review.googlesource.com/13789
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years agomime: move examples to external test file
Andrew Gerrand [Sat, 22 Aug 2015 09:40:01 +0000 (10:40 +0100)]
mime: move examples to external test file

Fixes #11257

Change-Id: I3f75db47b0f8e877d81e3c2dcea01ff747b47685
Reviewed-on: https://go-review.googlesource.com/13779
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agocmd/compile: in usage messages, name the binary "compile" instead of "Xg"
Brad Fitzpatrick [Sat, 22 Aug 2015 11:29:33 +0000 (20:29 +0900)]
cmd/compile: in usage messages, name the binary "compile" instead of "Xg"

Fixes #12227

Change-Id: I7c1b93e50736185a641fb637000aae2f15bc04ed
Reviewed-on: https://go-review.googlesource.com/13820
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years ago[dev.ssa] cmd/compile/internal: mark len(map), len/cap(chan) unimplemented
Todd Neal [Sat, 22 Aug 2015 02:38:41 +0000 (21:38 -0500)]
[dev.ssa] cmd/compile/internal: mark len(map), len/cap(chan) unimplemented

Mark these as unimplemented so we don't generate bad code.

Change-Id: I101190c40a753faaa82193ac37e2978b20a96e4e
Reviewed-on: https://go-review.googlesource.com/13748
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years agohtml: speed up UnescapeString
Ingo Oeser [Sat, 9 May 2015 15:55:05 +0000 (17:55 +0200)]
html: speed up UnescapeString

Add benchmarks for for sparsely escaped and densely escaped strings.
Then speed up the sparse unescaping part heavily by using IndexByte and
copy to skip the parts containing no escaping very fast.

Unescaping densely escaped strings slower because of
the new function call overhead. But sparsely encoded strings are seen
more often in the utf8 enabled web.

We win part of the speed back by looking up entityName differently.

benchmark                  old ns/op    new ns/op    delta
BenchmarkEscape                31680        31396   -0.90%
BenchmarkEscapeNone             6507         6872   +5.61%
BenchmarkUnescape              36481        48298  +32.39%
BenchmarkUnescapeNone            332          325   -2.11%
BenchmarkUnescapeSparse         8836         3221  -63.55%
BenchmarkUnescapeDense         30639        32224   +5.17%

Change-Id: If606cb01897a40eefe35ba98f2ff23bb25251606
Reviewed-on: https://go-review.googlesource.com/10172
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agotime: Use AppendFormat in Marshal[Text|JSON]
Justin Nuß [Sun, 31 May 2015 11:17:59 +0000 (13:17 +0200)]
time: Use AppendFormat in Marshal[Text|JSON]

The current implementations of MarshalJSON and MarshalText use
time.Format which returns a string (converted from a byte slice),
only to convert it back to a byte slice.

Avoid the conversion (and thus an allocation) by directly appending
the formatted time to a preallocated byte slice, using the new
AppendFormat function, introduced in golang.org/cl/1760.

This reduces the allocations done in Marshal[Text|JSON] by 50%.

benchmark                old ns/op     new ns/op     delta
BenchmarkMarshalJSON     626           507           -19.01%
BenchmarkMarshalText     598           511           -14.55%

benchmark                old allocs     new allocs     delta
BenchmarkMarshalJSON     2              1              -50.00%
BenchmarkMarshalText     2              1              -50.00%

benchmark                old bytes     new bytes     delta
BenchmarkMarshalJSON     96            48            -50.00%
BenchmarkMarshalText     96            48            -50.00%

Fixes #11025

Change-Id: I468f78d075a6ecc1cdc839df7fb407fbc6ff2e70
Reviewed-on: https://go-review.googlesource.com/10555
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agocmd/compile/internal, cmd/internal/obj: used keyed ProgInfo literals
Brad Fitzpatrick [Sat, 30 May 2015 22:08:46 +0000 (15:08 -0700)]
cmd/compile/internal, cmd/internal/obj: used keyed ProgInfo literals

Safer, more readable, shorter.

Change-Id: I5cf1f438e20a3df45fc43cc5c870a533f7c524bf
Reviewed-on: https://go-review.googlesource.com/10517
Reviewed-by: Minux Ma <minux@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agocmd/compile: allow huge rsh in constants arithmetic
Alberto Donizetti [Thu, 20 Aug 2015 15:53:41 +0000 (17:53 +0200)]
cmd/compile: allow huge rsh in constants arithmetic

Currently an expression like

var v = 0 >> 1000

is rejected by gc with a "stupid shift" error, while gotype
compiles it successfully.

As suggested by gri on the issue tracker, allow an rsh right
operand to be any valid uint value.

Fixes #11328

Change-Id: I6ccb3b7f842338d91fd26ae37dd4fa279d7fc440
Reviewed-on: https://go-review.googlesource.com/13777
Reviewed-by: Robert Griesemer <gri@golang.org>
9 years ago[dev.ssa] cmd/compile/internal/ssa: implement OMOD
Todd Neal [Wed, 19 Aug 2015 00:51:44 +0000 (19:51 -0500)]
[dev.ssa] cmd/compile/internal/ssa: implement OMOD

Change-Id: Iec954c4daefef4ab3fa2c98bfb2c70b2dea8dffb
Reviewed-on: https://go-review.googlesource.com/13743
Reviewed-by: Keith Randall <khr@golang.org>
9 years agocmd/compile/internal/big: update vendored math/big
Robert Griesemer [Fri, 21 Aug 2015 18:33:25 +0000 (11:33 -0700)]
cmd/compile/internal/big: update vendored math/big

This updates the big package used by the compiler to match the
public big package which contains some updates and bug fixes.
Obtained by running vendor.bash in the internal/big directory.
No manual changes.

Change-Id: I299aecc6599d4a745a721ce48def32449640dbb2
Reviewed-on: https://go-review.googlesource.com/13815
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agomath/big: fix TestBytes test
Robert Griesemer [Fri, 21 Aug 2015 18:30:19 +0000 (11:30 -0700)]
math/big: fix TestBytes test

Fixes #12231.

Change-Id: I1f07c444623cd864667e21b2fee534eacdc193bb
Reviewed-on: https://go-review.googlesource.com/13814
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocmd/trace: don't fail when no browser is available
David du Colombier [Fri, 21 Aug 2015 18:31:50 +0000 (20:31 +0200)]
cmd/trace: don't fail when no browser is available

When there is no browser available on the system,
we should print the URL instead of failing.

Change-Id: I4a2b099e17609394273eff150062c285d76bbac1
Reviewed-on: https://go-review.googlesource.com/13774
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
9 years ago[dev.ssa] cmd/compile: everything is live and reachable after regalloc
Josh Bleecher Snyder [Fri, 21 Aug 2015 17:15:15 +0000 (10:15 -0700)]
[dev.ssa] cmd/compile: everything is live and reachable after regalloc

This CL makes function printing and HTML generation
accurate after regalloc.

Prior to this CL, text and HTML function outputs
showed live values and blocks as dead.

Change-Id: I70669cd8641af841447fc5d2ecbd754b281356f0
Reviewed-on: https://go-review.googlesource.com/13812
Reviewed-by: Keith Randall <khr@golang.org>
9 years agomath/big: correctly handle large exponent in SetString
Alberto Donizetti [Fri, 21 Aug 2015 17:17:18 +0000 (19:17 +0200)]
math/big: correctly handle large exponent in SetString

Even though the umul/uquo functions expect two valid, finite big.Floats
arguments, SetString was calling them with possibly Inf values, which
resulted in bogus return values.

Replace umul and udiv calls with Mul and Quo calls to fix this. Also,
fix two wrong tests.

See relevant issue on issue tracker for a detailed explanation.

Fixes #11341

Change-Id: Ie35222763a57a2d712a5f5f7baec75cab8189a53
Reviewed-on: https://go-review.googlesource.com/13778
Reviewed-by: Robert Griesemer <gri@golang.org>
9 years ago[dev.ssa] cmd/compile: SETcc instructions do not clobber flags
Josh Bleecher Snyder [Fri, 21 Aug 2015 17:16:35 +0000 (10:16 -0700)]
[dev.ssa] cmd/compile: SETcc instructions do not clobber flags

This reduces the number of flags spilled during
make.bash by > 90%.

I am working (slowly) on the rest.

Change-Id: I3c08ae228c33e2f726f615962996f0350c8d592b
Reviewed-on: https://go-review.googlesource.com/13813
Reviewed-by: David Chase <drchase@google.com>
9 years agomath/big: remove superfluous comparison
Robert Griesemer [Fri, 19 Jun 2015 17:49:42 +0000 (10:49 -0700)]
math/big: remove superfluous comparison

This is not a functional change.

Also:
- minor cleanups, better comments
- uniform spelling of noun "zeros" (per OED)

Fixes #11277.

Change-Id: I1726f358ce15907bd2410f646b02cf8b11b919cd
Reviewed-on: https://go-review.googlesource.com/11267
Reviewed-by: Alan Donovan <adonovan@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
9 years agoruntime/cgo: remove __stack_chk_fail_local
Hyang-Ah (Hana) Kim [Thu, 13 Aug 2015 13:05:22 +0000 (09:05 -0400)]
runtime/cgo: remove __stack_chk_fail_local

I cannot find where it's being used.

This addresses a duplicate symbol issue encountered in golang/go#9327.

Change-Id: I8efda45a006ad3e19423748210c78bd5831215e0
Reviewed-on: https://go-review.googlesource.com/13615
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agoruntime, syscall: remove unused bits from Solaris implementation
Shawn Walker-Salas [Thu, 30 Jul 2015 20:32:55 +0000 (13:32 -0700)]
runtime, syscall: remove unused bits from Solaris implementation

CL 9184 changed the runtime and syscall packages to link Solaris binaries
directly instead of using dlopen/dlsym but did not remove the unused (and
now broken) references to dlopen, dlclose, and dlsym.

Fixes #11923

Change-Id: I36345ce5e7b371bd601b7d48af000f4ccacd62c0
Reviewed-on: https://go-review.googlesource.com/13410
Reviewed-by: Aram Hăvărneanu <aram@mgk.ro>
9 years agodoc: fix typo in release notes
Rob Pike [Thu, 20 Aug 2015 01:46:05 +0000 (11:46 +1000)]
doc: fix typo in release notes

Change-Id: I5310cef72e714b22bcf2ae9e6fd85dbb7e8a15a2
Reviewed-on: https://go-review.googlesource.com/13787
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agoall: fix some vet-caught formatting errors, mostly but not only in tests
Rob Pike [Tue, 11 Aug 2015 05:29:40 +0000 (15:29 +1000)]
all: fix some vet-caught formatting errors, mostly but not only in tests

Could go in 1.5, although not critical.
See also #12107

Change-Id: I7f1608b58581d21df4db58f0db654fef79e33a90
Reviewed-on: https://go-review.googlesource.com/13481
Reviewed-by: Dave Cheney <dave@cheney.net>
9 years agogo/types: fix complex(a, b) for untyped arguments a, b
Robert Griesemer [Thu, 30 Jul 2015 22:00:50 +0000 (15:00 -0700)]
go/types: fix complex(a, b) for untyped arguments a, b

R=1.6

Fixes #11669.

Change-Id: Id39e5401e991e46f014eb16b747f5d9b7b55b46a
Reviewed-on: https://go-review.googlesource.com/12937
Reviewed-by: Alan Donovan <adonovan@google.com>