aboutsummaryrefslogtreecommitdiffhomepage
Commit message (Collapse)AuthorAgeFilesLines
...
* backend: fix mem2reg & regalloclemon2023-06-267-61/+206
| | | | | | | | | | | | | | | | | | | | | | | | | | | | they were broken, especially for unstructured control flow. most significant fix is to register allocator for temporaries that are used before the first definition in the source order, e.g.: @1: %x = add %y, 1 b @3 @2 %y = ... b @1 it's legal for %x to use %y there (assuming @2 dominates @1) but from the point of view of the register allocator %y is defined and freed and then used again, which broke things. the fix is to introduce phis for this situation: @1: %y.1 = phi @2 %y %x = add %y.1, 1 b @3 @2 %y = ... b @1 then regalloc phi handling code makes it work
* frontend: add labels and goto statementlemon2023-06-262-8/+120
|
* fix some warningslemon2023-06-253-11/+2
|
* lex: use a circular buffer cache for pre-pre-processed charslemon2023-06-252-56/+67
|
* regalloc: fix temporary rename clobbering return register with multiple returnslemon2023-06-251-2/+13
|
* regalloc add sourceslemon2023-06-251-1/+3
|
* abi0: fix agg return by pointer not updating arg countlemon2023-06-241-0/+1
|
* fix regalloc thinking some ins are dead by adding ins.keeplemon2023-06-243-3/+8
|
* update todo.txtlemon2023-06-241-1/+1
|
* ir: dattab shouldn't reset for every functionlemon2023-06-241-1/+1
| | | | this was causing later functions' data to override earlier data
* amd64/emit: more float fixeslemon2023-06-241-21/+24
| | | | | optimize loading 0.0 in phis as well as regular copies and also don't use inc or addr for float addition
* backend: don't mixup float and int tempslemon2023-06-244-11/+29
| | | | | | copy propagation only happens when dataclasses match, register allocator ignores hints if hint register class and instruction class differ, also add mov between int and float regs in amd64/emit
* fix replcuseslemon2023-06-243-19/+19
|
* backend: fix regalloc to work with more complex dataflowlemon2023-06-2412-225/+748
| | | | | | | | basically an allocation map at the beginning (in) and end (out) of each block is kept and after the first allocation pass another pass is ran to resolve allocation conflicts between each edge, plus another pass to finish lowering phi functions. also introduced `regset` and plenty of other miscellaneous fixes
* change RMORE -> RADDR; use RXXX (RNONE) for special args,also undeflemon2023-06-229-74/+73
|
* Add .editorconfiglemon2023-06-221-0/+14
|
* misc fixlemon2023-06-223-18/+55
|
* mem2reg: implement ssa construction; this breaks regalloc right nowlemon2023-06-219-159/+300
|
* explicitly store predecessors in each blocklemon2023-06-218-115/+135
|
* amd64: fix aggregate return in regslemon2023-06-201-3/+3
|
* amd64: conform to ABI for varargs func callslemon2023-06-202-1/+9
|
* elf: fix emitting small datslemon2023-06-201-3/+3
|
* fix type of undeclared functionslemon2023-06-201-0/+1
|
* improve codegen for div a little (bikeshedding)lemon2023-06-202-1/+7
|
* amd64/emit: ensure stack is 16-byte alignedlemon2023-06-203-10/+34
|
* add basic mem2reglemon2023-06-208-14/+221
| | | | | | | promotes uniform stack slots to temporaries currently only for immutable variables, next thing to implement is ssa construction
* fix regression wiht ret args not being fixedlemon2023-06-201-2/+7
|
* fix out of bounds readlemon2023-06-201-0/+1
|
* regalloc: fix bug in spilling codelemon2023-06-201-7/+24
|
* another emit() erratalemon2023-06-201-1/+1
|
* fix regressionlemon2023-06-201-4/+4
|
* don't lower params and args to registers in abi0lemon2023-06-206-57/+101
| | | | | it's better to do it later, currently in isel(), but perhaps in a pre-isel abi1 pass
* fix cls logic for comparison instrslemon2023-06-206-17/+23
| | | | | | | | previously instr.cls always represented the output dataclass. this doesn't work for comparisons because we know the output is always a boolean integer and we care about the actual comparison dataclass. so now .cls represents the operation dataclass, which matches the result class except for comparisons where the result is always KI4V
* erratalemon2023-06-201-2/+2
|
* elf: fix type mismatch from bforelemon2023-06-191-3/+3
|
* regalloc: alloc extra memory for alloc maplemon2023-06-191-1/+1
| | | | | regalloc itself can insert instructions so this was causing out of bounds read errors
* backend: compile comparison instrs and brancheslemon2023-06-198-40/+370
|
* amd64/emit: fix mov(zx/sx)wlemon2023-06-191-6/+6
|
* oopslemon2023-06-191-1/+1
|
* frontend: disallow non-local decls in for initializerlemon2023-06-191-6/+14
|
* frontend: rename parser -> lexer and document c.clemon2023-06-193-233/+251
|
* frontend: separate compiler & lexerlemon2023-06-197-381/+386
|
* frontend: add for, break, continue statementslemon2023-06-193-75/+202
|
* fix isel & emit for sym constantslemon2023-06-193-9/+11
|
* add %y symbol printinglemon2023-06-192-4/+14
|
* move ctype to common.hlemon2023-06-192-11/+7
|
* don't try to compile when debugging IRlemon2023-06-193-8/+13
|
* oopslemon2023-06-191-1/+1
|
* forgot some staticslemon2023-06-182-3/+3
|
* update todo.txtlemon2023-06-181-2/+0
|