aboutsummaryrefslogtreecommitdiffhomepage
Commit message (Collapse)AuthorAgeFilesLines
...
* aarch64: fix stack frame layout, againlemon2026-04-122-35/+37
| | | | | Turns out hardware enforces SP 16-bit alignment in every SP relative load/store, but QEMU doesn't emulate this.
* test/csmith.sh: add --no-packed-structlemon2026-04-111-1/+1
| | | | We don't support #pragma pack yet
* frontend: always narrow assignment expression used as valuelemon2026-04-111-2/+2
|
* 0.2.5lemon2026-04-111-2/+2
|
* testing: script for csmith fuzz testinglemon2026-04-111-0/+90
|
* irdump: dont print instr numbers by defaultlemon2026-04-111-6/+21
|
* backend: fix memory leak from not calling deluses() after replcuses in some ↵lemon2026-04-114-12/+11
| | | | places
* backend: run mem2reg after inlininglemon2026-04-113-2/+8
|
* x86-64/emit: fix stack arg offset for edgecaseslemon2026-04-111-1/+2
| | | | | It was wrong for functions that didn't use the frame pointer but took arguments in the stack
* c: fix bitfields in unionslemon2026-04-101-4/+6
|
* x86-64/isel: always test for ZF after shiftlemon2026-04-091-3/+3
| | | | | The shift instructions do not update flags if the shift amount was zero, so can't realiably do this micro optimization
* backend: inlining improvementslemon2026-04-093-13/+29
|
* mkintcon: bugfix clamp i32 to i32 rangelemon2026-04-092-3/+5
|
* x86-64/isel: fix stack addr regression from 8b79b61ae7lemon2026-04-091-2/+4
| | | | Checks for RADDR should also look for RSTACK when fusing addresses
* x86-64/isel: use integer stores for storing float constantslemon2026-04-091-2/+16
| | | | | Because the integer mov can have immediate operands, avoids a round trip through an XMM register.
* aarch64 handle more cases of stack relative addressinglemon2026-04-092-3/+21
|
* 0.2.4lemon2026-04-081-2/+2
|
* Implement basic aarch64 struct arg passing ABIlemon2026-04-0810-139/+204
| | | | | | | | | | - Missing: vaargs, >2 member HFAs - Reworked the way stack allocation references are lowered. Now RSTACK persists throughout all passes until emit. This allows deferring stack frame layouting until the end in a less messy way than before, which was emiting frame-pointer relative addresses @ isel time and patching them up later in emit to account for actual stack frame layout.
* x86-64: redzone optimization for leaf functionslemon2026-03-272-9/+12
| | | | Don't use frame pointer or explicitly modify stack pointer for these
* aarch64: GOT relocationslemon2026-03-263-18/+49
|
* driver: try to autodetect crosscc includslemon2026-03-251-0/+21
|
* inliner: fix UB when ninstrtab==0lemon2026-03-251-1/+1
|
* abi: fix use bug preventing mem2reg optimization of struct returnlemon2026-03-252-4/+5
|
* aarch64 struct arg passing ABI wiplemon2026-03-255-11/+127
|
* *skiplemon2026-03-241-1/+1
|
* cpp: support directives within macro argument listlemon2026-03-243-55/+93
| | | | Undefined behavior by the standard but a GNU extension.
* driver: -pthread -> -D_REENTRANT & -lpthreadlemon2026-03-241-1/+4
|
* regalloc: remove dead code for liveness fixuplemon2026-03-241-100/+22
| | | | | | I tested it and it seems this wasn't doing anything. Maybe at some point in the past it was needed to fix up a worse implementation of mem2reg? So turn it into a check. Maybe it's wrong and it can be necessary.
* ir_inliner: redundant checklemon2026-03-241-1/+0
|
* Update todolemon2026-03-241-2/+4
|
* get rid of imap (was only used for mem2reg, no longer)lemon2026-03-242-111/+0
|
* mem2reg rewritelemon2026-03-242-108/+74
| | | | | | | Do it in 2 passes: 1. gather variables, 2. step thru RPO transforming loads/stores to each variable. More elegant solution to f9e3a52eaa. More efficient since all variable usages are visited in CFG order, which matters due to block sealing.
* 0.2.3lemon2026-03-231-2/+2
|
* IR: emit inline function standalone bodies lazilylemon2026-03-2310-41/+139
| | | | | | | If a function is stashed for inlining and inlined in all of its callsites or unused, it never ends up in the object file. If any symbol reference to it is emitted, then it must be de-inlined (rematerialized), and this is done near the end before emitting the actual object file.
* IR: mark free'd instructions as suchlemon2026-03-238-44/+54
| | | | | That way they are not copied when inlining. Also rename ninstr -> ninstrtab. opnarg -> opnoper
* 4f2fb9ba5f fixlemon2026-03-231-1/+2
|
* <iso646.h>, test for libc headerslemon2026-03-233-4/+62
|
* tests: don't rely on unportable %p outputlemon2026-03-232-7/+11
|
* rega/devirt: don't assume unused operands are zeroinitializedlemon2026-03-231-1/+1
|
* c: recognize __alignof__ and __alignas__lemon2026-03-231-2/+2
|
* c: __attribute__ after declaratorlemon2026-03-231-0/+1
|
* io: use FILE* for buf fp impllemon2026-03-232-8/+10
|
* c: __attribute__ in more placeslemon2026-03-231-0/+2
|
* c: remove inline 'backing' type tag for enumslemon2026-03-233-9/+4
| | | | | | | | | | It was meant as a micro-optimization but actually keeping it in sync was annoying. This for example was broken: ``` extern enum foo { ... } g_foo; enum foo g_foo; ```
* style: change uvlong -> u64int, vlong -> s64intlemon2026-03-2222-125/+125
| | | | | Is much nicer. I don't know whether I want to do it for the other int types too. char and uchar are fine as bytes. u/short -> u/s16int, maybe.
* Update README.mdlsof2026-03-221-0/+1
| | | | OpenBSD working & tested
* aarch64: rem/urem, bswap*, arg bugfixlemon2026-03-225-12/+67
|
* eval: fix errata in EGETF addr caselemon2026-03-221-1/+1
| | | | | | | The symref given by staticaddrof is in ex2, not sub. This worked by chance (with sub->ssym.off happening to be zero) on linux, but on OpenBSD it would give garbage. Which would result in messed up relocations later leading to miscompilations.
* mem2reg: improve on f9e3a52eaalemon2026-03-221-2/+18
| | | | | Move the alloca to the beginning of the block and do a 2nd pass on those odd cases.
* mem2reg: fix rare edge case with weird control flowlemon2026-03-222-0/+30
| | | | | | | | | mem2reg was assuming alloca's appeared before all their uses. When this didn't happen it broke the logic re. sealed blocks. Normally this doesn't happen in most natural code. Even with gotos, RPO would assure this in most cases, the exception I found is a goto that jumps into a loop past a variable declaration that is earlier in the loop. Then even RPO would keep the alloca itself past the first uses, breaking things.