Explorar el Código

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 hace 7 años
padre
commit
05e4ff33f5
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2
    2
      src/gallium/drivers/swr/rasterizer/common/os.h

+ 2
- 2
src/gallium/drivers/swr/rasterizer/common/os.h Ver fichero

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


Cargando…
Cancelar
Guardar