std.Target.Cpu.Arch: Remove the aarch64_32 tag.

This is a misfeature that we inherited from LLVM:

* https://reviews.llvm.org/D61259
* https://reviews.llvm.org/D61939

(`aarch64_32` and `arm64_32` are equivalent.)

I truly have no idea why this triple passed review in LLVM. It is, to date, the
*only* tag in the architecture component that is not, in fact, an architecture.
In reality, it is just an ILP32 ABI for AArch64 (*not* AArch32).

The triples that use `aarch64_32` look like `aarch64_32-apple-watchos`. Yes,
that triple is exactly what you think; it has no ABI component. They really,
seriously did this.

Since only Apple could come up with silliness like this, it should come as no
surprise that no one else uses `aarch64_32`. Later on, a GNU ILP32 ABI for
AArch64 was developed, and support was added to LLVM:

* https://reviews.llvm.org/D94143
* https://reviews.llvm.org/D104931

Here, sanity seems to have prevailed, and a triple using this ABI looks like
`aarch64-linux-gnu_ilp32` as you would expect.

As can be seen from the diffs in this commit, there was plenty of confusion
throughout the Zig codebase about what exactly `aarch64_32` was. So let's just
remove it. In its place, we'll use `aarch64-watchos-ilp32`,
`aarch64-linux-gnuilp32`, and so on. We'll then translate these appropriately
when talking to LLVM. Hence, this commit adds the `ilp32` ABI tag (we already
have `gnuilp32`).
This commit is contained in:
Alex Rønne Petersen
2024-07-27 03:52:19 +02:00
committed by Andrew Kelley
parent c157550928
commit d1d95294fd
23 changed files with 45 additions and 71 deletions

View File

@@ -3,9 +3,11 @@ const Cases = @import("src/Cases.zig");
const targets = [_]std.Target.Query{
.{ .cpu_arch = .aarch64, .os_tag = .freestanding, .abi = .none },
.{ .cpu_arch = .aarch64, .os_tag = .freestanding, .abi = .ilp32 },
.{ .cpu_arch = .aarch64, .os_tag = .ios, .abi = .none },
.{ .cpu_arch = .aarch64, .os_tag = .ios, .abi = .simulator },
.{ .cpu_arch = .aarch64, .os_tag = .linux, .abi = .none },
.{ .cpu_arch = .aarch64, .os_tag = .linux, .abi = .gnuilp32 },
.{ .cpu_arch = .aarch64, .os_tag = .macos, .abi = .none },
.{ .cpu_arch = .aarch64, .os_tag = .watchos, .abi = .none },
.{ .cpu_arch = .aarch64, .os_tag = .watchos, .abi = .simulator },
@@ -18,8 +20,6 @@ const targets = [_]std.Target.Query{
.{ .cpu_arch = .aarch64, .os_tag = .windows, .abi = .msvc },
.{ .cpu_arch = .aarch64_be, .os_tag = .freestanding, .abi = .none },
.{ .cpu_arch = .aarch64_be, .os_tag = .linux, .abi = .none },
.{ .cpu_arch = .aarch64_32, .os_tag = .freestanding, .abi = .none },
.{ .cpu_arch = .aarch64_32, .os_tag = .linux, .abi = .none },
.{ .cpu_arch = .amdgcn, .os_tag = .amdhsa, .abi = .none },
.{ .cpu_arch = .amdgcn, .os_tag = .amdpal, .abi = .none },
.{ .cpu_arch = .amdgcn, .os_tag = .linux, .abi = .none },