Commit Graph

23 Commits

Author SHA1 Message Date
Jakub Konka
02852098ee aarch64: emit DWARF debug info for fn params and locals
We postpone emitting debug info until *after* we generate the function
so that we have an idea of the consumed stack space. The stack offsets
encoded within DWARF are with respect to the frame pointer `.fp`.
2022-11-09 18:35:06 +01:00
joachimschmidt557
151e15e444 stage2 AArch64: merge floating-point registers into Register enum 2022-10-20 16:14:50 +02:00
joachimschmidt557
8b24c783c5 stage2 AArch64: implement basic integer division 2022-08-05 20:30:51 +02:00
Jakub Konka
d112cd52f3 aarch64: fix mul_with_overflow for ints <= 32bits 2022-05-05 21:43:36 +02:00
Jakub Konka
f4421c01e8 aarch64: implement mul_with_overflow for ints in range 33-64 bits incl 2022-05-05 21:43:36 +02:00
Jakub Konka
8715b01005 aarch64: implement mul_with_overflow for <= 32bit ints
Add emitters for `smull`, `umull` and `tst (immediate)` instructions.
2022-05-05 21:43:36 +02:00
joachimschmidt557
d9d9fea6ae stage2 AArch64: Add ldrsb, ldrsh instructions 2022-04-19 22:40:48 +02:00
joachimschmidt557
f95a8ddafa stage2 AArch64: Implement basic truncate functionality 2022-04-19 22:39:14 +02:00
joachimschmidt557
c78daeb642 stage2 AArch64: add basic assertions to bits.zig for correct codegen
Includes many fixes of errors discovered by adding these assertions
2022-04-19 22:37:56 +02:00
joachimschmidt557
12207bbbd6 stage2 AArch64: Implement bit shifting with immediate operands 2022-03-13 11:32:07 +01:00
joachimschmidt557
03dddc8d9c stage2 AArch64: implement bit shifts with register operands 2022-03-13 11:32:04 +01:00
joachimschmidt557
06058ed6f3 stage2 regalloc: replace Register.allocIndex with generic indexOfReg
* callee_preserved_regs and other ABI-specific information have been
moved to the respective abi.zig files
2022-03-11 13:29:16 +01:00
joachimschmidt557
e3121accac stage2 AArch64: introduce logical immediate instructions 2022-03-05 08:56:01 +01:00
joachimschmidt557
4683f94463 stage2 AArch64: remove MIR load_memory instruction
This instruction now just represents loading from a hard-coded adrress
after extracting the other use cases for load_memory into load_got and
load_direct.
2022-02-23 21:57:59 +01:00
joachimschmidt557
19c683fab0 stage2 AArch64: distinguish between sp/wsp and xzr/wzr 2022-02-21 22:44:47 +01:00
joachimschmidt557
1c37622659 stage2 AArch64: Implement not for booleans 2022-02-14 22:09:44 +01:00
joachimschmidt557
82f91adbb4 stage2 AArch64: Add madd, msub, mul, mneg instructions 2022-02-14 22:09:43 +01:00
joachimschmidt557
7e76aab98a stage2 AArch64: split ldr/str into {ldr,str}_register and _immediate 2022-01-14 00:46:07 +01:00
joachimschmidt557
8ab90a0b32 stage2 AArch64: split Instruction.ldr into ldr and ldrLiteral 2021-11-12 22:23:29 +01:00
joachimschmidt557
a5a012e859 stage2 AArch64: implement genSetReg for condition flags 2021-11-10 19:48:16 +01:00
joachimschmidt557
8cb00519cd stage2 AArch64: implement airCmp 2021-11-10 19:48:16 +01:00
Jakub Konka
91c3206b45 macho: use start.zig for macOS entrypoint
This effectively allows us to compile

```zig
pub fn main() void {}
```

which then calls into `std.start`.

Changes required to make this happen:
* handle signed int to immediate in x86_64 and aarch64 codegen
* ensure that on arm64 macOS, `.x19` is a caller-preserved register -
  I'm not sure about that one at all and would like to brainstorm it
  with anyone interested and especially Joachim.
* finally, fix a bug in the linker - mark new got entry as dirty upon
  atom growth.
2021-11-10 11:33:24 -05:00
joachimschmidt557
8f58e2d779 stage2 codegen: move bit definitions to src/arch 2021-09-24 13:47:59 -04:00