Re: [PATCH] RISC-V: Vectorized str(n)cmp and strlen.

2023-12-01 Thread Robin Dapp
Split it into four separate patches now. Regards Robin

Re: [PATCH] RISC-V: Vectorized str(n)cmp and strlen.

2023-11-30 Thread juzhe.zh...@rivai.ai
Ah. I see: --- a/gcc/config/riscv/riscv.md +++ b/gcc/config/riscv/riscv.md @@ -2336,9 +2336,7 @@ (define_expand "cpymem" (use (match_operand:SI 3 "const_int_operand"))])] "" { - if (riscv_vector::expand_block_move (operands[0], operands[1], operands[2])) -DONE; - else if (

Re: [PATCH] RISC-V: Vectorized str(n)cmp and strlen.

2023-11-30 Thread juzhe.zh...@rivai.ai
Hi, Robin. Thanks for working on this. I know this is a tedious work. A couple comments here: - if (TARGET_ZBB || TARGET_XTHEADBB) + if (TARGET_VECTOR && stringop_strategy & STRINGOP_STRATEGY_VECTOR) +{ + bool ok = riscv_vector::expand_strcmp (result, src1, src2, bytes_rtx, +

Re: [PATCH] RISC-V: Vectorized str(n)cmp and strlen.

2023-11-30 Thread Jeff Law
On 11/30/23 15:22, Robin Dapp wrote: Hi, this adds vectorized implementations of strcmp and strncmp as well as strlen. strlen falls back to the previously implemented rawmemchr. Also, it fixes a rawmemchr bug causing a SPEC2017 execution failure: We would only ever increment the source addre