Commit Graph
29 Commits
Author SHA1 Message Date
Guy Fischman 070276d8f1 compiler: add x86_64, aarch64, riscv, and loongarch preserve_most calling convention support 2026-10-12 10:49:23 +02:00
Alex Rønne Petersen 8c06a8dc8f compiler: add loongarch(32,64)_preserve_none calling convention support 2026-10-07 00:30:52 +02:00
Alex Rønne Petersen 45a40c4fa8 llvm: update address spaces to LLVM 23
Note: https://codeberg.org/ziglang/zig/issues/31190#issuecomment-20523923
2026-10-07 00:30:51 +02:00
Jacob Young b6f68ca4ba Runner: implement cbe backend 2026-09-26 19:08:50 -04:00
Alex Rønne Petersen 476efc5b70 remove internal and link_once global linkages
These have no clear use case, no coherent definition, and incomplete/broken
compiler and linker support.

If actually needed, they can be reintroduced if someone can present a reasonable
use case along with a plan for how they should be implemented consistently in
all backends and linkers.
2026-09-26 19:12:48 +02:00
Ali Cheraghi b3727d9bd1 spirv: rewrite linker
Previously, the SPIR-V linker would merge every function's MIR into one module, then parsed
it in `BinaryModule`, and run three passes over it:
- `prune_unused` walked the module from its entry points to drop dead declarations
- `dedup_types` deduplicated types and constants
- `lower_invocation_globals` rewrote function signatures to pass a pointer to global
  variables as function parameter

Now codegen emits instructions in the order it resolves them (not the spec specified order)
into one section per function. then the linker sorts them into the correct order while also
interning types, constants, strings, etc in the flush step.

Navs the frontend no longer references are now skipped using `Zcu.resolveReferences` instead
of a pass like `prune_unused`. Extern variables are also only loaded when an MIR references them.

`lower_invocation_globals` is gone too. non-`threadlocal` globals on SPIR-V targets are disallowed now.
Currently only vulkan supports them via the newly added `private` address space. See #36715

The new linker also supports incremental compilation now!
2026-09-18 16:36:23 +03:30
Ali Cheraghi e266901590 add missing local workgroup sizes to spirv_mesh's callconv info 2026-08-29 20:05:55 +02:00
Andrew Kelley 7e643ae8ab spork8: use snake2p calling convention 2026-08-26 20:54:49 -07:00
Andrew Kelley 3cd05f8a1b init spork8 backend 2026-08-26 20:54:49 -07:00
Subo2002 4ddb82ec2c Added missing local workgroup sizes to spirv_mesh's SpirvMeshOptions and
associated decorations
2026-08-24 17:49:49 +01:00
Andrew Kelley 515a494220 Merge pull request 'loongarch: self-hosted backend' (#36418) from AstraFall/zig:loongarch/isel-pr into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/36418
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
2026-08-20 22:01:52 +02:00
Andrew Kelley 89e0881f11 remove bad advice from @import("builtin")
also update doc comments on `std.lang.CompilerBackend`.
2026-08-11 20:51:12 -07:00
xtex 726f539fe5 loongarch: scaffold a self-hosted LoongArch backend
Signed-off-by: xtex <xtex@astrafall.org>
2026-08-09 11:10:26 +08:00
Ömer Faruk IRMAKandyarn bb296ab9b9 Add and lower preserve_none call convention for x86_64 & aarch64
std declarations, llvm lowering, c_abi test, compiler warning test

Co-authored-by: yarn <aethnem@gmail.com>
2026-07-29 03:13:48 +02:00
Jacob Young f2f770fdd3 llvm: implement c abi for x86 2026-07-27 14:44:41 -04:00
Andrew Kelley f2c2ee28cb std.lang.Optimize: provide alternative to std.debug.runtime_safety 2026-07-20 17:26:50 -07:00
Andrew Kelley ae4e835a66 std.lang: rename OptimizeMode to Optimize
and remove "release" from the enum tag names.

no functional change, however, despite the addition of
backwards-compatibile declarations in this patch, it is breaking because
expressions that use `==` or `!=` operators will not able to use the
deprecated names.

I predict these names to survive until the 1.0 tag without any more
breakage.
2026-07-20 17:26:50 -07:00
Justus Klausecker 69a26976ed zig fmt
Converts usages of `@intFromEnum` and `@enumFromInt` to instead use the
new `@backingInt` and `@fromBackingInt` builtins.
2026-07-17 23:30:26 +02:00
Ali Cheraghi e8ccd4fbcd spirv: allow specifying texel type for storage images 2026-06-25 15:47:10 +02:00
Ali Cheraghi 65e74dfbda @extern: add flat decoration 2026-06-18 13:38:58 +02:00
Ryan King a3da3eea8f wasm: add externref and funcref address spaces (#35813)
closes https://codeberg.org/ziglang/zig/issues/31190

Reviewed-on: https://codeberg.org/ziglang/zig/pulls/35813
Reviewed-by: Alex Rønne Petersen <alex@alexrp.com>
2026-06-17 22:36:19 +02:00
Alex Rønne Petersen 47e208e554 std.lang: fix accidentally swapped VaList layouts for hexagon and s390x
contributes to https://codeberg.org/ziglang/zig/issues/35523
2026-06-15 14:36:39 +02:00
Ali Cheraghi e2d11ff76b spirv: set execution mode via cc info
Execution modes (e.g. `LocalSize`, `OriginUpperLeft`) were previously set
via `gpu.executionMode()`, which used inline assembly to emit `OpExecutionMode`.
The SPIR-V assembler now rejects this instruction and retrieves execution mode information
from function cc, deleting `gpu.executionMode()` entirely.

Two new `spirv_task` and `spirv_mesh` calling conventions are also added
and `PackedCallingConvention.unpack()` now takes a trailing data slice.
2026-06-14 09:11:59 +02:00
Ali Cheraghi d7d131c050 add @SpirvType builtin
Closes #35240
Fixes #35238
Fixes #35259

Supported types are:
- `OpTypeSampler`
- `OpTypeImage`
- `OpTypeSampledImage`
- `OpTypeRuntimeArray` with indexing and `.len` field

The SPIR-V backend is bit-rotted so behavior tests no longer pass (compiler crashes).
However I've verified the new added tests are passing.
2026-06-07 04:58:53 +02:00
Krzysztof Wolicki 9e80795623 all: update to use new std.lang.Type definitions 2026-05-27 10:03:51 +01:00
Andrew Kelley 6925a57d2f Configuration: implement UnionList storage 2026-05-25 18:54:34 -07:00
Andrew Kelley 3e6bebbbca configure runner: serialization of Module 2026-05-25 18:54:33 -07:00
Alex Rønne Petersen 07262bddd6 std: add basic target information for m88k-openbsd
closes https://codeberg.org/ziglang/zig/issues/31816
2026-05-23 11:02:55 +02:00
Matthew Lugg 8df04e1444 std: actually rename std.builtin to std.lang
This is now the canonical name, and `std.builtin` is a deprecated alias.
2026-05-03 12:22:37 +01:00