Commit Graph

36606 Commits

Author SHA1 Message Date
Jacob Young 7d70d7b215 x86_64: rewrite scalar @popCount 2025-02-18 09:47:44 -05:00
Jacob Young ebea56d279 x86_64: rewrite scalar @ctz 2025-02-18 09:47:44 -05:00
Ali Cheraghi 7872082939 spirv: extend supported c constraint values 2025-02-18 18:08:51 +03:30
Ali Cheraghi d5e1cb3ea2 spirv: ziggify and remove unknown spirv features
`OpCapability` and `OpExtension` now can also be emitted from inline assembly
2025-02-18 18:08:47 +03:30
Ali Cheraghi 85169bbba2 spirv: respect cpu features 2025-02-18 18:07:48 +03:30
Ali Cheraghi 1b0c7f51ef target: update spirv features 2025-02-18 18:07:48 +03:30
Ali Cheraghi 29e46633ce spirv: cache more types & merge constructX functions 2025-02-18 18:07:48 +03:30
Ali Cheraghi 7bbeac7f17 std.gpu: stop using comptimePrint 2025-02-18 18:07:31 +03:30
Ryan Liptak 0779e847f7 Skip empty/invalid records/certs in MacOS keychain files
In the original PR that implemented this (https://github.com/ziglang/zig/pull/14325), it included a list of references for the keychain format. Multiple of those references include the checks that are added in this commit, and empirically this fixes the loading of a real keychain file that was previously failing (it had both a record with offset 0 and a record with cert_size 0).

Fixes #22870
2025-02-18 09:01:10 +01:00
schtvn 9e925a7acc Clean up duplicate code in decl_fields_fallible 2025-02-17 22:30:49 -08:00
schtvn 5a313192e6 Autodoc: Improve documentation for common types declared as type functions, such as ArrayList, StaticStringMap, BoundedArray, and more 2025-02-17 22:27:01 -08:00
Andrew Kelley d2e70ef84a Merge pull request #22913 from jacobly0/x86_64-rewrite
x86_64: rewrite unsafe int vector multiplication
2025-02-17 16:13:22 -08:00
Alex Rønne Petersen b732070fd3 Merge pull request #22589 from alexrp/target-changes
Some miscellaneous target and calling convention changes
2025-02-18 00:51:59 +01:00
Alex Rønne Petersen faccd79ca5 test: Update some compiler-internal type names in expected output. 2025-02-17 19:18:20 +01:00
Alex Rønne Petersen f90f8f59a5 stage1: Update zig1.wasm.
Signed-off-by: Alex Rønne Petersen <alex@alexrp.com>
2025-02-17 19:18:20 +01:00
Alex Rønne Petersen 481b7bf3f0 std.Target: Remove functions that just wrap component functions.
Functions like isMinGW() and isGnuLibC() have a good reason to exist: They look
at multiple components of the target. But functions like isWasm(), isDarwin(),
isGnu(), etc only exist to save 4-8 characters. I don't think this is a good
enough reason to keep them, especially given that:

* It's not immediately obvious to a reader whether target.isDarwin() means the
  same thing as target.os.tag.isDarwin() precisely because isMinGW() and similar
  functions *do* look at multiple components.
* It's not clear where we would draw the line. The logical conclusion before
  this commit would be to also wrap Arch.isX86(), Os.Tag.isSolarish(),
  Abi.isOpenHarmony(), etc... this obviously quickly gets out of hand.
* It's nice to just have a single correct way of doing something.
2025-02-17 19:18:19 +01:00
Alex Rønne Petersen e62352611f std.Target: Move osArchName() and Cpu.Arch.archName() to std.zig.target.
These deal with how Zig stores OS headers in `lib/libc/include` and so don't
really belong in std.Target.
2025-02-17 19:17:56 +01:00
Alex Rønne Petersen ce8c61b0fc std.Target: Move Cpu.Arch.supportsAddressSpace() up to Cpu.
This allows it to inspect CPU features which is needed for Propeller, and AVR in
the future.
2025-02-17 19:17:56 +01:00
Alex Rønne Petersen 0048166867 std.Target: Make Cpu.Arch.supportsAddressSpace() take an optional context.
Allows deduplicating the code in Sema.
2025-02-17 19:17:56 +01:00
Alex Rønne Petersen aa4ac2f85f std.builtin: Rename CallingConvention.propeller1_sysv to propeller_sysv. 2025-02-17 19:17:56 +01:00
Alex Rønne Petersen e0f8d4e68e std.builtin: Rename CallingConvention.wasm_watc to wasm_mvp. 2025-02-17 19:17:56 +01:00
Alex Rønne Petersen 9c015e6c2b std.builtin: Remove CallingConvention.arm_(apcs,aapcs16_vfp).
* arm_apcs is the long dead "OABI" which we never had working support for.
* arm_aapcs16_vfp is for arm-watchos-none which is a dead target that we've
  dropped support for.
2025-02-17 19:17:56 +01:00
Alex Rønne Petersen 2fe32ef847 std.Target: Remove Cpu.Arch.propeller2 and use a CPU feature instead. 2025-02-17 19:17:55 +01:00
Alex Rønne Petersen 5248f0a909 update_cpu_features: Handle targets that don't have LLVM data. 2025-02-17 19:17:55 +01:00
Alex Rønne Petersen b541a7af11 std.Target: Remove Cpu.Arch.spu_2.
This was for a hobby project that appears to be dormant for now. This can be
added back if the project is resumed in the future.
2025-02-17 19:17:55 +01:00
Frank Denis 55c46870b2 crypto.auth.Aegis128X*Mac: properly absorb tags in the first lane (#22922)
In the MAC finalization function, concatenated tags at odd positions
were not absorbed into the correct lane.

Spotted by a Tigerbeetle regression test and reported by Rafael Batiati
(@batiati) — Thanks!
2025-02-17 17:56:09 +00:00
schtvn 1b62469ec9 Fix build failure in sbrk allocator, caused by #20511 2025-02-17 15:37:19 +01:00
Jacob Young ff74127526 x86_64: implement prefetch 2025-02-17 06:04:43 -05:00
Jacob Young 82eedf56d7 x86_64: rewrite scalar @byteSwap 2025-02-17 05:36:18 -05:00
Jacob Young cec6867d76 x86_64: rewrite unsafe int vector multiplication 2025-02-17 00:10:24 -05:00
Tw d7b93c7876 Sema: make source location in checkCallConvSupportsVarArgs more meaningful
As calling convention may not be specified explicitly in the source,
so use va_arg's location instead.

Signed-off-by: Tw <tw19881113@gmail.com>
2025-02-17 05:28:11 +01:00
Mark Rushakoff 86064e66d6 std.testing: improve compile error on untagged union equality 2025-02-16 15:51:40 +01:00
Alex Rønne Petersen ddff1fa4c6 compiler-rt: Use Windows Arm ABI routines for UEFI for now.
Until #21630 is addressed.

Closes #22893.
2025-02-16 01:15:29 +01:00
Manuel Spagnolo 9ad57515b2 remove unneeded native_os check
The check is not needed, since we are already checking for the os
at line 847 and returning at 916 when the check succeeds.
Therefore, at 926, we know the os is not windows.
2025-02-16 01:02:33 +01:00
Alex Rønne Petersen d7f9b5a661 zig.h: Add new zig_gcc macro to indicate GCC.
As opposed to "GNU C" (zig_gnuc) which includes Clang.

This addresses #22890 but does not fix it until a zig1.wasm update.
2025-02-16 00:21:51 +01:00
Ian Johnson 75ccdcc356 Autodoc: report errors in user interface
Also includes panics by virtue of the previous commit, checking one item off #19249.
2025-02-15 17:32:44 -05:00
Ian Johnson b745a96d20 Autodoc: use browser console log levels and simplify panic
Using the browser's `console.error`, etc. functions instead of `console.log` produces prettier output in the console. Additionally, `console.error` in particular includes a stack trace, which is useful for debugging where the error occurred.

Additionally, this commit leverages the enhanced logging to delete the separate `panic` function from the JS code and write it in Zig instead.
2025-02-15 17:29:31 -05:00
Ian Johnson 293603f040 Autodoc: report syntax errors to user
Additionally, this commit streamlines the way unparseable files are handled, by giving them the AST of an empty file. This avoids bugs in the rest of the Autodoc logic trying to work with invalid ASTs.
2025-02-15 17:29:31 -05:00
Andrew Kelley e5174c7441 Merge pull request #22876 from jacobly0/x86_64-rewrite
x86_64: implement error set and enum safety
2025-02-15 12:33:09 -08:00
Jacob Young dcc9fe322e x86_64: rewrite unsafe scalar int multiplication 2025-02-15 04:13:21 -05:00
Jacob Young 5db585fcde x86_64: reuse integer @divTrunc for @divExact 2025-02-15 03:45:21 -05:00
Jacob Young f98f5a5f74 main: increase thread stack size for non-x86_64 backends
I observed a stack overflow during x86_64 CodeGen in a debug compiler
compiled by the llvm backend.  This happens while compiling
`main.buildOutputType` due to the Air being nested almost 500 levels.
2025-02-15 03:45:21 -05:00
Jacob Young 4ea18c22f9 x86_64: rewrite array access 2025-02-15 03:45:21 -05:00
Jacob Young 9f87aacaaf test: fix windows CI 2025-02-15 03:45:21 -05:00
Jacob Young f6bcc9dbcb x86_64: rewrite scalar and vector int @rem 2025-02-15 03:45:21 -05:00
Jacob Young 8c48376d64 x86_64: rewrite scalar and vector int @divTrunc 2025-02-15 03:45:21 -05:00
Jacob Young 9f121ec8fb x86_64: implement unsafe scalar and vector integer add/sub 2025-02-15 03:45:21 -05:00
Jacob Young 8159ff8b81 x86_64: implement error set and enum safety
This is all of the expected 0.14.0 progress on #21530, which can now be
postponed once this commit is merged.

This required rewriting the (un)wrap operations since the original
implementations were extremely buggy.

Also adds an easy way to retrigger Sema OPV bugs so that I don't have to
keep updating #22419 all the time.
2025-02-15 03:45:21 -05:00
Benjamin Thompson 5ab5113077 added expectEqualDeep test coverage for issue 16625 (#22781) 2025-02-15 03:41:58 +01:00
LmanTW 13ad984b1f std: add containsAtLeastScalar to mem (#22826) 2025-02-15 03:40:55 +01:00