diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-02-01 17:11:17 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-02-01 17:11:17 +0300 |
commit | 7bd86d74bacb0b1f42fbe5ab6ed223f319ef242e (patch) | |
tree | 8902addd94fdedbd5e36c8024b15ba7803167803 /intern | |
parent | 653746f5f829e399fe85b4c1d0707a69ee16b3aa (diff) |
Cycles: Fix for non-vectorized version of bitscan()
It was doing bit search in an opposite direction comparing to a
vectorized version.
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/util/util_simd.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/intern/cycles/util/util_simd.h b/intern/cycles/util/util_simd.h index f432fd7957a..8f6eb3995b7 100644 --- a/intern/cycles/util/util_simd.h +++ b/intern/cycles/util/util_simd.h @@ -454,13 +454,12 @@ ccl_device_inline int bitscan(int value) { assert(value != 0); int bit = 0; - while(value >>= 1) { + while((value & (1 << bit)) == 0) { ++bit; } return bit; } - #endif /* __KERNEL_SSE2__ */ /* quiet unused define warnings */ |