summaryrefslogtreecommitdiff
path: root/src/cmd/8a
Commit message (Collapse)AuthorAgeFilesLines
* [dev.power64] cmd/5a, cmd/6a, cmd/8a, cmd/9a: make labels function-scopedRuss Cox2014-10-283-548/+530
| | | | | | | | | | | | | | | | | | | | | | I removed support for jumping between functions years ago, as part of doing the instruction layout for each function separately. Given that, it makes sense to treat labels as function-scoped. This lets each function have its own 'loop' label, for example. Makes the assembly much cleaner and removes the last reason anyone would reach for the 123(PC) form instead. Note that this is on the dev.power64 branch, but it changes all the assemblers. The change will ship in Go 1.5 (perhaps after being ported into the new assembler). Came up as part of CL 167730043. LGTM=r R=r CC=austin, dave, golang-codereviews, minux https://codereview.appspot.com/159670043
* liblink: require DATA lines to be ordered by offset, with no overlapRuss Cox2014-10-141-0/+1
| | | | | | | | | | | | The assembler could give a better error, but this one is good enough for now. Fixes issue 8880. LGTM=r R=r CC=golang-codereviews https://codereview.appspot.com/153610043
* build: adjustments for move from src/pkg to srcRuss Cox2014-09-082-2/+2
| | | | | | | | | | | | | | | | | | | This CL adjusts code referring to src/pkg to refer to src. Immediately after submitting this CL, I will submit a change doing 'hg mv src/pkg/* src'. That change will be too large to review with Rietveld but will contain only the 'hg mv'. This CL will break the build. The followup 'hg mv' will fix it. For more about the move, see golang.org/s/go14nopkg. LGTM=r R=r CC=golang-codereviews https://codereview.appspot.com/134570043
* cmd/6a, cmd/8a: document AJxx condition codesJosh Bleecher Snyder2014-08-191-17/+17
| | | | | | | LGTM=ruiu, rsc R=rsc, ruiu CC=golang-codereviews https://codereview.appspot.com/130870043
* liblink, cmd/gc, cmd/{5,6,8}{a,c}: rename linkwriteobj to writeobjIan Lance Taylor2014-04-161-1/+1
| | | | | | | | | | | | | The name linkwriteobj is misleading because it implies that the function has something to do with the linker, which it does not. The name is historical: the function performs an operation that was previously performed by the linker, but no longer is. LGTM=rsc R=rsc, minux.ma CC=golang-codereviews https://codereview.appspot.com/88210045
* build: remove tmp dir names from objects, support GOROOT_FINAL againRuss Cox2014-04-152-36/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we compile a generated file stored in a temporary directory - let's say /tmp/12345/work/x.c - then by default 6c stores the full path and then the pcln table in the final binary includes the full path. This makes repeated builds (using different temporary directories) produce different binaries, even if the inputs are the same. In the old 'go tool pack', the P flag specified a prefix to remove from all stored paths (if present), and cmd/go invoked 'go tool pack grcP $WORK' to remove references to the temporary work directory. We've changed the build to avoid pack as much as possible, under the theory that instead of making pack convert from .6 to .a, the tools should just write the .a directly and save a round of I/O. Instead of going back to invoking pack always, define a common flag -trimpath in the assemblers, C compilers, and Go compilers, implemented in liblink, and arrange for cmd/go to use the flag. Then the object files being written out have the shortened paths from the start. While we are here, reimplement pcln support for GOROOT_FINAL. A build in /tmp/go uses GOROOT=/tmp/go, but if GOROOT_FINAL=/usr/local/go is set, then a source file named /tmp/go/x.go is recorded instead as /usr/local/go/x.go. We use this so that we can prepare distributions to be installed in /usr/local/go without actually working in that directory. The conversion to liblink deleted all the old file name handling code, including the GOROOT_FINAL translation. Bring the GOROOT_FINAL translation back. Before this CL, using GOROOT_FINAL=/goroot make.bash: g% strings $(which go) | grep -c $TMPDIR 6 g% strings $(which go) | grep -c $GOROOT 793 g% After this CL: g% strings $(which go) | grep -c $TMPDIR 0 g% strings $(which go) | grep -c $GOROOT 0 g% (The references to $TMPDIR tend to be cgo-generated source files.) Adding the -trimpath flag to the assemblers required converting them to the new Go-semantics flag parser. The text in go1.3.html is copied and adjusted from go1.1.html, which is when we applied that conversion to the compilers and linkers. Fixes issue 6989. LGTM=iant R=r, iant CC=golang-codereviews https://codereview.appspot.com/88300045
* liblink: introduce TLS register on 386 and amd64Russ Cox2014-04-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When I did the original 386 ports on Linux and OS X, I chose to define GS-relative expressions like 4(GS) as relative to the actual thread-local storage base, which was usually GS but might not be (it might be FS, or it might be a different constant offset from GS or FS). The original scope was limited but since then the rewrites have gotten out of control. Sometimes GS is rewritten, sometimes FS. Some ports do other rewrites to enable shared libraries and other linking. At no point in the code is it clear whether you are looking at the real GS/FS or some synthesized thing that will be rewritten. The code manipulating all these is duplicated in many places. The first step to fixing issue 7719 is to make the code intelligible again. This CL adds an explicit TLS pseudo-register to the 386 and amd64. As a register, TLS refers to the thread-local storage base, and it can only be loaded into another register: MOVQ TLS, AX An offset from the thread-local storage base is written off(reg)(TLS*1). Semantically it is off(reg), but the (TLS*1) annotation marks this as indexing from the loaded TLS base. This emits a relocation so that if the linker needs to adjust the offset, it can. For example: MOVQ TLS, AX MOVQ 8(AX)(TLS*1), CX // load m into CX On systems that support direct access to the TLS memory, this pair of instructions can be reduced to a direct TLS memory reference: MOVQ 8(TLS), CX // load m into CX The 2-instruction and 1-instruction forms correspond roughly to ELF TLS initial exec mode and ELF TLS local exec mode, respectively. Liblink applies this rewrite on systems that support the 1-instruction form. The decision is made using only the operating system (and probably the -shared flag, eventually), not the link mode. If some link modes on a particular operating system require the 2-instruction form, then all builds for that operating system will use the 2-instruction form, so that the link mode decision can be delayed to link time. Obviously it is late to be making changes like this, but I despair of correcting issue 7719 and issue 7164 without it. To make sure I am not changing existing behavior, I built a "hello world" program for every GOOS/GOARCH combination we have and then worked to make sure that the rewrite generates exactly the same binaries, byte for byte. There are a handful of TODOs in the code marking kludges to get the byte-for-byte property, but at least now I can explain exactly how each binary is handled. The targets I tested this way are: darwin-386 darwin-amd64 dragonfly-386 dragonfly-amd64 freebsd-386 freebsd-amd64 freebsd-arm linux-386 linux-amd64 linux-arm nacl-386 nacl-amd64p32 netbsd-386 netbsd-amd64 openbsd-386 openbsd-amd64 plan9-386 plan9-amd64 solaris-amd64 windows-386 windows-amd64 There were four exceptions to the byte-for-byte goal: windows-386 and windows-amd64 have a time stamp at bytes 137 and 138 of the header. darwin-386 and plan9-386 have five or six modified bytes in the middle of the Go symbol table, caused by editing comments in runtime/sys_{darwin,plan9}_386.s. Fixes issue 7164. LGTM=iant R=iant, aram, minux.ma, dave CC=golang-codereviews https://codereview.appspot.com/87920043
* cmd/5a, cmd/5c, cmd/6a, cmd/6c, cmd/8a, cmd/8c, cmd/cc: support for Native ↵Dave Cheney2014-02-271-1/+7
| | | | | | | | | | | | | | | | | Client From the original description in CL 15770043 The main change here is to consult $GOARCH. In 6c, when GOOS=nacl, some of the more complex addressing modes must be disabled, and the BP and R15 registers must not be used. See golang.org/s/go13nacl for design overview. LGTM=rsc R=golang-codereviews, gobot, rsc CC=golang-codereviews https://codereview.appspot.com/69020044
* cmd/cc, cmd/gc, cmd/ld: consolidate print format routinesAnthony Martin2014-02-121-0/+7
| | | | | | | | | | | | | | | We now use the %A, %D, %P, and %R routines from liblink across the board. Fixes issue 7178. Fixes issue 7055. LGTM=iant R=golang-codereviews, gobot, rsc, dave, iant, remyoudompheng CC=golang-codereviews https://codereview.appspot.com/49170043 Committer: Russ Cox <rsc@golang.org>
* runtime: faster memclr on x86.Keith Randall2014-02-061-0/+1
| | | | | | | | | | | | | | | | | Use explicit SSE writes instead of REP STOSQ. benchmark old ns/op new ns/op delta BenchmarkMemclr5 22 5 -73.62% BenchmarkMemclr16 27 5 -78.49% BenchmarkMemclr64 28 6 -76.43% BenchmarkMemclr256 34 8 -74.94% BenchmarkMemclr4096 112 84 -24.73% BenchmarkMemclr65536 1902 1920 +0.95% LGTM=dvyukov R=golang-codereviews, dvyukov CC=golang-codereviews https://codereview.appspot.com/60090044
* cmd/cc, cmd/gc: update compilers, assemblers for liblink changesRuss Cox2013-12-162-3/+9
| | | | | | | | | | | | | | | | | | | | | | - add buffered stdout to all tools and provide to link ctxt. - avoid extra \n before ! in .6 files written by assemblers (makes them match the C compilers). - use linkwriteobj instead of linkouthist+linkwritefuncs. - in assemblers and C compilers, record pc explicitly in Prog, for use by liblink. - in C compilers, preserve jump target links. - in Go compilers (gsubr.c) attach gotype directly to corresponding LSym* instead of rederiving from instruction stream. - in Go compilers, emit just one definition for runtime.zerovalue from each compilation. This CL consists entirely of small adjustments. The heavy lifting is in CL 39680043. Each depends on the other. R=golang-dev, dave, iant CC=golang-dev https://codereview.appspot.com/37030045
* cmd/5a, cmd/6a, cmd/8a: fix .y files to match y.tab.[ch]Russ Cox2013-12-111-1/+1
| | | | | | | | | | | | When I renamed LAddr back to Addr (before sending the original linker CLs), I missed the .y files in my global substitute. Since the .y files are only processed when running make in one of those directories (not during all.bash), they were behind the generated files. R=golang-dev, iant CC=golang-dev https://codereview.appspot.com/40770044
* cmd/5a, cmd/6a, cmd/8a: use liblinkRuss Cox2013-12-085-1209/+664
| | | | | | | | | | | Preparation for golang.org/s/go13linker work. This CL does not build by itself. It depends on 35740044 and 35790044 and will be submitted at the same time. R=iant CC=golang-dev https://codereview.appspot.com/35830043
* doc/asm: more about SP, ARM R11Russ Cox2013-11-131-1/+1
| | | | | | | | Also rename URL to /doc/asm. R=golang-dev, minux.ma, r CC=golang-dev https://codereview.appspot.com/26170043
* src/cmd/?a: link to new assembler documentRob Pike2013-11-121-0/+5
| | | | | | | | Blocked on 20930043, the CL the new text references. R=golang-dev, bradfitz CC=golang-dev https://codereview.appspot.com/18430044
* libbio, all cmd: consistently use BGETC/BPUTC instead of Bgetc/BputcDmitriy Vyukov2013-08-301-48/+24
| | | | | | | | | | | | | | | | | | | Also introduce BGET2/4, BPUT2/4 as they are widely used. Slightly improve BGETC/BPUTC implementation. This gives ~5% CPU time improvement on go install -a -p1 std. Before: real user sys 0m23.561s 0m16.625s 0m5.848s 0m23.766s 0m16.624s 0m5.846s 0m23.742s 0m16.621s 0m5.868s after: 0m22.999s 0m15.841s 0m5.889s 0m22.845s 0m15.808s 0m5.850s 0m22.889s 0m15.832s 0m5.848s R=golang-dev, r CC=golang-dev https://codereview.appspot.com/12745047
* runtime: cleanup: use ArgsSizeUnknown to mark all functionsKeith Randall2013-07-193-487/+755
| | | | | | | | | | | | whose argument size is unknown (C vararg functions, and assembly code without an explicit specification). We used to use 0 to mean "unknown" and 1 to mean "zero". Now we use ArgsSizeUnknown (0x80000000) to mean "unknown". R=golang-dev, rsc CC=golang-dev https://codereview.appspot.com/11590043
* cmd/6a, cmd/6l: make FUNCDATA workRuss Cox2013-07-184-547/+593
| | | | | | R=ken2 CC=golang-dev https://codereview.appspot.com/11397043
* cmd/5a, cmd/6a, cmd/8a: parse PCDATARuss Cox2013-07-164-548/+591
| | | | | | | | In cmd/5a, also add support for argument size in TEXT instruction. R=ken2 CC=golang-dev https://codereview.appspot.com/11357044
* cmd/5a, cmd/6a, cmd/8a: fix flag parsingRuss Cox2013-07-121-1/+1
| | | | | | | | | | go tool 6a -$(unicode fffd) was crashing. Fixes issue 5878. R=ken2 CC=golang-dev https://codereview.appspot.com/11208045
* 8a/8l: add PCMPEQB and PMOVMSKB to 386.Keith Randall2013-03-291-0/+2
| | | | | | | | Used by CL 8056043 for fast string equals. R=bradfitz CC=golang-dev https://codereview.appspot.com/8102044
* cmd/ld: emit TLS relocations during external linkingIan Lance Taylor2013-03-273-818/+563
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL was written by rsc. I just tweaked 8l. This CL adds TLS relocation to the ELF .o file we write during external linking, so that the host linker (gcc) can decide the final location of m and g. Similar relocations are not necessary on OS X because we use an alternate program start-time mechanism to acquire thread-local storage. Similar relocations are not necessary on ARM or Plan 9 or Windows because external linking mode is not yet supported on those systems. On almost all ELF systems, the references we use are like %fs:-0x4 or %gs:-0x4, which we write in 6a/8a as -0x4(FS) or -0x4(GS). On Linux/ELF, however, Xen's lack of support for this mode forced us long ago to use a two-instruction sequence: first we load %gs:0x0 into a register r, and then we use -0x4(r). (The ELF program loader arranges that %gs:0x0 contains a regular pointer to that same memory location.) In order to relocate those -0x4(r) references, the linker must know where they are. This CL adds the equivalent notation -0x4(r)(GS*1) for this purpose: it assembles to the same encoding as -0x4(r) but the (GS*1) indicates to the linker that this is one of those thread-local references that needs relocation. Thanks to Elias Naur for reminding me about this missing piece and also for writing the test. R=r CC=golang-dev https://codereview.appspot.com/7891047
* cmd/6a, cmd/8a, cmd/6l, cmd/8l: add AES instructionsKeith Randall2013-03-074-769/+922
| | | | | | | | Instructions for use in AES hashing. See CL#7543043 R=rsc CC=golang-dev https://codereview.appspot.com/7548043
* cmd/godoc: use go/build to determine package and example filesRobert Griesemer2013-02-191-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | Also: - faster code for example extraction - simplify handling of command documentation: all "main" packages are treated as commands - various minor cleanups along the way For commands written in Go, any doc.go file containing documentation must now be part of package main (rather then package documentation), otherwise the documentation won't show up in godoc (it will still build, though). For commands written in C, documentation may still be in doc.go files defining package documentation, but the recommended way is to explicitly ignore those files with a +build ignore constraint to define package main. Fixes issue 4806. R=adg, rsc, dave, bradfitz CC=golang-dev https://codereview.appspot.com/7333046
* cmd/5a, cmd/5c, cmd/6a, cmd/6c, cmd/8a, cmd/8c, cmd/ld: update referenceCarl Shapiro2013-01-181-1/+1
| | | | | | | | | Reference the 80386 compiler documentation now that the documentation for the 68020 is offline. R=golang-dev, minux.ma, rsc CC=golang-dev https://codereview.appspot.com/7127053
* cmd/8a: support XMM registers.R?my Oudompheng2012-12-064-906/+885
| | | | | | R=rsc, golang-dev CC=golang-dev https://codereview.appspot.com/6884046
* cmd/gc, cmd/ld: struct field trackingRuss Cox2012-11-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is an experiment in static analysis of Go programs to understand which struct fields a program might use. It is not part of the Go language specification, it must be enabled explicitly when building the toolchain, and it may be removed at any time. After building the toolchain with GOEXPERIMENT=fieldtrack, a specific field can be marked for tracking by including `go:"track"` in the field tag: package pkg type T struct { F int `go:"track"` G int // untracked } To simplify usage, only named struct types can have tracked fields, and only exported fields can be tracked. The implementation works by making each function begin with a sequence of no-op USEFIELD instructions declaring which tracked fields are accessed by a specific function. After the linker's dead code elimination removes unused functions, the fields referred to by the remaining USEFIELD instructions are the ones reported as used by the binary. The -k option to the linker specifies the fully qualified symbol name (such as my/pkg.list) of a string variable that should be initialized with the field tracking information for the program. The field tracking string is a sequence of lines, each terminated by a \n and describing a single tracked field referred to by the program. Each line is made up of one or more tab-separated fields. The first field is the name of the tracked field, fully qualified, as in "my/pkg.T.F". Subsequent fields give a shortest path of reverse references from that field to a global variable or function, corresponding to one way in which the program might reach that field. A common source of false positives in field tracking is types with large method sets, because a reference to the type descriptor carries with it references to all methods. To address this problem, the CL also introduces a comment annotation //go:nointerface that marks an upcoming method declaration as unavailable for use in satisfying interfaces, both statically and dynamically. Such a method is also invisible to package reflect. Again, all of this is disabled by default. It only turns on if you have GOEXPERIMENT=fieldtrack set during make.bash. R=iant, ken CC=golang-dev http://codereview.appspot.com/6749064
* cmd/8a: add SSE2 instructionsRuss Cox2012-10-074-674/+1034
| | | | | | R=ken CC=golang-dev http://codereview.appspot.com/6614063
* cmd/6l, cmd/8l, cmd/5l: add AUNDEF instructionRuss Cox2012-05-301-0/+1
| | | | | | | | | | | | | | | | | | On 6l and 8l, this is a real instruction, guaranteed to cause an 'undefined instruction' exception. On 5l, we simulate it as BL to address 0. The plan is to use it as a signal to the linker that this point in the instruction stream cannot be reached (hence the changes to nofollow). This will help the compiler explain that panicindex and friends do not return without having to put a list of these functions in the linker. R=ken2 CC=golang-dev http://codereview.appspot.com/6255064
* cmd/6g, cmd/8g: move panicindex calls out of lineRuss Cox2012-05-293-757/+564
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old code generated for a bounds check was CMP JLT ok CALL panicindex ok: ... The new code is (once the linker finishes with it): CMP JGE panic ... panic: CALL panicindex which moves the calls out of line, putting more useful code in each cache line. This matters especially in tight loops, such as in Fannkuch. The benefit is more modest elsewhere, but real. From test/bench/go1, amd64: benchmark old ns/op new ns/op delta BenchmarkBinaryTree17 6096092000 6088808000 -0.12% BenchmarkFannkuch11 6151404000 4020463000 -34.64% BenchmarkGobDecode 28990050 28894630 -0.33% BenchmarkGobEncode 12406310 12136730 -2.17% BenchmarkGzip 179923 179903 -0.01% BenchmarkGunzip 11219 11130 -0.79% BenchmarkJSONEncode 86429350 86515900 +0.10% BenchmarkJSONDecode 334593800 315728400 -5.64% BenchmarkRevcomp25M 1219763000 1180767000 -3.20% BenchmarkTemplate 492947600 483646800 -1.89% And 386: benchmark old ns/op new ns/op delta BenchmarkBinaryTree17 6354902000 6243000000 -1.76% BenchmarkFannkuch11 8043769000 7326965000 -8.91% BenchmarkGobDecode 19010800 18941230 -0.37% BenchmarkGobEncode 14077500 13792460 -2.02% BenchmarkGzip 194087 193619 -0.24% BenchmarkGunzip 12495 12457 -0.30% BenchmarkJSONEncode 125636400 125451400 -0.15% BenchmarkJSONDecode 696648600 685032800 -1.67% BenchmarkRevcomp25M 2058088000 2052545000 -0.27% BenchmarkTemplate 602140000 589876800 -2.04% To implement this, two new instruction forms: JLT target // same as always JLT $0, target // branch expected not taken JLT $1, target // branch expected taken The linker could also emit the prediction prefixes, but it does not: expected taken branches are reversed so that the expected case is not taken (as in example above), and the default expectaton for such a jump is not taken already. R=golang-dev, gri, r, dave CC=golang-dev http://codereview.appspot.com/6248049
* cmd/8a, cmd/8l: add BSWAPLRuss Cox2012-05-221-0/+1
| | | | | | R=ken2 CC=golang-dev http://codereview.appspot.com/6208093
* 8a, 8l: add PREFETCH instructionsRuss Cox2012-04-101-0/+4
| | | | | | R=ken2 CC=golang-dev http://codereview.appspot.com/5992082
* 5a, 6a, 8a: take GOROOT_FINAL into considerationShenghou Ma2012-04-041-0/+32
| | | | | | R=golang-dev, rsc CC=golang-dev http://codereview.appspot.com/5940052
* cmd/*: add -d option to bison.Adam Langley2012-02-211-1/+1
| | | | | | | | Without -d, bison doesn't generate y.tab.h. R=rsc CC=golang-dev http://codereview.appspot.com/5685065
* 8a, 8l: add EMMS instructionEvan Shaw2012-02-171-0/+1
| | | | | | | | R=golang-dev, rsc CC=golang-dev http://codereview.appspot.com/5673081 Committer: Russ Cox <rsc@golang.org>
* 8a, 8l: add LFENCE, MFENCE, SFENCEDarren Elwood2012-02-131-0/+3
| | | | | | | | R=golang-dev, rsc CC=golang-dev http://codereview.appspot.com/5650076 Committer: Russ Cox <rsc@golang.org>
* build: delete make paraphernaliaRuss Cox2012-02-061-20/+5
| | | | | | | | | | As a convenience to people working on the tools, leave Makefiles that invoke the go dist tool appropriately. They are not used during the build. R=golang-dev, bradfitz, n13m3y3r, gustavo CC=golang-dev http://codereview.appspot.com/5636050
* 8a, 8l: implement support for RDTSC instruction.Shenghou Ma2012-02-061-0/+1
| | | | | | | | | | Also modify runtime/asm_386.s to use it. R=rsc CC=golang-dev http://codereview.appspot.com/5634043 Committer: Russ Cox <rsc@golang.org>
* 5a, 6a, 8a, cc: check in y.tab.[ch]Russ Cox2012-02-032-0/+2987
| | | | | | | | This enables builds on systems without Bison/yacc. R=golang-dev, bradfitz CC=golang-dev http://codereview.appspot.com/5622050
* go: move compilers into the go-tool directoryRob Pike2012-01-301-1/+1
| | | | | | | | | | | | Also delete gotest, since it's messy to fix and slated for deletion anyway. A couple of things outside src can't be tested any more. "go test" will be fixed and these tests will be re-enabled. They're noisy for now. Fixes issue 284. R=rsc CC=golang-dev http://codereview.appspot.com/5598049
* 6a, 8a: allow $(-1) for consistency with $1, $(1), $-1.Russ Cox2011-11-111-0/+6
| | | | | | R=ken2 CC=golang-dev http://codereview.appspot.com/5373074
* 8a: fix IMULL grammarRuss Cox2011-11-031-2/+2
| | | | | | R=ken2 CC=golang-dev http://codereview.appspot.com/5298091
* 5a, 5c, 6a, 6c, 8a, 8c: fix Windows file pathsHector Chu2011-09-071-8/+8
| | | | | | | | | | Verified with objdump -W. R=alex.brainman, rsc CC=golang-dev http://codereview.appspot.com/4974061 Committer: Russ Cox <rsc@golang.org>
* runtime, syscall: use the vdso page on linux x86 for faster syscalls instead ↵Yuval Pavel Zholkover2011-08-291-0/+7
| | | | | | | | | | | | | of int $0x80. 8l: fix handling CALL $(constant) code generated by 8a. 8a,8l: add indirect call instruction: CALL *data(SB). R=rsc, iant CC=golang-dev http://codereview.appspot.com/4817054 Committer: Russ Cox <rsc@golang.org>
* 6l, 8l: remove JCXZ; add JCXZW, JCXZL, and JCXZQJaroslavas Po?epko2011-08-261-1/+2
| | | | | | | | R=golang-dev CC=golang-dev, rsc http://codereview.appspot.com/4950050 Committer: Russ Cox <rsc@golang.org>
* runtime: improve Linux mutexDmitriy Vyukov2011-07-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The implementation is hybrid active/passive spin/blocking mutex. The design minimizes amount of context switches and futex calls. The idea is that all critical sections in runtime are intentially small, so pure blocking mutex behaves badly causing a lot of context switches, thread parking/unparking and kernel calls. Note that some synthetic benchmarks become somewhat slower, that's due to increased contention on other data structures, it should not affect programs that do any real work. On 2 x Intel E5620, 8 HT cores, 2.4GHz benchmark old ns/op new ns/op delta BenchmarkSelectContended 521.00 503.00 -3.45% BenchmarkSelectContended-2 661.00 320.00 -51.59% BenchmarkSelectContended-4 1139.00 629.00 -44.78% BenchmarkSelectContended-8 2870.00 878.00 -69.41% BenchmarkSelectContended-16 5276.00 818.00 -84.50% BenchmarkChanContended 112.00 103.00 -8.04% BenchmarkChanContended-2 631.00 174.00 -72.42% BenchmarkChanContended-4 682.00 272.00 -60.12% BenchmarkChanContended-8 1601.00 520.00 -67.52% BenchmarkChanContended-16 3100.00 372.00 -88.00% BenchmarkChanSync 253.00 239.00 -5.53% BenchmarkChanSync-2 5030.00 4648.00 -7.59% BenchmarkChanSync-4 4826.00 4694.00 -2.74% BenchmarkChanSync-8 4778.00 4713.00 -1.36% BenchmarkChanSync-16 5289.00 4710.00 -10.95% BenchmarkChanProdCons0 273.00 254.00 -6.96% BenchmarkChanProdCons0-2 599.00 400.00 -33.22% BenchmarkChanProdCons0-4 1168.00 659.00 -43.58% BenchmarkChanProdCons0-8 2831.00 1057.00 -62.66% BenchmarkChanProdCons0-16 4197.00 1037.00 -75.29% BenchmarkChanProdCons10 150.00 140.00 -6.67% BenchmarkChanProdCons10-2 607.00 268.00 -55.85% BenchmarkChanProdCons10-4 1137.00 404.00 -64.47% BenchmarkChanProdCons10-8 2115.00 828.00 -60.85% BenchmarkChanProdCons10-16 4283.00 855.00 -80.04% BenchmarkChanProdCons100 117.00 110.00 -5.98% BenchmarkChanProdCons100-2 558.00 218.00 -60.93% BenchmarkChanProdCons100-4 722.00 287.00 -60.25% BenchmarkChanProdCons100-8 1840.00 431.00 -76.58% BenchmarkChanProdCons100-16 3394.00 448.00 -86.80% BenchmarkChanProdConsWork0 2014.00 1996.00 -0.89% BenchmarkChanProdConsWork0-2 1207.00 1127.00 -6.63% BenchmarkChanProdConsWork0-4 1913.00 611.00 -68.06% BenchmarkChanProdConsWork0-8 3016.00 949.00 -68.53% BenchmarkChanProdConsWork0-16 4320.00 1154.00 -73.29% BenchmarkChanProdConsWork10 1906.00 1897.00 -0.47% BenchmarkChanProdConsWork10-2 1123.00 1033.00 -8.01% BenchmarkChanProdConsWork10-4 1076.00 571.00 -46.93% BenchmarkChanProdConsWork10-8 2748.00 1096.00 -60.12% BenchmarkChanProdConsWork10-16 4600.00 1105.00 -75.98% BenchmarkChanProdConsWork100 1884.00 1852.00 -1.70% BenchmarkChanProdConsWork100-2 1235.00 1146.00 -7.21% BenchmarkChanProdConsWork100-4 1217.00 619.00 -49.14% BenchmarkChanProdConsWork100-8 1534.00 509.00 -66.82% BenchmarkChanProdConsWork100-16 4126.00 918.00 -77.75% BenchmarkSyscall 34.40 33.30 -3.20% BenchmarkSyscall-2 160.00 121.00 -24.38% BenchmarkSyscall-4 131.00 136.00 +3.82% BenchmarkSyscall-8 139.00 131.00 -5.76% BenchmarkSyscall-16 161.00 168.00 +4.35% BenchmarkSyscallWork 950.00 950.00 +0.00% BenchmarkSyscallWork-2 481.00 480.00 -0.21% BenchmarkSyscallWork-4 268.00 270.00 +0.75% BenchmarkSyscallWork-8 156.00 169.00 +8.33% BenchmarkSyscallWork-16 188.00 184.00 -2.13% BenchmarkSemaSyntNonblock 36.40 35.60 -2.20% BenchmarkSemaSyntNonblock-2 81.40 45.10 -44.59% BenchmarkSemaSyntNonblock-4 126.00 108.00 -14.29% BenchmarkSemaSyntNonblock-8 112.00 112.00 +0.00% BenchmarkSemaSyntNonblock-16 110.00 112.00 +1.82% BenchmarkSemaSyntBlock 35.30 35.30 +0.00% BenchmarkSemaSyntBlock-2 118.00 124.00 +5.08% BenchmarkSemaSyntBlock-4 105.00 108.00 +2.86% BenchmarkSemaSyntBlock-8 101.00 111.00 +9.90% BenchmarkSemaSyntBlock-16 112.00 118.00 +5.36% BenchmarkSemaWorkNonblock 810.00 811.00 +0.12% BenchmarkSemaWorkNonblock-2 476.00 414.00 -13.03% BenchmarkSemaWorkNonblock-4 238.00 228.00 -4.20% BenchmarkSemaWorkNonblock-8 140.00 126.00 -10.00% BenchmarkSemaWorkNonblock-16 117.00 116.00 -0.85% BenchmarkSemaWorkBlock 810.00 811.00 +0.12% BenchmarkSemaWorkBlock-2 454.00 466.00 +2.64% BenchmarkSemaWorkBlock-4 243.00 241.00 -0.82% BenchmarkSemaWorkBlock-8 145.00 137.00 -5.52% BenchmarkSemaWorkBlock-16 132.00 123.00 -6.82% BenchmarkContendedSemaphore 123.00 102.00 -17.07% BenchmarkContendedSemaphore-2 34.80 34.90 +0.29% BenchmarkContendedSemaphore-4 34.70 34.80 +0.29% BenchmarkContendedSemaphore-8 34.70 34.70 +0.00% BenchmarkContendedSemaphore-16 34.80 34.70 -0.29% BenchmarkMutex 26.80 26.00 -2.99% BenchmarkMutex-2 108.00 45.20 -58.15% BenchmarkMutex-4 103.00 127.00 +23.30% BenchmarkMutex-8 109.00 147.00 +34.86% BenchmarkMutex-16 102.00 152.00 +49.02% BenchmarkMutexSlack 27.00 26.90 -0.37% BenchmarkMutexSlack-2 149.00 165.00 +10.74% BenchmarkMutexSlack-4 121.00 209.00 +72.73% BenchmarkMutexSlack-8 101.00 158.00 +56.44% BenchmarkMutexSlack-16 97.00 129.00 +32.99% BenchmarkMutexWork 792.00 794.00 +0.25% BenchmarkMutexWork-2 407.00 409.00 +0.49% BenchmarkMutexWork-4 220.00 209.00 -5.00% BenchmarkMutexWork-8 267.00 160.00 -40.07% BenchmarkMutexWork-16 315.00 300.00 -4.76% BenchmarkMutexWorkSlack 792.00 793.00 +0.13% BenchmarkMutexWorkSlack-2 406.00 404.00 -0.49% BenchmarkMutexWorkSlack-4 225.00 212.00 -5.78% BenchmarkMutexWorkSlack-8 268.00 136.00 -49.25% BenchmarkMutexWorkSlack-16 300.00 300.00 +0.00% BenchmarkRWMutexWrite100 27.10 27.00 -0.37% BenchmarkRWMutexWrite100-2 33.10 40.80 +23.26% BenchmarkRWMutexWrite100-4 113.00 88.10 -22.04% BenchmarkRWMutexWrite100-8 119.00 95.30 -19.92% BenchmarkRWMutexWrite100-16 148.00 109.00 -26.35% BenchmarkRWMutexWrite10 29.60 29.40 -0.68% BenchmarkRWMutexWrite10-2 111.00 61.40 -44.68% BenchmarkRWMutexWrite10-4 270.00 208.00 -22.96% BenchmarkRWMutexWrite10-8 204.00 185.00 -9.31% BenchmarkRWMutexWrite10-16 261.00 190.00 -27.20% BenchmarkRWMutexWorkWrite100 1040.00 1036.00 -0.38% BenchmarkRWMutexWorkWrite100-2 593.00 580.00 -2.19% BenchmarkRWMutexWorkWrite100-4 470.00 365.00 -22.34% BenchmarkRWMutexWorkWrite100-8 468.00 289.00 -38.25% BenchmarkRWMutexWorkWrite100-16 604.00 374.00 -38.08% BenchmarkRWMutexWorkWrite10 951.00 951.00 +0.00% BenchmarkRWMutexWorkWrite10-2 1001.00 928.00 -7.29% BenchmarkRWMutexWorkWrite10-4 1555.00 1006.00 -35.31% BenchmarkRWMutexWorkWrite10-8 2085.00 1171.00 -43.84% BenchmarkRWMutexWorkWrite10-16 2082.00 1614.00 -22.48% R=rsc, iant, msolo, fw, iant CC=golang-dev http://codereview.appspot.com/4711045 Committer: Russ Cox <rsc@golang.org>
* 8a: fixes for Plan 9 buildLucio De Re2011-06-273-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 8a/a.h: . Removed <u.h> and <libc.h> includes as they work better in "a.y". . Made definition of EOF conditional as it's defined in the Plan 9 header files, but not elsewhere. 8a/a.y: . Added <u.h> and <libc.h> because <stdio.h> in Plan 9 needs them. Sequence <u.h>, <stdio.h>, <libc.h> recommended by RSC. 8a/lex.c: . Added <u.h> and <libc.h> as now needed by "a.h". . Dropped <ctype.h>. cc/lexbody: . exit() -> exits(). . Dropped unwanted incrementation. cc/macbody: . Adjusted a few format specifications. R=rsc CC=golang-dev http://codereview.appspot.com/4644047 Committer: Russ Cox <rsc@golang.org>
* 8a: delete dreg l.sRob Pike2011-06-201-734/+0
| | | | | | R=golang-dev, adg CC=golang-dev http://codereview.appspot.com/4631053
* 5a, 6a, 8a, cc: remove old environment variablesRuss Cox2011-05-021-49/+4
| | | | | | | | | Uses of $INCLUDE and $NPROC are left over from Plan 9. Remove them to avoid causing confusion. R=golang-dev, r2 CC=golang-dev http://codereview.appspot.com/4445079
* 8a, 8l: add CMPXCHG8B, XADDB, XADDL, XADDWRuss Cox2011-02-251-0/+4
| | | | | | R=ken2 CC=golang-dev http://codereview.appspot.com/4240041