Re: [PATCH] fat: Refactor fat_tolower with branchless implementation

From: I Hsin Cheng
Date: Tue Mar 18 2025 - 22:49:56 EST


On Tue, Mar 18, 2025 at 04:03:23AM +0000, Al Viro wrote:
> On Tue, Mar 18, 2025 at 11:43:09AM +0800, I Hsin Cheng wrote:
> > Elimate the need of if-else branch within fat_tolower, replace it with a
> > branchless bitwise operation. This can reduce the number of branch ~130
> > regarding to the test script[1].
>
> ... and for values outside of 32..126 it would give wrong results.

Ahh, sorry I didn't take these into consideration, I guess branch is
necessary here then. Thanks for your review!

Best regards,
I Hsin Cheng