Jakub Konka
bc43cee775
Get more things passing
2023-03-11 20:05:49 +01:00
Jakub Konka
ea3b3e94ab
x86_64: clean up call semantics in codegen
2023-03-11 20:05:49 +01:00
Jakub Konka
f14831ec73
x86_64: truncate immediates
2023-03-11 20:05:49 +01:00
Jakub Konka
817fb263b5
x86_64: downstream table-driven instruction encoder
2023-03-11 20:05:49 +01:00
Andrew Kelley
e7f128c205
Merge pull request #14782 from r00ster91/trap
...
add `@trap` builtin
2023-03-04 16:20:31 -05:00
r00ster91
65368683ad
add @trap builtin
...
This introduces a new builtin function that compiles down to something that results in an illegal instruction exception/interrupt.
It can be used to exit a program abnormally.
This implements the builtin for all backends.
2023-03-04 12:08:19 +01:00
Jakub Konka
1024332adc
arm: use common implementation of genTypedValue helper
2023-03-03 18:24:58 +01:00
Jakub Konka
c746cbc686
codegen: move gen logic for typed values, consts and decl ref to common codegen
2023-03-03 18:06:25 +01:00
Jacob Young
6bed45b873
codegen: fix test failures
...
Various backend were mismatching arg instructions and function args.
2023-02-27 16:30:15 -05:00
Jakub Konka
a7de8dc2dd
x86: alloc new mcv in bitcast if cannot reuse operand
...
Implement missing pointees when ptr is in register.
2023-02-20 10:52:26 +01:00
Andrew Kelley
aeaef8c0ff
update std lib and compiler sources to new for loop syntax
2023-02-18 19:17:21 -07:00
Jakub Konka
5de2aae63c
link: decouple DI atoms from linker atoms, and manage them in Dwarf linker
2023-02-01 15:03:55 +01:00
Jakub Konka
b3277c8936
link: make Plan9 atoms fully owned by the linker
2023-02-01 11:12:53 +01:00
Jakub Konka
c430e9afa7
link: make Coff atoms fully owned by the linker
2023-01-31 20:27:17 +01:00
Jakub Konka
4404c4d200
link: make Elf atoms fully owned by the linker
2023-01-31 17:54:12 +01:00
Jakub Konka
d42a931051
link: make MachO atoms fully owned by the linker
2023-01-31 00:43:25 +01:00
Jakub Konka
cc1d7a0e31
coff: migrate to new non-allocateDeclIndexes API
2023-01-26 14:29:14 +01:00
Jakub Konka
e1b9800ffa
elf: migrate to new non-allocateDeclIndexes API
2023-01-26 14:29:14 +01:00
Jakub Konka
041bc71bc8
self-hosted: clean up calling logic for x86_64 and aarch64 across linkers
2023-01-26 14:29:14 +01:00
Jakub Konka
4d804c1b23
macho: completely remove allocateDeclIndexes in favor of linker tracking
2023-01-26 14:29:14 +01:00
Jakub Konka
a95d58caf2
self-hosted: rename codegen Result.appended to Result.ok
2023-01-25 10:28:18 +01:00
Jakub Konka
4983da40d0
self-hosted: remove unused externally_managed prong for Decls code
2023-01-25 10:10:50 +01:00
Veikka Tuominen
4e64373fc0
fix generic function arg debug info referencing wrong parameter
...
Closes #14123
2022-12-30 17:00:50 +02:00
Andrew Kelley
aca9c74e80
Merge pull request #13914 from Vexu/variadic
...
implement defining C variadic functions
2022-12-18 16:24:13 -05:00
r00ster91
aac2d6b56f
std.builtin: rename Type.UnionField and Type.StructField's field_type to type
2022-12-17 14:11:33 +01:00
Veikka Tuominen
9bb1104e37
implement defining C variadic functions
2022-12-17 13:22:09 +02:00
Veikka Tuominen
8a0a6b7387
port packed vector elem ptr logic from stage1
...
Closes #12812
Closes #13925
2022-12-15 21:06:35 -05:00
Veikka Tuominen
7b2a936173
remove stack option from @call
2022-12-13 12:52:21 +02:00
Veikka Tuominen
9d93b2ccf1
Eliminate BoundFn type from the language
...
Closes #9484
2022-12-09 20:37:18 -07:00
Andrew Kelley
fdbb0fb7b9
Merge pull request #13744 from Vexu/stage2-fixes
...
Improve error messages, fix dependency loops
2022-12-03 00:42:11 -05:00
Veikka Tuominen
0e38cc16d5
Sema: fix comparisons between lazy and runtime values
...
Closes #12498
2022-12-03 00:09:23 +02:00
Jakub Konka
bfd36cbf97
dwarf: pass linker Tag and owner Decl.Index instead of *Atom
2022-12-02 13:17:52 +01:00
Jakub Konka
05962a4aa2
x86: do not deref ptr type, let Dwart do it
2022-12-02 12:23:01 +01:00
Jakub Konka
3ec0520bac
dwarf: use common DI union object for arg and var gen
2022-12-02 12:22:17 +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
Andrew Kelley
ceb0a632cf
std.mem.Allocator: allow shrink to fail
...
closes #13535
2022-11-29 23:30:38 -07:00
Stevie Hryciw
04f3067a79
run zig fmt on everything checked by CI
2022-11-18 19:22:42 +00: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
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
Veikka Tuominen
031c768cc8
add C ABI tests for simd vectors
2022-10-22 11:31:41 +03:00
Cody Tapscott
724d753638
stage2: Add .save_err_return_trace_index AIR op
...
This is encoded as a primitive AIR instruction to resolve one corner
case: A function may include a `catch { ... }` or `else |err| { ... }`
block but not call any errorable fn. In that case, there is no error
return trace to save the index of and codegen needs to avoid
interacting with the non-existing error trace.
By using a primitive AIR op, we can depend on Liveness to mark this
unused in this corner case.
2022-10-21 10:44:20 -07:00
Ali Chraghi
ca27055cda
all: rename @maximum to @max and @minimum to @min
2022-10-18 14:15:16 +03:00
Robin Voetter
5d429b03e3
stage2: add @addrSpaceCast builtin
2022-10-12 20:36:12 +02:00