- 20 Feb, 2015 3 commits
-
-
Rob Pike authored
Fix many incorrect FP references and a few other details. Some errors remain, especially in vlop, but fixing them requires semantics. For another day. Change-Id: Ib769fb519b465e79fc08d004a51acc5644e8b259 Reviewed-on: https://go-review.googlesource.com/5288Reviewed-by: Russ Cox <rsc@golang.org>
-
Russ Cox authored
Reconvert using rsc.io/c2go rev 27b3f59. Changes to converter: - fatal does not return, so no fallthrough after fatal in switch - many more function results and variables identified as bool - simplification of negated boolean expressions Change-Id: I3bc67da5e46cb7ee613e230cf7e9533036cc870b Reviewed-on: https://go-review.googlesource.com/5171Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
-
Russ Cox authored
c2go was putting a fallthrough after the fatal call. Changed c2go to know that fatal doesn't return, but then there is a missing return at the end of the translated Go function. Move code around a little to make C and Go agree. Change-Id: Icef3d55ccdde0709c02dd0c2b78826f6da33a146 Reviewed-on: https://go-review.googlesource.com/5170Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
-
- 19 Feb, 2015 7 commits
-
-
Rob Pike authored
Maybe fix build. Change-Id: I99ea76f0e6e472f0e88405bf5d77f72d4b097abd Reviewed-on: https://go-review.googlesource.com/5287Reviewed-by: Russ Cox <rsc@golang.org>
-
Rob Pike authored
Change-Id: Ia1ba28c81e31d149c59a48d5f71628ac0ff14d8e Reviewed-on: https://go-review.googlesource.com/5283Reviewed-by: Minux Ma <minux@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
-
Rob Pike authored
Was rejected but should be legal. Change-Id: I0189e3bef6b67c6ba390c75a48a8d9d8f39b7636 Reviewed-on: https://go-review.googlesource.com/5286Reviewed-by: Russ Cox <rsc@golang.org>
-
Russ Cox authored
They use too much memory in the current Go compiler draft. This should fix some builders. Reenabling is #9933. Change-Id: Ib5ef348b2c55d2012ffed765f2a6df99dec171f4 Reviewed-on: https://go-review.googlesource.com/5302Reviewed-by: Russ Cox <rsc@golang.org>
-
Rob Pike authored
Fairly straightforward. A couple of unusual addressing tricks. Also added the ability to write R(10) to mean R10. PPC64 uses this for a couple of large register spaces. It appears for ARM now as well, since I saw some uses of that before, although I rewrote them in our source. I could put it in for 386 and amd64 but it's not worth it. Change-Id: I3ffd7ffa62d511b95b92c3c75b9f1d621f5393b6 Reviewed-on: https://go-review.googlesource.com/5282Reviewed-by: Russ Cox <rsc@golang.org>
-
Rob Pike authored
References to FP must now have a symbol. Change-Id: I3f06b99cc48cbd4ccd6f23f2e4b0830af40f7f3d Reviewed-on: https://go-review.googlesource.com/5281Reviewed-by: Russ Cox <rsc@golang.org>
-
Rob Pike authored
Oversight in 9a: did not set the static bit in the assembler for symbols with <>. Change-Id: Id508dcd3ed07733e60395aefa86d0035faab14a9 Reviewed-on: https://go-review.googlesource.com/5280Reviewed-by: Russ Cox <rsc@golang.org>
-
- 18 Feb, 2015 6 commits
-
-
Russ Cox authored
Fixed for the other assemblers in CL 2297042 in 2010. Change-Id: I6cf41c569e884d98d295369e60e550ff8c0884e6 Reviewed-on: https://go-review.googlesource.com/5173Reviewed-by: Rob Pike <r@golang.org>
-
Russ Cox authored
Change-Id: Ide7cff506274ec76d26bdffe7890ca2c28737f2b Reviewed-on: https://go-review.googlesource.com/4852Reviewed-by: Rob Pike <r@golang.org>
-
Rob Pike authored
This will get fixed properly upstream, but this will serve for now. Change-Id: I25e5210d190bc7a06a5b9f80724e3360d1a6b10c Reviewed-on: https://go-review.googlesource.com/5121Reviewed-by: Russ Cox <rsc@golang.org>
-
Rob Pike authored
Require a name to be specified when referencing the pseudo-stack. If you want a real stack offset, use the hardware stack pointer (e.g., R13 on arm), not SP. Fix affected assembly files. Change-Id: If3545f187a43cdda4acc892000038ec25901132a Reviewed-on: https://go-review.googlesource.com/5120 Run-TryBot: Rob Pike <r@golang.org> Reviewed-by: Russ Cox <rsc@golang.org> Reviewed-by: Dave Cheney <dave@cheney.net>
-
Russ Cox authored
Historically, yacc has supported various kinds of inspections and manipulations of the parser state, exposed as global variables. The Go implementation of yacc puts that state (properly) in local stack variables, so it can only be exposed explicitly. There is now an explicit parser type, yyParser, returned by a constructor, yyNewParser. type yyParser interface { Parse(yyLexer) int Lookahead() int } Parse runs a parse. A call to the top-level func Parse is equivalent to calling yyNewParser().Parse, but constructing the parser explicitly makes it possible to access additional parser methods, such as Lookahead. Lookahead can be called during grammar actions to read (but not consume) the value of the current lookahead token, as returned by yylex.Lex. If there is no current lookahead token, Lookahead returns -1. Invoking Lookahead corresponds to reading the global variable yychar in a traditional Unix yacc grammar. To support Lookahead, the internal parsing code now separates the return value from Lex (yychar) from the reencoding used by the parsing tables (yytoken). This has the effect that grammars that read yychar directly in the action (possible since the actions are in the same function that declares yychar) now correctly see values from the Lex return value space, not the internal reencoding space. This can fix bugs in ported grammars not even using SetParse and Lookahead. (The reencoding was added on Plan 9 for large character sets. No Plan 9 programs using yacc looked at yychar.) Other methods may be added to yyParser later as needed. Obvious candidates include equivalents for the traditional yyclearin and yyerrok macros. Change-Id: Iaf7649efcf97e09f44d1f5bc74bb563a11f225de Reviewed-on: https://go-review.googlesource.com/4850Reviewed-by: Rob Pike <r@golang.org>
-
Rob Pike authored
Change-Id: If2aafc4dd3f91650fc7727ea7d534ad7aa627c8c Reviewed-on: https://go-review.googlesource.com/5090Reviewed-by: Russ Cox <rsc@golang.org>
-
- 17 Feb, 2015 17 commits
-
-
Russ Cox authored
First draft of converted Go compiler, using rsc.io/c2go rev 83d795a. Change-Id: I29f4c7010de07d2ff1947bbca9865879d83c32c3 Reviewed-on: https://go-review.googlesource.com/4851Reviewed-by: Rob Pike <r@golang.org>
-
Russ Cox authored
Change-Id: I2853535ab6c79d14f430c780161e4c35c52d9fb3 Reviewed-on: https://go-review.googlesource.com/4839Reviewed-by: Rob Pike <r@golang.org>
-
Russ Cox authored
Change-Id: I3be69a4ebf300ad24b55b5f43fd7ad1f001c762e Reviewed-on: https://go-review.googlesource.com/4838Reviewed-by: Rob Pike <r@golang.org>
-
Russ Cox authored
Change-Id: Ida60c30041505c321fbfc48b22b8ff5af1a3f474 Reviewed-on: https://go-review.googlesource.com/4837Reviewed-by: Rob Pike <r@golang.org> Reviewed-by: Minux Ma <minux@golang.org>
-
Rob Pike authored
Set TYPE_BRANCH for x(PC) in the parser and the assembler has less work to do. This also makes the operand test handle -4(PC) correctly. Also add a special test case for AX:DX, which should be fixed in obj really. Change-Id: If195e3a8cf3454a73508633e9b317d66030da826 Reviewed-on: https://go-review.googlesource.com/5071Reviewed-by: Russ Cox <rsc@golang.org>
-
Rob Pike authored
Use R15. May fix build. Change-Id: Ia25b0936c5aab2a427f8e6531688c3e537fbfdd0 Reviewed-on: https://go-review.googlesource.com/5070Reviewed-by: Russ Cox <rsc@golang.org>
-
Rob Pike authored
Generated by reducing all the amd64 operands in the core. Will add 386 and ARM later; this is a trial balloon. NOTE: There is at least one anomaly: AX:DX doesn't print correctly in this situation. Change-Id: I9f327c1890b100e3edb7b1b2a1c01f3e4b798f43 Reviewed-on: https://go-review.googlesource.com/4967Reviewed-by: Russ Cox <rsc@golang.org>
-
Rob Pike authored
R15 is the real register. PC is a pseudo-register that we are making illegal in this context as part of the grand assembly unification. Change-Id: Ie0ea38ce7ef4d2cf4fcbe23b851a570fd312ce8d Reviewed-on: https://go-review.googlesource.com/4966Reviewed-by: Minux Ma <minux@golang.org>
-
Rob Pike authored
Handle the special name of R10 on the ARM - it's g - when it appears in a register list [R0, g, R3]. Also simplify the pseudo-register parsing a little. Should fix the ARM build. Change-Id: Ifcafc8195dcd3622653b43663ced6e4a144a3e51 Reviewed-on: https://go-review.googlesource.com/4965Reviewed-by: Russ Cox <rsc@golang.org>
-
Alex Brainman authored
Change-Id: Ia47e1e387acd30f30559d766aa6fca18cbb098f9 Reviewed-on: https://go-review.googlesource.com/5010Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Rob Pike authored
Change-Id: I182ea770110255a5ac1c91cf30dd650696a8f1db Reviewed-on: https://go-review.googlesource.com/4961Reviewed-by: Russ Cox <rsc@golang.org>
-
Rob Pike authored
Mishandled the complex addressing mode in masks<>(SB)(CX*8) as a casualty of the ARM work. Fix by backing all the flows up to the state where registerIndirect is always called with the input sitting on the opening paren. With this, build passes for me with linux-arm, linux-386, and linux-amd64. Change-Id: I7cae69a6fa9b635c79efd93850bd1e744b22bc79 Reviewed-on: https://go-review.googlesource.com/4964Reviewed-by: Russ Cox <rsc@golang.org>
-
Rob Pike authored
A consequence of the ARM work overlooked that SP is a real register on x86, so we need to detect it specially. This will be done better soon, but this is a fast fix for the build. Change-Id: Ia30d111c3f42a5f0b5f4eddd4cc4d8b10470c14f Reviewed-on: https://go-review.googlesource.com/4963Reviewed-by: Russ Cox <rsc@golang.org>
-
Rob Pike authored
The tools have been fixed to not do this, but verifyAsm depends on this being fixed. TBR=rsc Change-Id: Ia8968cc803b3498dfa2f98188c6ed1cf2e11c66d Reviewed-on: https://go-review.googlesource.com/4962Reviewed-by: Rob Pike <r@golang.org>
-
Rob Pike authored
Change-Id: Ic33431cdcc93db300fc2c3467eafdb5340ee4896 Reviewed-on: https://go-review.googlesource.com/4924Reviewed-by: Dave Cheney <dave@cheney.net> Reviewed-by: Russ Cox <rsc@golang.org>
-
Rob Pike authored
There are many peculiarites of the ARM architecture that require work: condition codes, new instructions, new instruction arg counts, and more. Rewrite the parser to do a cleaner job, flowing left to right through the sequence of elements of an operand. Add ARM to arch. Add ARM-specific details to the arch in a new file, internal/arch/arm. These are probably better kept away from the "portable" asm. However there are some pieces, like MRC, that are hard to disentangle. They can be cleaned up later. Change-Id: I8c06aedcf61f8a3960a406c094e168182d21b972 Reviewed-on: https://go-review.googlesource.com/4923Reviewed-by: Russ Cox <rsc@golang.org>
-
Rob Pike authored
Because text/scanner hides the spaces, the lexer treated #define A(x) and #define A (x) the same, but they are not: the first is an argument with macros, the second is a simple one-word macro whose definition contains parentheses. Fix this by noticing the relative column number as we move from A to (. Hacky but simple. Also add a helper to recognize the peculiar ARM shifted register operators. Change-Id: I2cad22f5f1e11d8dad40ad13955793d178afb3ae Reviewed-on: https://go-review.googlesource.com/4872Reviewed-by: Russ Cox <rsc@golang.org>
-
- 14 Feb, 2015 1 commit
-
-
Rob Pike authored
The mechanical edit in the last round managed to miss ROUND1, among other indgnities. Change-Id: Ie3e19d00435a9e701b9872167e4bc7756a9fb5a5 Reviewed-on: https://go-review.googlesource.com/4870Reviewed-by: Minux Ma <minux@golang.org>
-
- 13 Feb, 2015 6 commits
-
-
Rob Pike authored
Change-Id: Id544d435620efffaf5757dd9d9ebbc6e969a052c Reviewed-on: https://go-review.googlesource.com/4823Reviewed-by: Rob Pike <r@golang.org>
-
Rob Pike authored
Several .s files for ARM had several properties the new assembler will not support. These include: - mentioning SP or PC as a hardware register These are always pseudo-registers except that in some contexts they're not, and it's confusing because the context should not affect which register you mean. Change the references to the hardware registers to be explicit: R13 for SP, R15 for PC. - constant creation using assignment The files say a=b when they could instead say #define a b. There is no reason to have both mechanisms. - R(0) to refer to R0. Some macros use this to a great extent. Again, it's easy just to use a #define to rename a register. Change-Id: I002335ace8e876c5b63c71c2560533eb835346d2 Reviewed-on: https://go-review.googlesource.com/4822Reviewed-by: Dave Cheney <dave@cheney.net>
-
Russ Cox authored
The point of GOOBJ=2 was to have an active test of the cmd/internal/obj code. Now we have end-to-end tests of the assembler, and soon the compiler, so we don't need this halfway test on by default anymore. (It's still possible to enable during debugging with the environment variable.) The problem it causes on the builders is that this particular testing mode ends up with both the C process and the Go objwriter subprocess having the same very large Prog list in memory simultaneously, which causes basically a 2x memory blowup. In large programs (such as the one generated by test/rotate.go) this is significant. Disabling GOOBJ=2 should help with the current dev.cc builder failures. Change-Id: I1b11e4f29ea575659f02d2234242a904f7c867e4 Reviewed-on: https://go-review.googlesource.com/4832 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Russ Cox authored
Conflicts: src/cmd/dist/build.go Change-Id: I98a4b5e010bee91507b85bb8efd9c74e1a1f649c
-
Russ Cox authored
Make cmd/ld a real library invoked by the individual linkers. There are no reverse symbol references anymore (symbols referred to in cmd/ld but defined in cmd/5l etc). This means that in principle we could do an automatic conversion of these to Go, as a stopgap until cmd/link is done or as a replacement for cmd/link. Change-Id: I4a94570257a3a7acc31601bfe0fad9dea0aea054 Reviewed-on: https://go-review.googlesource.com/4649Reviewed-by: Rob Pike <r@golang.org>
-
Russ Cox authored
Change-Id: I2db4db852492eaddaf09dd7bae2fbd49f916e78a Reviewed-on: https://go-review.googlesource.com/4648Reviewed-by: Rob Pike <r@golang.org>
-