- 04 Feb, 2015 1 commit
-
-
Rob Pike authored
An editing error prevented the tables from being set up correctly. With that fixed, asm is now compatible with 8a. Change-Id: Ieb20e6dcaf4c05bd448ea748a010ee1f58ef4807 Reviewed-on: https://go-review.googlesource.com/3867Reviewed-by: Russ Cox <rsc@golang.org>
-
- 03 Feb, 2015 3 commits
-
-
Alex Brainman authored
%r format prints nothing useful on windows (see issue 9722). Hopefully this will provide more clues about what happened. Change-Id: Ic553bbdcde0c3cbfffa3a28f2168d6e75694e2ac Reviewed-on: https://go-review.googlesource.com/3568Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Rob Pike authored
A typo limited the number of center-dot substitutions to one. Fixed. With these changes, plus a recent fix to 6a, the are no differences, down to the bit level, in object code for any assembly files in std between asm and 6a. (Runtime has not been checked yet, but I expect no errors.) Change-Id: I0e8045b4414223d937e7f8919c8768860554b7d5 Reviewed-on: https://go-review.googlesource.com/3820Reviewed-by: Russ Cox <rsc@golang.org>
-
Russ Cox authored
Lines beginning with #ifdef, #else, #endif were not incrementing the line number, resulting in bad line number information for assembly files with #ifdefs. Example: #ifndef GOARCH_ppc64 #endif #ifdef GOARCH_ppc64le #endif TEXT ·use(SB),7,$0 RET Before this change, the line number recorded for use in 6a -S output (and in the runtime information in the binary) was 4 too low. Change-Id: I23e599112ec9919f72e53ac82d9bebbbae3439ed Reviewed-on: https://go-review.googlesource.com/3783Reviewed-by: Rob Pike <r@golang.org>
-
- 02 Feb, 2015 1 commit
-
-
Rob Pike authored
Fix one place where semicolons were not recognized and fix the pattern match for the syntax of some pseudo ops. Also clean up a couple of unreachable code pieces. There is still an undiagnosed bit difference betwen old and new .6 files. TBD. With these fixes, asm can successfully compile and test the entire tree. (Verified by turn off verifyAsm in cmd/go make.bash cp $GOROOT/bin/asm $GOROOT/pkg/tool/darwin_amd64/6a go test -short std ) Change-Id: I91ea892098f76ef4f129fd2530e0c63ffd8745a9 Reviewed-on: https://go-review.googlesource.com/3688Reviewed-by: Russ Cox <rsc@golang.org>
-
- 30 Jan, 2015 2 commits
-
-
Rob Pike authored
Given #define X() foo X() X cpp produces foo X Asm does now as well. Change-Id: Ia36b88a23ce1660e6a02559c4f730593d62066f1 Reviewed-on: https://go-review.googlesource.com/3611Reviewed-by: Russ Cox <rsc@golang.org>
-
Rob Pike authored
The previous one was too broken, so just rewrite the code that invokes a macro. Basically it was evaluating things too early, and mishandling nested invocations. It's also easier to understand now. Keep backslash-newline around in macro definitions. They get processed when the body is evaluated. Write some golden tests. Change-Id: I27435f77f258a0873f80932bdc8d13ad39821ac1 Reviewed-on: https://go-review.googlesource.com/3550Reviewed-by: Russ Cox <rsc@golang.org>
-
- 29 Jan, 2015 2 commits
-
-
Rob Pike authored
The overflow checking was causing more problems than it was avoiding, so get rid of it. But because arithmetic is done with uint64s, to simplify dealing with large constants, complain about right shift and divide with huge numbers to avoid ambiguity about signed shifts. Change-Id: I5b5ea55d8e8c02846605f4a3f8fd7a176b1e962b Reviewed-on: https://go-review.googlesource.com/3531Reviewed-by: Russ Cox <rsc@golang.org>
-
Rob Pike authored
Set -S to false and add -debug to control the other debugging print. Change-Id: I864866c3d264a33e6dd0ce12a86a050a5fe0f875 Reviewed-on: https://go-review.googlesource.com/3453Reviewed-by: Andrew Gerrand <adg@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
-
- 28 Jan, 2015 4 commits
-
-
Rob Pike authored
The internal size of integers is not part of the definition of the assembler, so if bits roll out the top it's a portability problem at best. If you need to use shift to create a mask, use & to restrict the bit count before shifting. That will make it portable, too. Change-Id: I24f9a4d2152c3f9f253e22ff75270fe50c18612b Reviewed-on: https://go-review.googlesource.com/3451Reviewed-by: Russ Cox <rsc@golang.org>
-
Rob Pike authored
Rewrite the grammar to have one more production so it parses ~0*0 correctly and write tests to prove it. Change-Id: I0dd652baf65b48a3f26c9287c420702db4eaec59 Reviewed-on: https://go-review.googlesource.com/3443Reviewed-by: Russ Cox <rsc@golang.org>
-
Rob Pike authored
Allow TEXT to have two or three operands. In TEXT foo(SB),flag,$0 the flag can be missing, in which case we take it to be zero. Change-Id: I7b88543b52019f7890baac4b95f9e63884d43c83 Reviewed-on: https://go-review.googlesource.com/3440Reviewed-by: Russ Cox <rsc@golang.org>
-
Rob Pike authored
It was too complicated, assuming the syntax is more general than reality. It must be a possibly negative integer followed by an optional minus sign and positive integer. Literals only, no expresssions. Also put in a TODO about address parsing and clean up a couple of types. Change-Id: If8652249c742e42771ccf2e3024f77307b2e5d9a Reviewed-on: https://go-review.googlesource.com/3370Reviewed-by: Russ Cox <rsc@golang.org>
-
- 24 Jan, 2015 1 commit
-
-
Rob Pike authored
Fix up a couple of minor things pointed out in the last review. Also: 1. If the symbol starts with center dot, prefix the name with "". 2. If there is no locals size specified, use ArgsSizeUnknown (sic). 3. Do not emit a history point at the start of a macro invocation, since we do not pop it at the end, behavior consistent with the old code. With these changes, old and new assemblers produce identical output at least for my simple test case, so that provides a verifiable check for future cleanups. Change-Id: Iaa91d8e453109824b4be44321ec5e828f39f0299 Reviewed-on: https://go-review.googlesource.com/3242Reviewed-by: Russ Cox <rsc@golang.org>
-
- 23 Jan, 2015 5 commits
-
-
Russ Cox authored
Change-Id: I97bbf7a276c8f99554f0e3a9bcc8d3792a5e0f65 Reviewed-on: https://go-review.googlesource.com/3221Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Rob Pike authored
Add main.go, the simple driver for the assembler, and the subdirectory internal/asm, which contains the parser and instruction generator. It's likely that much of the implementation is superstition, or at best experimental phenomenology, but it does generate working binaries. Change-Id: I322a9ae8a20174b6693153f30e39217ba68f8032 Reviewed-on: https://go-review.googlesource.com/3196Reviewed-by: Russ Cox <rsc@golang.org>
-
Rob Pike authored
Add the lexing code for the new portable assembler. It is internal to the assembler, so lives in a subdirectory of cmd/asm/internal. Its only new dependency is the flags package for the assembler, so add that too; it's trivial. That package manages the command-line flags in a central place. The lexer builds on text/scanner to lex the input, including doing a Plan 9-level implementation of the C preprocessor. Change-Id: I262e8717b8c797010afaa5051920839906c0dd19 Reviewed-on: https://go-review.googlesource.com/3195Reviewed-by: Russ Cox <rsc@golang.org>
-
Rob Pike authored
This simple package holds the definition of the Addr (address) type that represents addresses inside the assembler. It has no dependencies. Change-Id: I7573fd70f1847ef68e3d6b663dc4c39eb2ebf8b3 Reviewed-on: https://go-review.googlesource.com/3193Reviewed-by: Russ Cox <rsc@golang.org>
-
Rob Pike authored
This package builds the representation of the machine architecture for the new assembler. Almost nothing in it is likely to last but this will get things running. Change-Id: I8edd891f927a81f76d2dbdcd7484b9c87ac0fb2e Reviewed-on: https://go-review.googlesource.com/3194Reviewed-by: Russ Cox <rsc@golang.org>
-
- 22 Jan, 2015 1 commit
-
-
Russ Cox authored
cmd/internal/obj reconverted using rsc.io/c2go rev 40275b8. All Prog*s need Ctxt field set so that the printer can tell which architecture the Prog belongs to. Use ctxt.NewProg consistently for this. Change-Id: Ic981b3d68f24931ffae74a772e83a3dc2fdf518a Reviewed-on: https://go-review.googlesource.com/3152Reviewed-by: Rob Pike <r@golang.org>
-
- 21 Jan, 2015 18 commits
-
-
Russ Cox authored
For new assembler, reconvert using rsc.io/c2go rev f9db76e. - Removes trailing _ from Go keywords that are exported. - Export regstr as Register, anames[5689] as Anames. Also update clients. Change-Id: I41c8fd2d14490236f548b4aa0ed0b9bd7571d2d7 Reviewed-on: https://go-review.googlesource.com/3151Reviewed-by: Rob Pike <r@golang.org>
-
David du Colombier authored
The function getgohostos and getgohostarch were declared in include/libc.h in CL 3042. Change-Id: Ib4ff5182cb71cc79a99663ce727fa4c28d15d7ad Reviewed-on: https://go-review.googlesource.com/3122Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
David du Colombier authored
The function runcmd was declared in include/libc.h in CL 7523043. Change-Id: I3839b96b2ac0d63e5c2eb4c216710442d0962119 Reviewed-on: https://go-review.googlesource.com/3125Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Russ Cox authored
When an assembly file must be assembled, cmd/go now runs both (say) 6a and new6a and checks that they write identical output files. This serves as a build-time test that the new assemblers are accurate conversions of the old ones. As long as they are producing identical bytes, there's no need for run-time testing. Once the C conversion is done, we'll throw away the C code and this checking. Change-Id: I0216dad56b7e79011eecd27f1aff4fe79bfe720b Reviewed-on: https://go-review.googlesource.com/3145Reviewed-by: Rob Pike <r@golang.org>
-
Russ Cox authored
The change to the bootstrap import conversion is for the a.y files, which use import dot. While we're editing the tool list, add "cmd/dist". Right now 'go install cmd/dist' installs to $GOROOT/bin/dist. (A new bug since cmd/dist has been rewritten in Go. When cmd/dist was a C program, go install cmd/dist just didn't work.) Change-Id: I362208dcfb4ae64c987f60b95dc946829fa506d8 Reviewed-on: https://go-review.googlesource.com/3144Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Rob Pike <r@golang.org>
-
Russ Cox authored
These assemblers produce byte-for-byte identical output to the ones written in C. They are primarily a proof that cmd/internal/obj can be used standalone to produce working object files. (The use via objwriter starts by deserializing an already-constructed internal representation, so objwriter does not exercise the code in cmd/internal/obj that creates such a representation from scratch.) Change-Id: I1793d8d010046cfb9d8b4d2d4469e7f47a3d3ac7 Reviewed-on: https://go-review.googlesource.com/3143Reviewed-by: Rob Pike <r@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Russ Cox authored
This is the raw output of c2go. It needs fixes to make it compile. Rather than make c2go do a 100% conversion (like we're doing for liblink and the Go compilers), since this is so trivial I'm going to make the remaining changes by hand in a followup CL. This CL makes the next CL's diffs useful. Also copy unmodified .y files (5a/a.y → new5a/a.y and so on) The converted 6a/lex.c has been written to new6a/lex.go but also to internal/asm/asm.go, because I'm going to factor out some common code rather than convert it four times. Change-Id: I01d5dfd6a9be3ef6191581560bdddd0ac0e8bc58 Reviewed-on: https://go-review.googlesource.com/3142Reviewed-by: Rob Pike <r@golang.org>
-
Russ Cox authored
Using rsc.io/c2go repo revision 60c9302. - Export a few symbols needed by assemblers. - Implement Getgoroot etc directly, and add Getgoversion. - Removes dependency on Go 1.4 go/build. - Change magic history name <no name> to <pop> The <pop> change requires adjustment to the liblink serializer. Change-Id: If5fb52ac9e91d50805263070b3fc5cc05d8b7632 Reviewed-on: https://go-review.googlesource.com/3141Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Rob Pike <r@golang.org>
-
Russ Cox authored
cmd/internal/obj needs information about the default values of GOROOT, GOARM, GOEXPERIMENT, Version, and so on. It cannot ask package runtime, because during bootstrap package runtime comes from Go 1.4. So it must have its own copy. Change-Id: I73d3e75a3d47210b3184a51a810ebb44826b81e5 Reviewed-on: https://go-review.googlesource.com/3140Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Rob Pike <r@golang.org>
-
Russ Cox authored
This CL enables moving the bulk of the object writing code out of liblink and into translated Go libraries in cmd/internal/obj, but it does not do the move. This CL introduces two new environment variables, $GOOBJ and $GOOBJWRITER, but both will be deleted along with the rest of the liblink C code. The default behavior of a build is unchanged by this CL: the C version of liblink uses the C object layout and writing code. If $GOOBJ=1, liblink invokes go tool objwriter instead. If $GOOBJ=2, liblink does its own layout and then invokes go tool objwriter, which checks that it gets the same answer. That is, in $GOOBJ=2 mode, both the C and the Go version of the code run, and the operation fails if the two produce different answers. This provides a very strong check that the translation is working correctly. Change-Id: I56ab49b07ccb2c7b81085f1d6950131047c6aa3c Reviewed-on: https://go-review.googlesource.com/3048Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Russ Cox authored
New code but nothing interesting. It's nearly all parsing code for the format written by liblink. The interesting part is the call to obj.Writeobjdirect, which is the Go translation of the C liblink writeobjdirect function. Change-Id: I2e9e755e7a3c999302e2ef2c7475c0af9c5acdd2 Reviewed-on: https://go-review.googlesource.com/3047Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Russ Cox authored
This CL adds the real cmd/internal/obj packages. Collectively they correspond to the liblink library. The conversion was done using rsc.io/c2go's run script at rsc.io/c2go repo version 706fac7. This is not the final conversion, just the first working draft. There will be more updates, but this works well enough to use with go tool objwriter and pass all.bash. Change-Id: I9359e835425f995a392bb2fcdbebf29511477bed Reviewed-on: https://go-review.googlesource.com/3046Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Russ Cox authored
Executing 'clean -i std' removes installed Go programs, including the toolchain binaries we need for building. It's not clear why the 'clean -i std' is here in the first place. cmd/dist just removed the entire pkg tree, so everything is new. The only reason for 'clean -i std' would be if you don't trust that dist compiled the packages properly. If that's true for some reason, we can fix cmd/dist, or add -a to the install commands that follow. Perhaps clean -i std should not remove tools, or perhaps std should not expand to any tools. Not sure. Also remove banner from make.bat and make.rc that was already removed from make.bash. cmd/dist prints it now. Also fix array size error in liblink/objfile.c. Fixes dev.cc build. Change-Id: I60855e001a682efce55ad9aa307a8f3ee47f7366 Reviewed-on: https://go-review.googlesource.com/3100Reviewed-by: Russ Cox <rsc@golang.org>
-
Russ Cox authored
This doesn't actually use objwriter for any real work. It's just to check that objwriter is available. The real work will be moved once the bootstrapping mechanisms are working. Change-Id: I5f41c8910c4b11b9d80cb0b0847ff9cb582fc2be Reviewed-on: https://go-review.googlesource.com/3045Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Russ Cox authored
Bootstrap the Go parts of the Go toolchain using Go 1.4, as described in https://golang.org/s/go15bootstrap. The first Go part of the Go toolchain will be cmd/objwriter, but for now that's just an empty program to test that this new code works. Once the build dashboard is okay with this change, we'll make objwriter a real program depended upon by the build. Change-Id: Iad3dce675571cbdb5ab6298fe6f98f53ede47d5c Reviewed-on: https://go-review.googlesource.com/3044Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Russ Cox authored
cmd/internal/obj is the name for the Go translation of the C liblink library. cmd/objwriter is the name of a Go binary that runs liblink's writeobj function. When the bulk of liblink has been converted to Go but the assemblers and compilers are still written in C, the C writeobj will shell out to the Go objwriter to actually write the object file. This lets us manage the transition in smaller pieces. The objwriter tool is purely transitional. It will not ship in any release (enforced in cmd/dist). Adding a dummy program and some dummy imports here so that we can work on the bootstrap mechanisms that will be necessary to build it. Once the build process handles objwriter properly, we'll work on the actual implementation. Change-Id: I675c818b3a513c26bb91c6dba564c6ace3b7fcd4 Reviewed-on: https://go-review.googlesource.com/3043Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Russ Cox authored
Needed for invoking a Go subprocess in the C code. The Go tools live in $GOROOT/pkg/tool/$GOHOSTARCH_$GOHOSTOS. Change-Id: I961b6b8a07de912de174b758b2fb87d77080546d Reviewed-on: https://go-review.googlesource.com/3042Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Russ Cox authored
The argument is unused in the C code but will be used in the Go translation, because the Prog holds information needed to invoke the right meaning of %A in the ctxt->diag calls in vaddr. Change-Id: I501830f8ea0e909aafd8ec9ef5d7338e109d9548 Reviewed-on: https://go-review.googlesource.com/3041Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
- 19 Jan, 2015 2 commits
-
-
Evan Kroske authored
Close the pipe for the body of a request when it is aborted and close all pipes when child.serve terminates. Fixes #6934 Change-Id: I1c5e7d2116e1ff106f11a1ef8e99bf70cf04162a Reviewed-on: https://go-review.googlesource.com/1923Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Mikio Hara authored
Reported via unsupported Github pull request: #9299 Change-Id: I0e98dd68cbc68fcc6bcec15c5b33f20b6a861ec6 Reviewed-on: https://go-review.googlesource.com/3025Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-