Re: [PATCH] ext4: improve str2hashbuf by processing 4-byte chunks

From: David Laight

Date: Fri Nov 21 2025 - 06:59:34 EST


On Fri, 21 Nov 2025 11:55:26 +0100
Andreas Schwab <schwab@xxxxxxxxxxxxxx> wrote:

> On Nov 20 2025, Theodore Tso wrote:
>
> > Secondly, it's not that a promotion happens before "any" arithmetic.
> > If we add two 8-bit values together, promotion doesn't happen.
>
> That is not true. Integer promotion is applied individually to each
> operand independent of context.

True.

You can think of the promotion happening every time a 'variable' is
read into a cpu register for any operation (including an assignment).

Similarly every write to a variable discards the high bits.

David