1
0
mirror of https://github.com/golang/go synced 2024-10-04 10:21:21 -06:00
go/src/cmd
Russ Cox 24c8035fbe cmd/6g: move opt instruction decode into common function
Add new proginfo function that returns information about a
Prog*. The information includes various instruction
description bits as well as a list of required registers set
and used and indexing registers used.

Convert the large instruction switches to use proginfo.

This information was formerly duplicated in multiple
optimization passes, inconsistently. For example, the
information about which registers an instruction requires
appeared three times for most instructions.

Most of the switches were incomplete or incorrect in some way.
For example, the switch in copyu did not list cases for INCB,
JPS, MOVAPD, MOVBWSX, MOVBWZX, PCDATA, POPQ, PUSHQ, STD,
TESTB, TESTQ, and XCHGL. Those were all falling into the
"unknown instruction" default case and stopping the rewrite,
perhaps unnecessarily. Similarly, the switch in needc only
listed a handful of the instructions that use or set the carry bit.

We still need to decide whether to use proginfo to generalize
a few of the remaining smaller switches in peep.c.

If this goes well, we'll make similar changes in 8g and 5g.

R=ken2
CC=golang-dev
https://golang.org/cl/12637051
2013-08-11 21:46:38 -04:00
..
5a runtime: cleanup: use ArgsSizeUnknown to mark all functions 2013-07-19 11:19:18 -07:00
5c cmd/5c, cmd/5g, cmd/5l: turn MOVB, MOVH into plain moves, optimize short arithmetic. 2013-08-09 06:43:17 +02:00
5g cmd/gc: zero pointers on entry to function 2013-08-09 23:10:58 -04:00
5l cmd/5c, cmd/5g, cmd/5l: turn MOVB, MOVH into plain moves, optimize short arithmetic. 2013-08-09 06:43:17 +02:00
6a runtime: cleanup: use ArgsSizeUnknown to mark all functions 2013-07-19 11:19:18 -07:00
6c runtime: use funcdata to supply garbage collection information 2013-07-19 16:04:09 -04:00
6g cmd/6g: move opt instruction decode into common function 2013-08-11 21:46:38 -04:00
6l cmd/ld: Put the textflag constants in a separate file. 2013-08-07 10:23:24 -07:00
8a runtime: cleanup: use ArgsSizeUnknown to mark all functions 2013-07-19 11:19:18 -07:00
8c runtime: use funcdata to supply garbage collection information 2013-07-19 16:04:09 -04:00
8g cmd/gc: zero pointers on entry to function 2013-08-09 23:10:58 -04:00
8l cmd/ld: Put the textflag constants in a separate file. 2013-08-07 10:23:24 -07:00
addr2line libmach: update for Go 1.2 pcln table 2013-07-18 10:12:28 -04:00
api cmd/api: eliminate duplicate package import work 2013-08-09 18:44:00 -04:00
cc cmd/cc, cmd/gc, runtime: Uniquely encode iface and eface pointers in the pointer map. 2013-08-09 16:48:12 -07:00
cgo build: on OS X 10.8 and later, use clang instead of gcc 2013-08-02 14:58:27 -04:00
dist cmd/dist: generate cmd/cgo/zdefaultcc.go on windows (fixes windows build) 2013-08-03 18:32:14 +10:00
fix cmd/fix: remove obsolete testdata. 2013-06-02 15:40:32 +02:00
gc cmd/gc: zero pointers on entry to function 2013-08-09 23:10:58 -04:00
go cmd/go: cgo programs depend on syscall 2013-08-09 09:03:25 -04:00
gofmt go/parser: ParseExpr must accept type expressions 2013-04-03 07:41:26 -07:00
ld cmd/ld: Put the textflag constants in a separate file. 2013-08-07 10:23:24 -07:00
nm cmd/nm: don't add filename elements for m symbols 2013-04-03 18:23:43 -07:00
objdump runtime/pprof: support OS X CPU profiling 2012-02-28 16:18:24 -05:00
pack cmd/pack: support removing of leading file prefix on windows 2013-07-26 16:56:24 +10:00
prof all: clean up C function prototypes 2013-02-26 09:51:33 -08:00
yacc all: fix typos 2013-06-09 21:50:24 +08:00