diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2018-02-01 18:13:44 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2018-02-01 18:13:44 +0300 |
commit | a57063a432a3908b0b750b889478ba87dfed60e2 (patch) | |
tree | 30e3ac9efa4f82c93cffdd426e13f6566bb8daaf /intern | |
parent | b8bb15f744ea811f3ff14882fdd012a378fbbc97 (diff) | |
parent | 7e928c3bbc5a0048a35ffe02a1244a2f04f46ca5 (diff) |
Merge remote-tracking branch 'origin/master' into blender2.8
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/util/util_simd.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/intern/cycles/util/util_simd.h b/intern/cycles/util/util_simd.h index f432fd7957a..04341451afb 100644 --- a/intern/cycles/util/util_simd.h +++ b/intern/cycles/util/util_simd.h @@ -454,12 +454,21 @@ ccl_device_inline int bitscan(int value) { assert(value != 0); int bit = 0; - while(value >>= 1) { + while((value & (1 << bit)) == 0) { ++bit; } return bit; } +ccl_device_inline int __bsr(int value) +{ + assert(value != 0); + int bit = 0; + while(value >>= 1) { + ++bit; + } + return bit; +} #endif /* __KERNEL_SSE2__ */ |