aboutsummaryrefslogtreecommitdiffhomepage
path: root/amd64
Commit message (Collapse)AuthorAgeFilesLines
* amd64: fix wrong condition code being used for float gth lemon2025-12-071-1/+1
| | | | ughh
* amd64: use XORPS for floating point negation lemon2025-12-072-3/+7
| | | | | | | | | | Previously `neg x` was being turned into `sub 0, x`. But this gives the wrong result for zero/negative zero (-0.0 == -0.0 but 0.0 - 0.0 == 0.0), so it wasn't IEEE compliant or correct. Do what every other compiler does instead and flip the sign bit with an exclusive or. Should implement someway of deduplicating small data constants like the ones used here though.
* abi: fix aggregate passed by regs 2nd reg offset lemon2025-12-061-3/+7
| | | | | | | | | It was broken for example `struct { i32 a; f64 b; }` (would try to load/store b from byte offset 4, not 8). Introduce r2off, realize in x86-64 it's always 8; even `struct {i32 a; f32 b;}` gets passed in one (integer) register. But not so in (future) ABIs like RISC-V, I believe there `{i32, f32}` would get passed in 1 integer and 1 float register (r2off = 4).
* add command-line predefined macros (-D, -U) lemon2025-12-061-1/+0
|
* amd64: fix pseudo-push/pop float reg lemon2025-12-051-2/+2
| | | | | | With add/sub flags can be trashed which can result in miscompilations, use lea. This shouldn't even exist, need to get rid of xsave/xrestore, but for now fix this kludge
* isel: fix flipped sub not being inplace lemon2025-12-051-0/+1
|
* amd64: handle unoredered float cmps lemon2025-12-051-2/+30
|
* isel: fix immediate of flipped sub lemon2025-12-041-0/+1
|
* test/11-abi lemon2025-12-021-6/+9
|
* amd64/isel: fix addressing index shift being possibly too large to encode (duh) lemon2025-11-292-1/+2
|
* isel: fix branch arg lemon2025-11-271-0/+2
|
* abi/isel: aggregate args in stack wip lemon2025-11-271-6/+11
|
* amd64/emit: I64 consts and fp push/pop lemon2025-11-241-7/+22
|
* fix regression w/ store instr + memory immediate lemon2025-11-241-11/+13
|
* isel: loadstoreaddr don't fuseaddr as much lemon2025-11-241-3/+5
|
* amd64/emit: fix (partially) float comparisonsd lemon2025-11-231-6/+10
|
* amd64: va_arg for small aggregates lemon2025-11-231-2/+8
|
* amd64/emit: this rbpoff approach is kinda broken.. lemon2025-11-231-1/+1
|
* implement float varargs, and some other fixes lemon2025-11-232-46/+51
|
* amd64/isel: indirect call arg must be memaddr lemon2025-11-221-2/+7
|
* make sure indirect function call pointer does not end up in clobber reg lemon2025-11-221-0/+5
|
* sysv: nested scalar classification of struct shouldn't return KPTR, used to ↵ lemon2025-11-221-1/+1
| | | | indicate aggregate in the stack
* amd64/emit: fix REX-requiring 8-bit GPR encoding checking wrong reg lemon2025-11-221-2/+2
|
* ir: barebones IR passes checked contracts lemon2025-11-211-0/+2
|
* remove umul lemon2025-11-212-4/+2
|
* change op names to match 285063eba44 lemon2025-11-213-48/+48
|
* rename IR classes to reflect bitsize lemon2025-11-213-47/+47
|
* isel: lower allocas a different way, such that stk address gets materialized ↵ lemon2025-11-202-27/+62
| | | | when necesary
* ir: for easier debugging, keep ctype in dats, print as literal when possible lemon2025-11-201-3/+7
|
* debug output to stdout lemon2025-11-191-1/+1
|
* ir: 'trap' jump; c: __builtin_trap; lex: __has_builtin lemon2025-11-151-0/+2
|
* isel: don't incorrectly clamp constant lhs of shift operation lemon2025-11-151-4/+4
|
* emit: stack alignment edgecases lemon2025-11-151-5/+9
|
* isel: fold arith lemon2025-11-141-1/+21
|
* sysv: document vaargs stack layout stuff lemon2025-11-141-3/+29
|
* preeliminary va_list support lemon2025-11-143-11/+186
|
* amd64/isel: fold Oext with immediates lemon2025-11-121-0/+8
|
* implement argument passing in stack lemon2025-11-121-6/+18
|
* amd64: fix positive RBP off (stack params); address encoding errata lemon2025-11-121-2/+2
|
* fixup! amd64: get rid of xinc/xdec. handle those at emit stage lemon2025-11-091-1/+1
|
* amd64/isel: make `sub imm` work for address fusing lemon2025-11-091-2/+8
|
* amd64: get rid of xinc/xdec. handle those at emit stage lemon2025-11-092-26/+7
|
* amd64: errata with unsigned greater than or equal (should be JAE) lemon2025-11-061-1/+1
|
* amd64: fix aggregate abi stuff;; ir: fold, peephole optimizing constructors lemon2025-11-052-19/+28
|
* isel: fix 3-address add when used for flags in branch lemon2025-11-021-0/+3
|
* isel fixes lemon2025-10-302-4/+11
|
* isel: fix address sel for absolute int addr lemon2025-10-261-0/+7
|
* emit: remove unnecessary REX.W prfix for TEST r8 lemon2025-10-261-1/+1
|
* amd64: add/sub operands less restrictive lemon2025-10-251-2/+2
|
* c: avoid generating relocations in .rodata (putting such objects in .data ↵ lemon2025-10-251-1/+3
| | | | instead for now)