Commit Graph

27974 Commits

Author SHA1 Message Date
Robin Voetter
1d548aa2aa
spirv: air splat 2024-02-04 19:09:33 +01:00
Robin Voetter
76d5696434
spirv: air abs 2024-02-04 19:09:32 +01:00
Robin Voetter
631d1b63a8
spirv: fix shuffle properly 2024-02-04 19:09:32 +01:00
Robin Voetter
9641d2ebdb
spirv: vectorize max, min 2024-02-04 19:09:31 +01:00
Robin Voetter
9f0227a326
spirv: vectorize int_cast, trunc 2024-02-04 19:09:31 +01:00
Robin Voetter
408c117246
spirv: air is_(non_)null_ptr, optional_payload_ptr 2024-02-04 19:09:30 +01:00
Robin Voetter
7dfd403da1
spirv: air mul_add 2024-02-04 19:09:30 +01:00
Robin Voetter
345d6e280d
spirv: air int_from_bool 2024-02-04 19:09:29 +01:00
Robin Voetter
77ef78a0ef
spirv: clean up arithmeticTypeInfo a bit
- No longer returns an error
- Returns more useful vector info
2024-02-04 19:09:29 +01:00
Robin Voetter
54ec936549
spirv: wrap strange its before instead of after operation
Wrapping strange integers before an operation was initially
done as an attempt to minimize the amount of normalizations
required: This way, there would not be a normalization
necessary between two modular operations. This was a
premature optimization, since the resulting logic is more
complicated than naive way of wrapping the result after
the operation.

This commit updates handling of strange integers to do
wrapping after each operation. It also seems slightly
more efficient in terms of size of generated code, as
it reduces the size of the behavior tests binary by
about 1%.
2024-02-04 19:09:28 +01:00
Robin Voetter
b67d983abd
spirv: vectorize add/sub overflow 2024-02-04 19:09:27 +01:00
Robin Voetter
761594e226
spirv: reduce, reduce_optimized 2024-02-04 19:09:27 +01:00
Robin Voetter
2f815853dc
spirv: shlWithOverflow 2024-02-04 19:09:26 +01:00
Robin Voetter
15cf5f88c1
spirv: vectors for air not 2024-02-04 19:09:25 +01:00
Robin Voetter
403c6262bb
spirv: use new vector stuff for arithOp and shift 2024-02-04 19:09:18 +01:00
Robin Voetter
cb9e20da00
spirv: element-wise operation helper 2024-02-04 19:09:00 +01:00
Robin Voetter
747f4ae3f5
spirv: sh[rl](_exact)? 2024-02-04 19:08:59 +01:00
Robin Voetter
3ef5b80d2c
std: use simple eqlBytes for spirv
The SPIR-V backend doesn't support the advanced
eqlBytes yet, and when it does, it likely that it
will be detrimental.
2024-02-04 19:08:57 +01:00
Jakub Konka
a1b607acb5 macho: sanitize Zig sections segment names before emitting a relocatable
As reported by jacobly, the Apple system linker matches sections to
segments by name and not by flags causing Zig's executable section
ending up in a segment with incorrect permission flags.
2024-02-04 18:05:38 +01:00
Andrew Kelley
3c7970dc4e
Merge pull request #18801 from jacobly0/fix-cache-retry
Cache: fix logic for retrying cache hits
2024-02-04 01:45:37 -08:00
Andrew Kelley
d3fc2648cc
Merge pull request #18778 from ziglang/system-package-mode
Implement system package mode and lazy dependencies
2024-02-04 01:44:12 -08:00
Jakub Konka
9bf97b8494
Merge pull request #18793 from ziglang/macho-zig-object
macho: emit relocatable with self-hosted x86_64 backend
2024-02-04 09:12:59 +01:00
Jacob Young
5b803aecfb bootstrap.c: allow overriding the host triple 2024-02-03 22:34:59 -05:00
Jacob Young
8fa7635419 stage1: implement fd_fdstat_get
I thought this might be needed, so may as well keep the implementation.
2024-02-04 03:48:29 +01:00
Jacob Young
26cb72086a Cache: fix logic for retrying cache hits
Fixes potentially #16149
2024-02-04 03:48:29 +01:00
lockbox
a65bc8d071 fix typo in wasm atomic opcodes doc comment 2024-02-04 00:25:05 +01:00
Chadwain Holness
6030855097
std.fmt: fix formatting slices of structs with custom formatting
`hasMethod` doesn't make sense for pointers to more than one item.
2024-02-03 21:47:55 +00:00
David Rubin
122387943b
Fix OOB when enum field out of order in different file 2024-02-03 19:52:05 +00:00
David Rubin
eb4024036d
Add error hint when looping over ErrorUnion 2024-02-03 19:16:27 +00:00
Jakub Konka
ca86dc61dd test/link/macho: test for signals only when running on the host 2024-02-03 19:36:52 +01:00
Jakub Konka
4ebd0036fd test/link/macho: add some smoke tests for self-hosted MachO 2024-02-03 17:57:35 +01:00
Jakub Konka
7641561f2d macho: refactor section/segment handle tracking logic 2024-02-03 16:57:15 +01:00
Jakub Konka
1ad545c97b macho: refactor growSection logic; remove -r limitation for ZigObject 2024-02-03 15:55:32 +01:00
Jakub Konka
0a0f90f949 macho: migrate thunks to use new relative addressing mechanism 2024-02-03 10:52:29 +01:00
Jakub Konka
aa1aa98863 macho: fix remaining references to Atom.value 2024-02-03 09:28:37 +01:00
Jakub Konka
dc6db3b309 macho: minor fixes and sanitize input *_zig segment/sections names 2024-02-03 09:28:34 +01:00
Jakub Konka
9fc1685c1c macho: make atom address relative wrt defining section 2024-02-03 09:28:30 +01:00
Jakub Konka
e10a2018a7 macho: emit relocs for ZigObject 2024-02-03 09:28:25 +01:00
Jakub Konka
dc222c9ba5 macho: use findFreeSpace for all sections 2024-02-03 09:28:19 +01:00
Jakub Konka
c5155170b2 macho: allocating space in .o 2024-02-03 09:28:12 +01:00
Jakub Konka
88a4bd6cf6 macho: pre-alloc sections in -r mode 2024-02-03 09:25:42 +01:00
Jakub Konka
352941b030 macho: emit incomplete object file 2024-02-03 09:25:41 +01:00
Andrew Kelley
3dad7312b2 CLI: use dummy http client when bootstrapping
Prevents unnecessary depedency on networking when bootstrapping zig.
2024-02-02 20:43:01 -07:00
Andrew Kelley
18091b4406 std.Build: use a runtime panic for wrong dependency API
This makes it easier to debug and avoids a false positive compile error
in the build script.
2024-02-02 20:43:01 -07:00
Andrew Kelley
a17505c711 zig build: avoid using stdout for communication with runner
Pass the required lazy dependencies from the build runner to the parent
process via a tmp file instead of stdout. I'll reproduce this comment to
explain it:

The `zig build` parent process needs a way to obtain results from the
configuration phase of the child process. In the future, the make phase
will be executed in a separate process than the configure phase, and we
can then use stdout from the configuration phase for this purpose.

However, currently, both phases are in the same process, and Run Step
provides API for making the runned subprocesses inherit stdout and stderr
which means these streams are not available for passing metadata back
to the parent.

Until make and configure phases are separated into different processes,
the strategy is to choose a temporary file name ahead of time, and then
read this file in the parent to obtain the results, in the case the child
exits with code 3.

This commit also extracts some common logic from the loop that rebuilds
the build runner so that it does not run again when the build runner is
rebuilt.
2024-02-02 20:43:01 -07:00
Andrew Kelley
996e61f813 Compilation: delete clang diag files afterwards
After parsing diagnostics files from clang we don't have any more use
for those tmp files. Delete them to reduce clutter and disk usage.
2024-02-02 20:43:01 -07:00
Andrew Kelley
d753c3a121 CLI: implement 'zig build' lazy dependency fetching
This makes `zig build` notice when lazy dependencies were missing, fetch
them, and then rebuild the build runner and run it again.
2024-02-02 20:43:01 -07:00
Andrew Kelley
252f4ab2a5 build system: implement lazy dependencies, part 1
Build manifest files support `lazy: true` for dependency sections.
This causes the auto-generated dependencies.zig to have 2 more
possibilities:
1. It communicates whether a dependency is lazy or not.
2. The dependency might be acknowledged, but missing due to being lazy
   and not fetched.

Lazy dependencies are not fetched by default, but if they are already
fetched then they are provided to the build script.

The build runner reports the set of missing lazy dependenices that are
required to the parent process via stdout and indicates the situation
with exit code 3.

std.Build now has a `lazyDependency` function. I'll let the doc comments
speak for themselves:

When this function is called, it means that the current build does, in
fact, require this dependency. If the dependency is already fetched, it
proceeds in the same manner as `dependency`. However if the dependency
was not fetched, then when the build script is finished running, the
build will not proceed to the make phase. Instead, the parent process
will additionally fetch all the lazy dependencies that were actually
required by running the build script, rebuild the build script, and then
run it again.
In other words, if this function returns `null` it means that the only
purpose of completing the configure phase is to find out all the other
lazy dependencies that are also required.
It is allowed to use this function for non-lazy dependencies, in which
case it will never return `null`. This allows toggling laziness via
build.zig.zon without changing build.zig logic.

The CLI for `zig build` detects this situation, but the logic for then
redoing the build process with these extra dependencies fetched is not
yet implemented.
2024-02-02 20:43:01 -07:00
Andrew Kelley
434a6a4f63 std.process.Child: use unreachable instead of @panic
This is how assertions work in zig.
2024-02-02 20:43:01 -07:00
Andrew Kelley
a68defbc65 std.Build: make systemIntegrationOption take a default 2024-02-02 20:43:01 -07:00