This email is a follow-up to some earlier email I sent about
alignment of spills and fills but did not get any replies to.

        https://gcc.gnu.org/ml/gcc/2015-03/msg00028.html

After looking into that I have decided to look more into dynamically
realigning the stack so that my spills and fills would be aligned and I have
done some experiments with stack realignment and I am trying to understand
what hooks already exist and how to use them.

Currently mips just has:

        #define STACK_BOUNDARY (TARGET_NEWABI ? 128 : 64)

I added:

        #define MAX_STACK_ALIGNMENT 128
        #define PREFERRED_STACK_BOUNDARY (TARGET_MSA ? 128 : STACK_BOUNDARY)
        #define INCOMING_STACK_BOUNDARY STACK_BOUNDARY

To try and get GCC to realign the stack to 128 bits if we are compiling
with the -mmsa option.  After doing this I found I needed to create a
TARGET_GET_DRAP_RTX that would return a register rtx when a drap was
needed so I did that and I got things to compile but I don't see any
code that actually realigned the stack.  It is not clear to me from the
documentation if there is shared code somewhere that should be trying to
realign the stack by changing the stack pointer given these definitions
or if I also need to add my own code to exand_prologue to do the stack
realignment myself.

I am also not sure if I understand the drap (Dynamic Realign Argument Pointer)
register functionality correctly.  My guess/understanding was that the drap
was used to access arguments in cases where the regular stack pointer may have
been changed in order to be aligned.  Is that correct?

Any help/advice on how the hooks for dynamically realigned stack are supposed
to all work together would be appreciated.

Steve Ellcey

Reply via email to