Discussion:
mtlo/mflo instructions when issue width is increased (MIPS 5kc)
Cherry Vanc
2014-09-17 23:59:38 UTC
Permalink
I added a functional unit to the MIPS 5kc backend for memory
operations and noticed that a function started getting mtlo / mflo
instructions in the prologue/epilogue. The function does not have any
mult/div instructions.

When I debug the source of these instructions, I can only tap into the
code path when GCC is looking for the instruction suiting the RTL
pattern (final.c).

Why are these instructions being generated when I simply just added a
functional unit to the pipeline description ? How can I debug why they
are being generated in the first place ?

Thanks
Segher Boessenkool
2014-09-18 02:13:02 UTC
Permalink
Post by Cherry Vanc
I added a functional unit to the MIPS 5kc backend for memory
operations and noticed that a function started getting mtlo / mflo
instructions in the prologue/epilogue. The function does not have any
mult/div instructions.
When I debug the source of these instructions, I can only tap into the
code path when GCC is looking for the instruction suiting the RTL
pattern (final.c).
Why are these instructions being generated when I simply just added a
functional unit to the pipeline description ? How can I debug why they
are being generated in the first place ?
Add -dap to your gcc command line. Also use -S, not -c.

Cheers,


Segher
Cherry Vanc
2014-09-19 23:49:34 UTC
Permalink
Thanks a lot for your comments. I figured that the IRA was spilling to
lo as adding a functional unit led to additional register pressure.

On Wed, Sep 17, 2014 at 7:13 PM, Segher Boessenkool
Post by Segher Boessenkool
Post by Cherry Vanc
I added a functional unit to the MIPS 5kc backend for memory
operations and noticed that a function started getting mtlo / mflo
instructions in the prologue/epilogue. The function does not have any
mult/div instructions.
When I debug the source of these instructions, I can only tap into the
code path when GCC is looking for the instruction suiting the RTL
pattern (final.c).
Why are these instructions being generated when I simply just added a
functional unit to the pipeline description ? How can I debug why they
are being generated in the first place ?
Add -dap to your gcc command line. Also use -S, not -c.
Cheers,
Segher
Loading...