summary refs log tree commit diff
AgeCommit message (Collapse)Author
2017-04-08new abi test for arm64 HFAsQuentin Carbonneaux
2017-04-08enable arm64 testsQuentin Carbonneaux
The vararg tests had to be changed because va_list is 32-bit wide on arm. The astute reader will notice that the way we pass va_list values is wrong, we should be using the ':valist' type as defined below instead of 'l'. But eh, that works for now, because of the ABI. type :valist = align 8 { 32 }
2017-04-08add cross testing for arm64Quentin Carbonneaux
2017-04-08new arm64 backend, yeepeeQuentin Carbonneaux
2017-04-08rework storage of typesQuentin Carbonneaux
The arm64 ABI needs to know precisely what floating point types are being used, so we need to store that information. I also made typ[] a dynamic array.
2017-04-08prepare for multi-targetQuentin Carbonneaux
This big diff does multiple changes to allow the addition of new targets to qbe. The changes are listed below in decreasing order of impact. 1. Add a new Target structure. To add support for a given target, one has to implement all the members of the Target structure. All the source files where changed to use this interface where needed. 2. Single out amd64-specific code. In this commit, the amd64 target T_amd64_sysv is the only target available, it is implemented in the amd64/ directory. All the non-static items in this directory are prefixed with either amd64_ or amd64_sysv (for items that are specific to the System V ABI). 3. Centralize Ops information. There is now a file 'ops.h' that must be used to store all the available operations together with their metadata. The various targets will only select what they need; but it is beneficial that there is only *one* place to change to add a new instruction. One good side effect of this change is that any operation 'xyz' in the IL now as a corresponding 'Oxyz' in the code. 4. Misc fixes. One notable change is that instruction selection now generates generic comparison operations and the lowering to the target's comparisons is done in the emitter. GAS directives for data are the same for many targets, so data emission was extracted in a file 'gas.c'. 5. Modularize the Makefile. The Makefile now has a list of C files that are target-independent (SRC), and one list of C files per target. Each target can also use its own 'all.h' header (for example to define registers).
2017-04-08fix bug in union size computationQuentin Carbonneaux
The size of a union is the size of the largest element aligned with the largest alignment. For example, the size of the following union is 16, not 13 (as returned before this patch). union { char c[13]; int i; };
2017-03-29improve global registers handlingQuentin Carbonneaux
The register allocation now has stricter assertions about global registers. The stricter assertions required changes in the spiller: We now correctly indicate to the register allocator what registers are used by "ret" instructions.
2017-03-03add another idiomatic C test (rega does no good)Quentin Carbonneaux
2017-02-27make install/uninstall phoniesQuentin Carbonneaux
2017-02-27add install and uninstall targets to MakefileQuentin Rameau
2017-02-27remove unused parameter from uffind()Quentin Carbonneaux
2017-02-27minor tweaks to simpljmp passQuentin Carbonneaux
2017-02-27fix int parsingQuentin Carbonneaux
The spec says that numbers can be arbitrarily big, and only the last 64 bits will be taken into consideration. Calling sscanf does not implement this, so I wrote an ad-hoc function.
2017-02-27scrub assembly outputQuentin Carbonneaux
Notably, this adds a new pass to get rid of jumps on jumps.
2017-02-27update license yearsQuentin Carbonneaux
2017-02-27cosmetic fixesQuentin Carbonneaux
2017-02-25do sign/zero extensions removal in copy.cQuentin Carbonneaux
2017-02-24cosmetic modifications to emit.cQuentin Carbonneaux
2017-02-24start a new simplification passQuentin Carbonneaux
2017-02-24fix pretty bad bug in alias analysisQuentin Carbonneaux
When a temporary marked local is escaping, the whole slot must be marked as such. To solve this, Alias now holds a pointer to the alias information of the slot. For simplicity of the code, this pointer is always valid and fetching ->type out of it is meaningful.
2017-02-24wrong assumption killsl()Quentin Carbonneaux
2017-02-24improve the range of action of load eliminationQuentin Carbonneaux
When eliminating `load %foo`, don't limit the search to the live range of %foo, but to the live range of its aliasing information. For example, if %foo is a constant offset into a stack-allocated slot, %foo =l add %slot, 42 the search will proceed on all the code in which %slot is live, not only below the definition of %foo, like before.
2017-02-24deduplicate loadsz & storeszQuentin Carbonneaux
2017-02-24reenable and fix a bug in memoptQuentin Carbonneaux
While a minimal dead store elimination is not implemented, the generated code looks quite a bit better with them enabled. It also is quite cheap.
2017-02-24update isel commentQuentin Carbonneaux
2017-02-23add simple idiomatic c testQuentin Carbonneaux
2017-02-23propagate aliasing information through copiesQuentin Carbonneaux
2017-02-22do not err on address comparisonsQuentin Carbonneaux
While I was at it I also refreshed some bits in the instruction selection.
2017-02-22turn the instruction index into a listQuentin Carbonneaux
2017-02-17stricter class constraints for store & vastartQuentin Carbonneaux
2017-02-15comment fixQuentin Carbonneaux
2017-02-15add support for closure callsQuentin Carbonneaux
Compiling languages with closures often requires passing an extra environment parameter to the called function. One solution is to use a convention, and reserve, say, the first argument for that purpose. However, that makes binding to C a little less smooth. Alternatively, QBE now provides a way to remain fully ABI compatible with C by having a "hidden" environment argument (marked with the keyword 'env'). Calling a function expecting an environment from C will make the contents of the environment undefined, but the normal arguments will be passed without alteration. Conversely, calling a C function like it is a closure by passing it an environemnt will work smoothly.
2017-02-14minor cleanup in all.hQuentin Carbonneaux
2017-02-10update minic for new vararg supportQuentin Carbonneaux
We conservatively assume all functions have variable argument lists.
2017-02-10tests for variable argument listsQuentin Carbonneaux
2017-02-10support variable argument listsQuentin Carbonneaux
This change is backward compatible, calls to "variadic" functions (like printf) must now be annotated (with ...).
2017-02-08make rsp and rbp globally liveQuentin Carbonneaux
2017-02-07update assert() missed in 7e1c1fQuentin Carbonneaux
2017-02-06fix edge deletion bug in sccpQuentin Carbonneaux
When an edge is deleted, the phis and predecessors of the destination block have to be updated. This is what blkdel() was doing, but at a level too coarse. The new function edgedel() allows to remove a single edge (and takes care of multiple edges).
2017-02-06robustness fix in fillfron()Quentin Carbonneaux
This makes it possible to call it several times in a row.
2017-02-06use uint for block idsQuentin Carbonneaux
2017-02-03create an index for the instructions in the IL docQuentin Rameau
2017-02-01fix the same bug in varget()Quentin Carbonneaux
2017-02-01fix bug in varadd(), thanks Ed DavisQuentin Carbonneaux
2017-01-20create an instruction index for the IL docQuentin Rameau
2017-01-20change 'b' and 'h' ordering in IL docQuentin Rameau
2017-01-12use a less obtuse api for vnew()Quentin Carbonneaux
2017-01-10isel fixes for lame apple assemblerQuentin Carbonneaux
2017-01-07remove styling from generated htmlQuentin Carbonneaux