summary refs log tree commit diff
path: root/lisc/isel.c
AgeCommit message (Collapse)Author
2015-09-17fix buggy handling of stack arguments in selpar()Quentin Carbonneaux
2015-09-17fix two bugs in selpar()Quentin Carbonneaux
- One missing argument for OAlloc. - One reference shuffling.
2015-09-17fix memcpy bugQuentin Carbonneaux
2015-09-17start work on fuction parametersQuentin Carbonneaux
2015-09-15heavy modification of call handlingQuentin Carbonneaux
The IR generated by calls was very bulky because two instructions were used for marking the live range of a clobber. This patch attempts to store the information of what registers are use/def/clobber in the call instruction itself, this leads to more compact code (even more when we'll have SSE registers). However, I find that the amount of extra code needed is not really easonable. Fortunately it is not too invasive, thus if the complexity creeps in, it should be easy to revert.
2015-09-15emit stack fixup only when necessaryQuentin Carbonneaux
2015-09-15reshuffle instructions around callQuentin Carbonneaux
2015-09-15hack to enable proper regalloc on callsQuentin Carbonneaux
I add the dual to dummy uses: dummy defs. They are compiled to nothing, but help preserving the invariants I had when writing the register allocator. Clearly, there should be a better way.
2015-09-15fix alignment for structs on the stackQuentin Carbonneaux
2015-09-15diagnose float structsQuentin Carbonneaux
2015-09-15implement aggregate passing in regsQuentin Carbonneaux
2015-09-15start function call lowering (wip)Quentin Carbonneaux
2015-09-15start work on aggregate typesQuentin Carbonneaux
The parser now has some code to parse the description of structured types. I tried to be even less specific than LLVM "type" by creating just enough abstraction so that I can deal with both AARCH64 and x64. The base types used in the definition of an aggregate are really just syntactic sugar to give a structure a size and an alignment. Only the location of float components matters for the compilation. In particular this means that the front-ends have to know how the ABI works to pass/return small integer types. This also means that the font-end has to be aware of the layout of structures. Chris Lattner has a proposition [1] for LLVM that is still pending and goes in the direction of giving more control of the ABI the front-end. [1]: http://www.nondot.org/sabre/LLVMNotes/ExtendedIntegerResults.txt
2015-09-15get rid of OTruncQuentin Carbonneaux
2015-09-15the wide bit of OAddr matters!Quentin Carbonneaux
2015-09-15add a size to all operations (wip)Quentin Carbonneaux
2015-09-15alloc16 comes for free, iiuc the abiQuentin Carbonneaux
2015-09-15add truncation operationQuentin Carbonneaux
It would be nicer to have some kind of subtyping where a l variable can be used in place of a w variable but it is more complications than a truncation insutruction. In some cases, it might be less efficient than the above solution by requiring two registers instead of one. (I.e when both the truncated variable and the long variable live together.) We have to see what are the usage patterns.
2015-09-15the abi is unclear, practice suggests that changeQuentin Carbonneaux
2015-09-15OXTestw should not have 64bits argumentsQuentin Carbonneaux
2015-09-15new NAlign constant and fix frame size computationQuentin Carbonneaux
2015-09-15move spill and emit to the new slot systemQuentin Carbonneaux
In emit, I worked a little to make sure that framesz works when we change the size of the svec array (if we need more alignments).
2015-09-15add sign/zero extension operationsQuentin Carbonneaux
2015-09-15add the mul instructionQuentin Carbonneaux
2015-09-15make sure tests emitted are encodableQuentin Carbonneaux
2015-09-15replace RMem refs with an OAddr opertationQuentin Carbonneaux
2015-09-15compile branches on and using testQuentin Carbonneaux
2015-09-15make sure eflags-writing do not disappearQuentin Carbonneaux
This is a hack implementation, ideally I would like something cleaner. The problem is that regalloc thinks an instruction is dead code because it's not aware that it writes to eflags.
2015-09-15handle OAnd in iselQuentin Carbonneaux
2015-09-15change strategy for phi nodesQuentin Carbonneaux
2015-09-15tentative support for fast allocsQuentin Carbonneaux
It seems that the MEM reference type is meaningless in too many positions. Because of this, it is unclear if we should keep it or just introduce a OAddr instruction that only accepts slots. Regardless of the above, the spilling module needs to use the new slot_() function, also, the emit function needs to fetch the size of the stack frame from the slot[] array. The naming is still very transitional, here is a list of all bogus names I can think of: - SLOT() - Tmp.spill - slot_
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-15add basic support for stack allocationQuentin Carbonneaux
2015-09-15fix typos in selcmp and commentQuentin Carbonneaux
2015-09-15comment about immutablesQuentin Carbonneaux
2015-09-15fail on constant comparisonsQuentin Carbonneaux
In the future they will be eliminated by constant propagation.
2015-09-15support for large constantsQuentin Carbonneaux
It was not as simple as I thought. All constants used in 32b context get truncated to 32 bits. All constants in 64b contexts can either remain as immutables are have to be evicted in a register, this choice is taken in noimm(). The case of the comparison needs to be documented since the context is not clearly 32 or 64 bits. I am still unsure if this is fully correct.
2015-09-15split store into store{w,l}Quentin Carbonneaux
2015-09-15fix my sloppy understanding of x86 assembly!Quentin Carbonneaux
2015-09-15ugly support for store/loadQuentin Carbonneaux
2015-09-15factor some comparison emitting codeQuentin Carbonneaux
2015-09-15add some more specific commentsQuentin Carbonneaux
2015-09-15the only wrong use count is the one of rQuentin Carbonneaux
2015-09-15I forgot cmp as flag setting instruction!Quentin Carbonneaux
2015-09-15jez becomes jnz, complete cmp+jmp contractionQuentin Carbonneaux
2015-09-15implement smarter compare+branchQuentin Carbonneaux
2015-09-15split cmp in two sizesQuentin Carbonneaux
2015-09-15fix two bugs in iselQuentin Carbonneaux
2015-09-15use a temporary for constant comparisonsQuentin Carbonneaux
2015-09-15quick fix for comparisons with constantsQuentin Carbonneaux