aboutsummaryrefslogtreecommitdiff
path: root/libcpp
diff options
context:
space:
mode:
authorLyut Nersisyan <lyut.nersisyan@gmail.com>2024-05-28 09:17:50 -0600
committerJeff Law <jlaw@ventanamicro.com>2024-05-28 09:22:28 -0600
commit236116068151bbc72aaaf53d0f223fe06f7e3bac (patch)
tree19b32ff6bb9f14fac7cb7b5645d5b16f1a85b670 /libcpp
parenta3aeff4ce95bd616a2108dc2363d9cbaba53b170 (diff)
downloadgcc-236116068151bbc72aaaf53d0f223fe06f7e3bac.zip
gcc-236116068151bbc72aaaf53d0f223fe06f7e3bac.tar.gz
gcc-236116068151bbc72aaaf53d0f223fe06f7e3bac.tar.bz2
[to-be-committed] [RISC-V] Some basic patterns for zbkb code generation
And here's Lyut's basic Zbkb support. Essentially it's four new patterns for packh, packw, pack plus a bridge pattern needed for packh. packw is a bit ugly as we need to match a sign extension in an inconvenient location. We pull it out so that the extension is exposed in a convenient place for subsequent sign extension elimination. We need a bridge pattern to get packh. Thankfully the bridge pattern is a degenerate packh where one operand is x0, so it works as-is without splitting and provides the bridge to the more general form of packh. This patch also refines the condition for the constant reassociation patch to avoid a few more cases than can be handled efficiently with other preexisting patterns and one bugfix to avoid losing bits, particularly in the xor/ior case. Lyut did the core work here. I think I did some minor cleanups and the bridge pattern to work with gcc-15 and beyond. This is a prerequisite for using zbkb in constant synthesis. It also stands on its own. I know we've seen it trigger in spec without the constant synthesis bits. It's been through our internal CI and my tester. I'll obviously wait for the upstream CI to finish before taking further action. gcc/ * config/riscv/crypto.md: Add new combiner patterns to generate pack, packh, packw instrutions. * config/riscv/iterators.md (HX): New iterator for half X mode. * config/riscv/riscv.md (<optab>_shift_reverse<X:mode>): Tighten cases to avoid. Do not lose bits for XOR/IOR. gcc/testsuite * gcc.target/riscv/pack32.c: New test. * gcc.target/riscv/pack64.c: New test. * gcc.target/riscv/packh32.c: New test. * gcc.target/riscv/packh64.c: New test. * gcc.target/riscv/packw.c: New test. Co-authored-by: Jeffrey A Law <jlaw@ventanamicro.com>
Diffstat (limited to 'libcpp')
0 files changed, 0 insertions, 0 deletions