On Sun, Jun 08, 2025 at 09:05:07AM -0600, Jeff Law wrote: > > > On 6/7/25 4:38 AM, Stafford Horne wrote: > > > > > ## Note on cstoresi4 and PUT_MODE. > > > > There was some concern raised by Jeff about the use of PUT_MODE in > > cstoresi4. > > This is here to convert a 'ne' to 'ne:SI', for example, allowing the > > generated > > RTL to match with the "*scc" insn pattern later. > > > > It seems to be working OK so I will leave this as is for now. But if you > > have > > any suggestions let me know. > Well, it's a sign that something is wrong. Patterns shouldn't be changing > the mode or code of an existing RTL node (say that 5 fast :-)
Understood, just some explaination, in this case we are updating RTL that was just generated by or1k_expand_compare().. /* Adjust the operands for use in the caller. */ operands[0] = flag_check_ne ? gen_rtx_NE (VOIDmode, sr_f, const0_rtx) : gen_rtx_EQ (VOIDmode, sr_f, const0_rtx); operands[1] = sr_f; operands[2] = const0_rtx; } Depending on the pattern we are expanding we want either: (ne (reg:BI 34 ?sr_f)(const_int 0 [0])) Or: (ne:SI (reg:BI 34 ?sr_f)(const_int 0 [0])) The PUT_MODE does the final adjustment. As a cleanup, the PUT_MODE could be moved into or1k_expand_compare. > I don't mind deferring since apparently it's not playing a role in this > issue, but that code is definitely very fishy. OK. -Stafford