diff options
| author | Alex Rønne Petersen <alex@alexrp.com> | 2025-02-18 05:25:36 +0100 |
|---|---|---|
| committer | Alex Rønne Petersen <alex@alexrp.com> | 2025-06-05 06:12:00 +0200 |
| commit | 9d534790ebc869ec933e932abe4be8b9e3593bbc (patch) | |
| tree | 70652dde381fd0c0d536d8e7665e725e0924bb51 /src/Zcu.zig | |
| parent | 14873f9a3434a0d753ca8438f389a7931956cf26 (diff) | |
| download | zig-9d534790ebc869ec933e932abe4be8b9e3593bbc.tar.gz zig-9d534790ebc869ec933e932abe4be8b9e3593bbc.zip | |
std.Target: Introduce Cpu convenience functions for feature tests.
Before:
* std.Target.arm.featureSetHas(target.cpu.features, .has_v7)
* std.Target.x86.featureSetHasAny(target.cpu.features, .{ .sse, .avx, .cmov })
* std.Target.wasm.featureSetHasAll(target.cpu.features, .{ .atomics, .bulk_memory })
After:
* target.cpu.has(.arm, .has_v7)
* target.cpu.hasAny(.x86, &.{ .sse, .avx, .cmov })
* target.cpu.hasAll(.wasm, &.{ .atomics, .bulk_memory })
Diffstat (limited to 'src/Zcu.zig')
| -rw-r--r-- | src/Zcu.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Zcu.zig b/src/Zcu.zig index 20fafb6c4d..d4a0adf284 100644 --- a/src/Zcu.zig +++ b/src/Zcu.zig @@ -3741,7 +3741,7 @@ pub fn errorSetBits(zcu: *const Zcu) u16 { if (zcu.error_limit == 0) return 0; if (target.cpu.arch.isSpirV()) { - if (!std.Target.spirv.featureSetHas(target.cpu.features, .storage_push_constant16)) { + if (!target.cpu.has(.spirv, .storage_push_constant16)) { return 32; } } @@ -3911,7 +3911,7 @@ pub fn atomicPtrAlignment( .aarch64_be, => 128, - .x86_64 => if (std.Target.x86.featureSetHas(target.cpu.features, .cx16)) 128 else 64, + .x86_64 => if (target.cpu.has(.x86, .cx16)) 128 else 64, }; if (ty.toIntern() == .bool_type) return .none; |
