30544 Commits

Author SHA1 Message Date
Alex Rønne Petersen
3b51b43dc8
build/test: Add -Dtest-target-filter for filtering module tests by target triple.
This is useful during porting work where you're not interested in running all
targets all the time while iterating on changes.
2024-08-14 07:03:23 +02:00
Alex Rønne Petersen
4a2b23c2be
build: Use the new b.addFail() for the update-mingw step.
This is precisely the kind of use case it was added for.
2024-08-14 07:03:23 +02:00
Alex Rønne Petersen
019c0fc184
test: Re-enable mips(el)-linux-gnueabihf tests.
Closes #4927.
2024-08-14 06:52:05 +02:00
Alex Rønne Petersen
819fe51a7e
llvm: Disable f128 on powerpc*-aix.
https://github.com/llvm/llvm-project/issues/101545
2024-08-13 23:30:43 +02:00
Alex Rønne Petersen
2f101e2b6e
llvm: Disable f128 on mips64(el).
https://github.com/llvm/llvm-project/issues/96432
2024-08-13 23:30:43 +02:00
Alex Rønne Petersen
18e94c355e
llvm: Also disable f16/f128 on aarch64_be with soft float. 2024-08-13 23:30:43 +02:00
Alex Rønne Petersen
f1af9eb836
std.zig.system: Support qemu-xtensa in getExternalExecutor(). 2024-08-13 23:30:43 +02:00
Alex Rønne Petersen
8e75ade253
std.zig.system: Support qemu-mipsn32(el) for mips with n32 ABI in getExternalExecutor(). 2024-08-13 23:30:43 +02:00
Alex Rønne Petersen
0e4263893c
std.zig.system: Support qemu-sparc32plus for sparc32 with v9 in getExternalExecutor(). 2024-08-13 23:30:43 +02:00
Andrew Kelley
0b5ea2b902
Merge pull request #21053 from alexrp/mips-tests
`test`: Re-enable `mips(el)-linux(-musl)` tests.
2024-08-13 11:48:33 -07:00
YANG Xudong
76f062690c add getcontext 2024-08-13 10:11:17 -07:00
Alex Rønne Petersen
eadc0c01cc test: Re-enable armv8-linux-gnueabihf tests.
Closes #3287.
2024-08-13 00:57:49 -07:00
Alex Rønne Petersen
e725d1e226 std.Thread: Fix freeAndExit() syscall numbers for mips64.
These just seem to have been copy/pasted from mips32.
2024-08-13 00:56:35 -07:00
Alex Rønne Petersen
d0ae803a77 std.Thread: Fix freeAndExit() assembly for powerpc.
Wrong source/destination register order.
2024-08-13 00:56:14 -07:00
Alex Rønne Petersen
b00f586c3d
std.os.linux: Add clone() implementation for mips64. (#21038)
Only for n64; no handling for n32 yet.

Also remove pointless comment about o32 in mips64 code.
2024-08-12 16:09:52 -07:00
Alex Rønne Petersen
d6f9972594 all: Handle spirv in addition to spirv(32,64) where applicable.
Some of this is arbitrary since spirv (as opposed to spirv32/spirv64) refers to
the version with logical memory layout, i.e. no 'real' pointers. This change at
least matches what clang does.
2024-08-12 16:08:28 -07:00
Alex Rønne Petersen
6d23850108 std.Thread: Explain apparently pointless mips instruction in freeAndExit().
https://git.musl-libc.org/cgit/musl/commit/?id=ce3688eca920aa77549323f84e21f33522397115
2024-08-12 16:07:46 -07:00
Andrew Kelley
f988cea825
Merge pull request #21019 from alexrp/target-os-cleanup
`std.Target`: Remove `minix` and `liteos`, rename `glsl450` to `opengl`, and some minor housekeeping
2024-08-12 16:06:57 -07:00
Alex Rønne Petersen
82b0f44721 llvm: Disable lowering to f16 on s390x.
https://github.com/llvm/llvm-project/issues/50374
2024-08-12 16:01:59 -07:00
Alex Rønne Petersen
a1a823f69c llvm: Disable lowering to f128 on sparc32.
efc6b50d2d/llvm/lib/Target/Sparc/SparcISelLowering.cpp (L561-L562)
2024-08-12 16:01:34 -07:00
Alex Rønne Petersen
87ec4e11c9 compiler-rt: Fix the leoncasa CPU feature check for sparc32. 2024-08-12 14:36:21 -07:00
Alex Rønne Petersen
f7fb261efd std.os.linux.tls: Support sparc32. 2024-08-12 14:22:24 -07:00
Alex Rønne Petersen
46f64358dd
test: Re-enable mips(el)-linux(-musl) tests.
Closes #13782.
Closes #16846.
2024-08-12 13:34:19 +02:00
Alex Rønne Petersen
19a91084c2
test: Partially disable vector float operators on mips.
https://github.com/ziglang/zig/issues/21051
2024-08-12 13:34:19 +02:00
Alex Rønne Petersen
abf6f35654
test: Disable reinterpret packed union on mips.
https://github.com/ziglang/zig/issues/21050
2024-08-12 13:34:19 +02:00
Linus Groh
9ef16b36ce std.os.linux: Fix definition of tc_lflag_t on MIPS
Regressed in #21000.
2024-08-12 00:46:28 -07:00
Alex Rønne Petersen
7a41e2f40b std.zig.target: Add missing thumbeb triples. 2024-08-12 00:44:56 -07:00
Rich Remer
6933ab4bf7 fix C type corresponding to f80 2024-08-12 00:25:16 -07:00
Alex Rønne Petersen
9f1fb45201
llvm: Move some OS selection prongs for clarity.
This makes it clearer which OSs are not known to or supported by LLVM at all vs
the ones where we're intentionally passing choosing "unknown".
2024-08-12 09:03:08 +02:00
Alex Rønne Petersen
8af4d65108
std.Target: Remove liteos OS tag.
It has not seen development in 4 years.

https://github.com/LiteOS/LiteOS/commits/master
2024-08-12 08:59:49 +02:00
Alex Rønne Petersen
e211dce6fc
std.Target: Remove minix OS tag.
It has not seen development in 6 years. RIP.

* https://github.com/Stichting-MINIX-Research-Foundation/minix/commits/master
* https://groups.google.com/g/minix3/c/nUG1NwxXXkg
2024-08-12 08:59:49 +02:00
Alex Rønne Petersen
4d4a023042
std.Target: Remove no longer relevant TODO about SPIR-V ABIs. 2024-08-12 08:59:49 +02:00
Alex Rønne Petersen
eb4539a27d
std.Target: Rename glsl450 Arch tag to opengl.
Versions can simply use the normal version range mechanism, or alternatively an
Abi tag if that makes more sense. For now, we only care about 4.5 anyway.
2024-08-12 08:59:47 +02:00
Alex Rønne Petersen
15a3ee1979
std.Target: Remove supportsNewStackCall().
This is literally just isWasm() and has no uses in the repository.
2024-08-12 08:57:10 +02:00
Alex Rønne Petersen
0bb9db3998
std.Target: Add comments explaining the baseline CPUs for hexagon/s390x. 2024-08-12 08:57:10 +02:00
Alex Rønne Petersen
7f7008b5b2
std.Target: Sort Os tags in a hopefully more sensible way. 2024-08-12 08:57:10 +02:00
Alex Rønne Petersen
60bf1a6543
std.Target: Sort Arch tags in a hopefully more sensible way. 2024-08-12 08:57:10 +02:00
Alex Rønne Petersen
25096ed893 std.Target: Some corrections and additions to stackAlignment().
Sourced from LLVM and GCC backends and ABI documents.
2024-08-11 20:28:29 -07:00
Alex Rønne Petersen
8161e61548 std.os.linux.start_pie: Add support for the new RELR relocation format. 2024-08-11 20:27:09 -07:00
Andrew Kelley
61dac74128
Merge pull request #20985 from alexrp/gpu-nonsense
Follow-up on `std.Target` GPU changes in #20960
2024-08-11 20:23:28 -07:00
Alex Rønne Petersen
6316fd9535 std.Target: Add goff and xcoff to ObjectFormat.
Also improve the docs a bit, and handle driverkit and dxil in default().
2024-08-11 20:21:28 -07:00
Andrew Kelley
fc29240806
Merge pull request #20964 from mlugg/the-great-decl-split-mk2
compiler: split `Decl` into `Nav` and `Cau`
2024-08-11 15:07:06 -07:00
mlugg
153e7d6235
frontend: give all container types namespaces
Eliding the namespace when a container type has no decls was an
experiment in saving memory, but it ended up causing more trouble than
it was worth in various places. So, take the small memory hit for
reified types, and just give every container type a namespace.
2024-08-11 07:30:21 +01:00
mlugg
548a087faf
compiler: split Decl into Nav and Cau
The type `Zcu.Decl` in the compiler is problematic: over time it has
gained many responsibilities. Every source declaration, container type,
generic instantiation, and `@extern` has a `Decl`. The functions of
these `Decl`s are in some cases entirely disjoint.

After careful analysis, I determined that the two main responsibilities
of `Decl` are as follows:
* A `Decl` acts as the "subject" of semantic analysis at comptime. A
  single unit of analysis is either a runtime function body, or a
  `Decl`. It registers incremental dependencies, tracks analysis errors,
  etc.
* A `Decl` acts as a "global variable": a pointer to it is consistent,
  and it may be lowered to a specific symbol by the codegen backend.

This commit eliminates `Decl` and introduces new types to model these
responsibilities: `Cau` (Comptime Analysis Unit) and `Nav` (Named
Addressable Value).

Every source declaration, and every container type requiring resolution
(so *not* including `opaque`), has a `Cau`. For a source declaration,
this `Cau` performs the resolution of its value. (When #131 is
implemented, it is unsolved whether type and value resolution will share
a `Cau` or have two distinct `Cau`s.) For a type, this `Cau` is the
context in which type resolution occurs.

Every non-`comptime` source declaration, every generic instantiation,
and every distinct `extern` has a `Nav`. These are sent to codegen/link:
the backends by definition do not care about `Cau`s.

This commit has some minor technically-breaking changes surrounding
`usingnamespace`. I don't think they'll impact anyone, since the changes
are fixes around semantics which were previously inconsistent (the
behavior changed depending on hashmap iteration order!).

Aside from that, this changeset has no significant user-facing changes.
Instead, it is an internal refactor which makes it easier to correctly
model the responsibilities of different objects, particularly regarding
incremental compilation. The performance impact should be negligible,
but I will take measurements before merging this work into `master`.

Co-authored-by: Jacob Young <jacobly0@users.noreply.github.com>
Co-authored-by: Jakub Konka <kubkon@jakubkonka.com>
2024-08-11 07:29:41 +01:00
Andrew Kelley
531cd177e8
Merge pull request #21021 from alexrp/target-os-versions
`std.Target`: Bump some minimum/maximum OS versions, and switch from SunOS to Solaris version numbers
2024-08-10 22:58:41 -07:00
Matthew Lugg
b7c01120b4
Merge pull request #21018 from ziglang/behavior-test-extern-disable
link: handle pointers to extern symbols
2024-08-11 00:46:05 +01:00
Jakub Konka
5dffd8cb7b Wasm: handle ref to an extern in getDeclVAddr 2024-08-10 22:32:06 +02:00
Jakub Konka
62fad66d64 Coff: handle ref to an extern in getDeclVAddr 2024-08-10 22:26:02 +02:00
Jakub Konka
8f82a66019 MachO/ZigObject: handle ref to an extern in getDeclVAddr 2024-08-10 22:25:57 +02:00
Jakub Konka
5d6e49d065 Elf/ZigObject: handle ref to an extern in getDeclVAddr
Prior to this change, we would unconditionally create a symbol and atom
pair for a Decl that could point to an extern, in which case no atom
can be created.
2024-08-10 22:23:24 +02:00