[ros-kernel] Little speedup (Nope)

Aleksey Bragin aleksey at studiocerebral.com
Tue Mar 30 00:54:07 CEST 2004


Thomas - I agree with Waldo, even GCC should do this automatically (though I
haven't studied GCC source code a lot, I bet it does this).

WBR,
Aleksey Bragin.

----- Original Message ----- 
From: "Waldo Alvarez Cañizares" <wac at lab.matcom.uh.cu>
To: "ReactOS Kernel List" <ros-kernel at reactos.com>
Sent: Monday, March 29, 2004 11:19 PM
Subject: [ros-kernel] Little speedup (Nope)



Hi Thomas:

That is not a speed-up. What you did there was instead a little obfuscation.
You have to get a very dumb compiler to generate a division for a power of
two. BTW GCC sometimes generates some mixture of shifts, additions and /or
substractions equivalent to multiplications or divisions so most of the
times GCC is cleaver enough (jeje sometimes better than me :) ) to let that
kind of optimization job to the compiler. So... there is not point in doing
that. If I'd were you I would revert the changes.

Best Regards
Waldo Alvarez



More information about the Ros-kernel mailing list