Procházet zdrojové kódy

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 před 7 roky
rodič
revize
05e4ff33f5
1 změnil soubory, kde provedl 2 přidání a 2 odebrání
  1. 2
    2
      src/gallium/drivers/swr/rasterizer/common/os.h

+ 2
- 2
src/gallium/drivers/swr/rasterizer/common/os.h Zobrazit soubor

@@ -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);
}


Načítá se…
Zrušit
Uložit