Alex Rønne Petersen
669c066801
llvm: fix sign extension of 32-bit integers in callconv(.c) on mips
2026-04-27 09:42:08 +02:00
Alex Rønne Petersen
a83aad152b
Merge pull request 'LLVM 22' ( #32013 ) from llvm22 into master
...
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/32013
2026-04-26 07:03:38 +02:00
Alex Rønne Petersen
1be84a39b8
compiler: fix and simplify DllMainCRTStartup handling
...
See: https://github.com/llvm/llvm-project/pull/171680
2026-04-25 21:54:48 +02:00
Alex Rønne Petersen
4c50c4b6e5
llvm: wire up the xtensa backend
...
As of LLVM 22, it can produce assembly and object files. No LLD support,
however, so using it is still a bit of a pain.
2026-04-25 21:54:47 +02:00
Alex Rønne Petersen
473df0c106
llvm: switch to wasip<n> for preview wasi versions in triples
2026-04-25 21:54:47 +02:00
Alex Rønne Petersen
593f45ee02
llvm: switch most targets to using half and fp128 IR types
...
As of LLVM 22, most backends can (finally) handle legalization of these types as
necessary, so we don't need to do it ourselves anymore.
closes https://github.com/ziglang/zig/issues/23674
2026-04-25 21:54:47 +02:00
Alex Rønne Petersen
421d997938
llvm: update data layout strings to LLVM 22
2026-04-25 21:54:47 +02:00
Alex Rønne Petersen
ca0b3318a0
std.Target: update CPU and feature data to LLVM 22
2026-04-25 21:54:47 +02:00
Jacob Young
2040f9bfd0
x86_64: fix c abi of f32 struct field followed by padding
...
Closes #31864
2026-04-25 12:10:35 -04:00
Jacob Young
cb1c7319b5
llvm: fix aarch64 c abi HFA detection
...
Aggregate types do not count as Homogeneous Aggregates if they have
padding gaps between fields or at the end due to field alignments.
2026-04-25 12:01:14 -04:00
Matthew Lugg
31bc385a96
cbe: add missing cast of overflow arithmetic out pointer
2026-04-25 05:22:41 +02:00
Andrew Kelley
fb9ba5e4b3
Merge pull request 'llvm: fix multiple_llvm_types handling and aarch64 return types' ( #32028 ) from aarch64-c-abi into master
...
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/32028
Reviewed-by: Andrew Kelley <andrew@ziglang.org >
2026-04-25 05:19:18 +02:00
andrew.kraevskii
bbab366b78
Audit usages of toOwnedSlice ( #32001 )
...
Followup to #30769
I grepped for `try .*toOwnedSlice` and checked all of them by hand.
Fixes a bunch of memory leaks removes usages or `errdefer` and `vars` in some places. I also switched array_list.Managed to ArrayList where it was convenient.
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/32001
Reviewed-by: Andrew Kelley <andrew@ziglang.org >
2026-04-22 19:35:46 +02:00
Jacob Young
df3aba6cc0
llvm: fix multiple_llvm_types handling and aarch64 return types
...
Closes #31994
2026-04-22 13:19:44 -04:00
Jacob Young
97ef8f1f8e
llvm: pass more c abi tests on aarch64
...
This is not what clang does, and is definitely wrong on big endian,
but lets at least pass the following simple tests first.
2026-04-22 14:35:22 +02:00
Pavel Verigo
22945fbbdc
stage2-wasm: vector, std tests
2026-04-22 00:19:46 +02:00
Ryan Liptak
3252a05531
Prefer <err> => |e| return e over <err> => return <err>
...
Avoids the potential for a typo on the `return <err>` side of the prong
2026-04-20 18:03:14 -07:00
Pavel Verigo
d840583458
remove AIR .bool_or/.bool_and
2026-04-19 21:49:51 +02:00
Mason Remaley
e2c3920fb1
Renames buffer first allocator in compiler and std
2026-04-18 14:51:49 -07:00
Mason Remaley
8c96487bb9
Updates all uses of StackFallbackAllocator
2026-04-18 14:51:49 -07:00
Alex Rønne Petersen
adb1f3efc2
Merge pull request 'test: reinstate compiler-rt and zigc tests with different LLVM bug workarounds' ( #31909 ) from alexrp/zig:reinstate-tests into master
...
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31909
2026-04-17 12:04:30 +02:00
Andrew Kelley
bea4ea5ff8
Merge pull request 'zigc: long double: call double function if long double and double are equivalent' ( #31775 ) from rpkak/zig:zigc-long-double into master
...
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31775
Reviewed-by: Andrew Kelley <andrew@ziglang.org >
2026-04-16 19:57:54 +02:00
Sam Connelly
17e0afd0e5
feat: init eZ80 arch via CBE
2026-04-16 19:21:16 +02:00
Alex Rønne Petersen
a283ca76fe
cbe: don't emit zig_no_builtin on every function with -fno-builtin
2026-04-16 17:46:29 +02:00
Matthew Lugg
84c2d809ec
llvm: workaround crash on large inline memset
...
See https://codeberg.org/ziglang/zig/issues/31701 for details. I am not
re-enabling the disabled compiler-rt module tests here because they are
also affected by https://codeberg.org/ziglang/zig/issues/31702 .
2026-04-16 17:00:04 +02:00
rpkak
f564a7733c
remove code, which is only reached if c_longdouble is only 16 or 32 bits big
2026-04-16 07:05:31 +02:00
Andrew Kelley
67a5b6e5e8
delete @cImport from the language
...
closes #20630
2026-04-15 17:43:53 -07:00
Andrew Kelley
e00b5daa1f
Merge pull request 'stage2-wasm: finish bigint support' ( #31784 ) from pavelverigo/zig:wasm-bigint-finish into master
...
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31784
Reviewed-by: Andrew Kelley <andrew@ziglang.org >
2026-04-15 23:07:40 +02:00
Pavel Verigo
c32f7a4513
stage2-wasm: support assembly
2026-04-15 22:57:41 +02:00
David Rubin
06ab4f702e
llvm: correctly bitcast for memset intrinsic path
2026-04-12 05:28:54 +02:00
Andrew Kelley
2322d45d80
Merge pull request 'Implement variadic functions for Win64 in the x86_64 backend' ( #31672 ) from kcbanner/zig:win64_varargs into master
...
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31672
Reviewed-by: Andrew Kelley <andrew@ziglang.org >
2026-04-12 01:34:16 +02:00
Jacob Young
9ba9865e51
x86_64: allow positive signed imms to match unsigned imm patterns
2026-04-10 23:23:33 +02:00
Jacob Young
1552bc7ad0
x86_64: fix mir rmi signedness
2026-04-10 23:23:33 +02:00
Mathieu Suen
2c88821c56
x64_86 fix: RMI can accept imm16 only for imul r16,r/m16
2026-04-10 23:23:33 +02:00
Pavel Verigo
773def30c2
stage2-wasm: fix bug in big endian limb64 + tiny fixes
2026-04-09 00:15:33 +02:00
Pavel Verigo
ed9b0655f7
stage2-wasm: introduce __u?(div|mod)ei5, revert prev approach
...
Co-authored-by: Jacob Young <jacobly0@users.noreply.github.com >
2026-04-09 00:14:09 +02:00
Pavel Verigo
07e3e50fd2
stage2-wasm: enabling bigint blocked tests + final fixes
2026-04-09 00:14:09 +02:00
Pavel Verigo
f2a842db5c
stage2-wasm: sat ops
2026-04-09 00:14:09 +02:00
Pavel Verigo
aa7874657b
stage2-wasm: bigint div mod rem
2026-04-09 00:14:09 +02:00
Pavel Verigo
fff887874e
stage2-wasm: @intFromFloat and @floatFromInt
2026-04-09 00:14:09 +02:00
Pavel Verigo
df79ea941b
stage2-wasm: bigint abs + test min/max
2026-04-09 00:14:09 +02:00
Pavel Verigo
0ebd270d90
stage2-wasm: bigint mulo
2026-04-09 00:14:08 +02:00
Pavel Verigo
58944586be
stage2-wasm: bigint support bitops and intcast
2026-04-09 00:14:08 +02:00
nektro
e73257dec2
lib/std: BitSet,EnumSet: replace initEmpty/initFull with decl literals ( #31469 )
...
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31469
Reviewed-by: Andrew Kelley <andrew@ziglang.org >
Co-authored-by: nektro <hello@nektro.net >
Co-committed-by: nektro <hello@nektro.net >
2026-04-05 05:12:13 +02:00
Pavel Verigo
ad7a028228
stage2-wasm: pass incremental tests
...
This PR enables all incremental tests under the `test/incremental` directory, except one: `change_exports`, which is currently ignored as it requires a non-trivial amount of work on the linker, since we do not currently support exporting data symbols.
To enable the other tests, the following fixes were needed:
1. `src/link/Wasm.zig`: instead of chasing function type through Nav, get it directly.
2. `src/target.zig`: `.panic_fn` appears to work fine with the wasm backend.
3. `src/codegen/wasm/CodeGen.zig`: there was a liveness related bug that caused some `ArenaAllocator` code to crash the backend.
More info on (3), the liveness and local reuse code in the backend for years in unfinished state. For example there is currently no branch merging and reuse happens only when inst die in same block level. I initially considered doing a large refactor to implement everything correctly, but aborted due to its sheer size and currently! no clear idea about how to do this efficiently.
Instead, I fixed the bug with minimal changes and removed useless code, keeping the old solution otherwise intact.
2026-04-04 15:21:35 +02:00
Pavel Verigo
557caecaaa
stage2-wasm: start big int support
2026-04-02 15:48:43 +02:00
Andrew Kelley
3e0f55fcc7
Merge pull request 'add an ast smith' ( #31635 ) from gooncreeper/zig:ast-smith into master
...
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31635
Reviewed-by: Andrew Kelley <andrew@ziglang.org >
2026-04-02 15:41:05 +02:00
Jacob Young
28ae5d4158
llvm: fix missing return attributes
...
Closes #31636
2026-04-02 14:31:12 +02:00
Jacob Young
4059242f44
x86_64: use correct alias for register constraints stored in registers
...
Closes #31722
2026-04-02 14:29:40 +02:00
Matthew Lugg
d28c5069b8
llvm: rework handling of globals
...
The main goal here is to make incremental compilation work a bit better.
I also slightly expanded some `std.zig.llvm.Builder` APIs so that we
don't need to pointlessly create new `Global`s whenever e.g. a function
turns into a variable or vice versa.
Also, lean into aliases for exports! If we just use aliases for every
export, everything becomes simpler. Besides, we can't just go around
renaming the globals of `Nav`s: the export could disappear on a future
update, in which case we'd have to somehow revert that change, which is
easier said than done.
2026-03-28 16:50:42 +00:00