diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2017-08-17 17:14:35 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2017-08-17 17:14:35 -0400 |
| commit | 0d117bb0a993b2a0a290f99255c5bf1bf05f187f (patch) | |
| tree | 54abbc90bb6c31746eb0d9b1c8a3269395190900 /std | |
| parent | 6a98bf3dba6f3ed5b40fe7899899e2a792028be4 (diff) | |
| download | zig-0d117bb0a993b2a0a290f99255c5bf1bf05f187f.tar.gz zig-0d117bb0a993b2a0a290f99255c5bf1bf05f187f.zip | |
fix wrong value for clz, ctz at compile time
closes #418
also make clz, ctz return smaller integer bit widths
and use smaller integer bit widths for enum tag types
Diffstat (limited to 'std')
| -rw-r--r-- | std/special/compiler_rt/index.zig | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/std/special/compiler_rt/index.zig b/std/special/compiler_rt/index.zig index c2486a3d59..0d2e1325ab 100644 --- a/std/special/compiler_rt/index.zig +++ b/std/special/compiler_rt/index.zig @@ -139,7 +139,7 @@ export fn __udivmoddi4(a: du_int, b: du_int, maybe_rem: ?&du_int) -> du_int { // K X // --- // 0 K - sr = 1 + n_uword_bits + @clz(su_int(d[low])) - @clz(su_int(n[high])); + sr = 1 + n_uword_bits + c_uint(@clz(su_int(d[low]))) - c_uint(@clz(su_int(n[high]))); // 2 <= sr <= n_udword_bits - 1 // q.all = n.all << (n_udword_bits - sr); // r.all = n.all >> sr; |
