11445 Commits

Author SHA1 Message Date
Robin Voetter
c6fbe0d5d8
dont destroy old bin file on link openpath failure
This was causing some crashes.
2023-04-09 01:51:47 +02:00
Robin Voetter
17de4a88e9
spirv: add Addresses capability for opencl
This capability is required to generate SPIR-V kernels with the Physical32
and Physical64 memory models, which we use in OpenCL kernels.
2023-04-09 01:51:47 +02:00
Andrew Kelley
c22a30ac99 zig cc: handle the -r flag
This makes -r treated the same as -c which is to output an object file.
Zig's ELF linker code already handles multiple object files into an
object file with the -r flag to LLD.

closes #11683
2023-04-08 15:48:27 -04:00
Luuk de Gram
58bab660b5
Merge pull request #15202 from SuperAuguste/misc-wasm
Implement `@shuffle`, fix vector element accesses for WASM backend
2023-04-08 17:13:58 +02:00
Auguste Rame
09fda08618
Fix 32-bit compile errors 2023-04-07 23:04:24 -04:00
Auguste Rame
8ba3ab948a
Handle compile time case for vector element access using lane access 2023-04-07 20:52:04 -04:00
Auguste Rame
1e310d3350
Finish shuffle, fix arrayElemVal for vectors 2023-04-07 20:35:15 -04:00
Andrew Kelley
55a8b7e1fa
Merge pull request #15097 from zachcheu/add-wrap-flag
add linker -wrap flag
2023-04-07 19:58:55 -04:00
Auguste Rame
d5511b35a9
Make airShuffle work for unrolled 2023-04-07 19:07:48 -04:00
Luuk de Gram
4ebf483e0d
Merge pull request #14668 from Techatrix/wasm-floatops
wasm: implement float operations with compiler-rt
2023-04-07 18:22:41 +02:00
Andrew Kelley
48f98494fd
Merge pull request #15195 from mlugg/fix/liveness-loop-defer-deaths
Liveness: defer deaths of externally-scoped instructions in loop bodies
2023-04-07 11:12:44 -04:00
Andrew Kelley
b086b7da9e zig cc: complete the -wrap flag implementation
* use a set instead of a list
* use of this flag currently requires LLD
* add documentation
* make it only a zig cc compatibility flag for now because I personally
  think this is an anti-feature.
2023-04-07 07:54:47 -07:00
Zach Cheung
1fdea551b2 add linker -wrap flag 2023-04-07 09:09:38 -04:00
mateusz
0866396308
std.json: allow returning custom errors from custom stringify 2023-04-07 15:01:09 +03:00
Auguste Rame
dac62424f9 Make self-hosted wasm @returnAddress return 0 2023-04-07 14:59:22 +03:00
Jacob Young
a7f674d6c1
cbe: assert there are no unfreed locals
Also fix the many revealed bugs.
2023-04-07 01:29:20 +01:00
mlugg
1059b57898
Liveness: defer deaths of externally-scoped instructions in loop bodies 2023-04-07 01:29:20 +01:00
Andrew Kelley
f289277599 Merge remote-tracking branch 'origin/master' into llvm16 2023-04-05 22:05:31 -07:00
Jacob Young
243848167b compiler_rt: attempt to fix f16 abi on mac with llvm 16 2023-04-05 22:05:06 -07:00
Veikka Tuominen
66520c8342 Sema: validate array element types
Fixes the compiler crash part of #15175
2023-04-05 14:45:56 +03:00
Veikka Tuominen
82a6acca93 Sema: implement inline switch capture at comptime
Closes #15157
2023-04-05 14:45:56 +03:00
Jakub Konka
a503724801 macho: reapply relocation dirtying logic from coff linker 2023-04-05 05:57:09 +02:00
Jakub Konka
f372995e1e macho: refactor adding GOT and stub entries
Don't special-case resolving of `dyld_stub_binder`.
2023-04-05 05:57:09 +02:00
Jakub Konka
5ea6e78943
Merge pull request #15162 from jacobly0/x86_64-start
x86_64: get enough things working to enable full `start.zig` logic
2023-04-05 03:02:42 +02:00
Jakub Konka
3a8362e751 macho+zld: refactor how we resolve dyld_stub_binder symbol 2023-04-04 15:44:01 +02:00
Jacob Young
821eb595f4 x86_64: implement cmp_lt_errors_len 2023-04-03 15:19:07 -04:00
Jacob Young
9fd460821f elf: cleanup phdr tracking
Since one of the program header entries is now the program header table
itself, we can avoid tracking it explicitly and just track it as yet
another program segment.
2023-04-03 14:17:43 -04:00
Jakub Konka
c0e9b84997 elf: preallocate offsets for PT_PHDR and PT_LOAD (empty) segment
Otherwise, we will be using `undefined` as the offset to allocate
remaining phdrs and shdrs.
2023-04-03 18:30:55 +02:00
Jacob Young
5900dc0580 x86_64: fix typos 2023-04-03 18:02:55 +02:00
Jacob Young
562170681a link: cleanup lazy symbols
We now only update one lazy symbol in flushModule.
Updating the rest from updateDecl is TBD.
2023-04-03 18:02:53 +02:00
Jacob Young
f0d13489f8 Elf: add program headers for the program header table 2023-04-03 17:45:17 +02:00
Jacob Young
cd24ab7f6e x86_64: canonicalise loops 2023-04-03 17:45:16 +02:00
Jacob Young
1980f5479b x86_64: implement store to immediate address 2023-04-03 17:45:16 +02:00
Jacob Young
272acb7ee5 x86_64: implement storing large immediates 2023-04-03 17:45:16 +02:00
Jacob Young
f5f0d95f0e x86_64: implement a more generic assembler for inline assembly 2023-04-03 17:45:16 +02:00
Jakub Konka
72137824e5 macho: clean up code responsible for growing sections in file 2023-04-03 10:07:49 +02:00
Jakub Konka
ad8dfd3673 macho+coff: remove alignment from Atom as it is unused 2023-04-03 09:14:36 +02:00
Jacob Young
f4b411314c Sema: defer stores to inferred allocs
This lets us generate the store with knowledge of the type to be stored.
Therefore, we can avoid generating garbage Air with stores through
pointers to comptime-only types which backends cannot lower.

Closes #13410
Closes #15122
2023-04-02 18:05:44 +03:00
Jacob Young
f4359531b1 x86_64: implement shl with overflow 2023-04-02 06:11:12 -04:00
Jacob Young
0e289cc826 x86_64: implement large add/sub with overflow 2023-04-02 05:16:46 -04:00
Jacob Young
c713c86389 x86_64: implement wide multiply 2023-04-02 04:49:53 -04:00
Jacob Young
b80cdde4f0 x86_64: implement struct_field_val for large packed structs 2023-04-02 04:49:53 -04:00
Jacob Young
83a208c355 x86_64: implement large cmp 2023-04-02 04:49:53 -04:00
Jacob Young
677427bc3a x86_64: implement error name 2023-04-02 04:49:53 -04:00
Jacob Young
ccefa9dbf5 x86_64: implement calling var args functions 2023-04-02 04:49:53 -04:00
Jacob Young
ac68d72d24 x86_64: implement aggregate init of a packed struct 2023-04-02 04:49:53 -04:00
Jakub Konka
a88c0b4d08 link: handle -u flag in all linkers
Also clean up parsing of linker args - reuse `ArgsIterator`.

In MachO, ensure we add every symbol marked with `-u` as undefined
before proceeding with symbol resolution. Additionally, ensure those
symbols are never garbage collected.

MachO entry_in_dylib test: pass `-u _my_main` when linking executable
so that it is not incorrectly garbage collected by the linker.
2023-04-01 14:22:44 +02:00
Jakub Konka
2dd178443a macho: do not assume entrypoint is defined 2023-04-01 14:22:44 +02:00
Jakub Konka
6f83a741d8 macho: handle weird case of entrypoint being a stub 2023-04-01 14:22:44 +02:00
Jakub Konka
f2587de4e9 macho: look for entry in archives/dylibs too 2023-04-01 14:22:44 +02:00