]> git.ipfire.org Git - thirdparty/gcc.git/commit
[RISC-V] Handle 32bit operands in condition for conditional moves
authorShreya Munnangi <smunnangi1@ventanamicro.com>
Sun, 8 Jun 2025 14:42:53 +0000 (08:42 -0600)
committerJeff Law <jlaw@ventanamicro.com>
Sun, 8 Jun 2025 14:44:23 +0000 (08:44 -0600)
commit2523c15430d980c380684c3df49f9ae016b8647d
treec47cd87feec3af48a4bf508f580a1076c6e19bbc
parent5f3b5b0616fe883e86e95d9476371cf87059ca7f
[RISC-V] Handle 32bit operands in condition for conditional moves

So here's the next chunk of conditional move work from Shreya.

It's been a long standing wart that the conditional move expander does not
support sub-word operands in the comparison.  Particularly since we have
support routines to handle the necessary extensions for that case.

This patch adjusts the expander to use riscv_extend_comparands rather than fail
for that case.  I've built spec2017 before/after this and we definitely get
more conditional moves and they look sensible from a performance standpoint.
None are likely hitting terribly hot code, so I wouldn't expect any performance
jumps.

Waiting on pre-commit testing to do its thing.

gcc/
* config/riscv/riscv.cc (riscv_expand_conditional_move): Use
riscv_extend_comparands to extend sub-word comparison arguments.

Co-authored-by: Jeff Law <jlaw@ventanamicro.com>
gcc/config/riscv/riscv.cc