| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This CL introduces a FUNCDATA number for runtime-specific
garbage collection metadata, changes the C and Go compilers
to emit that metadata, and changes the runtime to expect it.
The old pseudo-instructions that carried this information
are gone, as is the linker code to process them.
R=golang-dev, dvyukov, cshapiro
CC=golang-dev
https://codereview.appspot.com/11406044
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
R=ken2
CC=golang-dev
https://codereview.appspot.com/11364043
|
|
|
|
|
|
| |
R=golang-dev, bradfitz, khr, r
CC=golang-dev
https://codereview.appspot.com/7461046
|
|
|
|
|
|
|
|
| |
Already fixed independently in Plan 9.
R=ken2
CC=golang-dev
https://codereview.appspot.com/10041044
|
|
|
|
|
|
|
|
| |
Fixes issue 5419.
R=golang-dev, dave, minux.ma, rsc
CC=golang-dev
https://codereview.appspot.com/9241044
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On amd64
benchmark old ns/op new ns/op delta
BenchmarkHashStringSpeed 91 74 -18.49%
BenchmarkHashInt32Speed 54 45 -17.88%
BenchmarkHashInt64Speed 76 58 -23.53%
BenchmarkHashStringArraySpeed 231 188 -18.61%
Fixes issue 5367.
R=golang-dev, iant, dave, daniel.morsing, ality, rsc
CC=golang-dev
https://codereview.appspot.com/9040043
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes issue 5085.
{6,8}c/swt.c allocates a third Biobuf in automatic memory which is not terminated at the end of the function. This causes the buffer to be 'in use' when the batexit handler fires, confusing valgrind.
Huge thanks to DMorsing for the diagnosis.
R=golang-dev, daniel.morsing, rsc
CC=golang-dev
https://codereview.appspot.com/7844044
|
|
|
|
|
|
|
|
|
|
| |
Switch to new pragma names, but leave old ones available for now.
Merge the three cgo-related sections in the .6 files into a single
cgo section.
R=golang-dev, iant, ality
CC=golang-dev
https://codereview.appspot.com/7424048
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
copy+paste error while cleaning up CL 7303099 before submit
R=ken2
CC=golang-dev
https://codereview.appspot.com/7308104
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The routine that adds an automatic to the stack was
adding ptrsize-1 to the size before rounding up.
That addition would only make sense to turn a round down
into a round up. Before a round up, it just wastes a word.
The effect was that a 6c function with one local and
one two-word function call used (8+8)+(16+8) = 40 bytes
instead of 8+16 = 24 bytes.
The wasted space mostly didn't matter, but one place where
it does matter is when trying to stay within the 128-byte
total frame constraint for #pragma textflag 7 functions.
This only affects the C compilers, not the Go compilers.
5c already had correct code, which is now copied to 6c and 8c.
R=ken2
CC=golang-dev
https://codereview.appspot.com/7303099
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Added the -pic flag to 6c and 6g to avoid assembler instructions that
cannot?use RIP-relative adressing. This is needed to support the -shared mode
in 6l.
See also:
https://codereview.appspot.com/6926049
https://codereview.appspot.com/6822078
R=golang-dev, rsc
CC=golang-dev
https://codereview.appspot.com/7064048
Committer: Russ Cox <rsc@golang.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The FmtLong flag should only be used with the %D verb
when printing an ATEXT Prog. It was erroneously used
for every Prog except ADATA. This caused a preponderance
of exclamation points, "!!", in the assembly listings.
I also cleaned up the code so that the list.c files look
very similar. Now the real differences are easily spotted
with a simple diff.
R=golang-dev, rsc
CC=golang-dev
https://codereview.appspot.com/7128045
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For simplicity, only recognizes expressions of the exact form
"(x << a) | (x >> b)" where x is a variable and a and b are
integer constant expressions that add to x's bit width.
Fixes issue 4629.
$ cat rotate.c
unsigned int
rotate(unsigned int x)
{
x = (x << 3) | (x >> (sizeof(x) * 8 - 3));
return x;
}
## BEFORE
$ go tool 6c -S rotate.c
(rotate.c:2) TEXT rotate+0(SB),$0-8
(rotate.c:2) MOVL x+0(FP),!!DX
(rotate.c:4) MOVL DX,!!AX
(rotate.c:4) SALL $3,!!AX
(rotate.c:4) MOVL DX,!!CX
(rotate.c:4) SHRL $29,!!CX
(rotate.c:4) ORL CX,!!AX
(rotate.c:5) RET ,!!
(rotate.c:5) RET ,!!
(rotate.c:5) END ,!!
## AFTER
$ go tool 6c -S rotate.c
(rotate.c:2) TEXT rotate+0(SB),$0-8
(rotate.c:4) MOVL x+0(FP),!!AX
(rotate.c:4) ROLL $3,!!AX
(rotate.c:5) RET ,!!
(rotate.c:5) RET ,!!
(rotate.c:5) END ,!!
R=rsc, minux.ma
CC=golang-dev
https://codereview.appspot.com/7069056
Committer: Russ Cox <rsc@golang.org>
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Update issue 4629.
$ cat shift2.c
unsigned int
shift(unsigned int x, unsigned int y)
{
x = (x << 3);
y = (y << 5);
x = (x << 7);
y = (y << 9);
return x ^ y;
}
## BEFORE
$ go tool 6c -S shift2.c
(shift2.c:2) TEXT shift+0(SB),$0-8
(shift2.c:4) MOVL x+0(FP),!!AX
(shift2.c:4) SALL $3,!!AX
(shift2.c:4) MOVL AX,!!DX
(shift2.c:5) MOVL y+4(FP),!!AX
(shift2.c:5) SALL $5,!!AX
(shift2.c:5) MOVL AX,!!CX
(shift2.c:6) MOVL DX,!!AX
(shift2.c:6) SALL $7,!!AX
(shift2.c:6) MOVL AX,!!DX
(shift2.c:7) MOVL CX,!!AX
(shift2.c:7) SALL $9,!!AX
(shift2.c:7) MOVL AX,!!CX
(shift2.c:8) MOVL DX,!!AX
(shift2.c:8) XORL CX,!!AX
(shift2.c:8) RET ,!!
(shift2.c:8) RET ,!!
(shift2.c:8) END ,!!
## AFTER
$ go tool 6c -S shift2.c
(shift2.c:2) TEXT shift+0(SB),$0-8
(shift2.c:4) MOVL x+0(FP),!!AX
(shift2.c:4) SALL $3,!!AX
(shift2.c:5) MOVL y+4(FP),!!CX
(shift2.c:5) SALL $5,!!CX
(shift2.c:6) SALL $7,!!AX
(shift2.c:7) SALL $9,!!CX
(shift2.c:8) XORL CX,!!AX
(shift2.c:8) RET ,!!
(shift2.c:8) RET ,!!
(shift2.c:8) END ,!!
R=rsc, minux.ma, dave, nigeltao
CC=golang-dev
https://codereview.appspot.com/7066055
Committer: Russ Cox <rsc@golang.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The fixjmp step eliminates redundant chains of JMP
instructions that are produced by the compiler during
code generation.
It is already implemented in gc, and can be adapted to 6c/8c with
the exception that JMPs refer to destination by pc instead of by
pointer. The algorithm is modified to operate on Regs instead of Progs
for this reason. The pcs are already restored later by regopt.
R=goalng-dev, rsc
CC=golang-dev
https://codereview.appspot.com/6865046
|
|
|
|
|
|
|
|
|
|
|
| |
On ARM, char is unsigned, and the code generation for
multiplication gets totally broken.
Fixes issue 4354.
R=golang-dev, dave, minux.ma, rsc
CC=golang-dev
http://codereview.appspot.com/6826079
|
|
|
|
|
|
| |
R=golang-dev, rsc, dave
CC=golang-dev
http://codereview.appspot.com/6569044
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some newer Linux distributions (Ubuntu ARM at least) use a new multiarch
directory organization, where dynamic linker is no longer in the hardcoded
path in our linker.
For example, Ubuntu 12.04 ARM hardfloat places its dynamic linker at
/lib/arm-linux-gnueabihf/ld-linux.so.3
Ref: http://lackof.org/taggart/hacking/multiarch/
Also, to support Debian GNU/kFreeBSD as a FreeBSD variant, we need this capability, so it's part of issue 3533.
This CL add a new pragma (#pragma dynlinker "path") to cc.
R=iant, rsc
CC=golang-dev
http://codereview.appspot.com/6086043
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This makes it possible to inline the prefetch of upcoming
memory addresses during garbage collection, instead of
needing to flush registers, make a function call, and
reload registers. On garbage collection-heavy workloads,
this results in a 5% speedup.
Fixes issue 3493.
R=dvyukov, ken, r, dave
CC=golang-dev
http://codereview.appspot.com/5990066
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Without an explicit signal for a truncation, copy propagation
will sometimes propagate a 32-bit truncation and end up
overwriting uses of the original 64-bit value.
The case that arose in practice is in C but I believe
that the same could plausibly happen in Go.
The main reason we didn't run into the same in Go
is that I (perhaps incorrectly?) drop MOVL AX, AX
during gins, so the truncation was never generated, so
it didn't confuse the optimizer.
Fixes issue 1315.
Fixes issue 3488.
R=ken2
CC=golang-dev
http://codereview.appspot.com/6002043
|
|
|
|
|
|
|
|
| |
This is a pointer being copied; MOVL can't possibly be right.
R=ken2
CC=golang-dev
http://codereview.appspot.com/5999043
|
|
|
|
|
|
| |
R=golang-dev, rsc
CC=golang-dev
http://codereview.appspot.com/5936050
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
cc: add #pragma textflag to set it
runtime: mark mheap to go into noptr-bss.
remove special case in garbage collector
Remove the ARM from.flag field created by CL 5687044.
The DUPOK flag was already in p->reg, so keep using that.
Otherwise test/nilptr.go creates a very large binary.
Should fix the arm build.
Diagnosed by minux.ma; replacement for CL 5690044.
R=golang-dev, minux.ma, r
CC=golang-dev
http://codereview.appspot.com/5686060
|
|
|
|
|
|
|
|
|
|
| |
CL 5666043 fixed the same checking for 5g.
R=golang-dev, rsc
CC=golang-dev
http://codereview.appspot.com/5666045
Committer: Russ Cox <rsc@golang.org>
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
This can happen on Plan 9 if we we're building
with the 32-bit and 64-bit host compilers, one
after the other.
R=rsc
CC=golang-dev
http://codereview.appspot.com/5599053
|
|
|
|
|
|
|
|
|
| |
On Plan 9 this flag is used to discover
constant expressions in "if" statements.
R=golang-dev, rsc
CC=golang-dev
http://codereview.appspot.com/5601060
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
R=ken2
CC=golang-dev
http://codereview.appspot.com/5569071
|
|
|
|
|
|
|
|
|
|
| |
For real this time. :-)
R=rsc, ken
CC=golang-dev
http://codereview.appspot.com/5486061
Committer: Russ Cox <rsc@golang.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Change the name of cas() in cc to newcase() to avoid a NIX conflict.
cas() is used in cc to create a new Case struct. There is a name
conflict in that cas() is a commonly-used
name for compare and swap. Since cas() is only used internally
in the compiler in 3 places, change the name to avoid a wider
conflict with the NIX runtime. This issue might well come up on
other OSes in the future anyway, as the name is fairly common.
R=rsc
CC=golang-dev
http://codereview.appspot.com/5294071
Committer: Russ Cox <rsc@golang.org>
|
|
|
|
|
|
|
|
|
|
| |
Verified with objdump -W.
R=alex.brainman, rsc
CC=golang-dev
http://codereview.appspot.com/4974061
Committer: Russ Cox <rsc@golang.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
src/cmd/5c/reg.c:
. Added USED() attribute.
src/cmd/6c/cgen.c:
. Revised code around "REGARG" to resemble use in "8c" and
consequently remove a warning.
src/cmd/6l/asm.c:
. Added USED() attributes.
. Removed an unnecessary assignment.
R=golang-dev
CC=golang-dev, rsc
http://codereview.appspot.com/4836045
Committer: Russ Cox <rsc@golang.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
6a/a.h:
. Dropped <u.h> and <libc.h>.
. Made definition of EOF conditional.
6a/a.y:
. Added <u.h> and <libc.h>.
6a/lex.c:
. Added <u.h> and <libc.h>.
. Dropped <ctype.h> (now in <u.h>).
6c/gc.h:
. Added varargck pragma for "lD".
6c/swt.c:
. Dropped unused "thestring" argument in Bprint() calls.
6l/Makefile:
. Dropped unneeded directory prefix.
6l/l.h:
. Dropped unneeded directory prefix.
. Added varargck pragma for "I" and "i".
6l/obj.c:
. Dropped unneeded assignment.
. Dropped unreachable goto statement.
6l/pass.c:
. Dropped assignments flagged as unused.
6l/prof.c:
. Replaced "#if 0" with "#ifdef NOTDEF".
6l/span.c:
. Dropped unused incrementation.
. Added USED() as required.
. Dropped unreachable "return" statement.
R=golang-dev
CC=golang-dev, rsc
http://codereview.appspot.com/4747044
Committer: Russ Cox <rsc@golang.org>
|
|
|
|
|
|
| |
R=ken2
CC=golang-dev
http://codereview.appspot.com/4668049
|
|
|
|
|
|
|
|
| |
R=golang-dev, r, r
CC=golang-dev
http://codereview.appspot.com/4648043
Committer: Rob Pike <r@golang.org>
|
|
|
|
|
|
|
|
| |
Better to fix the warnings that we find.
R=iant
CC=golang-dev
http://codereview.appspot.com/4406042
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The object files begin with a header that is
$GOARCH
on a line by itself. This CL changes that header to
go object $GOOS $GOARCH release.2011-01-01 4567+
where the final two fields are the most recent release
tag and the current hg version number.
All objects imported into a Go compilation or linked into an
executable must have the same header line, and that header
line must match the compiler and linker versions.
The effect of this will be that if you update and run all.bash
and then try to link in objects compiled with an earlier version
of the compiler (or invoke the wrong version of the compiler),
you will get an error showing the different headers instead
of perhaps silent incompatibility.
Normal usage with all.bash should be unaffected, because
all.bash deletes all the object files in $GOROOT/pkg/$GOOS_$GOARCH
and cleans all intermediate object files before starting.
This change is intended to diagnose stale objects arising when
users maintaining alternate installation directories forget to
rebuild some of their files after updating.
It should help make the adoption of $GOPATH (CL 3780043)
less error-prone.
R=ken2, r
CC=golang-dev
http://codereview.appspot.com/4023063
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
cc: same
runtime: test cc alignment (required moving #define of offsetof to runtime.h)
fix bug260
Fixes issue 482.
Fixes issue 609.
R=ken2, r
CC=golang-dev
http://codereview.appspot.com/3563042
|
|
|
|
|
|
|
|
|
|
| |
This makes it much easier to use a tool like Swig which needs
to run either 8c or 6c on generated code which #include's
"runtime.h".
R=ken2, rsc
CC=golang-dev
http://codereview.appspot.com/3205041
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The Plan 9 tools assume that long is 32 bits.
We converted all instances of long to int32 when
importing the code but missed the print formats.
Because int32 is always int on the compilers we use,
it is never correct to use %lux, %ld, etc. Convert to %ux, %d, etc.
(It matters because on 64-bit gcc, long is 64 bits,
so we were printing 32-bit quantities with 64-bit formats.)
R=ken2
CC=golang-dev
http://codereview.appspot.com/2491041
|
|
|
|
|
|
| |
R=ken2
CC=golang-dev
http://codereview.appspot.com/2107047
|
|
|
|
|
|
| |
R=r
CC=golang-dev
http://codereview.appspot.com/1982049
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Returns R14 and R15 to the available register pool.
Plays more nicely with ELF ABI C code.
In particular, our signal handlers will no longer crash
when a signal arrives during execution of a cgo C call.
Fixes issue 720.
R=ken2, r
CC=golang-dev
http://codereview.appspot.com/1847051
|
|
|
|
|
|
| |
R=rsc
CC=golang-dev
http://codereview.appspot.com/778041
|
|
|
|
|
|
| |
R=rsc
CC=golang-dev
http://codereview.appspot.com/661043
|
|
|
|
|
|
|
|
| |
Cgo users will need to rerun cgo.
R=rsc
CC=golang-dev
http://codereview.appspot.com/692041
|