ARM64: ABI - Support for using register x8 as the return buffer argument for structs
This is feature complete and fixes dotnet/coreclr#4949 but is being checked in disabled as it has dependencies
on some additional work in the VM dotnet/coreclr#4950 (saving and restoring register x8 in thePrestub, etc..)
In target.h
Added defines on ARM64 for the additional argument register used to pass the return buffer
This is register x8 and when it used it is considered the 9th argiment with an arg num of 8 (zero based)
Added new method hasFixedRetBuffReg() that will return true on ARM64 (when this feature is fully enabled)
Added new method theFixedRetBuffReg() that returns register REG_R8 (x8) for ARM64
Added new method theFixedRetBuffArgNum that returns RET_BUFF_ARGNUM (8) for ARM64
Updated isValidIntArgReg to allow for a fixed return buff register
In codegencommon.cpp:
Increase the static size of regArgTab[] by one for the integer registers
This allows us to optionally support having a fixed return buffer registers
We now track the maximum index into regArgTab[] using argMax which is
either the old value of regState->rsCalleeRegArgCount or thefixedRetBufArgNum()
Corrected the emitAttr size value for 64-bit targets to use EA_PTRSIZE instead of EA_4BYTE
In codegeninterface.cpp: (and other places)
Renamed rsCalleeRegNum to be rsCalleeRegArgCount to better reflect what it represents
In compiler.hpp
Updated genMapIntRegArgNumToRegNum and genMapIntRegNumToRegArgNum to handle
the fixed return buffer register for ARM64
In lclvars.cpp
Updated lvaInitRetBuffArg to handle the fixed return buffer register for ARM64
In morph.cpp
Updated fgMorphArgs to properly handle the fixed return buffer register for ARM64
In regalloc.cpp
Updated the assert check raUpdateRegStateForArg to allow for the fixed return buffer register for ARM64
Updated with changes from code review feedback
Commit migrated from https://github.com/dotnet/coreclr/commit/
e7abaeb795a6ff8556b871822f7ec092eb50835c