aboutsummaryrefslogtreecommitdiff
path: root/src/InternPool.zig
diff options
context:
space:
mode:
authorNiles Salter <Validark@pm.me>2023-06-20 17:32:07 -0600
committerAndrew Kelley <andrew@ziglang.org>2023-06-22 01:57:28 -0700
commitff5850183eee854fdfe0d3f7b7242b9ff56c2116 (patch)
tree715ed346487b0f221f92e26280ea5e5b52a9254a /src/InternPool.zig
parent991e00c2702b31dffb7b5ada26c7b19a552502a7 (diff)
downloadzig-ff5850183eee854fdfe0d3f7b7242b9ff56c2116.tar.gz
zig-ff5850183eee854fdfe0d3f7b7242b9ff56c2116.zip
[priority_deque] simplify & optimize isMinLayer
LLVM has trouble compiling the old implementation, (presumably) because `leading_zeros` is thought to be a `u7` rather than a `u6`, which means `63 - clz` is not equivalent to `63 ^ clz`, which means it can't deduce that the final condition can simply be flipped. (I am assuming `usize` is a `u64` here for ease of understanding, but it's the same for any power of 2) https://zig.godbolt.org/z/Pbj4P7ob3 The new version is slightly better too because `isMinLayer(maxInt(usize))` is now well-defined behavior.
Diffstat (limited to 'src/InternPool.zig')
0 files changed, 0 insertions, 0 deletions