aboutsummaryrefslogtreecommitdiff
path: root/src/analyze.cpp
diff options
context:
space:
mode:
authorvegecode <39607947+vegecode@users.noreply.github.com>2019-01-02 15:47:47 -0600
committerAndrew Kelley <andrew@ziglang.org>2019-01-02 16:47:47 -0500
commitf6cd68386d76e4a9a489187c47f218b59e1734f3 (patch)
tree016fbfe6ceff6e7535bc55c27735e8723ee037de /src/analyze.cpp
parent6df8e4bca73309f2e340dbfa9031f1bb16a73bcc (diff)
downloadzig-f6cd68386d76e4a9a489187c47f218b59e1734f3.tar.gz
zig-f6cd68386d76e4a9a489187c47f218b59e1734f3.zip
@bitreverse intrinsic, part of #767 (#1865)
* bitreverse - give bswap behavior * bitreverse, comptime_ints, negative values still not working? * bitreverse working for negative comptime ints * Finished bitreverse test cases * Undo exporting a bigint function. @bitreverse test name includes ampersand * added docs entry for @bitreverse
Diffstat (limited to 'src/analyze.cpp')
-rw-r--r--src/analyze.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp
index 0f2b8e48cc..b9794114a0 100644
--- a/src/analyze.cpp
+++ b/src/analyze.cpp
@@ -6121,6 +6121,8 @@ uint32_t zig_llvm_fn_key_hash(ZigLLVMFnKey x) {
return (uint32_t)(x.data.floating.bit_count) * (uint32_t)2225366385;
case ZigLLVMFnIdBswap:
return (uint32_t)(x.data.bswap.bit_count) * (uint32_t)3661994335;
+ case ZigLLVMFnIdBitReverse:
+ return (uint32_t)(x.data.bit_reverse.bit_count) * (uint32_t)2621398431;
case ZigLLVMFnIdOverflowArithmetic:
return ((uint32_t)(x.data.overflow_arithmetic.bit_count) * 87135777) +
((uint32_t)(x.data.overflow_arithmetic.add_sub_mul) * 31640542) +
@@ -6141,6 +6143,8 @@ bool zig_llvm_fn_key_eql(ZigLLVMFnKey a, ZigLLVMFnKey b) {
return a.data.pop_count.bit_count == b.data.pop_count.bit_count;
case ZigLLVMFnIdBswap:
return a.data.bswap.bit_count == b.data.bswap.bit_count;
+ case ZigLLVMFnIdBitReverse:
+ return a.data.bit_reverse.bit_count == b.data.bit_reverse.bit_count;
case ZigLLVMFnIdFloor:
case ZigLLVMFnIdCeil:
case ZigLLVMFnIdSqrt: