Преглед на файлове

swr/rast: Flip BitScanReverse index calculation

The intrinsic returns the number of leading zeros, not the bit number of
the first nonzero, so just flip it based on the mask size

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
tags/19.1-branchpoint
Alok Hota преди 7 години
родител
ревизия
05e4ff33f5
променени са 1 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 2
    2
      src/gallium/drivers/swr/rasterizer/common/os.h

+ 2
- 2
src/gallium/drivers/swr/rasterizer/common/os.h Целия файл

@@ -202,13 +202,13 @@ inline unsigned char _BitScanForward(unsigned int* Index, unsigned int Mask)

inline unsigned char _BitScanReverse(unsigned long* Index, unsigned long Mask)
{
*Index = __builtin_clz(Mask);
*Index = 63 - __builtin_clz(Mask);
return (Mask != 0);
}

inline unsigned char _BitScanReverse(unsigned int* Index, unsigned int Mask)
{
*Index = __builtin_clz(Mask);
*Index = 31 - __builtin_clz(Mask);
return (Mask != 0);
}


Loading…
Отказ
Запис