| Commit message (Collapse) | Author | Age | Files | Lines | |
|---|---|---|---|---|---|
| * | frontend: add static assert | 2023-06-26 | 2 | -2/+38 | |
| | | |||||
| * | regalloc: remove unused variable | 2023-06-26 | 1 | -5/+0 | |
| | | |||||
| * | backend: fix mem2reg & regalloc | 2023-06-26 | 7 | -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 statement | 2023-06-26 | 2 | -8/+120 | |
| | | |||||
| * | fix some warnings | 2023-06-25 | 3 | -11/+2 | |
| | | |||||
| * | lex: use a circular buffer cache for pre-pre-processed chars | 2023-06-25 | 2 | -56/+67 | |
| | | |||||
| * | regalloc: fix temporary rename clobbering return register with multiple returns | 2023-06-25 | 1 | -2/+13 | |
| | | |||||
| * | regalloc add sources | 2023-06-25 | 1 | -1/+3 | |
| | | |||||
| * | abi0: fix agg return by pointer not updating arg count | 2023-06-24 | 1 | -0/+1 | |
| | | |||||
| * | fix regalloc thinking some ins are dead by adding ins.keep | 2023-06-24 | 3 | -3/+8 | |
| | | |||||
| * | update todo.txt | 2023-06-24 | 1 | -1/+1 | |
| | | |||||
| * | ir: dattab shouldn't reset for every function | 2023-06-24 | 1 | -1/+1 | |
| | | | | | this was causing later functions' data to override earlier data | ||||
| * | amd64/emit: more float fixes | 2023-06-24 | 1 | -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 temps | 2023-06-24 | 4 | -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 replcuses | 2023-06-24 | 3 | -19/+19 | |
| | | |||||
| * | backend: fix regalloc to work with more complex dataflow | 2023-06-24 | 12 | -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 undef | 2023-06-22 | 9 | -74/+73 | |
| | | |||||
| * | Add .editorconfig | 2023-06-22 | 1 | -0/+14 | |
| | | |||||
| * | misc fix | 2023-06-22 | 3 | -18/+55 | |
| | | |||||
| * | mem2reg: implement ssa construction; this breaks regalloc right now | 2023-06-21 | 9 | -159/+300 | |
| | | |||||
| * | explicitly store predecessors in each block | 2023-06-21 | 8 | -115/+135 | |
| | | |||||
| * | amd64: fix aggregate return in regs | 2023-06-20 | 1 | -3/+3 | |
| | | |||||
| * | amd64: conform to ABI for varargs func calls | 2023-06-20 | 2 | -1/+9 | |
| | | |||||
| * | elf: fix emitting small dats | 2023-06-20 | 1 | -3/+3 | |
| | | |||||
| * | fix type of undeclared functions | 2023-06-20 | 1 | -0/+1 | |
| | | |||||
| * | improve codegen for div a little (bikeshedding) | 2023-06-20 | 2 | -1/+7 | |
| | | |||||
| * | amd64/emit: ensure stack is 16-byte aligned | 2023-06-20 | 3 | -10/+34 | |
| | | |||||
| * | add basic mem2reg | 2023-06-20 | 8 | -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 fixed | 2023-06-20 | 1 | -2/+7 | |
| | | |||||
| * | fix out of bounds read | 2023-06-20 | 1 | -0/+1 | |
| | | |||||
| * | regalloc: fix bug in spilling code | 2023-06-20 | 1 | -7/+24 | |
| | | |||||
| * | another emit() errata | 2023-06-20 | 1 | -1/+1 | |
| | | |||||
| * | fix regression | 2023-06-20 | 1 | -4/+4 | |
| | | |||||
| * | don't lower params and args to registers in abi0 | 2023-06-20 | 6 | -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 instrs | 2023-06-20 | 6 | -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 | ||||
| * | errata | 2023-06-20 | 1 | -2/+2 | |
| | | |||||
| * | elf: fix type mismatch from bfore | 2023-06-19 | 1 | -3/+3 | |
| | | |||||
| * | regalloc: alloc extra memory for alloc map | 2023-06-19 | 1 | -1/+1 | |
| | | | | | | regalloc itself can insert instructions so this was causing out of bounds read errors | ||||
| * | backend: compile comparison instrs and branches | 2023-06-19 | 8 | -40/+370 | |
| | | |||||
| * | amd64/emit: fix mov(zx/sx)w | 2023-06-19 | 1 | -6/+6 | |
| | | |||||
| * | oops | 2023-06-19 | 1 | -1/+1 | |
| | | |||||
| * | frontend: disallow non-local decls in for initializer | 2023-06-19 | 1 | -6/+14 | |
| | | |||||
| * | frontend: rename parser -> lexer and document c.c | 2023-06-19 | 3 | -233/+251 | |
| | | |||||
| * | frontend: separate compiler & lexer | 2023-06-19 | 7 | -381/+386 | |
| | | |||||
| * | frontend: add for, break, continue statements | 2023-06-19 | 3 | -75/+202 | |
| | | |||||
| * | fix isel & emit for sym constants | 2023-06-19 | 3 | -9/+11 | |
| | | |||||
| * | add %y symbol printing | 2023-06-19 | 2 | -4/+14 | |
| | | |||||
| * | move ctype to common.h | 2023-06-19 | 2 | -11/+7 | |
| | | |||||
| * | don't try to compile when debugging IR | 2023-06-19 | 3 | -8/+13 | |
| | | |||||
| * | oops | 2023-06-19 | 1 | -1/+1 | |
| | | |||||