Part of initial Arm64EC patchset.
A key part of Arm64EC is the presence of "thunks"; bits of code that translate between the x64 calling convention, and the ARM64 calling convention. To lower these, we need to emit calls in a unique way.
This patch adds two calling conventions: one for each side of a thunk. The native side of the thunk just uses the ARM64 calling convention, with the called function stored in x9. The x64 side uses the x64 calling convention with the registers renamed. (See https://docs.microsoft.com/en-us/cpp/build/arm64ec-windows-abi-conventions for the complete register mapping.)
Note that this doesn't deal with variadic functions; we need to do something a bit different for that. (I'm currently thinking we won't actually represent the thunks as "variadic"; we don't need to access any arguments via sp, so we can just treat x0-x5 as the arguments.)
When adding a calling convention, does it not also need to be added to the IR AsmWriter/AsmPrinter?