Cycles: Fix for non-vectorized version of bitscan()
It was doing bit search in an opposite direction comparing to a vectorized version.
This commit is contained in:
@@ -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 */
|
||||
|
Reference in New Issue
Block a user