9977ce841aRemove the bytes1, bytes2, bytes4, bytes8 attributes; remove the concept of a register 'type'; now use int/float/long/double throughout to identify registers. Lots of register allocator tweaks and table bugfixes --- we now get through the dreading Mathlib.mod!
David Given
2016-10-25 23:04:20 +0200
45a7f2e993Phi copies are now inserted as part of type inference. More opcodes.
David Given
2016-10-24 22:14:08 +0200
111c13e253More opcodes.
David Given
2016-10-24 20:15:22 +0200
a4644dee4dMore opcodes.
David Given
2016-10-24 12:08:40 +0200
b22780c075More opcodes, including the difficult and fairly stupid los/sts.
David Given
2016-10-23 22:24:08 +0200
abd0cedd61Massive change to how IR types are handled; we use the type code for matching rather than the size. Much cleaner and simpler.
David Given
2016-10-23 21:54:14 +0200
b1a3d76d6fRe-re-add the type inference layer, now I know more about how things work. Remove that terrible float promotion code.
David Given
2016-10-22 23:04:13 +0200
11b0bc1055More opcodes.
David Given
2016-10-22 20:32:51 +0200
2d52b1fdaaRemove GETRET; values are now returned directly by CALL. Fix a bug in convertstackops which was resulting in duplicate IR groups.
David Given
2016-10-22 12:13:57 +0200
ceb938fb3cMore opcodes.
David Given
2016-10-22 11:26:28 +0200
7ae888b754Hacky workaround the way the Modula-2 compiler generates non-standard sized loads and saves. More opcodes; simplified table using macros.
David Given
2016-10-22 10:48:22 +0200
90d0661639Typo fix.
David Given
2016-10-22 00:48:55 +0200
f851ab83afBetter (and more correct) floating point conversions; fif; various new opcodes.
David Given
2016-10-22 00:48:26 +0200
d535be87b1fef4 and fef8 is now cleaner, albeit slower; add some more register alias stuff.
David Given
2016-10-22 00:02:15 +0200
4db402f229Add (pretty crummy) support for register aliases and static pairs of registers. We should have enough functionality now for rather buggy 8-bit ints and doubles. Rework the table and the platform.c to match.
David Given
2016-10-21 23:31:00 +0200
d6984d60acAdd parsing support for register aliases.
David Given
2016-10-20 21:47:28 +0200
e4fec71f9cLots more opcodes; better eviction behaviour; better register moves. Lots more PowerPC stuff (some working).
David Given
2016-10-19 23:29:05 +0200
ffb1eabf45Floating point promotion is less buggy.
David Given
2016-10-19 23:27:53 +0200
34c4cfee8fMerge pull request #6 from kernigh/pr-linuxppc
David Given
2016-10-19 20:39:10 +0200
99dee0ad24Remove f14 to f31 from FREG and FSREG.
George Koehler
2016-10-18 21:16:47 -0400
d5071e7df1Promote values accessed via NOP.
David Given
2016-10-18 23:58:03 +0200
5413d47029'!' tracing is now always emitted; tracing goes to stderr.
David Given
2016-10-18 22:32:09 +0200
3520704ea8Add support for floating point constants.
David Given
2016-10-18 22:29:42 +0200
cfbc537959In powerpc ncg, add a speed hack for sti 8.
George Koehler
2016-10-17 20:31:59 -0400
938fb8c2fcLots more opcodes.
David Given
2016-10-18 00:31:26 +0200
4a093b9ebaAdd li and mr pseudoinstructions.
David Given
2016-10-18 00:21:32 +0200
c7b68033efAdd costs to powerpc instructions.
George Koehler
2016-10-17 14:57:21 -0400
f33b30ed3cRewrite .fif8 to avoid powerpc64 fctid
George Koehler
2016-10-17 00:39:59 -0400
e2ccc8f942Add "kills MEMORY" to powerpc sti rules.
George Koehler
2016-10-16 18:13:39 -0400
5f0164db62Bolt mcg into the PowerPC backend. It doesn't build yet, but it is generating *some* code.
David Given
2016-10-17 00:06:06 +0200
d539389e81Merge in the unfinished PowerPC branch.
David Given
2016-10-16 22:38:27 +0200
1e17921208Implement saving of dirty registers onto the stack.
David Given
2016-10-16 22:37:42 +0200
19f0eb86a4Remove IND_LABEL_W and IND_LABEL_D
George Koehler
2016-10-16 16:33:24 -0400
5b5f774a64Simplify moves to and from IND_RC_*
George Koehler
2016-10-16 16:02:25 -0400
486cf9562fDon't need Lua any more.
David Given
2016-10-16 20:10:24 +0200
1f56bab521Remember to create the build directory when bootstrapping.
David Given
2016-10-16 20:09:52 +0200
479a4efa4fUse a self-hosted Lua instead of the system one.
David Given
2016-10-16 20:07:54 +0200
7c64dab491Refactor how powerpc ncg pushes constants.
George Koehler
2016-10-16 13:58:54 -0400
714d8985c8Experiments with declarative apt and OSX.
David Given
2016-10-16 18:16:30 +0200
6a06ce798bAdd missing header that was causing builds to fail on Travis.
David Given
2016-10-16 17:58:01 +0200
baa152217eRemove unused parts of mach/powerpc/ncg/table
George Koehler
2016-10-15 20:00:48 -0400
32c53a452dMerge from trunk.
David Given
2016-10-16 00:06:14 +0200
6a23906ad8Various bits of cleanup; we should almost be ready to try sending this to the assembler soon...
David Given
2016-10-15 23:39:38 +0200
286435a2edOops, forgot to add the output option spec to the string!
David Given
2016-10-15 23:34:54 +0200
b36897c299References to the stack frame are now rendered properly.
David Given
2016-10-15 23:33:30 +0200
a8ee82d197Stop passing proc around, and use a global instead --- much cleaner.
David Given
2016-10-15 23:19:44 +0200
7aa60a6451Register spilling to the stack frame works, more or less.
David Given
2016-10-15 22:53:56 +0200
0eb32e7553Fix yet another bug to do with IR register outputs.
David Given
2016-10-15 19:14:25 +0200
9504aec2bdFunction termination gets routed through an exit block; we now have prologues and epilogues. mcgg now exports some useful data as headers. Start factoring out some of the architecture-specific bits into an architecture-specific file.
David Given
2016-10-15 18:38:46 +0200
5ad3aa8595Add a pile of new instructions used by Pascal; I'm going to need to think about how locals and the local base are handled.
David Given
2016-10-15 13:07:59 +0200
358c44de35Bytes were sometimes failing to be sign extended correctly.
David Given
2016-10-15 12:11:40 +0200
517120d0fbAllow asm names for registers which are different from the friendly names shown in the tracing (because PowerPC register names are just numbers).
David Given
2016-10-15 11:42:47 +0200
b2ddf12473Some more opcodes.
David Given
2016-10-15 11:22:40 +0200
29cb008faaIn powerpc table, fix macros los() and his().
George Koehler
2016-10-14 23:59:26 -0400
bb17aea73aYou can now mark a register as corrupting a certain register class; calls work, or at least look like they work. The bad news is that the register allocator has a rare talent for putting things in the wrong register.
David Given
2016-10-15 01:15:08 +0200
886adb86d7Log empty hops.
David Given
2016-10-14 23:19:25 +0200
4f2177e41fReworked loads and stores; it's now *different*, maybe not better.
David Given
2016-10-14 23:19:02 +0200
a63052427eFactor out the register allocation routines to make them easier to deal with.
David Given
2016-10-14 23:17:06 +0200
bb53a7fb51Fix stupid issue where hop output registers were being overwritten, leading to invalid SSA form.
David Given
2016-10-14 23:12:29 +0200
98fe70a7deOutput register equality constraints work.
David Given
2016-10-14 22:17:02 +0200
216ff5cc43Make loads and stores in the table nicer; fix a place where it looked like it was working but only accidentally.
David Given
2016-10-12 23:12:53 +0200
f06b51c981Keep track of register types as well as attributes --- the type being how we find new registers when evicting values. Input constraints work (they were being ignored before). Various bug fixing so they actually work.
David Given
2016-10-12 22:58:46 +0200
4723a1442fAdd code to remove unused phis, converting to pruned SSA form, to avoid confusing the register allocator later.
David Given
2016-10-12 21:50:12 +0200
df239b3f90Don't allow the same IR to be added to the sequence list more than once (sometimes happens because op_dup, but makes no sense).
David Given
2016-10-12 00:45:36 +0200
96dffd2007Clean up the allocator a bit, in preparation for making it lots more complicated; no semantic changes.
David Given
2016-10-11 23:17:30 +0200
668cccdff1A few more opcodes.
David Given
2016-10-11 00:29:18 +0200
2be1c51885A little fiddling with store instructions. The PowerPC is not friendly to iburg.
David Given
2016-10-11 00:23:35 +0200
e93c58dc8dRefactored the way hops are rendered; add support for emitting code (although with no prologue or epilogue yet).
David Given
2016-10-11 00:12:11 +0200
92bd1ac5f4Register allocator now gets all the way through all of my test file without crashing (albeit with register moves and swaps stubbed out). Correct code? Who knows.
David Given
2016-10-10 23:19:46 +0200
a4d06d1795D'oh, need multiple passes over the edge splitter in order to properly find all cases.
David Given
2016-10-10 23:18:37 +0200
fac12aae32Calculate phi congruency groups; use them to solve the importing-hreg-from-the-future problem (probably poorly).
David Given
2016-10-09 22:04:20 +0200
ff58a6100fAdd pmap_remove().
David Given
2016-10-09 22:03:44 +0200
23c3575f0fThe register allocator now makes a spirited attempt to honour register attributes when allocating. Unfortunately, backward edges don't work (because the limited def-use chain stuff doesn't work across basic blocks). Needs more thought.
David Given
2016-10-09 15:09:34 +0200
38de688c5aFloating point promotion was broken since the IR float change. Fix.
David Given
2016-10-09 15:08:03 +0200
36cddd6afbAdd some more opcodes; rearrange the registers to be more PowerPC-friendly.
David Given
2016-10-09 14:45:13 +0200
cfe5312fccPredicates can now take numeric arguments. The PowerPC predicates have been turned into generic ones (as they'll be useful everywhere). Node arguments for predicates require the '%' prefix for consistency. Hex numbers are permitted.
David Given
2016-10-09 12:32:36 +0200
d75cc0a663Basic register allocation works!
David Given
2016-10-08 23:32:54 +0200
4261744537Replace pmap_get() with pmap_findleft() and pmap_findright(), to allow lookups in both directions.
David Given
2016-10-08 23:32:13 +0200
637aeed70aOnly allocate an output vreg if the instruction actually wants one.
David Given
2016-10-08 12:15:21 +0200
2198db69b1Instruction predicates work now.
David Given
2016-10-08 11:35:33 +0200
9ebf731335Minor cleanup.
David Given
2016-10-08 11:07:28 +0200
9db902314bFix bug where pushes were being placed in the wrong blocks.
David Given
2016-10-08 10:21:24 +0200
65c2a8a0aeRemove stackadjust and stackoffset() from ncg.
George Koehler
2016-10-07 20:52:13 -0400
4e49830e09Overhaul of everything phi related; critical edge splitting now happens before anything SSA happens; liveness calculations now look like they might be working.
David Given
2016-10-08 00:21:23 +0200
b7af003dbbAdd array_{appendall,removeall,appendallu}.
David Given
2016-10-08 00:20:26 +0200
409ba7fb1bRemove most of GPRE from mach/powerpc/ncg/table
George Koehler
2016-10-06 22:59:27 -0400
7cccd88b71Rename SCRATCH to RSCRATCH. Never stack RSCRATCH nor FSCRATCH.
George Koehler
2016-10-06 20:47:42 -0400
ee93389c5fRefactor the cfg and dominance stuff to make it a lot nicer.
David Given
2016-10-06 21:34:21 +0200
7f901aa4d0We're not using 'allocates' any more; clean up.
David Given
2016-10-06 21:33:43 +0200
d20b63dc94The register allocator is really a pass, so arrange the code like one.
David Given
2016-10-05 23:55:38 +0200
87e004e4a9Warning fix.
David Given
2016-10-05 23:55:04 +0200
21034c0d65No, dammit, for register allocation I need to walk the blocks in *dominance* order. Since the dominance tree has changed when I fiddled with the graph, I need to recompute it, so factor it out of the SSA pass. Code is uglier than I'd like but at least the RET statement goes last in the generated code now.
David Given
2016-10-05 23:52:54 +0200
d95c75dfd7Allowing an input filename on the command line makes debuggers happy. (Then we don't need to redirect stdin.)
David Given
2016-10-05 23:24:29 +0200
88fb231d6eBetter constraint syntax; mcgg now passes register usage information up to mcg; mcg can track individual hop inputs and outputs (needed for live range analysis!); the register allocator now puts the basic blocks into the right order in preparation for live range analysis.
David Given
2016-10-05 22:56:25 +0200
7a6fc7a72bMade sure that all files end in vim magic.
David Given
2016-10-05 21:07:29 +0200
92502901a7Better management of register data. Add struct hreg.
David Given
2016-10-05 21:00:28 +0200
ac62c34e19Add a pass to do critical edge splitting.
David Given
2016-10-04 23:42:00 +0200
8fedf5a0a8Added support for the op_bXX conditional branch instructions.
David Given
2016-10-04 23:28:16 +0200
249855ed23Fix the horror of the startup code; now uses getopt and stuff and the debug flags can be set as an option.
David Given
2016-10-04 22:36:01 +0200
ac063a6f54Remove unused variable (reduce memory usage by 1/10).
David Given
2016-10-04 22:35:08 +0200