Skip to content

Commit

Permalink
all: merge dev.cc (a91c2e0) into master
Browse files Browse the repository at this point in the history
This change deletes the C implementations of
the Go compiler and assembler from the master branch.

The Go implementations are a bit slower right now,
due mainly to garbage generated by taking addresses
of stack variables all over the place (it was C code,
after all). That will be cleaned up (mechanically) over the
next week or so, and things will get faster.

Change-Id: I66b2b3477aec8835f9960d0798f5752dcd98d08f
  • Loading branch information
rsc committed Feb 23, 2015
2 parents bceb18e + a91c2e0 commit b986f3e
Show file tree
Hide file tree
Showing 346 changed files with 129,643 additions and 93,009 deletions.
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,14 @@ misc/cgo/life/run.out
misc/cgo/stdio/run.out
misc/cgo/testso/main
misc/dashboard/builder/builder
src/cmd/?a/y.output
src/liblink/anames?.c
src/cmd/cc/y.output
src/cmd/*/y.output
src/cmd/cgo/zdefaultcc.go
src/cmd/dist/dist.dSYM
src/cmd/gc/mkbuiltin1
src/cmd/gc/opnames.h
src/cmd/gc/y.output
src/cmd/go/zdefaultcc.go
src/cmd/internal/obj/zbootstrap.go
src/go/doc/headscan
src/runtime/mkversion
src/runtime/zaexperiment.h
Expand Down
19 changes: 19 additions & 0 deletions doc/go1.5.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ testing/quick: support generation of arrays (https://golang.org/cl/3865)

Tools:

cmd/go: std wildcard now excludes commands in main repo (https://golang.org/cl/5550)
cmd/vet: better validation of struct tags (https://golang.org/cl/2685)
cmd/ld: no longer record build timestamp in Windows PE file header (https://golang.org/cl/3740)

Expand All @@ -34,3 +35,21 @@ strconv: optimize decimal to string conversion (https://golang.org/cl/2105)
math/big: faster assembly kernels for amd64 and 386 (https://golang.org/cl/2503, https://golang.org/cl/2560)
math/big: faster "pure Go" kernels for platforms w/o assembly kernels (https://golang.org/cl/2480)

Assembler:

ARM assembly syntax has had some features removed.

- 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.

Also expression evaluation now uses uint64s instead of signed integers and the
precedence of operators is now Go-like rather than C-like.
2 changes: 2 additions & 0 deletions include/libc.h
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,8 @@ extern char* getgoversion(void);
extern char* getgoarm(void);
extern char* getgo386(void);
extern char* getgoextlinkenabled(void);
extern char* getgohostos(void);
extern char* getgohostarch(void);

extern char* mktempdir(void);
extern void removeall(char*);
Expand Down
3 changes: 3 additions & 0 deletions include/link.h
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ struct Prog
uchar ft; // oclass cache
uchar tt; // oclass cache
uchar isize; // amd64, 386
uchar printed;

char width; /* fake for DATA */
char mode; /* 16, 32, or 64 in 6l, 8l; internal use in 5g, 6g, 8g */
Expand Down Expand Up @@ -303,6 +304,7 @@ struct LSym
uchar localentry; // ppc64: instrs between global & local entry
uchar seenglobl;
uchar onlist; // on the textp or datap lists
uchar printed;
int16 symid; // for writing .5/.6/.8 files
int32 dynid;
int32 sig;
Expand Down Expand Up @@ -458,6 +460,7 @@ struct Hist
char* name;
int32 line;
int32 offset;
uchar printed;
};

struct Plist
Expand Down
4 changes: 4 additions & 0 deletions include/plan9/libc.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ char* getgoversion(void);
char* getgoarm(void);
char* getgo386(void);
char* getgoextlinkenabled(void);
char* getgohostos(void);
char* getgohostarch(void);

int runcmd(char**);

void flagcount(char*, char*, int*);
void flagint32(char*, char*, int32*);
Expand Down
2 changes: 1 addition & 1 deletion misc/cgo/test/issue9400/asm_arm.s
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "textflag.h"

TEXT cas<>(SB),NOSPLIT,$0
MOVW $0xffff0fc0, PC
MOVW $0xffff0fc0, R15 // R15 is PC

TEXT ·RewindAndSetgid(SB),NOSPLIT,$-4-0
// Save link register
Expand Down
14 changes: 14 additions & 0 deletions misc/nacl/testzip.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,23 @@ usr src=../misc/nacl/testdata
go src=..
src
cmd
asm
internal
asm
testdata
+
internal
objfile
objfile.go
rsc.io
arm
armasm
testdata
+
x86
x86asm
testdata
+
gofmt
gofmt.go
gofmt_test.go
Expand Down
10 changes: 0 additions & 10 deletions src/cmd/5a/Makefile

This file was deleted.

173 changes: 0 additions & 173 deletions src/cmd/5a/a.h

This file was deleted.

Loading

0 comments on commit b986f3e

Please sign in to comment.