uint EvenBitMask = 0x55555555u; uint HighIndexBit = PackedIndices >> 1; float NumWeight1 = float(countbits(EvenBitMask & ~HighIndexBit & PackedIndices)); float NumWeight2 = float(countbits(EvenBitMask & HighIndexBit & ~PackedIndices)); float NumWeight3 = float(countbits(EvenBitMask & HighIndexBit & PackedIndices)); // with NV LOP3: 1 shift, 3 LOP3, 3 pop count, 3 int->float = 10 insns total for 16 pixels // without: 1 shift, 2 NOT, 5 AND, 3 pop count, 3 int->float = 14 insns total for 16 pixels