Commit Graph

26 Commits

Author SHA1 Message Date
Michael McLoughlin
284ee13ada build: support comments in functions (#41) 2019-01-11 10:33:41 -08:00
Michael McLoughlin
0f63e0906d ast: move "ast" types from root to ir sub-package
Closes #32
2019-01-06 14:21:10 -08:00
Michael McLoughlin
07901bb91b build: return ErrorList type
Adds a very similar interface to go/scanner package for returning a list
of errors.

Updates #34
2019-01-06 13:32:09 -08:00
Michael McLoughlin
602bb5197c build: unify Label function signatures
The Context.Label method and LABEL global function did not agree. Also
breaks the convention I'd like to set that capitalized functions must
agree with existing Go assembly syntax.

To help avoid a conflict with `avo.Label`, attributes were moved to
their own package.

Fixes #35
2019-01-05 18:18:49 -08:00
Michael McLoughlin
816cf06a08 pass: doc exported symbols (#9) 2019-01-04 20:00:22 -08:00
Michael McLoughlin
672b77a441 reg,build: remove "v" from virtual register ctors
Fixes #30
2019-01-04 18:23:44 -08:00
Michael McLoughlin
c79a926930 lint: enable some more linters 2018-12-31 11:01:50 -08:00
Michael McLoughlin
c62e40f8d2 pass: add textflags.h if required
Closes #12
2018-12-31 00:23:27 -08:00
Michael McLoughlin
18cdf50d7c reg: support for register casting
Adds methods for referencing sub- or super-registers. For example, for
general purpose registers you can now reference As8(), As16(), ... and
for vector AsX(), AsY(), AsZ().

Closes #1
2018-12-30 18:40:45 -08:00
Michael McLoughlin
a1440c51a4 pass: some basic allocator test cases 2018-12-28 15:48:37 -08:00
Michael McLoughlin
d29c6340d7 ast: change file to have a list of sections 2018-12-26 18:58:12 -08:00
Michael McLoughlin
abd300c0e9 operand: const types 2018-12-26 16:42:39 -08:00
Michael McLoughlin
b3644ec7fc pass: tweak ordering in liveness analysis
Previously we updated the set of live in registers before live out. This
was extremely inefficient, since on each pass through live in depends on
live out.

We also change to processing the instructions in reverse order, which is
more likely to be efficient, although we should replace this with
topological sort order soon.
2018-12-24 12:48:29 -08:00
Michael McLoughlin
c70c642ddb attempt to make register allocation deterministic 2018-12-13 00:34:44 -08:00
Michael McLoughlin
93b53377ac add fnv1a example 2018-12-13 00:18:44 -08:00
Michael McLoughlin
b89d211ff4 examples/complex: and bugfixes 2018-12-12 00:02:22 -08:00
Michael McLoughlin
c882e52510 printing: commit some refactors (probably broken) 2018-12-11 00:18:22 -08:00
Michael McLoughlin
20525e1437 get the basic add example working 2018-12-08 22:02:02 -08:00
Michael McLoughlin
fa18d7229f address some lint 2018-12-05 00:27:42 -08:00
Michael McLoughlin
022cbb7792 pass: first attempt at register allocation 2018-12-05 00:05:57 -08:00
Michael McLoughlin
9376a230cf refactor to use reg.Set 2018-12-03 22:39:43 -08:00
Michael McLoughlin
faafa00e40 pass: test for liveness 2018-12-03 20:40:43 -08:00
Michael McLoughlin
b52c67f3fb pass: naive implementation of liveness 2018-12-02 23:59:29 -08:00
Michael McLoughlin
f18271ada5 add reg.Type 2018-12-02 15:15:00 -08:00
Michael McLoughlin
bc7d0fa410 pass: cfg tests 2018-12-02 13:51:03 -08:00
Michael McLoughlin
43575d8b61 start at some basic passes 2018-12-02 13:51:03 -08:00