[ros-dev] [ros-diffs] [tkreuzer] 44464: [RTL] Rewrite the rtl bitmap implementation. The old one was a little .... suboptimal. The new one should outperform the old one by several orders of magnitude, especially RtlFindClearBits that was literally searching bit by bit.

Alex Ionescu ionucu at videotron.ca
Tue Dec 8 05:34:37 CET 2009


I'm concerned about code duplication.

Why can't our intrinsic header be used on host machines???

On 2009-12-07, at 11:16 PM, Timo Kreuzer wrote:

> 
> Why should I bother reimplementing the intrinsics yet another time for
> different compilers in host headers? and what about compiling on a
> non-x86 linux machine? This code is portable and serves it's pupose very
> well.
> Or are you seriously concerned about the performance?
> 
> 
> Alex Ionescu schrieb:
>> So? Use intrinsics anyways.
>> 
>> Or __builtin_clz...
>> 
>> On 2009-12-07, at 10:07 PM, Timo Kreuzer wrote:
>> 
>> 
>>> Because this is a host module.
>>> 
>>> Alex Ionescu wrote:
>>> 
>>>> Well why this then? They should be intrinsics...
>>>> 
>>>> On 2009-12-07, at 8:43 PM, Timo Kreuzer wrote:
>>>> 
>>>> 
>>>> 
>>>>>>> +unsigned char BitScanForward(ULONG * Index, unsigned long Mask)
>>>>>>> +{
>>>>>>> +    *Index = 0;
>>>>>>> +    while (Mask && ((Mask & 1) == 0))
>>>>>>> +    {
>>>>>>> +        Mask >>= 1;
>>>>>>> +        ++(*Index);
>>>>>>> +    }
>>>>>>> +    return Mask ? 1 : 0;
>>>>>>> +}
>>>>>>> +
>>>>>>> +unsigned char BitScanReverse(ULONG * const Index, unsigned long Mask)
>>>>>>> +{
>>>>>>> +    *Index = 0;
>>>>>>> +    while (Mask && ((Mask & (1 << 31)) == 0))
>>>>>>> +    {
>>>>>>> +        Mask <<= 1;
>>>>>>> +        ++(*Index);
>>>>>>> +    }
>>>>>>> +    return Mask ? 1 : 0;
>>>>>>> +}
>>>>>>> 
>>>>>>> 
>>>> Best regards,
>>>> Alex Ionescu
>>>> 
>>>> 
>>>> _______________________________________________
>>>> Ros-dev mailing list
>>>> Ros-dev at reactos.org
>>>> http://www.reactos.org/mailman/listinfo/ros-dev
>>>> 
>>>> 
>>>> 
>>> _______________________________________________
>>> Ros-dev mailing list
>>> Ros-dev at reactos.org
>>> http://www.reactos.org/mailman/listinfo/ros-dev
>>> 
>> 
>> Best regards,
>> Alex Ionescu
>> 
>> 
>> _______________________________________________
>> Ros-dev mailing list
>> Ros-dev at reactos.org
>> http://www.reactos.org/mailman/listinfo/ros-dev
>> 
>> 
> 
> 
> _______________________________________________
> Ros-dev mailing list
> Ros-dev at reactos.org
> http://www.reactos.org/mailman/listinfo/ros-dev

Best regards,
Alex Ionescu




More information about the Ros-dev mailing list