Linus Torvalds writes: (Summary)
The alternatives of doing it _entirely_ by hand tend to be much worse
(ie you end up using a macro from hell that checks which of the two
bits are bigger and shifting in the right direction by using
multiplication or division).
multiplication or division).
So let's just rewrite that mnt_flags conversion that way, justr to get gcc to generate the obvious code.
gcc to generate the obvious code.
It's a bit sad how gcc didn't pick up on the original code, especially since it had already done the much more complicated translation of doing the if-conversion.
doing the if-conversion.
Thanks for pointing out the gcc pattern.
Thanks for pointing out the gcc pattern.
Linus
Linus
Linus
multiplication or division).
So let's just rewrite that mnt_flags conversion that way, justr to get gcc to generate the obvious code.
gcc to generate the obvious code.
It's a bit sad how gcc didn't pick up on the original code, especially since it had already done the much more complicated translation of doing the if-conversion.
doing the if-conversion.
Thanks for pointing out the gcc pattern.
Thanks for pointing out the gcc pattern.
Linus
Linus
Linus