]> Cypherpunks repositories - gostls13.git/log
gostls13.git
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 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 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 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 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 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 ago[dev.ssa] cmd/compile: add decompose pass
Keith Randall [Tue, 18 Aug 2015 17:26:28 +0000 (10:26 -0700)]
[dev.ssa] cmd/compile: add decompose pass

Decompose breaks compound objects up into pieces that can be
operated on by the target architecture.  The decompose pass only
does phi ops, the rest is done by the rewrite rules in generic.rules.

Compound objects include strings,slices,interfaces,structs,arrays.

Arrays aren't decomposed because of indexing (we could support
constant indexes, but dynamic indexes can't be handled using SSA).
Structs will come in a subsequent CL.

TODO: after this pass we have lost the association between, e.g.,
a string's pointer and its size.  It would be nice if we could keep
that information around for debugging info somehow.

Change-Id: I6379ab962a7beef62297d0f68c421f22aa0a0901
Reviewed-on: https://go-review.googlesource.com/13683
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years ago[dev.ssa] cmd/compile: implement more panic stuff
Keith Randall [Tue, 18 Aug 2015 22:25:40 +0000 (15:25 -0700)]
[dev.ssa] cmd/compile: implement more panic stuff

Implement index check panics (and slice check panics, for when
we need those).

Clean up nil check.  Now that the new regalloc is in we can use
the register we just tested as the address 0 destination.

Remove jumps after panic calls, they are unreachable.

Change-Id: Ifee6e510cdea49cc7c7056887e4f06c67488d491
Reviewed-on: https://go-review.googlesource.com/13687
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years ago[dev.ssa] cmd/compile: used Bounded field to fix empty range loops
Keith Randall [Tue, 18 Aug 2015 21:17:30 +0000 (14:17 -0700)]
[dev.ssa] cmd/compile: used Bounded field to fix empty range loops

    for i, v := range a {
    }

Walk converts this to a regular for loop, like this:

    for i := 0, p := &a[0]; i < len(a); i++, p++ {
        v := *p
    }

Unfortunately, &a[0] fails its bounds check when a is
the empty slice (or string).  The old compiler gets around this
by marking &a[0] as Bounded, meaning "don't emit bounds checks
for this index op".  This change makes SSA honor that same mark.

The SSA compiler hasn't implemented bounds check panics yet,
so the failed bounds check just causes the current routine
to return immediately.

Fixes bytes package tests.

Change-Id: Ibe838853ef4046c92f76adbded8cca3b1e449e0b
Reviewed-on: https://go-review.googlesource.com/13685
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years ago[dev.ssa] cmd/compile/internal/ssa: implement OHMUL
Todd Neal [Wed, 19 Aug 2015 00:14:47 +0000 (19:14 -0500)]
[dev.ssa] cmd/compile/internal/ssa: implement OHMUL

Adds support for high multiply which is used by the frontend when
rewriting const division.  The frontend currently only does this for 8,
16, and 32 bit integer arithmetic.

Change-Id: I9b6c6018f3be827a50ee6c185454ebc79b3094c8
Reviewed-on: https://go-review.googlesource.com/13696
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile/internal/ssa: implement ODIV
Todd Neal [Mon, 17 Aug 2015 22:46:06 +0000 (17:46 -0500)]
[dev.ssa] cmd/compile/internal/ssa: implement ODIV

Implement integer division for non-consts.

Change-Id: If40cbde20e5f0ebb9993064def7be468e4eca076
Reviewed-on: https://go-review.googlesource.com/13644
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: fix string store rewrite
Keith Randall [Tue, 18 Aug 2015 17:28:58 +0000 (10:28 -0700)]
[dev.ssa] cmd/compile: fix string store rewrite

Store ops now need their size in the auxint field.  I missed this one.

Change-Id: I050fd6b5b00579883731702c426edafa3a5f7561
Reviewed-on: https://go-review.googlesource.com/13682
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years ago[dev.ssa] cmd/compile/internal/ssa: New register allocator
Keith Randall [Tue, 11 Aug 2015 19:51:33 +0000 (12:51 -0700)]
[dev.ssa] cmd/compile/internal/ssa: New register allocator

Implement a global (whole function) register allocator.
This replaces the local (per basic block) register allocator.

Clobbering of registers by instructions is handled properly.
A separate change will add the correct clobbers to all the instructions.

Change-Id: I38ce4dc7dccb8303c1c0e0295fe70247b0a3f2ea
Reviewed-on: https://go-review.googlesource.com/13622
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Todd Neal <todd@tneal.org>
9 years ago[dev.ssa] cmd/compile: add likely annotations to blocks in html
Josh Bleecher Snyder [Mon, 17 Aug 2015 07:29:56 +0000 (00:29 -0700)]
[dev.ssa] cmd/compile: add likely annotations to blocks in html

This was missing from CL 13472
due to a badly synced client.

Change-Id: If59fc669125dd1caa335dacfbf0f8dbd7b074312
Reviewed-on: https://go-review.googlesource.com/13639
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: first unoptimized cut at adding FP support
David Chase [Wed, 12 Aug 2015 20:38:11 +0000 (16:38 -0400)]
[dev.ssa] cmd/compile: first unoptimized cut at adding FP support

Added F32 and F64 load, store, and addition.
Added F32 and F64 multiply.
Added F32 and F64 subtraction and division.
Added X15 to "clobber" for FP sub/div
Added FP constants
Added separate FP test in gc/testdata

Change-Id: Ifa60dbad948a40011b478d9605862c4b0cc9134c
Reviewed-on: https://go-review.googlesource.com/13612
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: fix dev.ssa build
Josh Bleecher Snyder [Mon, 17 Aug 2015 07:18:31 +0000 (00:18 -0700)]
[dev.ssa] cmd/compile: fix dev.ssa build

Broken by CL 13472.

Change-Id: Ib65331b291c8fab4238ca91e085779bb954d70e8
Reviewed-on: https://go-review.googlesource.com/13638
Reviewed-by: David Chase <drchase@google.com>
9 years ago[dev.ssa] cmd/compile/internal/ssa: Use explicit size for store ops
Keith Randall [Sat, 15 Aug 2015 04:47:20 +0000 (21:47 -0700)]
[dev.ssa] cmd/compile/internal/ssa: Use explicit size for store ops

Using the type of the store argument is not safe, it may change
during rewriting, giving us the wrong store width.

(Store ptr (Trunc32to16 val) mem)

This should be a 2-byte store.  But we have the rule:

(Trunc32to16 x) -> x

So if the Trunc rewrite happens before the Store -> MOVW rewrite,
then the Store thinks that the value it is storing is 4 bytes
in size and uses a MOVL.  Bad things ensue.

Fix this by encoding the store width explicitly in the auxint field.

In general, we can't rely on the type of arguments, as they may
change during rewrites.  The type of the op itself (as used by
the Load rules) is still ok to use.

Change-Id: I9e2359e4f657bb0ea0e40038969628bf0f84e584
Reviewed-on: https://go-review.googlesource.com/13636
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years ago[dev.ssa] cmd/compile/internal/ssa/gen: more simplifications and foldings.
Alexandru Moșoi [Fri, 14 Aug 2015 10:59:33 +0000 (12:59 +0200)]
[dev.ssa] cmd/compile/internal/ssa/gen: more simplifications and foldings.

Change-Id: I74d1267dbfced2663072b4f091732c0fb328690f
Reviewed-on: https://go-review.googlesource.com/13641
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile/internal/ssa/gen: fold Mul8 properly.
Alexandru Moșoi [Fri, 14 Aug 2015 11:23:11 +0000 (13:23 +0200)]
[dev.ssa] cmd/compile/internal/ssa/gen: fold Mul8 properly.

Mul8 is lowered to MULW, but the rules for constant
folding do not handle the fact that the operands
are int8.

Change-Id: I2c336686d86249393a8079a471c6ff74e6228f3d
Reviewed-on: https://go-review.googlesource.com/13642
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile/internal/gc: handle all inputs for shifts.
Alexandru Moșoi [Fri, 7 Aug 2015 10:19:03 +0000 (12:19 +0200)]
[dev.ssa] cmd/compile/internal/gc: handle all inputs for shifts.

Disable CX as output for shift operations.

Change-Id: I85e6b22d09009b38847082dc375b6108c2dee80a
Reviewed-on: https://go-review.googlesource.com/13370
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: add HTML SSA printer
Josh Bleecher Snyder [Mon, 10 Aug 2015 19:15:52 +0000 (12:15 -0700)]
[dev.ssa] cmd/compile: add HTML SSA printer

This is an initial implementation.
There are many rough edges and TODOs,
which will hopefully be polished out
with use.

Fixes #12071.

Change-Id: I1d6fd5a343063b5200623bceef2c2cfcc885794e
Reviewed-on: https://go-review.googlesource.com/13472
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: improve inBounds rewrite rules
Josh Bleecher Snyder [Wed, 12 Aug 2015 20:48:36 +0000 (13:48 -0700)]
[dev.ssa] cmd/compile: improve inBounds rewrite rules

Change-Id: Ia238187a89f820cd1620ab5acdbf1c8f003569b1
Reviewed-on: https://go-review.googlesource.com/13587
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: add register spec to getg
Keith Randall [Thu, 13 Aug 2015 20:12:17 +0000 (13:12 -0700)]
[dev.ssa] cmd/compile: add register spec to getg

This omission was causing the new regalloc to fail.

Change-Id: If7ba7be38a436dbd0dd443828ddd7ebf6e35be0e
Reviewed-on: https://go-review.googlesource.com/13632
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years ago[dev.ssa] cmd/compile: fix constant subtraction rules
Keith Randall [Thu, 13 Aug 2015 19:47:50 +0000 (12:47 -0700)]
[dev.ssa] cmd/compile: fix constant subtraction rules

(SUBQconst [x] y) computes y-x, not x-y.

Fixes #12137

Change-Id: Idbd0554eee051102f562240d1756647843666ee6
Reviewed-on: https://go-review.googlesource.com/13631
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years ago[dev.ssa] cmd/compile: move rewrite logging behind codegen flag
Josh Bleecher Snyder [Wed, 12 Aug 2015 22:39:16 +0000 (15:39 -0700)]
[dev.ssa] cmd/compile: move rewrite logging behind codegen flag

Generating logging code every time causes large
diffs for small changes.

Since the intent is to use this for debugging only,
generate logging code only when requested.
Committed generated code will be logging free.

Change-Id: I9ef9e29c88b76c2557bad4c6b424b9db1255ec8b
Reviewed-on: https://go-review.googlesource.com/13623
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: make sure entry block has no predecessors
Keith Randall [Wed, 12 Aug 2015 21:51:24 +0000 (14:51 -0700)]
[dev.ssa] cmd/compile: make sure entry block has no predecessors

Fix one test that build a violating CFG.

Change-Id: Ie0296ced602984d914a70461c76559c507ce2510
Reviewed-on: https://go-review.googlesource.com/13621
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years ago[dev.ssa] cmd/compile: log line numbers in generated rewrite rules
Josh Bleecher Snyder [Wed, 12 Aug 2015 20:54:04 +0000 (13:54 -0700)]
[dev.ssa] cmd/compile: log line numbers in generated rewrite rules

This makes it easier to investigate and
understand rewrite behavior.

Change-Id: I790e8964922caf98362ce8a6d6972f52d83eefa8
Reviewed-on: https://go-review.googlesource.com/13588
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: implement OGETG
Josh Bleecher Snyder [Wed, 12 Aug 2015 18:22:16 +0000 (11:22 -0700)]
[dev.ssa] cmd/compile: implement OGETG

Change-Id: I7ecf62cf399c710b4a617803c43e83fce09b8a7d
Reviewed-on: https://go-review.googlesource.com/13585
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: initial implementation of likely direction
Josh Bleecher Snyder [Wed, 12 Aug 2015 00:28:56 +0000 (17:28 -0700)]
[dev.ssa] cmd/compile: initial implementation of likely direction

Change-Id: Id8457b18c07bf717d13c9423d8f314f253eee64f
Reviewed-on: https://go-review.googlesource.com/13580
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: update opnames
Josh Bleecher Snyder [Wed, 12 Aug 2015 17:21:41 +0000 (10:21 -0700)]
[dev.ssa] cmd/compile: update opnames

This claims to be autogenerated from go tool dist,
but I don't see where.

In any case, the update is trivial.

Change-Id: I58daaba755f3d34a0396005046b89411a02ada7e
Reviewed-on: https://go-review.googlesource.com/13584
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: implement OSPTR
Josh Bleecher Snyder [Wed, 12 Aug 2015 17:12:14 +0000 (10:12 -0700)]
[dev.ssa] cmd/compile: implement OSPTR

Change-Id: Iaa40f14a1e3e4393af3c446953ffc315e79a3762
Reviewed-on: https://go-review.googlesource.com/13581
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: fix function call memory
Keith Randall [Wed, 12 Aug 2015 19:54:47 +0000 (12:54 -0700)]
[dev.ssa] cmd/compile: fix function call memory

We need to move the memory variable update back to before endBlock
so that all successors use the right memory value.

See https://go-review.googlesource.com/13560

Change-Id: Id72e5526c56e5e070b933d3b28dc503a5a2978dc
Reviewed-on: https://go-review.googlesource.com/13586
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years ago[dev.ssa] cmd/compile/ssa: fix test for dse
Todd Neal [Wed, 12 Aug 2015 00:31:53 +0000 (19:31 -0500)]
[dev.ssa] cmd/compile/ssa: fix test for dse

Fix the test broken with dee1f2 by implementing Elem()

Change-Id: I7a4a487885267c24fdc52d79fb7d450231328812
Reviewed-on: https://go-review.googlesource.com/13551
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile/ssa: eliminate Zero with dse
Todd Neal [Tue, 11 Aug 2015 02:05:35 +0000 (21:05 -0500)]
[dev.ssa] cmd/compile/ssa: eliminate Zero with dse

Consider OpZero to be a store so it can be eliminated by dse.

Change-Id: Idebb6a190657b76966f0c5b20f2ec9f52fe47499
Reviewed-on: https://go-review.googlesource.com/13447
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: make failed nil checks panic
Josh Bleecher Snyder [Tue, 11 Aug 2015 16:47:45 +0000 (09:47 -0700)]
[dev.ssa] cmd/compile: make failed nil checks panic

Introduce pseudo-ops PanicMem and LoweredPanicMem.
PanicMem could be rewritten directly into MOVL
during lowering, but then we couldn't log nil checks.

With this change, runnable nil check tests pass:

GOSSAPKG=main go run run.go -- nil*.go

Compiler output nil check tests fail:

GOSSAPKG=p go run run.go -- nil*.go

This is due to several factors:

* SSA has improved elimination of unnecessary nil checks.
* SSA is missing elimination of implicit nil checks.
* SSA is missing extra logging about why nil checks were removed.

I'm not sure how best to resolve these failures,
particularly in a world in which the two backends
will live side by side for some time.
For now, punt on the problem.

Change-Id: Ib2ca6824551671f92e0e1800b036f5ca0905e2a3
Reviewed-on: https://go-review.googlesource.com/13474
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: fix function call memory accounting
Josh Bleecher Snyder [Tue, 11 Aug 2015 21:23:08 +0000 (14:23 -0700)]
[dev.ssa] cmd/compile: fix function call memory accounting

We were not recording function calls as
changing the state of memory.

As a result, the scheduler was not aware that
storing values to the stack in order to make a
function call must happen *after* retrieving
results from the stack from a just-completed
function call.

This fixes the container/ring tests.

This was my first experience debugging an issue
using the HTML output. I'm feeling quite
pleased with it.

Change-Id: I9e8276846be9fd7a60422911b11816c5175e3d0a
Reviewed-on: https://go-review.googlesource.com/13560
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: add support for LROT, and tests
David Chase [Thu, 6 Aug 2015 02:11:14 +0000 (22:11 -0400)]
[dev.ssa] cmd/compile: add support for LROT, and tests

Hardcoded the limit on constants only allowed.

Change-Id: Idb9b07b4871db7a752a79e492671e9b41207b956
Reviewed-on: https://go-review.googlesource.com/13257
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years ago[dev.ssa] cmd/compile/ssa: don't nil check phis with non-nil arguments
Todd Neal [Fri, 7 Aug 2015 01:13:27 +0000 (20:13 -0500)]
[dev.ssa] cmd/compile/ssa: don't nil check phis with non-nil arguments

Move the known-non-nil scan outside the work loop to resolve an issue
with values that were declared outside the block being operated on.
Also consider phis whose arguments are all non-nil, as non-nil.

Change-Id: I4d5b840042de9eb181f2cb918f36913fb5d517a2
Reviewed-on: https://go-review.googlesource.com/13441
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile/internal/ssa: Update TODO list
Keith Randall [Mon, 10 Aug 2015 20:40:28 +0000 (13:40 -0700)]
[dev.ssa] cmd/compile/internal/ssa: Update TODO list

Change-Id: Ibcd4c6984c8728fd9ab76e0c7df555984deaf281
Reviewed-on: https://go-review.googlesource.com/13471
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years ago[dev.ssa] cmd/compile: detect rewrite loops of length > 1
Josh Bleecher Snyder [Mon, 10 Aug 2015 21:01:04 +0000 (14:01 -0700)]
[dev.ssa] cmd/compile: detect rewrite loops of length > 1

Use a version of Floyd's cycle finding algorithm,
but advance by 1 and 1/2 steps per cycle rather
than by 1 and 2. It is simpler and should be cheaper
in the normal, acyclic case.

This should fix the 386 and arm builds,
which are currently hung.

Change-Id: If8bd443011b28a5ecb004a549239991d3dfc862b
Reviewed-on: https://go-review.googlesource.com/13473
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile/internal/ssa: enforce load-store ordering in scheduler
Keith Randall [Mon, 10 Aug 2015 18:10:53 +0000 (11:10 -0700)]
[dev.ssa] cmd/compile/internal/ssa: enforce load-store ordering in scheduler

We must make sure that all loads that use a store are scheduled
before the next store.  Add additional dependency edges to the
value graph to enforce this constraint.

Change-Id: Iab83644f68bc4c30637085b82ca7467b9d5513a5
Reviewed-on: https://go-review.googlesource.com/13470
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years ago[dev.ssa] cmd/compile: add simplifying block rewrite rules
Josh Bleecher Snyder [Fri, 7 Aug 2015 17:24:57 +0000 (10:24 -0700)]
[dev.ssa] cmd/compile: add simplifying block rewrite rules

Change-Id: Ia946c259628f84dc7031171456563975d2ad5ea9
Reviewed-on: https://go-review.googlesource.com/13381
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile/ssa: don't perform nilcheck on OpAddr/OpAddPtr values
Todd Neal [Mon, 3 Aug 2015 23:08:22 +0000 (18:08 -0500)]
[dev.ssa] cmd/compile/ssa: don't perform nilcheck on OpAddr/OpAddPtr values

Don't nilcheck values that were constructed as a result of OpAddr or
OpAddPtr.

Change-Id: I38053e905d1b76a2a64e77f84e444d38a5217108
Reviewed-on: https://go-review.googlesource.com/13256
Reviewed-by: David Chase <drchase@google.com>
9 years ago[dev.ssa] cmd/compile: copy values during rewrites
Josh Bleecher Snyder [Wed, 5 Aug 2015 17:33:09 +0000 (10:33 -0700)]
[dev.ssa] cmd/compile: copy values during rewrites

Rather than require an explicit Copy on the RHS of rewrite rules,
use rulegen magic to add it.

The advantages to handling this in rulegen are:

* simpler rules
* harder to accidentally miss a Copy

Change-Id: I46853bade83bdf517eee9495bf5a553175277b53
Reviewed-on: https://go-review.googlesource.com/13242
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile/internal/ssa/gen: generate better code when right-shifting...
Alexandru Moșoi [Thu, 6 Aug 2015 16:33:49 +0000 (18:33 +0200)]
[dev.ssa] cmd/compile/internal/ssa/gen: generate better code when right-shifting with a constant.

The lowering rules were missing the non-64 bit case.

SBBLcarrymask can be folded to a int32 integer whose
type has a smaller bit size. Without the new AND rules
the following would be generated:

    v19 = MOVLconst <uint8> [-1] : SI
    v20 = ANDB <uint8> v18 v19 : DI

which is obviously a NOP.

Fixes #12022

Change-Id: I5f4209f78edc0f118e5b9b2908739f09cefebca4
Reviewed-on: https://go-review.googlesource.com/13301
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: handle phi control values
Josh Bleecher Snyder [Wed, 5 Aug 2015 22:56:31 +0000 (15:56 -0700)]
[dev.ssa] cmd/compile: handle phi control values

Tests courtesy of Todd Neal.

Change-Id: If657c7c7d3cd1ce01e9d9ad79eb6b2110230c0f9
Reviewed-on: https://go-review.googlesource.com/13267
Reviewed-by: Todd Neal <todd@tneal.org>
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile/internal/ssa: more checks on ssa structure
Keith Randall [Wed, 5 Aug 2015 04:59:15 +0000 (21:59 -0700)]
[dev.ssa] cmd/compile/internal/ssa: more checks on ssa structure

Make sure all referenced Blocks and Values are really there.
Fix deadcode to generate SSA graphs that pass this new test.

Change-Id: Ib002ce20e33490eb8c919bd189d209f769d61517
Reviewed-on: https://go-review.googlesource.com/13147
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years ago[dev.ssa] cmd/compile: enforce that all phis are first during regalloc
Josh Bleecher Snyder [Wed, 5 Aug 2015 18:01:59 +0000 (11:01 -0700)]
[dev.ssa] cmd/compile: enforce that all phis are first during regalloc

Change-Id: I035708f5d0659b3deef00808d35e1cc8a80215e0
Reviewed-on: https://go-review.googlesource.com/13243
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: schedule phi control values first
Josh Bleecher Snyder [Wed, 5 Aug 2015 23:07:13 +0000 (16:07 -0700)]
[dev.ssa] cmd/compile: schedule phi control values first

Change-Id: I684440dc316625d5572cc12179adbc206e306429
Reviewed-on: https://go-review.googlesource.com/13263
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: tidy up register setup
Josh Bleecher Snyder [Thu, 6 Aug 2015 16:34:54 +0000 (09:34 -0700)]
[dev.ssa] cmd/compile: tidy up register setup

No functional changes.
The intent is just to make this
easier to read and maintain.

Change-Id: Iec207546482cd62bcb22eaae8efe5be6c4f15378
Reviewed-on: https://go-review.googlesource.com/13284
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: improve error message for phi location mismatch
Josh Bleecher Snyder [Wed, 5 Aug 2015 23:43:49 +0000 (16:43 -0700)]
[dev.ssa] cmd/compile: improve error message for phi location mismatch

Change-Id: I402841743fcdc287631646039eb149f5cfdf886c
Reviewed-on: https://go-review.googlesource.com/13269
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: don't move OpSP and OpSB values
Josh Bleecher Snyder [Wed, 5 Aug 2015 23:11:57 +0000 (16:11 -0700)]
[dev.ssa] cmd/compile: don't move OpSP and OpSB values

regalloc expects to find all OpSP and OpSB values
in the entry block.

There is no value to moving them; don't.

Change-Id: I775198f03ce7420348721ffc5e7d2bab065465b1
Reviewed-on: https://go-review.googlesource.com/13266
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: provide better errors for regnum and localOffset failures
Josh Bleecher Snyder [Wed, 5 Aug 2015 23:06:39 +0000 (16:06 -0700)]
[dev.ssa] cmd/compile: provide better errors for regnum and localOffset failures

Change-Id: I2667b0923e17df7cbf08e34ebec1b69a0f2f02b2
Reviewed-on: https://go-review.googlesource.com/13265
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: respect phi values in tighten
Josh Bleecher Snyder [Wed, 5 Aug 2015 22:51:05 +0000 (15:51 -0700)]
[dev.ssa] cmd/compile: respect phi values in tighten

Given (say)

b1: <- b2 b3
  v1 = Phi <t> v2 v3
b2:
  v2 = ...
b3:
  ...

tighten will move v2 to b1, since it is only used in b1.

This is wrong; v2 needs to be evaluated before entering b1.
Fix it.

Change-Id: I2cc3b30e3ffd221cf594e36cec534dfd9cf3c6a7
Reviewed-on: https://go-review.googlesource.com/13264
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: add SSA pass to move values closer to uses
Josh Bleecher Snyder [Tue, 4 Aug 2015 21:55:35 +0000 (14:55 -0700)]
[dev.ssa] cmd/compile: add SSA pass to move values closer to uses

Even this very simple, restricted initial implementation helps.

While running make.bash, it moves 84437 values
to new, closer homes.

As a concrete example:

func f_ssa(i, j int, b bool) int {
if !b {
return 0
}
return i + j
}

It cuts off one stack slot and two instructions:

Before:

"".f_ssa t=1 size=96 value=0 args=0x20 locals=0x18
0x0000 00000 (x.go:3) TEXT "".f_ssa(SB), $24-32
0x0000 00000 (x.go:3) SUBQ $24, SP
0x0004 00004 (x.go:3) FUNCDATA $0, "".gcargs·0(SB)
0x0004 00004 (x.go:3) FUNCDATA $1, "".gclocals·1(SB)
0x0004 00004 (x.go:5) MOVQ $0, AX
0x0006 00006 (x.go:3) MOVQ 32(SP), CX
0x000b 00011 (x.go:3) MOVQ 40(SP), DX
0x0010 00016 (x.go:3) LEAQ 48(SP), BX
0x0015 00021 (x.go:3) MOVB (BX), BPB
0x0018 00024 (x.go:3) MOVQ $0, SI
0x001a 00026 (x.go:3) MOVQ SI, 56(SP)
0x001f 00031 (x.go:3) TESTB BPB, BPB
0x0022 00034 (x.go:5) MOVQ AX, (SP)
0x0026 00038 (x.go:3) MOVQ CX, 8(SP)
0x002b 00043 (x.go:3) MOVQ DX, 16(SP)
0x0030 00048 (x.go:4) JEQ 74
0x0032 00050 (x.go:3) MOVQ 8(SP), AX
0x0037 00055 (x.go:3) MOVQ 16(SP), CX
0x003c 00060 (x.go:7) LEAQ (AX)(CX*1), DX
0x0040 00064 (x.go:7) MOVQ DX, 56(SP)
0x0045 00069 (x.go:3) ADDQ $24, SP
0x0049 00073 (x.go:3) RET
0x004a 00074 (x.go:5) MOVQ (SP), AX
0x004e 00078 (x.go:5) MOVQ AX, 56(SP)
0x0053 00083 (x.go:3) JMP 69

After:

"".f_ssa t=1 size=80 value=0 args=0x20 locals=0x10
0x0000 00000 (x.go:3) TEXT "".f_ssa(SB), $16-32
0x0000 00000 (x.go:3) SUBQ $16, SP
0x0004 00004 (x.go:3) FUNCDATA $0, "".gcargs·0(SB)
0x0004 00004 (x.go:3) FUNCDATA $1, "".gclocals·1(SB)
0x0004 00004 (x.go:3) MOVQ 32(SP), AX
0x0009 00009 (x.go:3) MOVQ 24(SP), CX
0x000e 00014 (x.go:3) LEAQ 40(SP), DX
0x0013 00019 (x.go:3) MOVB (DX), BL
0x0015 00021 (x.go:3) MOVQ $0, BP
0x0017 00023 (x.go:3) MOVQ BP, 48(SP)
0x001c 00028 (x.go:3) TESTB BL, BL
0x001e 00030 (x.go:3) MOVQ AX, (SP)
0x0022 00034 (x.go:3) MOVQ CX, 8(SP)
0x0027 00039 (x.go:4) JEQ 64
0x0029 00041 (x.go:3) MOVQ 8(SP), AX
0x002e 00046 (x.go:3) MOVQ (SP), CX
0x0032 00050 (x.go:7) LEAQ (AX)(CX*1), DX
0x0036 00054 (x.go:7) MOVQ DX, 48(SP)
0x003b 00059 (x.go:3) ADDQ $16, SP
0x003f 00063 (x.go:3) RET
0x0040 00064 (x.go:5) MOVQ $0, AX
0x0042 00066 (x.go:5) MOVQ AX, 48(SP)
0x0047 00071 (x.go:3) JMP 59

Of course, the old backend is still well ahead:

"".f_ssa t=1 size=48 value=0 args=0x20 locals=0x0
0x0000 00000 (x.go:3) TEXT "".f_ssa(SB), $0-32
0x0000 00000 (x.go:3) NOP
0x0000 00000 (x.go:3) NOP
0x0000 00000 (x.go:3) FUNCDATA $0, gclocals·a8eabfc4a4514ed6b3b0c61e9680e440(SB)
0x0000 00000 (x.go:3) FUNCDATA $1, gclocals·33cdeccccebe80329f1fdbee7f5874cb(SB)
0x0000 00000 (x.go:4) CMPB "".b+24(FP), $0
0x0005 00005 (x.go:4) JNE 17
0x0007 00007 (x.go:5) MOVQ $0, "".~r3+32(FP)
0x0010 00016 (x.go:5) RET
0x0011 00017 (x.go:7) MOVQ "".i+8(FP), BX
0x0016 00022 (x.go:7) MOVQ "".j+16(FP), BP
0x001b 00027 (x.go:7) ADDQ BP, BX
0x001e 00030 (x.go:7) MOVQ BX, "".~r3+32(FP)
0x0023 00035 (x.go:7) RET

Some regalloc improvements should help considerably.

Change-Id: I95bb5dd83e56afd70ae4e983f1d32dffd0c3d46a
Reviewed-on: https://go-review.googlesource.com/13142
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile/internal/ssa: implement ITAB
Keith Randall [Tue, 4 Aug 2015 22:47:22 +0000 (15:47 -0700)]
[dev.ssa] cmd/compile/internal/ssa: implement ITAB

Implement ITAB, selecting the itable field of an interface.

Soften the lowering check to allow lowerings that leave
generic but dead ops behind.  (The ITAB lowering does this.)

Change-Id: Icc84961dd4060d143602f001311aa1d8be0d7fc0
Reviewed-on: https://go-review.googlesource.com/13144
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years ago[dev.ssa] cmd/compile: make GOSSAFUNC trigger logging
Josh Bleecher Snyder [Tue, 4 Aug 2015 18:13:56 +0000 (11:13 -0700)]
[dev.ssa] cmd/compile: make GOSSAFUNC trigger logging

I find myself always adding this in temporarily.
Make it permanent.

Change-Id: I1646b3930a07d0ea01840736ccd449b7fd24f06e
Reviewed-on: https://go-review.googlesource.com/13141
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: treat control ops as live at end of block
Josh Bleecher Snyder [Tue, 4 Aug 2015 21:22:29 +0000 (14:22 -0700)]
[dev.ssa] cmd/compile: treat control ops as live at end of block

Failure to treat control ops as live can lead
to them being eliminated when they live in
other blocks.

Change-Id: I604a1977a3d3884b1f4516bea4e15885ce38272d
Reviewed-on: https://go-review.googlesource.com/13138
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: always print block control values
Josh Bleecher Snyder [Tue, 4 Aug 2015 19:53:05 +0000 (12:53 -0700)]
[dev.ssa] cmd/compile: always print block control values

They were being omitted after scheduling.

Change-Id: Ia20e2dcb61fde9ec854918b958c3897bafd282a6
Reviewed-on: https://go-review.googlesource.com/13140
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile/internal/ssa: put new values for block rewrites in rewritten...
Keith Randall [Tue, 4 Aug 2015 19:24:23 +0000 (12:24 -0700)]
[dev.ssa] cmd/compile/internal/ssa: put new values for block rewrites in rewritten block

Don't put them in the control value's block.
That may be many blocks up the dominator tree.

Change-Id: Iab3ea36a890ffe0e355dadec7aeb676901c4f070
Reviewed-on: https://go-review.googlesource.com/13134
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years ago[dev.ssa] cmd/compile: log progs during ssa codegen
Josh Bleecher Snyder [Fri, 31 Jul 2015 21:37:15 +0000 (14:37 -0700)]
[dev.ssa] cmd/compile: log progs during ssa codegen

This is helpful when debugging generated code.

Change-Id: I268efa3593a03bb2c4e9f07d9034c004cd40df41
Reviewed-on: https://go-review.googlesource.com/13099
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: simplify repeated OCOM
Todd Neal [Thu, 30 Jul 2015 20:02:24 +0000 (16:02 -0400)]
[dev.ssa] cmd/compile: simplify repeated OCOM

Rewrite ^{n}x to be ^{n % 2}x.  This will eventually resolve a fuzz
issue that breaks v1.5.

Updates #11352

Change-Id: I1b3f93872d06222f9ff5f6fd5580178ebaf4c003
Reviewed-on: https://go-review.googlesource.com/13110
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile/ssa : fix typo in error message
Todd Neal [Tue, 4 Aug 2015 00:28:48 +0000 (19:28 -0500)]
[dev.ssa] cmd/compile/ssa : fix typo in error message

Change-Id: Ibb5169aade15190773ff7dd11b303c1f1345a0c2
Reviewed-on: https://go-review.googlesource.com/13100
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile/internal/ssa: Fix scheduler
Keith Randall [Mon, 3 Aug 2015 19:33:03 +0000 (12:33 -0700)]
[dev.ssa] cmd/compile/internal/ssa: Fix scheduler

The DFS scheduler doesn't do the right thing.  If a Value x is used by
more than one other Value, then x is put into the DFS queue when
its first user (call it y) is visited.  It is not removed and reinserted
when the second user of x (call it z) is visited, so the dependency
between x and z is not respected.  There is no easy way to fix this with
the DFS queue because we'd have to rip values out of the middle of the
DFS queue.

The new scheduler works from the end of the block backwards, scheduling
instructions which have had all of their uses already scheduled.
A simple priority scheme breaks ties between multiple instructions that
are ready to schedule simultaneously.

Keep track of whether we've scheduled or not, and make print() use
the scheduled order if we have.

Fix some shift tests that this change tickles.  Add unsigned right shift tests.

Change-Id: I44164c10bb92ae8ab8f76d7a5180cbafab826ea1
Reviewed-on: https://go-review.googlesource.com/13069
Reviewed-by: Todd Neal <todd@tneal.org>
9 years ago[dev.ssa] cmd/compile/ssa: speed up nilcheck
Todd Neal [Tue, 14 Jul 2015 21:26:38 +0000 (16:26 -0500)]
[dev.ssa] cmd/compile/ssa: speed up nilcheck

Reworks nilcheck to be performed by a depth first traversal of the
dominator tree, keeping an updated map of the values that have been
nil-checked during the traversal.

benchmark                           old ns/op     new ns/op     delta
BenchmarkNilCheckDeep1-8            1242          1825          +46.94%
BenchmarkNilCheckDeep10-8           2397          3942          +64.46%
BenchmarkNilCheckDeep100-8          29105         24873         -14.54%
BenchmarkNilCheckDeep1000-8         2742563       265760        -90.31%
BenchmarkNilCheckDeep10000-8        335690119     3157995       -99.06%

benchmark                           old MB/s     new MB/s     speedup
BenchmarkNilCheckDeep1-8            0.81         0.55         0.68x
BenchmarkNilCheckDeep10-8           4.17         2.54         0.61x
BenchmarkNilCheckDeep100-8          3.44         4.02         1.17x
BenchmarkNilCheckDeep1000-8         0.36         3.76         10.44x
BenchmarkNilCheckDeep10000-8        0.03         3.17         105.67x

benchmark                        old allocs     new allocs     delta
BenchmarkNilCheckDeep1-8         9              14             +55.56%
BenchmarkNilCheckDeep10-8        9              23             +155.56%
BenchmarkNilCheckDeep100-8       9              113            +1155.56%
BenchmarkNilCheckDeep1000-8      9              1015
+11177.78%
BenchmarkNilCheckDeep10000-8     9              10024
+111277.78%

benchmark                        old bytes     new bytes     delta
BenchmarkNilCheckDeep1-8         432           608           +40.74%
BenchmarkNilCheckDeep10-8        1008          1496          +48.41%
BenchmarkNilCheckDeep100-8       8064          11656         +44.54%
BenchmarkNilCheckDeep1000-8      73728         145240        +96.99%
BenchmarkNilCheckDeep10000-8     737280        2144411       +190.85%

Change-Id: I0f86010e9823aec04aac744fdb589b65ec8acefc
Reviewed-on: https://go-review.googlesource.com/12332
Reviewed-by: David Chase <drchase@google.com>
9 years ago[dev.ssa] cmd/compile/ssa: test against known values
Todd Neal [Mon, 3 Aug 2015 01:28:31 +0000 (20:28 -0500)]
[dev.ssa] cmd/compile/ssa: test against known values

Modify tests to use a known value instead of comparing the backends
directly.

Change-Id: I32e804e12515885bd94c4f83644cbca03b018fea
Reviewed-on: https://go-review.googlesource.com/13042
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile/internal/ssa/gen: add more simplifications rules
Alexandru Moșoi [Fri, 31 Jul 2015 10:32:22 +0000 (12:32 +0200)]
[dev.ssa] cmd/compile/internal/ssa/gen: add more simplifications rules

This is a follow up on https://go-review.googlesource.com/#/c/12420/
with some rules moved to AMD64 closer to the existing rules.

Change-Id: Id346bb0fc4459b3c49b826a59cc74308a590310e
Reviewed-on: https://go-review.googlesource.com/12906
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: handle non-in-place NEG and NOT
Josh Bleecher Snyder [Fri, 31 Jul 2015 00:15:16 +0000 (17:15 -0700)]
[dev.ssa] cmd/compile: handle non-in-place NEG and NOT

This fixes the crypto/subtle tests.

Change-Id: Ie6e721eec3481f67f13de1bfbd7988e227793148
Reviewed-on: https://go-review.googlesource.com/13000
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: move most types outside SSA
Josh Bleecher Snyder [Thu, 30 Jul 2015 18:03:05 +0000 (11:03 -0700)]
[dev.ssa] cmd/compile: move most types outside SSA

The only types that remain in the ssa package
are special compiler-only types.

Change-Id: If957abf128ec0778910d67666c297f97f183b7ee
Reviewed-on: https://go-review.googlesource.com/12933
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: provide stack trace for caught panics
Josh Bleecher Snyder [Thu, 30 Jul 2015 17:28:57 +0000 (10:28 -0700)]
[dev.ssa] cmd/compile: provide stack trace for caught panics

Change-Id: I9cbb6d53a8c2302222b13d2f33b081b704208b8a
Reviewed-on: https://go-review.googlesource.com/12932
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Todd Neal <todd@tneal.org>
9 years ago[dev.ssa] cmd/compile/internal/ssa/gen: implement OXOR.
Alexandru Moșoi [Thu, 30 Jul 2015 10:33:36 +0000 (12:33 +0200)]
[dev.ssa] cmd/compile/internal/ssa/gen: implement OXOR.

From compiling go there were 260 functions where XOR was needed.

Much of the required changes for implementing XOR were already
done in 12813.

Change-Id: I5a68aa028f5ed597bc1d62cedbef3620753dfe82
Reviewed-on: https://go-review.googlesource.com/12901
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: use Copy instead of ConvNop
Josh Bleecher Snyder [Tue, 28 Jul 2015 21:31:25 +0000 (14:31 -0700)]
[dev.ssa] cmd/compile: use Copy instead of ConvNop

The existing backend simply elides OCONVNOP.
There's no reason for us to do any differently.
Rather than insert ConvNops and then rewrite them
away, stop creating them in the first place.

Change-Id: I4bcbe2229fcebd189ae18df24f2c612feb6e215e
Reviewed-on: https://go-review.googlesource.com/12810
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: fix SUBQ generation error
Todd Neal [Thu, 30 Jul 2015 17:57:43 +0000 (13:57 -0400)]
[dev.ssa] cmd/compile: fix SUBQ generation error

Fix code generation error that resulted in a multi-argument NEGQ

doasm: notfound ft=13 tt=13 00134 NEGQ AX, AX 13 13

Change-Id: I8b712d21a5523eccbae1f33ccea417844c27073e
Reviewed-on: https://go-review.googlesource.com/12869
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years ago[dev.ssa] Merge remote-tracking branch 'origin/master' into mergebranch
Keith Randall [Thu, 30 Jul 2015 19:22:02 +0000 (12:22 -0700)]
[dev.ssa] Merge remote-tracking branch 'origin/master' into mergebranch

Semi-regular merge from tip into ssa branch

Change-Id: Ida553b5c504058347c0bdcb1a987727bdcea456b

9 years agoruntime/cgo: fix darwin/amd64 signal handling setup
Russ Cox [Thu, 30 Jul 2015 18:53:44 +0000 (14:53 -0400)]
runtime/cgo: fix darwin/amd64 signal handling setup

Was not allocating space for the frame above sigpanic,
nor was it pushing the LR into the right place.
Because traceback past sigpanic only needs the
LR for faulting leaves, this was not noticed too much.
But it did break the sync/atomic nil deref tests.

Change-Id: Icba53fffa193423aab744c37f21ee893ce2ee3ac
Reviewed-on: https://go-review.googlesource.com/12926
Reviewed-by: David Crawshaw <crawshaw@golang.org>
9 years ago[dev.ssa] cmd/compile/internal/ssa: fix shift operations
Keith Randall [Thu, 30 Jul 2015 00:07:09 +0000 (17:07 -0700)]
[dev.ssa] cmd/compile/internal/ssa: fix shift operations

Convert shift ops to also encode the size of the shift amount.

Change signed right shift from using CMOV to using bit twiddles.
It is a little bit better (5 instructions instead of 4, but fewer
bytes and slightly faster code).  It's also a bit faster than
the 4-instruction branch version, even with a very predictable
branch.  As tested on my machine, YMMV.

Implement OCOM while we are here.

Change-Id: I8ca12dd62fae5d626dc0e6da5d4bbd34fd9640d2
Reviewed-on: https://go-review.googlesource.com/12867
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years agocmd/compile: add case for ODOTTYPE to escwalk
David Chase [Thu, 30 Jul 2015 16:31:18 +0000 (12:31 -0400)]
cmd/compile: add case for ODOTTYPE to escwalk

ODOTTYPE should be treated a whole lot like ODOT,
but it was missing completely from the switch in
escwalk and thus escape status did not propagate
to fields.

Since interfaces are required to trigger this bug,
the test was added to escape_iface.go.

Fixes #11931.

Change-Id: Id0383981cc4b1a160f6ad447192a112eed084538
Reviewed-on: https://go-review.googlesource.com/12921
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
9 years ago[dev.ssa] cmd/compile/internal/ssa: update generated code
Keith Randall [Thu, 30 Jul 2015 17:36:37 +0000 (10:36 -0700)]
[dev.ssa] cmd/compile/internal/ssa: update generated code

Missed somehow in #12813

Change-Id: I28f2789e33822a4ff884d8a3f474522747f61c73
Reviewed-on: https://go-review.googlesource.com/12868
Reviewed-by: Keith Randall <khr@golang.org>
9 years agosync/atomic: reenable TestNilDeref everywhere
Russ Cox [Thu, 30 Jul 2015 16:37:05 +0000 (12:37 -0400)]
sync/atomic: reenable TestNilDeref everywhere

There is absolutely no information about how this was failing.
If we reenable the test then at least we can get a build log from
darwin/arm.

There are not even freebsd/arm or netbsd/arm builders,
so not too worried about those. (That is another problem.)

Change-Id: I0e739a4dd2897adbe110aa400d720d8fa02ae65f
Reviewed-on: https://go-review.googlesource.com/12920
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoruntime: change arm software div/mod call sequence not to modify stack
Russ Cox [Thu, 30 Jul 2015 14:45:01 +0000 (10:45 -0400)]
runtime: change arm software div/mod call sequence not to modify stack

Instead of pushing the denominator argument on the stack,
the denominator is now passed in m.

This fixes a variety of bugs related to trying to take stack traces
backwards from the middle of the software div/mod routines.
Some of those bugs have been kludged around in the past,
but others have not. Instead of trying to patch up after breaking
the stack, this CL stops breaking the stack.

This is an update of https://golang.org/cl/19810043,
which was rolled back in https://golang.org/cl/20350043.

The problem in the original CL was that there were divisions
at bad times, when m was not available. These were divisions
by constant denominators, either in C code or in assembly.
The Go compiler knows how to generate division by multiplication
for constant denominators, but the C compiler did not.
There is no longer any C code, so that's taken care of.
There was one problematic DIV in runtime.usleep (assembly)
but https://golang.org/cl/12898 took care of that one.
So now this approach is safe.

Reject DIV/MOD in NOSPLIT functions to keep them from
coming back.

Fixes #6681.
Fixes #6699.
Fixes #10486.

Change-Id: I09a13c76ad08ba75b3bd5d46a3eb78e66a84ab38
Reviewed-on: https://go-review.googlesource.com/12899
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocmd/cgo: discard trailing zero-sized fields in a non-empty C struct
Ian Lance Taylor [Thu, 30 Jul 2015 05:04:09 +0000 (22:04 -0700)]
cmd/cgo: discard trailing zero-sized fields in a non-empty C struct

In order to fix issue #9401 the compiler was changed to add a padding
byte to any non-empty Go struct that ends in a zero-sized field.  That
causes the Go version of such a C struct to have a different size than
the C struct, which can considerable confusion.  Change cgo so that it
discards any such zero-sized fields, so that the Go and C structs are
the same size.

This is a change from previous releases, in that it used to be
possible to refer to a zero-sized trailing field (by taking its
address), and with this change it no longer is.  That is unfortunate,
but something has to change.  It seems better to visibly break
programs that do this rather than to silently break programs that rely
on the struct sizes being the same.

Update #9401.
Fixes #11925.

Change-Id: I3fba3f02f11265b3c41d68616f79dedb05b81225
Reviewed-on: https://go-review.googlesource.com/12864
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoruntime: replace divide with multiply in runtime.usleep on arm
Russ Cox [Thu, 30 Jul 2015 14:54:53 +0000 (10:54 -0400)]
runtime: replace divide with multiply in runtime.usleep on arm

We want to adjust the DIV calling convention to use m,
and usleep can be called without an m, so switch to a
multiplication by the reciprocal (and test).

Step toward a fix for #6699 and #10486.

Change-Id: Iccf76a18432d835e48ec64a2fa34a0e4d6d4b955
Reviewed-on: https://go-review.googlesource.com/12898
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocmd/internal/obj/arm: fix line numbers after constant pool
Russ Cox [Thu, 30 Jul 2015 14:28:44 +0000 (10:28 -0400)]
cmd/internal/obj/arm: fix line numbers after constant pool

If a function is large enough to need to flush the constant pool
mid-function, the line number assignment code was forcing the
line numbers not just for the constant pool but for all the instructions
that follow it. This made the line number information completely
wrong for all but the beginning of large functions on arm.

Same problem in code copied into arm64.

This broke runtime/trace's TestTraceSymbolize.

Fixes arm build.

Change-Id: I84d9fb2c798c4085f69b68dc766ab4800c7a6ca4
Reviewed-on: https://go-review.googlesource.com/12894
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>

9 years agocrypto/x509: mark root_darwin_armx.go as cgo-only
Russ Cox [Thu, 30 Jul 2015 15:08:15 +0000 (11:08 -0400)]
crypto/x509: mark root_darwin_armx.go as cgo-only

This allows running a cross-compile like
GOOS=darwin GOARCH=arm go build std
to check that everything builds.

Otherwise there is a redefinition error because both
root_nocgo_darwin.go and root_darwin_armx.go
supply initSystemRoots.

Change-Id: Ic95976b2b698d28c629bfc93d8dac0048b023578
Reviewed-on: https://go-review.googlesource.com/12897
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agonet: allow longer timeout in dialClosedPort test on windows
Russ Cox [Thu, 30 Jul 2015 14:39:07 +0000 (10:39 -0400)]
net: allow longer timeout in dialClosedPort test on windows

The test expects the dial to take 1.0 seconds
on Windows and allows it to go to 1.095 seconds.
That's far too optimistic.
Recent failures are reporting roughly 1.2 seconds.
Let it have 1.5.

Change-Id: Id69811ccb65bf4b4c159301a2b4767deb6ee8d28
Reviewed-on: https://go-review.googlesource.com/12895
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agomath/rand: warn against using package for security-sensitive work
Andrey Petrov [Thu, 30 Jul 2015 09:47:01 +0000 (11:47 +0200)]
math/rand: warn against using package for security-sensitive work

Urge users of math/rand to consider using crypto/rand when doing
security-sensitive work.

Related to issue #11871. While we haven't reached consensus on how
to make the package inherently safer, everyone agrees that the docs
for math/rand can be improved.

Change-Id: I576a312e51b2a3445691da6b277c7b4717173197
Reviewed-on: https://go-review.googlesource.com/12900
Reviewed-by: Rob Pike <r@golang.org>
9 years agoruntime/trace: test requires 'go tool addr2line'
David Crawshaw [Wed, 29 Jul 2015 23:56:10 +0000 (19:56 -0400)]
runtime/trace: test requires 'go tool addr2line'

For the android/arm builder.

Change-Id: Iad4881689223cd6479870da9541524a8cc458cce
Reviewed-on: https://go-review.googlesource.com/12859
Reviewed-by: Andrew Gerrand <adg@golang.org>
Run-TryBot: David Crawshaw <crawshaw@golang.org>

9 years agocmd/compile: fix uninitialized memory during type switch assertE2I2
Russ Cox [Thu, 30 Jul 2015 04:46:42 +0000 (00:46 -0400)]
cmd/compile: fix uninitialized memory during type switch assertE2I2

Fixes arm64 builder crash.

The bug is possible on all architectures; you just have to get lucky
and hit a preemption or a stack growth on entry to assertE2I2.
The test stacks the deck.

Change-Id: I8419da909b06249b1ad15830cbb64e386b6aa5f6
Reviewed-on: https://go-review.googlesource.com/12890
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
9 years agoruntime: enable TestEmptySlice
Russ Cox [Wed, 29 Jul 2015 23:05:07 +0000 (19:05 -0400)]
runtime: enable TestEmptySlice

It says to disable until #7564 is fixed. It was fixed in April 2014.

Change-Id: I9bebfe96802bafdd2d1a0a47591df346d91b000c
Reviewed-on: https://go-review.googlesource.com/12858
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agoruntime: set invalidptr=1 by default, as documented go1.5beta3
Russ Cox [Wed, 29 Jul 2015 23:04:35 +0000 (19:04 -0400)]
runtime: set invalidptr=1 by default, as documented

Also make invalidptr control the recently added GC pointer check,
as documented.

Change-Id: Iccfdf49480219d12be8b33b8f03d8312d8ceabed
Reviewed-on: https://go-review.googlesource.com/12857
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
9 years agodoc: remove non-answer from FAQ
Andrew Gerrand [Wed, 29 Jul 2015 22:27:56 +0000 (08:27 +1000)]
doc: remove non-answer from FAQ

Change-Id: Ie43986d016e5a9fb17ca1393263932bbb56e81ff
Reviewed-on: https://go-review.googlesource.com/12836
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agoruntime/trace: remove existing Skips
Russ Cox [Tue, 28 Jul 2015 17:37:13 +0000 (13:37 -0400)]
runtime/trace: remove existing Skips

The skips added in CL 12579, based on incorrect time stamps,
should be sufficient to identify and exclude all the time-related
flakiness on these systems.

If there is other flakiness, we want to find out.

For #10512.

Change-Id: I5b588ac1585b2e9d1d18143520d2d51686b563e3
Reviewed-on: https://go-review.googlesource.com/12746
Reviewed-by: Austin Clements <austin@google.com>
9 years agoruntime/trace: record event sequence numbers explicitly
Russ Cox [Thu, 23 Jul 2015 18:01:03 +0000 (14:01 -0400)]
runtime/trace: record event sequence numbers explicitly

Nearly all the flaky failures we've seen in trace tests have been
due to the use of time stamps to determine relative event ordering.
This is tricky for many reasons, including:
 - different cores might not have exactly synchronized clocks
 - VMs are worse than real hardware
 - non-x86 chips have different timer resolution than x86 chips
 - on fast systems two events can end up with the same time stamp

Stop trying to make time reliable. It's clearly not going to be for Go 1.5.
Instead, record an explicit event sequence number for ordering.
Using our own counter solves all of the above problems.

The trace still contains time stamps, of course. The sequence number
is just used for ordering.

Should alleviate #10554 somewhat. Then tickDiv can be chosen to
be a useful time unit instead of having to be exact for ordering.

Separating ordering and time stamps lets the trace parser diagnose
systems where the time stamp order and actual order do not match
for one reason or another. This CL adds that check to the end of
trace.Parse, after all other sequence order-based checking.
If that error is found, we skip the test instead of failing it.
Putting the check in trace.Parse means that cmd/trace will pick
up the same check, refusing to display a trace where the time stamps
do not match actual ordering.

Using net/http's BenchmarkClientServerParallel4 on various CPU counts,
not tracing vs tracing:

name                      old time/op    new time/op    delta
ClientServerParallel4       50.4µs ± 4%    80.2µs ± 4%  +59.06%        (p=0.000 n=10+10)
ClientServerParallel4-2     33.1µs ± 7%    57.8µs ± 5%  +74.53%        (p=0.000 n=10+10)
ClientServerParallel4-4     18.5µs ± 4%    32.6µs ± 3%  +75.77%        (p=0.000 n=10+10)
ClientServerParallel4-6     12.9µs ± 5%    24.4µs ± 2%  +89.33%        (p=0.000 n=10+10)
ClientServerParallel4-8     11.4µs ± 6%    21.0µs ± 3%  +83.40%        (p=0.000 n=10+10)
ClientServerParallel4-12    14.4µs ± 4%    23.8µs ± 4%  +65.67%        (p=0.000 n=10+10)

Fixes #10512.

Change-Id: I173eecf8191e86feefd728a5aad25bf1bc094b12
Reviewed-on: https://go-review.googlesource.com/12579
Reviewed-by: Austin Clements <austin@google.com>
9 years agoruntime: ignore arguments in cgocallback_gofunc frame
Russ Cox [Wed, 29 Jul 2015 20:16:13 +0000 (16:16 -0400)]
runtime: ignore arguments in cgocallback_gofunc frame

Otherwise the GC may see uninitialized memory there,
which might be old pointers that are retained, or it might
trigger the invalid pointer check.

Fixes #11907.

Change-Id: I67e306384a68468eef45da1a8eb5c9df216a77c0
Reviewed-on: https://go-review.googlesource.com/12852
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
9 years agoruntime: fix darwin/amd64 assembly frame sizes
Russ Cox [Wed, 29 Jul 2015 22:25:30 +0000 (18:25 -0400)]
runtime: fix darwin/amd64 assembly frame sizes

Change-Id: I2f0ecdc02ce275feadf07e402b54f988513e9b49
Reviewed-on: https://go-review.googlesource.com/12855
Reviewed-by: Russ Cox <rsc@golang.org>
9 years ago[dev.ssa] cmd/compile/internal/ssa: implement lots of small (<8byte) ops.
Keith Randall [Tue, 28 Jul 2015 23:04:50 +0000 (16:04 -0700)]
[dev.ssa] cmd/compile/internal/ssa: implement lots of small (<8byte) ops.

Lots and lots of ops!
Also XOR for good measure.

Add a pass to the compiler generator to check that all of the
architecture-specific opcodes are handled by genValue.  We will
catch any missing ones if we come across them during compilation,
but probably better to catch them statically.

Change-Id: Ic4adfbec55c8257f88117bc732fa664486262868
Reviewed-on: https://go-review.googlesource.com/12813
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years agocmd/internal/obj/arm64: fix build
Russ Cox [Wed, 29 Jul 2015 21:42:58 +0000 (17:42 -0400)]
cmd/internal/obj/arm64: fix build

Change-Id: I3088e17aff72096e3ec2ced49c70564627c982a6
Reviewed-on: https://go-review.googlesource.com/12854
Reviewed-by: Russ Cox <rsc@golang.org>