Jakub Konka
3ec0520bac
dwarf: use common DI union object for arg and var gen
2022-12-02 12:22:17 +01:00
Jakub Konka
8fea84f77e
dwarf: move Wasm specific dwarf gen out of codegen
2022-12-01 20:55:55 +01:00
Jakub Konka
17ab40f755
dwarf: refactor arm and riscv64 to the new scheme
2022-12-01 20:06:11 +01:00
Jakub Konka
4120332577
dwarf: fix typos after refactoring dbi gen
2022-12-01 17:23:28 +01:00
Jakub Konka
5bffc17c42
codegen: make LinkerLoad a common struct shared by backends
2022-12-01 16:32:09 +01:00
Jakub Konka
00016ab6a0
dwarf: extract common logic for generating func var dbg info
2022-12-01 15:28:22 +01:00
Jakub Konka
7d0af639d8
dwarf: update arm and riscv codegens to the new model
2022-12-01 14:32:09 +01:00
Jakub Konka
5ee99f862a
dwarf: extract common logic for generating func arg dbg info
2022-12-01 14:06:24 +01:00
Luuk de Gram
3933a4bac5
codegen: support generating packed structs
2022-11-30 17:56:02 +01:00
Luuk de Gram
df7ddb475e
wasm: Fix pointer to field of packed struct
...
When requesting a pointer to a field of a packed struct (of which is
not byte-aligned), we simply provide the address of the packed struct
itself.
2022-11-30 17:56:02 +01:00
Luuk de Gram
6924f21bbd
wasm: support non-natural alignment in load/store
...
This implements support for loading and storing where the lhs is
of pointer type with host_size != 0. e.g. when loading a specific
field from a packed struct with a non-byte alignment such as (0:1:3).
2022-11-30 17:56:02 +01:00
Luuk de Gram
a7ad1212cb
wasm: airAggregateInit - Support packed structs
...
This allows the Wasm backend to construct an instance of a packed
struct during runtime. We first allocate a local, and then
shift+or each field's value into the result local. We then finally
return this result local as value.
The commit also fixes a type-issue in `airElemVal` where we used
the element type instead of a pointer type to store the value's
address into.
2022-11-30 17:56:02 +01:00
Luuk de Gram
a314e86772
wasm: support passing packed struct over C-ABI
...
This also adds support loading a runtime pointer from a packed struct.
Also, this commit improves many utility functions such as `trunc` and
`intcast` to also support non-integer types such as booleans.
2022-11-30 17:56:02 +01:00
Luuk de Gram
4af5bbde53
wasm: airStructFieldPtr - Support packed structs
...
Simplifies the airStructFieldPtr(index) functions to only obtain the
correct struct type and field index, which is then passed into the
structFieldPtr function. This function now calculates the byte-offset
of the field's address and returns a new `WValue` with this offset.
This means we only have to do this calculation in a single function,
and no longer have to duplicate any logic. This also handles both
regular (tagged) unions and packed unions.
2022-11-30 17:56:01 +01:00
Luuk de Gram
eb2caf9390
wasm: airStructFieldVal - Support packed structs
...
This implements loading a field from a packed struct, regardless of
its field's type. This means it supports pointers, floats and
integers. The commit also extracts the logic from airTrunc into its
own `trunc` function so it can be re-used.
2022-11-30 17:56:01 +01:00
Luuk de Gram
7cf442cabc
wasm: Support bitcasting between floats and ints
2022-11-30 17:56:01 +01:00
Luuk de Gram
2be0d5bbca
wasm: add support packed structs in lowerConstant
...
When lowering constants of packed structs, which are smaller than 65
bits, we lower the value to an integer rather than store it in the
constant data section. This allows us to use an immediate value,
for quick loads and stores.
2022-11-30 17:56:01 +01:00
Andrew Kelley
ceb0a632cf
std.mem.Allocator: allow shrink to fail
...
closes #13535
2022-11-29 23:30:38 -07:00
Veikka Tuominen
8eea73fb92
add tests for tuple declarations
2022-11-23 22:16:31 +02:00
Veikka Tuominen
fc5209c139
llvm: fix x86_64 sysV ABI of big vectors on avx512 enabled CPUs
...
Closes #13629
2022-11-23 00:05:07 +02:00
joachimschmidt557
89c374cd2d
stage2 ARM: misc fixes
...
- remove redundant `new` from `binOpRegisterNew` name
- fix mul_with_overflow
2022-11-21 08:23:07 +01:00
Guillaume Wenzek
476b946802
compute LLVMTypes in ParamTypeIterator ( #13592 )
...
follow up on #13376 - fixes a bug in the x86_64 C ABI.
Co-authored-by: Veikka Tuominen <git@vexu.eu>
2022-11-20 01:14:02 -08:00
Stevie Hryciw
04f3067a79
run zig fmt on everything checked by CI
2022-11-18 19:22:42 +00:00
Jakub Konka
4b3637820d
Merge pull request #13495 from ziglang/macho-dsym
...
stage2: misc DWARF debug info fixes and additions for x86_64 and aarch64
2022-11-10 16:50:57 +01:00
Jakub Konka
31e755df6f
aarch64: handle .stack_argument_offset as a valid local var
2022-11-09 19:58:14 +01:00
Jakub Konka
df09d9c14a
x86_64: add DWARF encoding for vector registers
...
Clean up how we handle emitting of DWARF debug info for `x86_64`
codegen.
2022-11-09 18:35:06 +01:00
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
Jakub Konka
179f16904f
aarch64: circumvent zig0 inference problems
2022-11-08 13:59:06 +01:00
Jakub Konka
32ad218f5a
aarch64: revert changes to .call
2022-11-08 13:50:30 +01:00
Jakub Konka
45f65c8445
aarch64: fix implementation of .is_null and .is_non_null
2022-11-08 13:42:58 +01:00
Jakub Konka
0d556877af
aarch64: implement .wrap_optional always saving to the stack
2022-11-08 13:42:58 +01:00
Jakub Konka
a07449450f
aarch64: implement optionalPayload when mcv is register
2022-11-08 13:42:58 +01:00
Jakub Konka
35bd5363ee
aarch64: implement isNull() for non-pointer optionals
2022-11-08 13:42:58 +01:00
Jakub Konka
0de56d1722
aarch64: partially implement optionalPayload()
2022-11-08 13:42:58 +01:00
Jakub Konka
cd7cbed651
aarch64: partially implement isNull()
2022-11-08 13:42:58 +01:00
Jakub Konka
83d89a05b7
coff: compile and link simple exit program on arm64
...
* make image base target dependent
* fix relocs to imports
2022-11-05 10:15:01 +01:00
Jakub Konka
53a9661c1a
coff: generate relocations for branch, GOT, direct refs
2022-11-05 10:15:00 +01:00
Jakub Konka
62ae365308
aarch64: implement airCall for COFF
2022-11-05 10:15:00 +01:00
Jakub Konka
1fe0b58942
aarch64: extract atom index for both COFF and MachO
2022-11-05 10:14:59 +01:00
Jakub Konka
df0212bf47
aarch64: handle register downgrading in truncRegister
2022-11-05 10:14:59 +01:00
joachimschmidt557
3051fab97c
stage2 AArch64: misc fixes, enable printing in test runner
...
- Fixed missing airRetPtr implementation
- Fixed wrong pop_regs order
- Fixed wrong source and destination register in store
2022-11-01 20:44:18 +01:00
joachimschmidt557
4e0779813b
stage2 AArch64: add inline memset
2022-11-01 20:43:27 +01:00
joachimschmidt557
8a022d9c92
stage2 AArch64: implement wrap_errunion_{err,payload}
2022-11-01 20:43:27 +01:00
joachimschmidt557
3ecec50f0c
stage2 AArch64: implement basic switch statements
2022-11-01 20:43:27 +01:00
joachimschmidt557
d2a5a36cab
stage2 AArch64: implement min/max
2022-11-01 20:43:27 +01:00
Andrew Kelley
cbdc91eb1a
stage2: fix compilation on 32-bit arm
2022-10-31 14:21:36 -07:00
Andrew Kelley
28dc208f65
Merge pull request #13082 from g-w1/unnamed-decls-and-relocs-p9
...
Plan9: Fix The Backend
2022-10-29 17:45:00 -04:00
Veikka Tuominen
d03c47bf85
Sema: use runtime_value instead of creating allocs
2022-10-27 21:08:25 -04:00
Jacob G-W
5cf3d10e35
Plan9: deal with unnamed decls
...
Hello World works again!
2022-10-24 16:53:12 -04:00
Andrew Kelley
04472af328
Merge pull request #13251 from Vexu/c-abi
...
implement ARM C ABI, separate C ABI tests from standalone tests
2022-10-23 12:16:58 -07:00