aboutsummaryrefslogtreecommitdiff
path: root/src/codegen
diff options
context:
space:
mode:
authorIsaac Freund <mail@isaacfreund.com>2022-04-26 17:08:54 +0200
committerIsaac Freund <mail@isaacfreund.com>2022-04-27 11:10:52 +0200
commit6f4343b61afe36a709e713735947561a2b76bce8 (patch)
tree19517971ce99ed10afeac53ed4e19c97c60da7cc /src/codegen
parent6c0719fd5f29f524b789d5038fdc9fc0878f2e6a (diff)
downloadzig-6f4343b61afe36a709e713735947561a2b76bce8.tar.gz
zig-6f4343b61afe36a709e713735947561a2b76bce8.zip
std: replace usage of std.meta.bitCount() with @bitSizeOf()
Diffstat (limited to 'src/codegen')
-rw-r--r--src/codegen/spirv.zig2
-rw-r--r--src/codegen/spirv/Section.zig2
2 files changed, 2 insertions, 2 deletions
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);