Skip to content

Commit

Permalink
std.Target: Remove armv7k/armv7s.
Browse files Browse the repository at this point in the history
Like d1d9529, this is more Apple nonsense where
they abused the arch component of the triple to encode what's really an ABI.

Handling this correctly in Zig's target triple model would take quite a bit of
work. Fortunately, the last Armv7-based Apple Watch was released in 2017 and
these targets are now considered legacy. By the time Zig hits 1.0, they will be
a distant memory. So just remove them.
  • Loading branch information
alexrp committed Nov 2, 2024
1 parent ab89af3 commit fccf15f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 21 deletions.
16 changes: 0 additions & 16 deletions lib/std/Target/arm.zig
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,8 @@ pub const Feature = enum {
v6t2,
v7a,
v7em,
v7k,
v7m,
v7r,
v7s,
v7ve,
v8_1a,
v8_1m_main,
Expand Down Expand Up @@ -1177,13 +1175,6 @@ pub const all_features = blk: {
.thumb_mode,
}),
};
result[@intFromEnum(Feature.v7k)] = .{
.llvm_name = "armv7k",
.description = "ARMv7a architecture",
.dependencies = featureSet(&[_]Feature{
.v7a,
}),
};
result[@intFromEnum(Feature.v7m)] = .{
.llvm_name = "armv7-m",
.description = "ARMv7m architecture",
Expand All @@ -1208,13 +1199,6 @@ pub const all_features = blk: {
.rclass,
}),
};
result[@intFromEnum(Feature.v7s)] = .{
.llvm_name = "armv7s",
.description = "ARMv7a architecture",
.dependencies = featureSet(&[_]Feature{
.v7a,
}),
};
result[@intFromEnum(Feature.v7ve)] = .{
.llvm_name = "armv7ve",
.description = "ARMv7ve architecture",
Expand Down
3 changes: 0 additions & 3 deletions src/codegen/llvm.zig
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,6 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![]const u8 {
.{ .v6kz, "v6kz" },
.{ .v6m, "v6m" },
.{ .v6t2, "v6t2" },
// v7k and v7s imply v7a so they have to be tested first.
.{ .v7k, "v7k" },
.{ .v7s, "v7s" },
.{ .v7a, "v7a" },
.{ .v7em, "v7em" },
.{ .v7m, "v7m" },
Expand Down
4 changes: 2 additions & 2 deletions tools/update_cpu_features.zig
Original file line number Diff line number Diff line change
Expand Up @@ -699,11 +699,11 @@ const llvm_targets = [_]LlvmTarget{
},
.{
.llvm_name = "armv7k",
.zig_name = "v7k",
.omit = true,
},
.{
.llvm_name = "armv7s",
.zig_name = "v7s",
.omit = true,
},
.{
.llvm_name = "armv7ve",
Expand Down

0 comments on commit fccf15f

Please sign in to comment.