From 6f4343b61afe36a709e713735947561a2b76bce8 Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Tue, 26 Apr 2022 17:08:54 +0200 Subject: std: replace usage of std.meta.bitCount() with @bitSizeOf() --- src/codegen/spirv.zig | 2 +- src/codegen/spirv/Section.zig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/codegen') diff --git a/src/codegen/spirv.zig b/src/codegen/spirv.zig index 791c2dc187..0dc39db134 100644 --- a/src/codegen/spirv.zig +++ b/src/codegen/spirv.zig @@ -341,7 +341,7 @@ pub const DeclGen = struct { // We can just use toSignedInt/toUnsignedInt here as it returns u64 - a type large enough to hold any // SPIR-V native type (up to i/u64 with Int64). If SPIR-V ever supports native ints of a larger size, this // might need to be updated. - assert(self.largestSupportedIntBits() <= std.meta.bitCount(u64)); + assert(self.largestSupportedIntBits() <= @bitSizeOf(u64)); // Note, value is required to be sign-extended, so we don't need to mask off the upper bits. // See https://www.khronos.org/registry/SPIR-V/specs/unified1/SPIRV.html#Literal diff --git a/src/codegen/spirv/Section.zig b/src/codegen/spirv/Section.zig index 83383e442a..6ed2de92f0 100644 --- a/src/codegen/spirv/Section.zig +++ b/src/codegen/spirv/Section.zig @@ -170,7 +170,7 @@ fn writeString(section: *Section, str: []const u8) void { var j: usize = 0; while (j < @sizeOf(Word) and i + j < str.len) : (j += 1) { - word |= @as(Word, str[i + j]) << @intCast(Log2Word, j * std.meta.bitCount(u8)); + word |= @as(Word, str[i + j]) << @intCast(Log2Word, j * @bitSizeOf(u8)); } section.instructions.appendAssumeCapacity(word); -- cgit v1.2.3