diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2021-06-11 17:03:46 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-06-11 17:03:46 -0400 |
| commit | f7361970b334faf4433b3bd1d5dd6d499860c288 (patch) | |
| tree | 7e1b177c8e28979af2ceb306c71e2337a67f5b8e /lib/std/target.zig | |
| parent | 45212e3b33151b016ae4a597a898db0cc13d4e6b (diff) | |
| parent | da4081fe21f534157a7a88e2d6b2b6a80ee2f32d (diff) | |
| download | zig-f7361970b334faf4433b3bd1d5dd6d499860c288.tar.gz zig-f7361970b334faf4433b3bd1d5dd6d499860c288.zip | |
Merge pull request #8060 from DrDeano/feature/add-mcpu-to-target-options
Add CPU feature check to standardTargetOptions
Diffstat (limited to 'lib/std/target.zig')
| -rw-r--r-- | lib/std/target.zig | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/std/target.zig b/lib/std/target.zig index 3fd5cd5f94..faebe665ab 100644 --- a/lib/std/target.zig +++ b/lib/std/target.zig @@ -664,8 +664,15 @@ pub const Target = struct { return @ptrCast(*const [byte_count]u8, &set.ints); } - pub fn eql(set: Set, other: Set) bool { - return mem.eql(usize, &set.ints, &other.ints); + pub fn eql(set: Set, other_set: Set) bool { + return mem.eql(usize, &set.ints, &other_set.ints); + } + + pub fn isSuperSetOf(set: Set, other_set: Set) bool { + const V = std.meta.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); } }; |
