aboutsummaryrefslogtreecommitdiff
path: root/lib/std/Target.zig
diff options
context:
space:
mode:
authorJacob Young <jacobly0@users.noreply.github.com>2025-05-31 18:54:01 -0400
committermlugg <mlugg@mlugg.co.uk>2025-06-01 08:24:01 +0100
commitec579aa0f372b2054ad659aaacd190c1a986d7f2 (patch)
tree193cca8db61e7885b94639e18319b4d98e586552 /lib/std/Target.zig
parentadd2976a9ba76ec661ae5668eb2a8dca2ccfad42 (diff)
downloadzig-ec579aa0f372b2054ad659aaacd190c1a986d7f2.tar.gz
zig-ec579aa0f372b2054ad659aaacd190c1a986d7f2.zip
Legalize: implement scalarization of `@shuffle`
Diffstat (limited to 'lib/std/Target.zig')
-rw-r--r--lib/std/Target.zig27
1 files changed, 6 insertions, 21 deletions
diff --git a/lib/std/Target.zig b/lib/std/Target.zig
index bf5a6369b5..b60de995fa 100644
--- a/lib/std/Target.zig
+++ b/lib/std/Target.zig
@@ -1246,11 +1246,7 @@ pub const Cpu = struct {
/// Adds the specified feature set but not its dependencies.
pub fn addFeatureSet(set: *Set, other_set: Set) void {
- if (builtin.zig_backend == .stage2_x86_64 and builtin.object_format == .coff) {
- for (&set.ints, other_set.ints) |*set_int, other_set_int| set_int.* |= other_set_int;
- } else {
- set.ints = @as(@Vector(usize_count, usize), set.ints) | @as(@Vector(usize_count, usize), other_set.ints);
- }
+ set.ints = @as(@Vector(usize_count, usize), set.ints) | @as(@Vector(usize_count, usize), other_set.ints);
}
/// Removes the specified feature but not its dependents.
@@ -1262,11 +1258,7 @@ pub const Cpu = struct {
/// Removes the specified feature but not its dependents.
pub fn removeFeatureSet(set: *Set, other_set: Set) void {
- if (builtin.zig_backend == .stage2_x86_64 and builtin.object_format == .coff) {
- for (&set.ints, other_set.ints) |*set_int, other_set_int| set_int.* &= ~other_set_int;
- } else {
- set.ints = @as(@Vector(usize_count, usize), set.ints) & ~@as(@Vector(usize_count, usize), other_set.ints);
- }
+ set.ints = @as(@Vector(usize_count, usize), set.ints) & ~@as(@Vector(usize_count, usize), other_set.ints);
}
pub fn populateDependencies(set: *Set, all_features_list: []const Cpu.Feature) void {
@@ -1295,17 +1287,10 @@ pub const Cpu = struct {
}
pub fn isSuperSetOf(set: Set, other_set: Set) bool {
- if (builtin.zig_backend == .stage2_x86_64 and builtin.object_format == .coff) {
- var result = true;
- for (&set.ints, other_set.ints) |*set_int, other_set_int|
- result = result and (set_int.* & other_set_int) == other_set_int;
- return result;
- } else {
- const V = @Vector(usize_count, usize);
- const set_v: V = set.ints;
- const other_v: V = other_set.ints;
- return @reduce(.And, (set_v & other_v) == other_v);
- }
+ const V = @Vector(usize_count, usize);
+ const set_v: V = set.ints;
+ const other_v: V = other_set.ints;
+ return @reduce(.And, (set_v & other_v) == other_v);
}
};