summary refs log tree commit diff
AgeCommit message (Collapse)Author
2015-09-15change references representationQuentin Carbonneaux
2015-09-15try writing a parser, painfulQuentin Carbonneaux
2015-09-15change name of test fileQuentin Carbonneaux
2015-09-15some new CQuentin Carbonneaux
2015-09-15add an untracked directoryQuentin Carbonneaux
2015-09-15bugfix in regalloc (Div,Rem) and in peuclQuentin Carbonneaux
2015-09-15attempt to implement euclide algorithmQuentin Carbonneaux
2015-09-15restore addition in testQuentin Carbonneaux
2015-09-15generate code for the divisionQuentin Carbonneaux
2015-09-15reserve edx in all cases for divisionsQuentin Carbonneaux
2015-09-15more cleaningQuentin Carbonneaux
2015-09-15add gitignoreQuentin Carbonneaux
2015-09-15fix code emitting for x = y op xQuentin Carbonneaux
2015-09-15fix addition opcodesQuentin Carbonneaux
2015-09-15do a bigger test computationQuentin Carbonneaux
2015-09-15compile tmain with optimizationsQuentin Carbonneaux
2015-09-15run multiple rounds for stable timingQuentin Carbonneaux
2015-09-15quietQuentin Carbonneaux
2015-09-15time executionQuentin Carbonneaux
2015-09-15cosmeticsQuentin Carbonneaux
2015-09-15cleanup overflow computationQuentin Carbonneaux
2015-09-15fix spill codeQuentin Carbonneaux
2015-09-15add `Ret jump and dump elf filesQuentin Carbonneaux
2015-09-15remove default tests in ElfQuentin Carbonneaux
2015-09-15add popd in the Heap moduleQuentin Carbonneaux
2015-09-15add simple MakefileQuentin Carbonneaux
2015-04-04write down some more ideasQuentin Carbonneaux
2015-04-01do not freeze r when allocating for r2Quentin Carbonneaux
2015-03-31update TODO with fix commitQuentin Carbonneaux
2015-03-31tentative fix of messed up spills for phisQuentin Carbonneaux
2015-03-31add bugsQuentin Carbonneaux
2015-03-31avoid evicting argumentsQuentin Carbonneaux
2015-03-31add move constant to spillQuentin Carbonneaux
2015-03-31better support for constantsQuentin Carbonneaux
2015-03-27refine TODOQuentin Carbonneaux
2015-03-27add a scratch TODOQuentin Carbonneaux
2015-03-25expect reg in brz, might not be trueQuentin Carbonneaux
2015-03-25simplify label logicQuentin Carbonneaux
2015-03-25branch codeQuentin Carbonneaux
2015-03-25more codegenQuentin Carbonneaux
2015-03-25start writing some codegenQuentin Carbonneaux
2015-02-20improvements to elf.mlQuentin Carbonneaux
2015-02-20fix bugs in movgenQuentin Carbonneaux
2015-02-20start work on movgenQuentin Carbonneaux
2015-02-18cosmeticsQuentin Carbonneaux
2015-02-18add spill testQuentin Carbonneaux
2015-02-18kind of working!Quentin Carbonneaux
2015-02-18wipQuentin Carbonneaux
2015-02-18wipQuentin Carbonneaux
2015-02-15add notesQuentin Carbonneaux
I start to believe that it is possible to simply reuse the regalloc I wrote. All the data structures seem fine. Here is a list modifications to make for sure: - Keep track of the mapping for live in variables for each block. - Make sure 'loc' (or a new function) returns registers for the arguments of base instructions. Spilling -------- When we need a register and none are left. If we are at the end of a block, simply spill anybody (the resolving will take care of adding the moves). If we are in a block, find somebody to spill and its next use, if the next use is in the same block, emit reload code, otherwise, decide to emit the reload at the end of the cheapest block (this means that we have to patch some mappings that were already stored). We let the resolve handle the insertion of the reload code. Example: +----------------------+ | | | | | +----+ +----+ | +----+ -+-> | b1 | --> | b2 | -+-> | b3 | --> +----+ +----+ +----+ ^ ^ Spill x First use of x (Was in r1) The cheapest position for reload code is at the beginning of b3, so we have to modify the mapping at the end of b1, beginning of b2, and end of b2 to change it from (x -> r1) to (x -> spill). Reloading --------- When a spilled variable is needed in register. In this case, we are necessarily inside a block (or at a branch) because that is the only place we require a variable to be in register. Here again we are constrained to insert the spill code before the next use of the variable, but more importantly, we must do it before the register chosen is *in use next*.