Commit graph

152 commits

Author SHA1 Message Date
Quentin Carbonneaux
337b10f6ed store register usage of ret instructions (abi fuzz)
So far I was ignoring register uses of return instructions
and it was working because at most one register could be
returned.  Now that more complex returns are supported it
is necessary to keep track of the registers used by
returns.

The abi fuzzer triggered an assertion failure in the
register allocator with the following IL:

        R1 =l load [%t16]
        R3 =l load [8 + %t16]
        ret

The regalloc would use R1 for %t16, and then a (nice)
assertion realized the inconsistent state because R1
could only be def'd by an assignment to %t16.
2016-03-22 11:53:57 -04:00
Quentin Carbonneaux
5ad3eaa75a typo in lexing table (abi fuzzer) 2016-03-22 10:59:16 -04:00
Quentin Carbonneaux
99eab2d147 oops, nul terminate string tokens 2016-03-18 15:21:17 -04:00
Quentin Carbonneaux
b19b9a27a0 handle padding correctly in types 2016-03-18 15:15:02 -04:00
Quentin Carbonneaux
3f3dce67f4 tentative support of calls with struct return 2016-03-18 15:14:55 -04:00
Quentin Carbonneaux
2889d44f24 parse fixes for struct return 2016-03-17 13:02:18 -04:00
Quentin Carbonneaux
ce7fd0cb49 add unsigned division and remainder 2016-03-16 11:30:57 -04:00
Quentin Carbonneaux
db6f7ad72d add shift instructions 2016-03-16 11:18:28 -04:00
Quentin Carbonneaux
7d79f9e216 be more precise in load types 2016-03-09 11:52:56 -05:00
Quentin Carbonneaux
4d41a720d0 use opdesc[] in isel.c 2016-03-09 11:50:44 -05:00
Quentin Carbonneaux
8645a5ae23 add more info in opdesc[] 2016-03-08 16:47:34 -05:00
Quentin Carbonneaux
995deebfd7 add a default align for data defs 2016-03-08 11:05:10 -05:00
Quentin Carbonneaux
cebec4dd47 add new cast instruction 2016-03-07 13:46:44 -05:00
Quentin Carbonneaux
4c855e3e12 cosmetics in err() 2016-03-07 12:51:57 -05:00
Quentin Carbonneaux
4467769253 get rid of hard coded NBlk 2016-03-04 10:30:13 -05:00
Quentin Carbonneaux
169411a220 add some (easy) instructions 2016-03-03 17:40:48 -05:00
Quentin Carbonneaux
d3530271f8 cosmetics 2016-02-29 10:09:17 -05:00
Quentin Carbonneaux
addd42ceae group symbols together in tokens enum 2016-02-29 10:03:33 -05:00
Ori Bernstein
032c3eafdd Make err nonstatic. 2016-02-28 23:39:43 -08:00
Ori Bernstein
542d89bcd5 Add zero fill data. 2016-02-28 20:39:41 -08:00
Ori Bernstein
8a9b0c5513 Add strings as 'b "foo"' 2016-02-28 20:36:01 -08:00
Ori Bernstein
50c5af4290 Allow trailing and ',' and references in data.
This change adds support for two things:

		data $foo {l 123,}

	Which allows easier machine generation of data
	statements. It also adds the ability to parse
	and emit references in data declarations.
2016-02-28 20:16:20 -08:00
Ori Bernstein
ec7c4e0d60 Make parser slightly more accepting.
'_' is ok to start a symbol, and '$' is an acceptable character
	within a symbol.
2016-02-28 19:40:06 -08:00
Ori Bernstein
7f738bb025 More standard/better error message formatting. 2016-02-28 19:38:11 -08:00
Quentin Carbonneaux
187c9991b5 print new jump instructions 2016-02-23 11:27:46 -05:00
Quentin Carbonneaux
82d5bbc0bc patch return, might not work 2016-02-23 10:54:56 -05:00
Quentin Carbonneaux
e400e177b6 use isstore() in parser 2016-02-22 13:55:18 -05:00
Quentin Carbonneaux
3983c206f9 add lexing sugar for backward compatibility 2016-02-19 14:17:22 -05:00
Quentin Carbonneaux
97cfdc309e stop using OXxx1 and use new OLoad 2016-02-18 19:40:40 -05:00
Quentin Carbonneaux
6dc1cdead0 always print RACall with 3 digits 2016-02-15 22:12:54 -05:00
Quentin Carbonneaux
1d9499172b cut code, use scanf a little more 2016-02-12 14:23:57 -05:00
Quentin Carbonneaux
8e88861807 new syntax for float literals 2016-02-12 14:20:12 -05:00
Quentin Carbonneaux
8b81a5acc6 scan ints using scanf 2016-02-12 13:56:29 -05:00
Quentin Carbonneaux
53a5d7de2a fp cmp fixes (highly untested) 2016-02-11 16:12:11 -05:00
Quentin Carbonneaux
d71749d2fd go verbose in parse.c 2015-12-27 14:13:33 -05:00
Quentin Carbonneaux
0791dd026e sanitize constants representation 2015-12-08 10:39:06 -05:00
Quentin Carbonneaux
0298b6c4ca oops, fix typo bug in parse.c 2015-12-01 13:11:03 -05:00
Quentin Carbonneaux
839dca331a more error reporting in parsedat() 2015-11-30 16:12:51 -05:00
Quentin Carbonneaux
7c97ca6aae parse and print floating points 2015-11-30 15:51:32 -05:00
Quentin Carbonneaux
af1a5079fd change the wide bit to a class number 2015-11-30 11:44:37 -05:00
Quentin Carbonneaux
5097cf1d42 stores becomes storeh 2015-11-30 10:18:03 -05:00
Quentin Carbonneaux
a968dc687d support _ in identifiers 2015-11-18 08:56:02 -05:00
Quentin Carbonneaux
8dcf6dceab export printref function 2015-11-13 15:22:33 -05:00
Quentin Carbonneaux
a3a1fc0c80 move usage computation in filluse() 2015-11-11 21:21:54 -05:00
Quentin Carbonneaux
0b559fcd4d support lighter syntax for arrays 2015-11-05 09:57:30 -05:00
Quentin Carbonneaux
0679df0b56 break Tmp.phi chains at phi nodes
This makes sure the Tmp.phi "chain" is at most
two elements long.  Something smarted could be
possible, but union-find with path compression
is still not exactly what I want.
2015-11-01 13:55:06 -05:00
Quentin Carbonneaux
07c46bc6f9 support dots in idents for k0ga 2015-11-01 09:15:27 -05:00
Quentin Carbonneaux
7abf421ea2 make phi-class handling more local
The phi classes are no longer in a union-find
structure, instead each temporary argument of
a phi node gets a pointer to it.  The hinting
of the phi node is then shared with its the
one of its arguments.  When liveness proceeds
and finds out that two elements with same
hinting (a phi node and one of its arguments
or two arguments of the same phi node)
interfere, one of them has its phi pointer
reset, that way, the hinting won't be shared.
2015-10-31 23:39:52 -04:00
Quentin Carbonneaux
486915f501 print memory references in IR dumps 2015-10-30 13:20:42 -04:00
Quentin Carbonneaux
04b66d38db start integrating RAMem references 2015-10-30 13:20:42 -04:00