On 5/18/25 2:24 PM, Richard Sandiford wrote:


gcc/
        * genemit.cc (gen_rtx_scratch, gen_exp): Use operands[%d] rather than
        operand%d.
        (start_gen_insn): Store the incoming arguments to an operands array.
        (gen_expand, gen_split): Remove copies into and out of the operands
        array.
        * config/stormy16/stormy16.md (negsi): Remove redundant assignment.
So two questions.  Is there any meanginful performance impact expected
here using the array form rather than locals?   And does this impact how
folks write their C/C++ fragments in the expanders and such?

I don't think there should be any compile-time impact, and I can't
measure one when compiling fold-const.ii -O0 (my go-to test for this).
Sounds good.


The md interface remains the same, in that all interaction is via the
the operands[] array.  Any writes to the individual operandN variables
(where present) are ignored both before and after the patch.
I must have mis-read a bit then. My mental model was we were losing the operandN interface.


However, I suppose this does make it possible to turn the operandN
arguments into constants, to prevent accidents.  I'll try that.
If it works, it's a good idea as I've had to chase down bugs in this space a few times through the years...
jeff

Reply via email to