- 27 Jul, 2016 2 commits
-
-
Cherry Zhang authored
Instead of comparing the address of the end of the memory to zero/copy, comparing the address of the last element, which is a valid pointer. Also unify large and unaligned Zero/Move, by passing alignment as AuxInt. Fixes #16515 for ARM. Change-Id: I19a62b31c5acf5c55c16a89bea1039c926dc91e5 Reviewed-on: https://go-review.googlesource.com/25300 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
-
Cherry Zhang authored
Support the following: - Shifts. ARM64 machine instructions only use lowest 6 bits of the shift (i.e. mod 64). Use conditional selection instruction to ensure Go semantics. - Zero/Move. Alignment is ensured. - Hmul, Avg64u, Sqrt. - reserve R18 (platform register in ARM64 ABI) and R29 (frame pointer in ARM64 ABI). Everything compiles, all.bash passed (with non-SSA test disabled). Change-Id: Ia8ed58dae5cbc001946f0b889357b258655078b1 Reviewed-on: https://go-review.googlesource.com/25290 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
-
- 26 Jul, 2016 1 commit
-
-
David Chase authored
Added support for ClosureCall, DeferCall, InterCall (GoCall not yet tested). Added support for GetClosurePtr, IsNonNil, IsInBounds, IsSliceInBounds, NilCheck (Convert and GetG not yet tested) Still need to implement NilCheck optimizations. Fixed move boolean constant, order of operands to subtract. Updates #16010. Change-Id: Ibe0f6a6e688df4396cd77de0e9095997e4ca8ed2 Reviewed-on: https://go-review.googlesource.com/25241Reviewed-by: Cherry Zhang <cherryyz@google.com> Run-TryBot: David Chase <drchase@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 24 Jul, 2016 1 commit
-
-
David Chase authored
Because PPC lacks store-immediate, remove the instruction that implies that it exists. Replace it with storezero for the special case of storing zero, because R0 is reserved zero for Go (though the assembler knows this, do it in SSA). Also added address folding for storezero. (Now corrected to use right-sized stores in bulk-zero code.) Hello.go now compiles to genssa main 00000 (...hello.go:7) TEXT "".main(SB), $0 00001 (...hello.go:7) FUNCDATA $0, "".gcargs·0(SB) 00002 (...hello.go:7) FUNCDATA $1, "".gclocals·1(SB) v23 00003 (...hello.go:8) MOVD $go.string."Hello, World!\n"(SB), R3 v11 00004 (...hello.go:8) MOVD R3, 32(R1) v22 00005 (...hello.go:8) MOVD $14, R3 v6 00006 (...hello.go:8) MOVD R3, 40(R1) v20 00007 (...hello.go:8) MOVD R0, 48(R1) v18 00008 (...hello.go:8) MOVD R0, 56(R1) v9 00009 (...hello.go:8) MOVD R0, 64(R1) v10 00010 (...hello.go:8) CALL fmt.Printf(SB) b2 00011 (...hello.go:9) RET 00012 (<unknown line number>) END Updates #16010 Change-Id: I33cfd98c21a1617502260ac753fa8cad68c8d85a Reviewed-on: https://go-review.googlesource.com/25151Reviewed-by: Cherry Zhang <cherryyz@google.com> Run-TryBot: David Chase <drchase@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 23 Jul, 2016 1 commit
-
-
Cherry Zhang authored
Mostly copied from ARM port, with instruction names and Prog fields adjusted, and 64-bit int ops added. Not complete. Fib compiles and runs correctly. Change-Id: Id3ecb0d4b571200a035344b3e8e4408769f76221 Reviewed-on: https://go-review.googlesource.com/25130Reviewed-by: David Chase <drchase@google.com> Run-TryBot: David Chase <drchase@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 22 Jul, 2016 1 commit
-
-
David Chase authored
Runs fibonacci for all integer types. Fold addressing arithmetic into stores. Updates #16010. Change-Id: I257982c82c00c80b00679757c3da345045968022 Reviewed-on: https://go-review.googlesource.com/25103Reviewed-by: Cherry Zhang <cherryyz@google.com> Run-TryBot: David Chase <drchase@google.com>
-
- 21 Jul, 2016 2 commits
-
-
Keith Randall authored
GOARCH=386 SSATEST=1 ./all.bash passes Caveat: still needs changes to test/ files to use *_ssa.go versions. I won't check those changes in with this CL because the builders will complain as they don't have SSATEST=1. Mostly minor fixes. Implement float <-> uint32 in assembly. It seems the simplest option for now. GO386=387 does not work. That's why I can't make SSA the default for 386 yet. Change-Id: Ic4d4402104d32bcfb1fd612f5bb6539f9acb8ae0 Reviewed-on: https://go-review.googlesource.com/25119Reviewed-by: Cherry Zhang <cherryyz@google.com>
-
Cherry Zhang authored
For register-register move, if there is only one use, allocate it in the same register so we don't need to emit an instruction. Updates #15365. Change-Id: Iad41843854a506c521d577ad93fcbe73e8de8065 Reviewed-on: https://go-review.googlesource.com/25059 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
-
- 20 Jul, 2016 1 commit
-
-
Cherry Zhang authored
Updates #15365. Change-Id: I372a5617c2c7d91de545cac0464809b96711b63a Reviewed-on: https://go-review.googlesource.com/24646 Run-TryBot: Cherry Zhang <cherryyz@google.com> Reviewed-by: David Chase <drchase@google.com>
-
- 19 Jul, 2016 1 commit
-
-
Keith Randall authored
Fix up zero/move code, including duff calls and rep movs. Handle the new ops generated by dec64.rules. Fix constant shifts. Change-Id: I7d89194b29b04311bfafa0fd93b9f5644af04df9 Reviewed-on: https://go-review.googlesource.com/25033 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
-
- 18 Jul, 2016 4 commits
-
-
Keith Randall authored
Use Cherry's awesome pair type constructor. Change-Id: I282156a570ee4dd3548bd82fbf15b8d8eb5bedf6 Reviewed-on: https://go-review.googlesource.com/25009Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
-
Keith Randall authored
add/sub/mul, plus constant input variants. Change-Id: I1c8006727c4fdf73558da0e646e7d1fa130ed773 Reviewed-on: https://go-review.googlesource.com/25006Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Cherry Zhang <cherryyz@google.com>
-
Keith Randall authored
We now allow Values to have 2 outputs. Use that ability for amd64. This allows x,y := a/b,a%b to use just a single divide instruction. Update #6815 Change-Id: Id70bcd20188a2dd8445e631a11d11f60991921e4 Reviewed-on: https://go-review.googlesource.com/25004Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: David Chase <drchase@google.com>
-
Keith Randall authored
Make tuple types and their SelectX ops fully generic. These ops no longer need to be lowered. Regalloc understands them and their tuple-generating arguments. We can now have opcodes returning arbitrary pairs of results. (And it would be easy to move to >2 results if needed.) Update arm implementation to the new standard. Implement just enough in 386 port to do 64-bit add. Change-Id: I370ed5aacce219c82e1954c61d1f63af76c16f79 Reviewed-on: https://go-review.googlesource.com/24976Reviewed-by: Cherry Zhang <cherryyz@google.com> Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 16 Jul, 2016 2 commits
-
-
Cherry Zhang authored
NaCl code runs in sandbox and there are restrictions for its instruction uses (https://developer.chrome.com/native-client/reference/sandbox_internals/arm-32-bit-sandbox). Like the legacy backend, on NaCl, - don't use R9, which is used as NaCl's "thread pointer". - don't use Duff's device. - don't use indexed load/stores. - the assembler rewrites DIV/MOD to runtime calls, which on NaCl clobbers R12, so R12 is marked as clobbered for DIV/MOD. - other restrictions are satisfied by the assembler. Enable SSA specific tests on nacl/arm, and disable non-SSA ones. Updates #15365. Change-Id: I9262693ec6756b89ca29d3ae4e52a96fe5403b02 Reviewed-on: https://go-review.googlesource.com/24859Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
-
Cherry Zhang authored
Add some simplification rules for floating point ops. cmd/internal/obj/arm supports instructions that compare FP register to 0, but runtime softfloat simulator does not. This CL adds these instructions to softfloat simulator as well. Updates #15365. Change-Id: I29405b2bfcb4c8cf106cb7a1a811409fec91b170 Reviewed-on: https://go-review.googlesource.com/24790 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
-
- 15 Jul, 2016 3 commits
-
-
Cherry Zhang authored
The argument size for runtime call was incorrectly includes the size of LR (FixedFrameSize in general). This makes the stack frame sometimes unnecessarily 4 bytes larger on ARM. For example, func f(b []byte) byte { return b[0] } compiles to 0x0000 00000 (h.go:6) TEXT "".f(SB), $4-16 // <-- framesize = 4 0x0000 00000 (h.go:6) MOVW 8(g), R1 0x0004 00004 (h.go:6) CMP R1, R13 0x0008 00008 (h.go:6) BLS 52 0x000c 00012 (h.go:6) MOVW.W R14, -8(R13) 0x0010 00016 (h.go:6) FUNCDATA $0, gclocals·8355ad952265fec823c17fcf739bd009(SB) 0x0010 00016 (h.go:6) FUNCDATA $1, gclocals·69c1753bd5f81501d95132d08af04464(SB) 0x0010 00016 (h.go:6) MOVW "".b+4(FP), R0 0x0014 00020 (h.go:6) CMP $0, R0 0x0018 00024 (h.go:6) BLS 44 0x001c 00028 (h.go:6) MOVW "".b(FP), R0 0x0020 00032 (h.go:6) MOVBU (R0), R0 0x0024 00036 (h.go:6) MOVB R0, "".~r1+12(FP) 0x0028 00040 (h.go:6) MOVW.P 8(R13), R15 0x002c 00044 (h.go:6) PCDATA $0, $1 0x002c 00044 (h.go:6) CALL runtime.panicindex(SB) 0x0030 00048 (h.go:6) UNDEF 0x0034 00052 (h.go:6) NOP 0x0034 00052 (h.go:6) MOVW R14, R3 0x0038 00056 (h.go:6) CALL runtime.morestack_noctxt(SB) 0x003c 00060 (h.go:6) JMP 0 Note that the frame size is 4, but there is actually no local. It incorrectly thinks call to runtime.panicindex needs 4 bytes space for argument. This CL fixes it. Updates #15365. Change-Id: Ic65d55283a6aa8a7861d7a3fbc7b63c35785eeec Reviewed-on: https://go-review.googlesource.com/24909 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
-
Cherry Zhang authored
If a spill is used to satisfy a merge edge (in shuffle), don't sink it out of loop. This is found in the following code (on ARM) where there is a stack Phi (v268) inside a loop (b36 -> ... -> b47 -> b38 -> b36). (before shuffle) b36: <- b34 b38 ... v268 = Phi <int> v410 v360 : autotmp_198[int] ... ... -> b47 b47: <- b44 ... v360 = ... : R6 v230 = StoreReg <int> v360 : autotmp_198[int] v261 = CMPconst <flags> [0] v360 EQ v261 -> b49 b38 (unlikely) b38: <- b47 ... Plain -> b36 During shuffle, v230 (as spill of v360) is found to satisfy v268, but it didn't record its use in shuffle, and v230 is sunk out of the loop (to b49), which leads to bad value in v268. This seems never happened on AMD64 (in make.bash), until 4 registers are removed. Change-Id: I01dfc28ae461e853b36977c58bcfc0669e556660 Reviewed-on: https://go-review.googlesource.com/24858Reviewed-by: David Chase <drchase@google.com>
-
Cherry Zhang authored
This CL implements the following optimizations for ARM: - use shifted ops (e.g. ADD R1<<2, R2) and indexed load/stores - break up shift ops. Shifts used to be one SSA op that generates multiple instructions. We break them up to multiple ops, which allows constant folding and CSE for comparisons. Conditional moves are introduced for this. - simplify zero/sign-extension ops. Updates #15365. Change-Id: I55e262a776a7ef2a1505d75e04d1208913c35d39 Reviewed-on: https://go-review.googlesource.com/24512 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
-
- 13 Jul, 2016 4 commits
-
-
Keith Randall authored
Basically just copied all the amd64 files, removed all the *Q ops, and rebuilt. Compiles fib successfully. Still need to do: - all the 64->32 bit op translations. - audit for instructions that aren't available on 386. - GO386=387? Update #16358 Change-Id: Ib8c684586416a554a527a5eefa0cff71424e36f5 Reviewed-on: https://go-review.googlesource.com/24912Reviewed-by: Cherry Zhang <cherryyz@google.com>
-
Keith Randall authored
Semi-regular merge of tip into dev.ssa. Change-Id: I855817c4746237792a2dab6eaf471087a3646be4
-
Emmanuel Odeke authored
Document that the http.Server is now stricter about rejecting requests with invalid HTTP versions, and also that it rejects plaintext HTTP/2 requests, except for `PRI * HTTP/2.0` upgrade requests. The relevant CL is https://golang.org/cl/24505. Updates #15810. Change-Id: Ibbace23e001b5e2eee053bd341de50f9b6d3fde8 Reviewed-on: https://go-review.googlesource.com/24731Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Bryan C. Mills authored
New Gophers sometimes misconstrue the advice in the "Generality" section as "export interfaces instead of implementations" and add needless interfaces to their code as a result. Down the road, they end up needing to add methods and either break existing callers or have to resort to unpleasant hacks (e.g. using "magic method" type-switches). Weaken the first paragraph of this section to only advise leaving types unexported when they will never need additional methods. Change-Id: I32a1ae44012b5896faf167c02e192398a4dfc0b8 Reviewed-on: https://go-review.googlesource.com/24892Reviewed-by: Rob Pike <r@golang.org> Reviewed-by: Andrew Gerrand <adg@golang.org>
-
- 12 Jul, 2016 4 commits
-
-
Brad Fitzpatrick authored
Fixes #12272 Change-Id: I0306ce0ef4a87df2158df3b7d4d8d93a1cb6dabc Reviewed-on: https://go-review.googlesource.com/24864Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org>
-
Ian Lance Taylor authored
The cgocallback function picked up a ctxt parameter in CL 22508. That CL updated the assembler implementation, but there are a few mentions in Go code that were not updated. This CL fixes that. Fixes #16326 Change-Id: I5f68e23565c6a0b11057aff476d13990bff54a66 Reviewed-on: https://go-review.googlesource.com/24848 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Minux Ma <minux@golang.org>
-
Ian Lance Taylor authored
The reflect package was returning a non-empty PkgPath for an unnamed type with methods, such as a type whose methods have a pointer receiver. Fixes #16328. Change-Id: I733e93981ebb5c5c108ef9b03bf5494930b93cf3 Reviewed-on: https://go-review.googlesource.com/24862Reviewed-by: David Crawshaw <crawshaw@golang.org>
-
Ian Lance Taylor authored
This is a copy of the "FANOUT" benchmark recently added to RE2 with the following comment: // This has quite a high degree of fanout. // NFA execution will be particularly slow. Most of the benchmarks on the regexp package have very little fanout and are designed for comparing the regexp package's NFA with backtracking engines found in other regular expression libraries. This benchmark exercises the performance of the NFA on expressions with high fanout.Reviewed-on: https://go-review.googlesource.com/24846Reviewed-by: Andrew Gerrand <adg@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> " This reverts commit fc803874. Reason for revert: Breaks the -race build because the benchmark takes too long to run. Change-Id: I6ed4b466f74a4108d8bcd5b019b9abe971eb483e Reviewed-on: https://go-review.googlesource.com/24861 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Michael Matloob <matloob@golang.org>
-
- 11 Jul, 2016 5 commits
-
-
Michael Matloob authored
This is a copy of the "FANOUT" benchmark recently added to RE2 with the following comment: // This has quite a high degree of fanout. // NFA execution will be particularly slow. Most of the benchmarks on the regexp package have very little fanout and are designed for comparing the regexp package's NFA with backtracking engines found in other regular expression libraries. This benchmark exercises the performance of the NFA on expressions with high fanout. Change-Id: Ie9c8e3bbeffeb1fe9fb90474ddd19e53f2f57a52 Reviewed-on: https://go-review.googlesource.com/24846Reviewed-by: Andrew Gerrand <adg@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Francesc Campoy authored
PrintDefaults already calls os.Exit(2). Change-Id: I0d783a6476f42b6157853cdb34ba69618e3f3fcb Reviewed-on: https://go-review.googlesource.com/24844Reviewed-by: Andrew Gerrand <adg@golang.org>
-
Ian Lance Taylor authored
A follow-on to https://golang.org/cl/24852 that mentions the documentation clarifications. Updates #16308. Change-Id: Ic2a6e1d4938d74352f93a6649021fb610efbfcd0 Reviewed-on: https://go-review.googlesource.com/24857 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com> Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
-
Ian Lance Taylor authored
There are no synchronization points protecting the readVal and readPos variables. This leads to a race when Read is called concurrently. Fix this by adding methods to lockedSource, which is the case where a race matters. Fixes #16308. Change-Id: Ic028909955700906b2d71e5c37c02da21b0f4ad9 Reviewed-on: https://go-review.googlesource.com/24852Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
-
Brad Fitzpatrick authored
Updates #16230 Change-Id: Ie38f85419c41c00108f8843960280428a39789b5 Reviewed-on: https://go-review.googlesource.com/24850 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 08 Jul, 2016 5 commits
-
-
Ian Lance Taylor authored
Fixes #16303. Change-Id: I2832477ce0117a66da53ca1f198ebb6121953d56 Reviewed-on: https://go-review.googlesource.com/24833 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Ian Lance Taylor authored
Fixes #16299. Change-Id: I76f541c7f11edb625df566f2f1035147b8bcd9dd Reviewed-on: https://go-review.googlesource.com/24830 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Ian Lance Taylor authored
For better or for worse, it's IsExist, not IsExists. Change-Id: I4503f961486edd459c0c81cf3f32047dff7703a4 Reviewed-on: https://go-review.googlesource.com/24819 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Ian Lance Taylor authored
In the beta version of the macOS Sierra (10.12) release, the gettimeofday system call changed on x86. Previously it always returned the time in the AX/DX registers. Now, if AX is returned as 0, it means that the system call has stored the values into the memory pointed to by the first argument, just as the libc gettimeofday function does. The libc function handles both cases, and we need to do so as well. Fixes #16272. Change-Id: Ibe5ad50a2c5b125e92b5a4e787db4b5179f6b723 Reviewed-on: https://go-review.googlesource.com/24812Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Ian Lance Taylor authored
The shrinkstack code locks all the channels a goroutine is waiting for, but didn't handle the case of the same channel appearing in the list multiple times. This led to a deadlock. The channels are sorted so it's easy to avoid locking the same channel twice. Fixes #16286. Change-Id: Ie514805d0532f61c942e85af5b7b8ac405e2ff65 Reviewed-on: https://go-review.googlesource.com/24815 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Austin Clements <austin@google.com>
-
- 07 Jul, 2016 3 commits
-
-
Brad Fitzpatrick authored
Fixes #16273 Change-Id: I443e1f254fd683c4ff61beadae89c1c45ff5d972 Reviewed-on: https://go-review.googlesource.com/24744Reviewed-by: Andrew Gerrand <adg@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Quentin Smith <quentin@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Brad Fitzpatrick authored
The test was checking for 1 of 2 possible error values. But based on goroutine scheduling and the randomness of select statement receive cases, it was possible for a 3rd type of error to be returned. This modifies the code (not the test) to make that third type of error actually the second type of error, which is a nicer error message. The test is no longer flaky. The flake was very reproducible with a 5ms sleep before the select at the end of Transport.getConn. Thanks to Github user @jaredborner for debugging. Fixes #16049 Change-Id: I0d2a036c9555a8d2618b07bab01f28558d2b0b2c Reviewed-on: https://go-review.googlesource.com/24748Reviewed-by: Andrew Gerrand <adg@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Ian Lance Taylor authored
Change-Id: I0c76e8deae49c1149647de421503c5175028b948 Reviewed-on: https://go-review.googlesource.com/24781 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-