On 5/4/24 8:41 AM, Jeff Law wrote:
The CI system caught a latent bug in the inline string comparison code that shows up with rv32+zbb.  It was hardcoding 64 when AFAICT it should have been using BITS_PER_WORD.

So v2 with that fixed.
So per the discussion in today's call I reviewed a couple of spaces, particularly -Os and interactions with vector expansion of these routines.


WRT vector expansion. We *always* use loops for this stuff right now (str[n]cmp, strlen). Vector expansion of these routines is suppressed with -Os enabled, which is good as it's hard to see how the vector loops will ever be smaller than a function call.

WRT scalar expansion. -Os generally turns off scalar expansion as well, with the exception of trivial cases involving str[n]cmp with one arg being a constant string.

These shouldn't interact at all with Sergei's setmem, clrmem, movmem expanders.

If we look to improve the vector expansion case (say by handling cases with small counts for strncmp or when one argument to str[n]cmp is a constant string) in the future, we'll have to revisit.

Overall conclusion is we should go ahead with the patch.

jeff

Reply via email to