Re: [PATCH] rx: avoid adding setpsw for rx_cmpstrn when len is const

2025-04-17 Thread Keith Packard
> Thanks. I made some minor stylistic adjustments and pushed the change > to the trunk. Thanks! That's awesome, thanks so much! -- -keith signature.asc Description: PGP signature

Re: [PATCH] rx: avoid adding setpsw for rx_cmpstrn when len is const

2025-04-16 Thread Jeff Law
On 4/13/25 10:50 PM, Keith Packard wrote: pattern using rx_cmpstrn is cmpstrsi for which len is a constant -1, so we'll be moving the setpsw instructions from rx_cmpstrn to cmpstrnsi as follows: 1. Adjust the predicate on the length operand from "register_operand" to "nonmemory_operand

[PATCH] rx: avoid adding setpsw for rx_cmpstrn when len is const

2025-04-13 Thread Keith Packard
The only pattern for which the len may be zero is cmpstrsni. The other pattern using rx_cmpstrn is cmpstrsi for which len is a constant -1, so we'll be moving the setpsw instructions from rx_cmpstrn to cmpstrnsi as follows: 1. Adjust the predicate on the length operand from "register_operand"

Re: [PATCH] rx: avoid adding setpsw for rx_cmpstrn when len is const

2025-04-13 Thread Keith Packard
> Were you able to actually trigger cases where operands[3] is a > CONST_INT? Again, it's not entirely clear if that can actually happen > given the operand predicates on the cmpstrnsi expander. (sorry for the long delay; I'm just getting back to reviewing my pending GCC patches) Good call. N

Re: [PATCH] rx: avoid adding setpsw for rx_cmpstrn when len is const

2025-03-05 Thread Jeff Law
On 2/18/25 11:12 AM, Keith Packard wrote: We can avoid the setpsw instructions when len is a known constant. When len is zero, the insn result is zero. When len is non-zero, the scmpu instructions will set the flags correctly. Were you able to actually trigger cases where operands[3] is a CON

[PATCH] rx: avoid adding setpsw for rx_cmpstrn when len is const

2025-02-18 Thread Keith Packard
We can avoid the setpsw instructions when len is a known constant. When len is zero, the insn result is zero. When len is non-zero, the scmpu instructions will set the flags correctly. Signed-off-by: Keith Packard --- gcc/config/rx/rx.md | 19 --- 1 file changed, 16 insertions(+)