summary refs log tree commit diff
path: root/lisc/rega.c
AgeCommit message (Collapse)Author
2015-09-15use the same bitset for regs and tmps in rega()Quentin Carbonneaux
This is possible because we know that they are represented by different integers.
2015-09-15major lifting: get rid of RRegQuentin Carbonneaux
I've been septic since I introduced it, this commit proves that it costs more than it helps. I've also fixed a bad bug in rega() where I alloc'ed the wrong size for internal arrays. Enums now have names so I can use them to cast in gdb to get the name corresponding to a constant.
2015-09-15prefix register macrosQuentin Carbonneaux
2015-09-15use round-robin in rallocQuentin Carbonneaux
This gives a more uniform use of the registers.
2015-09-15simplify frequent pred detection in regaQuentin Carbonneaux
2015-09-15fix 2 bad bugs in rega and improve substractionQuentin Carbonneaux
The substraction contrained the register allocator to allocate a different register for the result and the second operand, now, we use a neg trick to compile it down. The machinery that was setup is, regardless, interesting and will have to be used for floating point computations (division). The first bug in rega made broke the explicited loop invariant: we were using register allocation unavailable information from other blocks. It's still unclear how we got wrong results from that considering mappings are all 0-initialized. The second bug is a stupid one, one sizeof operator was missing from a memcpy...
2015-09-15use correct sizes during reg allocationQuentin Carbonneaux
2015-09-15use a new Ref type for registersQuentin Carbonneaux
This might not be a good idea, the problem was that many spurious registers would be added to the Bits data-structures during compilation (and would always remain 0). However, doing the above modification de-uniformizes the handling of temps and regs, this makes the code longer and not really nicer. Also, additional Bits structures are required to track the registers independently. Overall this might be a bad idea to revert.
2015-09-15start work on word/long handlingQuentin Carbonneaux
2015-09-15clean the commutativity + fix bug in emitQuentin Carbonneaux
The commutativity information only makes sense for arithmetic expressions. To account for that, I introduced a new tri-valued boolean type B3. Memory operations, for example, will receive an undefined commutativity trit. The code emitter was buggy when rega emitted instructions like 'rax = add 1, rax', this is now fixed using the commutativity information (we rewrite it in 'rax = add rax, 1').
2015-09-15add support for in-block reg. contraintsQuentin Carbonneaux
2015-09-15add crippled dce to the allocatorQuentin Carbonneaux
2015-09-15complete a crude register allocatorQuentin Carbonneaux
2015-09-15start work on parallel movesQuentin Carbonneaux
2015-09-15initiate work on reg allocationQuentin Carbonneaux