On 5/9/25 4:09 AM, Anton Blanchard wrote:
If the vector version of clmul (vclmul) is available and the scalar
one is not, use it for CRC expansion.
gcc/Changelog:
* config/riscv/bitmanip.md (crc_rev<ANYI1:mode><ANYI:mode>4): Check
TARGET_ZVBC.
(crc<SUBX1:mode><SUBX:mode>4): Likewise.
* config/riscv/riscv.cc (expand_crc_using_clmul): Emit code using
vclmul if TARGET_ZVBC.
(expand_reversed_crc_using_clmul): Likewise.
gcc/testsuite/ChangeLog:
* gcc.target/riscv/rvv/base/crc-builtin-zvbc.c: New test.
THanks. I pushed this after fixing one formatting nit.
+
+ rtx shift_amount = gen_int_mode (GET_MODE_BITSIZE (word_mode) -
+ data_size, Pmode);
When we wrap we bring the operator down to the next line. We usually
also put expressions like this in an additional level of parenthesis.
But there's an easier way :-) GET_MODE_BITSIZE (word_mode) is always
going to be BITS_PER_WORD. So I used that instead which avoids
wrapping. There was another instance a elsewhere I adjusted to be
consistent.
Thanks!
jeff