aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Unhardcode byte size being 8 bits.David Given2008-12-171-1/+1
| | | | | | Signed-off-by: David Given <dg@cowlark.com> [negative value division fixed by alexey.zaytsev@gmal.com] Signed-off-by: Alexey Zaytsev <alexey.zaytsev@gmail.com>
* Fix most -Wshadow warnings in Sparse.Josh Triplett2007-05-011-1/+1
| | | | Signed-off-by: Josh Triplett <josh@freedesktop.org>
* Use GCC format and sentinel attributes on appropriate functionsJosh Triplett2007-03-091-4/+4
| | | | | | | | | | | | | Expose the FORMAT_ATTR portability macro in lib.h, and use it on the various printf-like functions in sparse. Add a new SENTINEL_ATTR portability macro for the GCC sentinel attribute, and use it on match_idents in parse.c. match_oplist in expression.c should use SENTINEL_ATTR, but GCC does not accept an integer 0 as a sentinel, only a pointer 0 like NULL. Signed-off-by: Josh Triplett <josh@freedesktop.org>
* Fix typos in commentsJosh Triplett2007-03-091-3/+3
| | | | Signed-off-by: Josh Triplett <josh@freedesktop.org>
* Disable liveness "dead" instruction by default.Christopher Li2007-02-281-0/+1
| | | | | | | | | | | The liveness instruction takes up about 10% of the bytecode bloat file. It is not very useful, it is duplicate information that can be obtained from the def/user chain. This change disables the liveness instruction by default. The caller can track_pseudo_death() if needed. Signed-Off-By: Christopher Li <sparse@chrisli.org>
* Coding style fix: in a pointer type, * goes with the name, not the type.Josh Triplett2007-01-271-1/+1
| | | | Signed-off-by: Josh Triplett <josh@freedesktop.org>
* cleanup write to argument array hackChristopher Li2006-12-041-3/+7
| | | | | | | | | | | | The sparse interface is a kind of snaky that it change the input argument array. The function sparse() does the same hack just to skip the files. This patch add the ptr list for string. So sparse_initialize will return list of file to compile. The string pointer is not aligned at word boundary. This patch introduce non taged version of the ptr list iteration function. Signed-off-by: Christopher Li <sparse@chrisli.org>
* Typo fixesPavel Roskin2006-11-061-2/+2
| | | | | Signed-off-by: Pavel Roskin <proski@gnu.org> Signed-off-by: Josh Triplett <josh@freedesktop.org>
* [PATCH] avoid a crash caused by the phisrc OP_COPY with a NULL ->def.Luc Van Oostenryck2005-11-251-1/+1
| | | | | Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@looxix.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* example: OP_COPY must destroy any old pseudo stateLinus Torvalds2005-11-221-0/+24
| | | | | | | | | | | | Toto, I have a feeling We're not in SSA land any more. (Not that it really helps. The example compiler not only had SSA assumptions, it also depended on liveness information and insn->def state, both of which are destroyed by the un-ssa phase. So this is really a small bandage around a much larger problem, and doesn't really fix anything fundamental). Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* Make the "example" compiler use the new unssa() phaseLinus Torvalds2005-11-221-54/+14
| | | | | | | | | Yeah, this probably breaks the example in a totally _different_ way than it was broken before ;) But it's certainly no worse than before. At least not much. Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* Handle symbols from "-include" file tooLinus Torvalds2005-11-021-1/+1
| | | | | | Noted by Mitesh Shah Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* Update the calling interface to "sparse()".Linus Torvalds2005-08-031-2/+5
| | | | | | | | | | | | | | Start off with sparse_initialize(argc, argv); which will return the number of filenames found. You can then use that, or just check if *argv is NULL in a loop like while (*argv) list = sparse(argv); where you get the declaration list for each file in turn.
* Add compile-time "range-check" infrastructure to sparseLinus Torvalds2005-04-071-1/+3
|
* Duh. When a function returns VOID, we should _not_ add thatLinus Torvalds2005-04-071-1/+2
| | | | to the return register state.
* Fix code generation confusion between OP_ADDR and theLinus Torvalds2005-04-071-12/+45
| | | | value that is contained within.
* Make the example code generator do something half-way saneLinus Torvalds2005-04-071-14/+32
| | | | about addresses of local variables.
* Split the binops where signedness matters into unsigned and signed.Linus Torvalds2005-04-071-7/+12
| | | | | | | This is OP_MUL/OP_DIV/OP_MOD/OP_SHR. We actually do the constant simplifications still wrong, but now the information is all there.
* Make output_insn() tell where it was called from, and avoidLinus Torvalds2005-04-071-0/+7
| | | | doing unnecessary register->sameregister moves.
* Make "fill_reg" do somewhat the right thing when we take theLinus Torvalds2005-04-071-1/+28
| | | | | | address of a symbol. Not quite there..
* Oops. Missed a place where we still tested for "busy" thinking thatLinus Torvalds2005-04-071-1/+1
| | | | it meant "contains a pseudo".
* Make the argument storage setup be a bit more accurate.Linus Torvalds2005-04-071-10/+33
| | | | | | Take argument type into account (somewhat), and do a first (broken, but it's a good example) cut at having different calling conventions for different kinds of functions.
* Make "reg->busy" mean how many "operands" actually reference thisLinus Torvalds2005-04-071-26/+53
| | | | | | | register right now. Change users that just wanted to test for "empty" to check that "reg->contains" is NULL instead.
* Start moving to a more symbol "struct operand" notion, rather thanLinus Torvalds2005-04-071-15/+144
| | | | | | | using static strings. If we ever want to generate more abstract output (and we do), we can't just have strings.
* Split OP_SETVAL into OP_SETVAL (fp expressions and labels) and OP_SYMADDRLinus Torvalds2005-04-071-2/+2
| | | | | | | (symbol addresses). They are pretty different. Symbol addresses have special meaning during various phases, from symbol simplification to CSE.
* Make sure to mark all registers that have already been allocatedLinus Torvalds2005-04-071-0/+28
| | | | | | | by a parent as outputs as unavailable as an input register. The parent won't be able to write two different pseudos to the same register..
* The stack offset is global, not per-bb.Linus Torvalds2005-04-071-6/+5
| | | | | We could make the internal per-bb allocations be local, though. That would require some more care.
* Duh. We marked the wrong register REG_FIXED when we wrote outLinus Torvalds2005-04-071-1/+1
| | | | | | | the outgoing pseudos. This caused us to then possibly double-allocate that register later for another pseudo..
* Add some back-of-the-envelope support for asm inputs tiedLinus Torvalds2005-04-071-5/+31
| | | | to the outputs.
* Do absolutely horrid job of generating code for asms.Linus Torvalds2005-04-071-7/+137
| | | | | I totally botch the constraints handling, but hey, it's just an example.
* Use the one-deep CC-cache for OP_SEL too.Linus Torvalds2005-04-071-21/+30
|
* If we decide to mark a register as being its own storage,Linus Torvalds2005-04-071-2/+3
| | | | | | | return NULL from find_pseudo_storage(). That way the caller won't bother to move the register to itself - it sees that it has no separate storage.
* Add a one-deep CC-cache for condition code setting and usage.Linus Torvalds2005-04-071-123/+218
| | | | | | | | We could make it deeper if we wanted to combine conditionals, but one-deep is good enough to catch the common "setXX + brcc" thing, and thus makes the conditional branches MUCH more readable. This also moves things around a bit to help organization.
* Show asm inputs/outputs as bugus instructions as opposed to comments.Linus Torvalds2005-04-071-2/+2
| | | | They otherwise get drowned out by the _real_ comments.
* Start looking at asms in code generation.Linus Torvalds2005-04-071-1/+40
| | | | Just the infrastructure.
* Do some kind of signed cast too.Linus Torvalds2005-04-071-5/+8
|
* Do slightly better on casts.Linus Torvalds2005-04-071-6/+13
| | | | In particular, casts to a smaller type doesn't need to do anything.
* Teach code generator about commutative operations.Linus Torvalds2005-04-071-6/+63
| | | | | It can select the order based on whether one of the sources is dead, or on the target register choice.
* Mark the backing store storage dead when marking a pseudo dead.Linus Torvalds2005-04-071-19/+25
| | | | | | | | | This allows us to mark a register dead when we load it from dead backing store. NOTE! This all sounds nonsensical, but we mark things "dead" _before_ the last use, not after. So dead means not that it's gone, it means that this use is the last one.
* Make "find_pseudo_storage()" return the storage hash entryLinus Torvalds2005-04-071-6/+10
| | | | | | | rather than the storage itself. I'll want to mark the hash entry dead when marking the pseudo dead, and this allows me to use the common helper routine.
* Split up the code that finds the underlying storage for aLinus Torvalds2005-04-071-44/+71
| | | | | | | | | | pseudo into a routine of its own. Cleaner and more readable. This also allows us to be a lot better at the "generic" inputs (aka gcc "g" specifier), since it can now just look up the storage instead of having to load it into a register.
* Add support for various arch-specific storage allocationLinus Torvalds2005-04-071-2/+116
| | | | | | | issues: - argument passign setup - return value storage - silly switch register hack.
* Kill off dead pseudos before doing target allocation for casts and loads.Linus Torvalds2005-04-071-12/+16
| | | | That allows us to re-use the sources if they have died.
* Keep dead pseudos in the register "busy" count, add "dead" count.Linus Torvalds2005-04-071-5/+57
| | | | | | | This makes it much easier to look at the real state of a register: - busy == 0 means no users - busy == dead means all users are dead - dead != 0 means that we should clean it
* Add comment on where incoming pseudos come from.Linus Torvalds2005-04-071-0/+1
|
* Generate pseudo-code for OP_SEL.Linus Torvalds2005-04-071-0/+18
| | | | | You know the drill by now. It's not so much correct, as it is "kind of looks right".
* Make target register allocation prefer empty registers.Linus Torvalds2005-04-071-0/+4
| | | | Yeah, yeah, it's still pretty stupid.
* Generate cheesy "cast" instructions.Linus Torvalds2005-04-071-0/+23
| | | | | No sign extension, no nuffink. My opcode generation gets worse and worse.
* Add fake OP_CALL code generation.Linus Torvalds2005-04-071-0/+39
| | | | Just real enough to make it look good.
* Be a bit more forgiving about impossible output register situations.Linus Torvalds2005-04-071-1/+4
| | | | | | We get those when encountering unimplemented instructions, since then we'll have bad register contents. Let's just silently ignore it for now.