Commit Graph

29519 Commits

Author SHA1 Message Date
David Rubin
b67995689d
riscv: add airAggregateInit for arrays 2024-06-13 02:22:04 -07:00
David Rubin
b2cb090c37
riscv: float args 2024-06-13 02:21:39 -07:00
David Rubin
031d8248e0
riscv: first sign of floats! 2024-06-13 02:21:38 -07:00
David Rubin
7ed2f2156f
riscv: fix register clobber in certain edge cases 2024-06-13 02:21:38 -07:00
David Rubin
381a1043eb
ZigObject: enforce min function alignement on riscv 2024-06-13 02:21:38 -07:00
David Rubin
6603a9c26c
testing: fix test runner 2024-06-13 02:20:48 -07:00
David Rubin
39c95e8930
riscv: switch the test runner to mainSimple 2024-06-13 02:20:47 -07:00
David Rubin
05de6c279b
riscv: std.fmt.format running
- implements `airSlice`, `airBitAnd`, `airBitOr`, `airShr`.

- got a basic design going for the `airErrorName` but for some reason it simply returns
empty bytes. will investigate further.

- only generating `.got.zig` entries when not compiling an object or shared library

- reduced the total amount of ops a mnemonic can have to 3, simplifying the logic
2024-06-13 02:20:47 -07:00
David Rubin
55b28c7e44
riscv: PRO member function calls
this is enough progress for us to be able to call `stdout.write`!
2024-06-13 02:19:40 -07:00
David Rubin
c457f35da5
riscv: arbitrary sized arrays 2024-06-13 02:19:40 -07:00
David Rubin
f34dcd067b
riscv: basic libc varargs 2024-06-13 02:19:39 -07:00
David Rubin
fcafaae747
riscv: get basic libc interop 2024-06-13 02:19:39 -07:00
David Rubin
004d0c8978
riscv: switch progress + by-ref return progress 2024-06-13 02:19:38 -07:00
Andrew Kelley
4aa15440c7
Merge pull request #20268 from ziglang/keep-calm-and-continue-panicking 2024-06-13 00:21:12 -04:00
Andrew Kelley
5fc1f8a32b std.Thread.Mutex.Recursive: alternate implementation
This version is simpler. Thanks King!
2024-06-12 18:07:39 -07:00
Andrew Kelley
fad223d92e std.Progress: use a recursive mutex for stderr 2024-06-12 17:43:49 -07:00
Andrew Kelley
506b3f6db6 introduce std.Thread.Mutex.Recursive 2024-06-12 17:43:49 -07:00
Andrew Kelley
55a9ea250c std.debug: lock stderr mutex when panicking
The doc comments for this global said:
"Locked to avoid interleaving panic messages from multiple threads."

Huh? There's already a mutex for that, it's the stderr mutex. Lock that
one instead.
2024-06-12 17:09:07 -07:00
Ryan Liptak
0cef727e59 More precise error message for unencodable \u escapes
The surrogate code points U+D800 to U+DFFF are valid code points but are not Unicode scalar values. This commit makes the error message more accurately reflect what is actually allowed in `\u` escape sequences.

From https://www.unicode.org/versions/Unicode15.0.0/ch03.pdf:

> D71 High-surrogate code point: A Unicode code point in the range U+D800 to U+DBFF.
> D73 Low-surrogate code point: A Unicode code point in the range U+DC00 to U+DFFF.
>
> 3.9 Unicode Encoding Forms
> D76 Unicode scalar value: Any Unicode code point except high-surrogate and low-surrogate code points.

Related: #20270
2024-06-12 16:49:00 -04:00
Andrew Kelley
44f4abf380
Merge pull request #20269 from ziglang/fix-progress-race 2024-06-12 13:20:14 -04:00
Andrew Kelley
727f1fa743 update update_cpu_features tool to latest std.Progress API
closes #20261
2024-06-11 15:24:57 -07:00
Andrew Kelley
4b776ae441 std.Progress: fix race assertion failure
A node may be freed during the execution of this loop, causing there to
be a parent reference to a nonexistent node. Without this assignment,
this would lead to the map entry containing stale data. By assigning
none, the child node with the bad parent pointer will be harmlessly
omitted from the tree.

Closes #20262
2024-06-11 15:24:57 -07:00
Robin Voetter
d9bd34fd05
Merge pull request #20247 from Snektron/spirv-vectors-v3
spirv: vectors v3
2024-06-11 08:21:04 +02:00
Robin Voetter
a567f3871e
spirv: improve shuffle codegen 2024-06-10 20:32:50 +02:00
Robin Voetter
a3b1ba82f5
spirv: new vectorization helper
The old vectorization helper (WipElementWise) was clunky and a bit
annoying to use, and it wasn't really flexible enough.

This introduces a new vectorization helper, which uses Temporary and
Operation types to deduce a Vectorization to perform the operation
in a reasonably efficient manner. It removes the outer loop
required by WipElementWise so that implementations of AIR instructions
are cleaner. This helps with sanity when we start to introduce support
for composite integers.

airShift, convertToDirect, convertToIndirect, and normalize are initially
implemented using this new method.
2024-06-10 20:32:49 +02:00
Robin Voetter
4e7159ae1d
spirv: remove OpCompositeConstruct workarounds
Now that we use POCL to test, we no longer need this 
2024-06-10 20:32:43 +02:00
Robin Voetter
4bd9d9b7e0
spirv: change direct vector child repr to direct
Previously the child type of a vector was always in indirect representation.
Concretely, this meant that vectors of bools are represented by vectors
of u8.

This was undesirable because it introduced a difference between vectorizable
operations with a scalar bool and a vector of bool. This commit changes the
representation to be the same for vectors and scalars everywhere.

Some issues arised with constructing vectors: it seems the previous temporary-
and-pointer approach does not work properly with vectors of bool. To work around
this, simply use OpCompositeConstruct. This is the proper instruction for this,
but it was previously not used because of a now-solved limitation in the
SPIRV-LLVM-Translator. It was not yet applied to Zig because the Intel OpenCL
CPU runtime does not have a recent enough version of the translator yet, but
to solve that we just switch to testing with POCL instead.
2024-06-10 20:32:43 +02:00
Robin Voetter
b9d738a5cf
spirv: disable tests that fail on pocl
Besides the Intel OpenCL CPU runtime, we can now run the
behavior tests using the Portable Computing Language. This
implementation is open-source, so it will be easier for us
to patch in updated versions of spirv-llvm-translator that
have bug fixes etc.
2024-06-10 20:32:34 +02:00
mlugg
d4bc64038c Zir: remove legacy error_set_decl variants
These instructions are not emitted by AstGen. They also would have no
effect even if they did appear in ZIR: the Sema handling for these
instructions creates a Decl which the name strategy is applied to, and
proceeds to never use it. This pointless CPU heater is now gone, saving
2 ZIR tags in the process.
2024-06-10 05:02:34 +01:00
Robin Voetter
44443b833b
build: inherit setExecCmd from test compile steps when creating run steps
This should fix #17756
2024-06-09 01:55:50 +02:00
Robin Voetter
fba6b7e4c2
spirv: fix error code encoding 2024-06-09 01:55:49 +02:00
Shane Peelar
ec337051a9 Fix slight deviation from spec in handling Elf*_Rela relative relocations
`Elf*_Rela` relocations store their argument in `r_addend`, including for `R_*_RELATIVE` relocations.  Unlike `Elf*_Rel` relocations, they are not applied as a delta to the destination virtual address.  Instead, they are computed from `base_address + r_addend` directly.
2024-06-08 16:02:47 -04:00
Andrew Kelley
7ae9d8089d
Merge pull request #19007 from rootbeer/glibc-c-test
test/link/glibc_compat: Add C test case for glibc versions
2024-06-08 15:57:35 -04:00
Gordon Cassie
24f28753e6
Document a few non-obvious variable assignments (#20213)
Provide examples of various initializations.
2024-06-08 12:39:11 -07:00
expikr
7cf6650663
autodoc: fix misaligned table header when alignment is default (#20220) 2024-06-08 12:37:07 -07:00
Ryan Liptak
65cad8ab13 Fix index-of-out-bounds when no versions are found in the sdk lib dir
The current code wrongly assumes that versions[0] will always exist after the iterateAndFilterByVersion call.
2024-06-08 15:36:21 -04:00
Igor Anić
45b62c4529 io_uring: don't assume completions order
We are posting two submission (zero copy send and receive) and then
reading two completions. There is no guarantee that those completions
will be in the order of submissions.
This test was expecting fist send completion then receive.
Fix is allowing them to come other way too.
2024-06-08 15:35:41 -04:00
Ekin Dursun
0ba64e9ce3 Add ECONNREFUSED to sendto 2024-06-08 15:35:00 -04:00
Michael Dusan
2cd536d7e8 libcxx: fix building when -fsingle-threaded
* Skip building libcxx mt-only source files when single-threaded.
* This change is required for llvm18 libcxx.
* Add standalone test to link a trivial:
    - mt-executable with libcxx
    - st-executable with libcxx
2024-06-08 15:34:19 -04:00
Krzysztof Wolicki
6327a3994a
std.Build: remove deprecated b.host in favor of b.graph.host (#20237) 2024-06-08 12:22:38 -07:00
MrDmitry
84d1580873 Report error on missing values for addConfigHeader 2024-06-08 15:18:56 -04:00
Andrew Kelley
0884a43411 CMake: remove -Dstd-docs=false flag when building stage3
This now defaults to false already since the autodocs rework.

The langref still cannot be enabled by default because the langref
contains doctests that exercise the `@cImport` feature which is disabled
in zig2 builds.
2024-06-07 12:42:14 -07:00
Andrew Kelley
aab5cccc78 start the 0.14.0 release cycle 2024-06-06 12:05:37 -07:00
Andrew Kelley
cf90dfd309 Release 0.13.0 2024-06-06 12:05:11 -07:00
Ben Crist
a9e9c9965d
Build system: Support Windows depfiles with unquoted, backslash escaped spaces (#20100) 2024-06-06 18:40:10 +00:00
Andrew Kelley
63754916c5 disable failing IoUring test
tracked by #20212
2024-06-06 11:13:22 -07:00
Pat Tullmann
ed795a907d target.zig: Constrain aarch64 to glibc version 2.17 or later
Had constrained the `aarch64_be` target, but not `aarch64`.  This
constraint is necessary because earlier versions of glibc do not support
the aarch64 architecture.

Also, skip unsupported test cases.
2024-06-06 09:36:16 -07:00
Pat Tullmann
8bee879fc2 test/link/glibc_compat: Add C test case for glibc versions
glibc_runtime_check.c is a simple test case that exercises glibc functions
that might smoke out linking problems with Zig's C compiler.  The
build.zig compiles it against a variety of glibc versions.

Also document and test glibc v2.2.5 (from 2002) as the oldest working
glibc target for C binaries.
2024-06-06 09:36:16 -07:00
Maciej 'vesim' Kuliński
a4e01074b5 Add support for []enum in Build.option 2024-06-06 12:27:29 -04:00
Andrew Kelley
4d499359d5
Merge pull request #20207 from ziglang/glibc-2.39
add support for targeting glibc 2.39
2024-06-06 12:23:59 -04:00