Jakub Konka
ac434fd8cc
x86_64: avoid inline for-loops when scanning the encodings table
2023-03-12 22:06:22 +01:00
Jakub Konka
955e394792
x86_64: fix 32bit build issues in the encoder
2023-03-12 08:47:23 +01:00
Jakub Konka
707a74655b
x86_64: downstream encoder/assembler tests
2023-03-12 08:41:44 +01:00
Jakub Konka
433558a92f
x86_64: clean up
2023-03-11 20:05:50 +01:00
Jakub Konka
f279ccb807
x86_64: rename asmNone to asmOpOnly
2023-03-11 20:05:50 +01:00
Jakub Konka
fb38e3d6b2
x86_64: simplify immediate handling at MIR level
2023-03-11 20:05:50 +01:00
Jakub Konka
0a8b5c20aa
x86_64: add wrapper for .jcc with relocation
2023-03-11 20:05:50 +01:00
Jakub Konka
c9a153c797
x86_64: add .dead pseudo-instruction to mark an unused MIR instruction
2023-03-11 20:05:50 +01:00
Jakub Konka
621fc36b55
x86_64: add wrapper for .jmp_reloc
2023-03-11 20:05:50 +01:00
Jakub Konka
21630ea17f
x86_64: apply couple of tweaks and pass behavior tests
2023-03-11 20:05:50 +01:00
Jakub Konka
6e1da36503
x86_64: PtrSize.fromSize() should take into account nonexact sizes too
2023-03-11 20:05:50 +01:00
Jakub Konka
e34e7d5ad1
x86_64: add missing decodings for .movsx
2023-03-11 20:05:50 +01:00
Jakub Konka
fe1fab4a8e
x86_64: fix CALL emits for ELF and Plan9
2023-03-11 20:05:49 +01:00
Jakub Konka
d0e7212539
x86_64: finish rolling out all MIR assembly helpers
2023-03-11 20:05:49 +01:00
Jakub Konka
022b308d6a
x86_64: start converting MI references
2023-03-11 20:05:49 +01:00
Jakub Konka
4af8313f36
x86_64: plug up all RM/MR references
2023-03-11 20:05:49 +01:00
Jakub Konka
32708dd6e2
x86_64: add RM and MR helpers to codegen
2023-03-11 20:05:49 +01:00
Jakub Konka
9658ab6766
x86_64: handle all instructions without introducing Memory operand
2023-03-11 20:05:49 +01:00
Jakub Konka
1bde522c2c
x86_64: add helper for Jcc instruction
2023-03-11 20:05:49 +01:00
Jakub Konka
7221cd8ec9
x86_64: add helpers for CMOVcc and SETcc at the MIR level
2023-03-11 20:05:49 +01:00
Jakub Konka
f61a70e812
x86_64: handle encoding and decoding Imm64 unsigned
2023-03-11 20:05:49 +01:00
Jakub Konka
aa8fda799e
x86_64: split up assemble() into more declarative single-purpose helpers
2023-03-11 20:05:49 +01:00
Jakub Konka
6e882d730b
x86_64: introduce assemble() helper which encodes/decodes into MIR -> Instruction
2023-03-11 20:05:49 +01:00
Jakub Konka
5b37701028
x86_64: refactor immediate selection logic
2023-03-11 20:05:49 +01:00
Jakub Konka
219c1261a5
x86_64: all behavior tests passing
2023-03-11 20:05:49 +01:00
Jakub Konka
292f91aef2
Handle .ah vs .spl register aliases
2023-03-11 20:05:49 +01:00
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
Andrius Bentkus
4ea2f441df
Module: retry ZIR cache file creation
...
There are no dir components, so you would think that this was
unreachable, however we have observed on macOS two processes racing to
do openat() with O_CREAT manifest in ENOENT.
closes #12138
2023-03-11 06:20:51 -05:00
Luuk de Gram
904f414e7e
Merge pull request #14869 from Luukdegram/wasm-linker
...
wasm-linker: refactor virtual addresses
2023-03-10 16:48:30 +01:00
mlugg
023753b469
Sema: correctly detect use of undefined within slices in @Type
...
Resolves : #14712
2023-03-10 12:18:06 +02:00
Luuk de Gram
0ee9a52507
wasm-linker: remove synthetic segments & atoms
2023-03-10 06:20:10 +01:00
antlilja
b445bbfea2
Add ability to import dependencies from build.zig
2023-03-09 22:38:14 -05:00
Luuk de Gram
87738cad86
wasm-linker: store symbol's virtual address
...
For data symbols we will now store its virtual address. This means
we do no longer have to calculate it each time a relocation asks
for the address. This is now done for all data symbols only once
rather than every single relocation for that symbol.
This now also allows us directly store the virtual address of synthetic
symbols without having to create an atom for them. This means we also
don't need to have a "synthetic" segment any longer and do not emit
the synthetic symbols such as __heap_end and __heap_base into the final
binary.
2023-03-09 19:14:17 +01:00
mlugg
6d7fb8f19c
Sema: check type of comptime try operand
...
Resolves : #14693
2023-03-09 02:02:19 +02:00
John Schmidt
ecc0108cea
astgen: fill result location with void value if no other value
...
With this change, `break` and `break :blk` will fill the result location
with `.void_value`, ensuring that the value will be type checked.
The same will happen for a for loop that contains no `break`s in it's body.
Closes https://github.com/ziglang/zig/issues/14686 .
2023-03-08 16:35:53 +02:00
Frank Denis
fea14c78d1
wasm-linker: emit build_id section ( #14820 )
...
The Build ID is a value that uniquely identifies a build.
It is intended to capture the "meaning" or inputs of the build,
and is usually associated with debug info.
Reference: https://github.com/WebAssembly/tool-conventions/blob/main/BuildId.md
2023-03-08 13:50:06 +00:00
Jacob Young
e3cf9d1650
Module: rewrite zir caching logic
...
Multiple processes can sit waiting for the exclusive lock at the same
time, so we want to recheck whether it needs to be updated whenever
we get an exclusive lock.
This also fixes a race condition between one process truncating the
cache file and another process reading it without atomic locking.
2023-03-08 00:00:52 -05:00
Jacob Young
77d06012c2
CBE: implement unsigned big int div and mod
2023-03-07 03:03:35 -05:00
r00ster91
6218e40046
Zir: fix outdated comment
2023-03-06 18:18:52 -05:00
r00ster91
70cbe5ac7c
AstGen: remove unnecessary pubs
...
I think it helps when you know that something is entirely
self-contained, which AstGen is. The only function public is `generate`.
2023-03-06 18:18:52 -05:00
jim price
6ab04b5941
std.os: Allow write functions to return INVAL errors
...
In Linux when interacting with the virtual file system when writing
in invalid value to a file the OS will return errno 22 (INVAL).
Instead of triggering an unreachable, this change now returns a
newly introduced error.InvalidArgument.
2023-03-06 15:59:18 -05:00
Andrew Kelley
c839c180ef
stage2: add zig_backend to ZIR cache namespace
2023-03-05 17:23:09 -07:00
Andrew Kelley
48e72960a4
llvm: fix lowering of @trap
...
It needed an unreachable instruction after it.
2023-03-05 17:23:09 -07:00
Andrew Kelley
2641feb9b9
Merge pull request #14789 from jacobly0/ditype
...
llvm: fix use after free with pointers to optional slices
2023-03-05 16:32:51 -05:00
r00ster91
f1ae688d37
AstGen: ensure certain builtin functions return void
...
Fixes #14779
Co-authored-by: Veikka Tuominen <git@vexu.eu >
2023-03-05 23:01:17 +02:00
jiacai2050
29c56a8aa7
fix package redeclaration when cache is not found
2023-03-05 14:59:34 -05:00
Andrew Kelley
7b01af2bfd
Merge pull request #14745 from jacobly0/bigint
...
CBE: add support for integers larger than 128 bits (and apparently vectors too)
2023-03-05 14:48:06 -05:00