Re: [PATCH] rx: allow cmpstrnsi len to be zero

2025-02-17 Thread Jeff Law
On 2/15/25 12:32 PM, Keith Packard wrote: It's as reasonable as other methods such as turning it into a define_expand and emitting a conditional branch around the sequence when the count is zero. Thanks much. I suspect the cost of the PSW setting instructions is far less than a branch, so

Re: [PATCH] rx: allow cmpstrnsi len to be zero

2025-02-15 Thread Keith Packard
> It's as reasonable as other methods such as turning it into a > define_expand and emitting a conditional branch around the sequence when > the count is zero. Thanks much. I suspect the cost of the PSW setting instructions is far less than a branch, so how about this version which emits them o

Re: [PATCH] rx: allow cmpstrnsi len to be zero

2025-02-15 Thread Jeff Law
On 2/15/25 10:08 AM, Keith Packard wrote: From: Jeff Law Date: Sat, 15 Feb 2025 09:19:42 -0700 It's as reasonable as other methods such as turning it into a define_expand and emitting a conditional branch around the sequence when the count is zero. Yeah, it would be "better" to avoid thos

Re: [PATCH] rx: allow cmpstrnsi len to be zero

2025-02-15 Thread Keith Packard
From: Jeff Law Date: Sat, 15 Feb 2025 09:19:42 -0700 > It's as reasonable as other methods such as turning it into a > define_expand and emitting a conditional branch around the sequence when > the count is zero. Yeah, it would be "better" to avoid those extra instructions when the count is kn

Re: [PATCH] rx: allow cmpstrnsi len to be zero

2025-02-15 Thread Jeff Law
On 2/15/25 3:31 AM, Keith Packard wrote: The SCMPU instruction doesn't change the C and Z flags when the incoming length is zero, which means the insn will produce a value based upon the existing flag values. As a quick kludge, adjust these flags to ensure a zero result in this case. It's as