Commit graph

95 commits

Author SHA1 Message Date
Quentin Carbonneaux
04b66d38db start integrating RAMem references 2015-10-30 13:20:42 -04:00
Quentin Carbonneaux
b33febc25c prepare for using memory refs 2015-10-30 13:20:42 -04:00
Quentin Carbonneaux
82d79017ff fix test for load folding 2015-10-30 13:20:42 -04:00
Quentin Carbonneaux
e205856bc6 stick scales close to their instruction 2015-10-30 13:20:42 -04:00
Quentin Carbonneaux
97db80da31 start work on fusing loads in arithmetic 2015-10-30 13:20:42 -04:00
Quentin Carbonneaux
475e90a371 first attempt at address matching 2015-10-30 13:20:42 -04:00
Quentin Carbonneaux
8ef0e2d027 cosmetics on address numbering code 2015-10-30 13:20:42 -04:00
Quentin Carbonneaux
b44f46fafc store addressability infos in a struct 2015-10-30 13:20:42 -04:00
Quentin Carbonneaux
639142f44c do not give an addressability number to scales 2015-10-30 13:20:42 -04:00
Quentin Carbonneaux
5e43482c11 store child matchings in the addressing table 2015-10-30 13:20:42 -04:00
Quentin Carbonneaux
4185168edc missed a few cases in the tree automaton 2015-10-30 13:20:42 -04:00
Quentin Carbonneaux
bb5f95c192 start adress mode recognition 2015-10-30 13:20:42 -04:00
Quentin Carbonneaux
4bce97b16b rename spill field in Tmp to slot 2015-10-30 13:20:42 -04:00
Quentin Carbonneaux
b284721c8a emit code for extensions, move slots into RAlt 2015-10-30 13:20:42 -04:00
Quentin Carbonneaux
7c6fadc6ba uniformize sign extension and mem loads 2015-10-19 17:28:21 -04:00
Quentin Carbonneaux
72fc455978 add pool memory management 2015-10-06 22:51:51 -04:00
Quentin Carbonneaux
99ad19546d use new vector functions instead of reallocs 2015-10-06 20:42:54 -04:00
Quentin Carbonneaux
1f7acbd88f specialize vdup into idup 2015-10-06 13:22:46 -04:00
Quentin Carbonneaux
ce72ad0ecd factor ins array edition in icpy 2015-10-06 13:17:20 -04:00
Quentin Carbonneaux
a83174f447 factor vector duplication in vdup() 2015-10-05 21:38:55 -04:00
Quentin Carbonneaux
e30fab31e1 factor some utility functions/data in util.c 2015-10-05 17:24:19 -04:00
Quentin Carbonneaux
a18e0ef50f clean the command line interface 2015-10-05 15:57:04 -04:00
Quentin Carbonneaux
ecaad8119f fix a bug for structure arguments in regs 2015-10-01 13:20:21 -04:00
Quentin Carbonneaux
2d5c07fa4e remove dead assignment 2015-09-30 11:48:50 -04:00
Quentin Carbonneaux
790f852b96 fix two invalid Tmp.spill values 2015-09-30 10:34:52 -04:00
Quentin Carbonneaux
e2174da2f1 wip on new stack slots (emit, spill) 2015-09-29 22:25:49 -04:00
Quentin Carbonneaux
ae158a5c40 more fixes for the new slot representation 2015-09-29 17:40:47 -04:00
Quentin Carbonneaux
5e5d0a1e99 wip on a simpler slot handling 2015-09-29 17:25:04 -04:00
Quentin Carbonneaux
2d5302df71 small simplification in seljmp 2015-09-22 20:47:02 -04:00
Quentin Carbonneaux
bbbc8994f9 compile retw and retl as a move in rax 2015-09-22 17:24:26 -04:00
Quentin Carbonneaux
9fcad221d0 save callee-save registers 2015-09-20 17:47:23 -04:00
Quentin Carbonneaux
fff669e54a this fixme was really more a todo 2015-09-17 21:24:46 -04:00
Quentin Carbonneaux
4d7c42d4fb fix buggy handling of stack arguments in selpar() 2015-09-17 21:12:42 -04:00
Quentin Carbonneaux
7540024f78 fix two bugs in selpar()
- One missing argument for OAlloc.
- One reference shuffling.
2015-09-17 19:56:58 -04:00
Quentin Carbonneaux
4a2c4d63f9 fix memcpy bug 2015-09-17 19:50:26 -04:00
Quentin Carbonneaux
c298820211 start work on fuction parameters 2015-09-17 19:29:49 -04:00
Quentin Carbonneaux
f7bfa2e435 heavy modification of call handling
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-15 23:01:33 -04:00
Quentin Carbonneaux
bad74e6dce emit stack fixup only when necessary 2015-09-15 23:01:33 -04:00
Quentin Carbonneaux
73b7d9b199 reshuffle instructions around call 2015-09-15 23:01:33 -04:00
Quentin Carbonneaux
f8d922b27c hack to enable proper regalloc on calls
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-15 23:01:33 -04:00
Quentin Carbonneaux
b5a009347e fix alignment for structs on the stack 2015-09-15 23:01:33 -04:00
Quentin Carbonneaux
9bb69bf4c7 diagnose float structs 2015-09-15 23:01:33 -04:00
Quentin Carbonneaux
ece185f067 implement aggregate passing in regs 2015-09-15 23:01:33 -04:00
Quentin Carbonneaux
8201c6161e start function call lowering (wip) 2015-09-15 23:01:33 -04:00
Quentin Carbonneaux
87ab8941ed start work on aggregate types
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-15 23:01:32 -04:00
Quentin Carbonneaux
f6349f4b6e get rid of OTrunc 2015-09-15 23:01:32 -04:00
Quentin Carbonneaux
0f0290c1db the wide bit of OAddr matters! 2015-09-15 23:01:32 -04:00
Quentin Carbonneaux
28110b1439 add a size to all operations (wip) 2015-09-15 23:01:32 -04:00
Quentin Carbonneaux
328cdc448c alloc16 comes for free, iiuc the abi 2015-09-15 23:01:32 -04:00
Quentin Carbonneaux
2c6f6b4b2d add truncation operation
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-15 23:01:32 -04:00