diff options
author | Mariam Arutunian <mariamarutunian@gmail.com> | 2024-11-28 14:35:23 -0700 |
---|---|---|
committer | Jeff Law <jlaw@ventanamicro.com> | 2024-11-29 08:02:32 -0700 |
commit | 74eb3570e6fba73b0e2bfce2a14d7696e30b48a8 (patch) | |
tree | 85fdb3573cc53891b7fd9dfec3dc99966613dc91 /libgcc | |
parent | fe29b03825c9971ef1726bf9c7288de3389511b3 (diff) | |
download | gcc-74eb3570e6fba73b0e2bfce2a14d7696e30b48a8.zip gcc-74eb3570e6fba73b0e2bfce2a14d7696e30b48a8.tar.gz gcc-74eb3570e6fba73b0e2bfce2a14d7696e30b48a8.tar.bz2 |
[PATCH v7 03/12] RISC-V: Add CRC expander to generate faster CRC.
If the target is ZBC or ZBKC, it uses clmul instruction for the CRC
calculation. Otherwise, if the target is ZBKB, generates table-based
CRC, but for reversing inputs and the output uses bswap and brev8
instructions. Add new tests to check CRC generation for ZBC, ZBKC and
ZBKB targets.
gcc/
* expr.cc (gf2n_poly_long_div_quotient): New function.
* expr.h (gf2n_poly_long_div_quotient): New function declaration.
* hwint.cc (reflect_hwi): New function.
* hwint.h (reflect_hwi): New function declaration.
* config/riscv/bitmanip.md (crc_rev<ANYI1:mode><ANYI:mode>4): New
expander for reversed CRC.
(crc<SUBX1:mode><SUBX:mode>4): New expander for bit-forward CRC.
* config/riscv/iterators.md (SUBX1, ANYI1): New iterators.
* config/riscv/riscv-protos.h (generate_reflecting_code_using_brev):
New function declaration.
(expand_crc_using_clmul): Likewise.
(expand_reversed_crc_using_clmul): Likewise.
* config/riscv/riscv.cc (generate_reflecting_code_using_brev): New
function.
(expand_crc_using_clmul): Likewise.
(expand_reversed_crc_using_clmul): Likewise.
* config/riscv/riscv.md (UNSPEC_CRC, UNSPEC_CRC_REV): New unspecs.
* doc/sourcebuild.texi: Document new target selectors.
gcc/testsuite
* lib/target-supports.exp (check_effective_target_riscv_zbc): New
target supports predicate.
(check_effective_target_riscv_zbkb): Likewise.
(check_effective_target_riscv_zbkc): Likewise.
(check_effective_target_zbc_ok): Likewise.
(check_effective_target_zbkb_ok): Likewise.
(check_effective_target_zbkc_ok): Likewise.
(riscv_get_arch): Add zbkb and zbkc support.
* gcc.target/riscv/crc-builtin-zbc32.c: New file.
* gcc.target/riscv/crc-builtin-zbc64.c: Likewise.
Co-author: Jeff Law <jlaw@ventanamicro.com>
Diffstat (limited to 'libgcc')
0 files changed, 0 insertions, 0 deletions