On 4/27/23 08:29, Karen Sargsyan via Gcc-patches wrote: > clmul[h] instructions were added only for the ZBKC extension. > This patch includes them in the ZBC extension too. > Besides, added support of 'clmulr' instructions for ZBC extension. > > gcc/ChangeLog: > > * config/riscv/bitmanip.md: Added clmulr instruction. > * config/riscv/riscv-builtins.cc (AVAIL): Add new. > * config/riscv/riscv.md: (UNSPEC_CLMULR): Add new unspec type. > * config/riscv/riscv-cmo.def: Added built-in function for clmulr. > * config/riscv/crypto.md: Move clmul[h] instructions to bitmanip.md. > * config/riscv/riscv-scalar-crypto.def: Move clmul[h] built-in > functions to riscv-cmo.def. > > gcc/testsuite/ChangeLog: > > * gcc.target/riscv/zbc32.c: New test. > * gcc.target/riscv/zbc64.c: New test. THanks. I made a couple of minor changes. Specifically rather than using the "bitmanip" type, I added a "clmul" type. These instructions are typically not going to be single cycle and thus uarchs probably want to schedule them differently than a generic bitmanip instruction. I also added the clmul type to the generic pipeline desription, routing into the generic_imul unit which seemed like the best fit. Attached is the actual patch I committed. Jeff