[arm64_32] make "Debug Mode" work on Watch series 4 with --interpreter (mono/mono#16865)
[arm64_32] make "Debug Mode" work on Watch series 4 with --interpreter
Main objective for reviewers: This PR shouldn't change anything for `arm64`.
Context: "Debug Mode" on the Apple Watch allows execution of regular machine code and thus is pretty similar to FullAOT on iPhone, i.e. it doesn't require bitcode, but _still_ doesn't allow `signal(3)` so cooperative suspend is required.
Apple Watch Series 4 and onward use an ARM64 chip, but with a different ABI, also known as `arm64_32`. This PR changes the AOT compiler and related trampolines so that the AOT compiler can generate all necessary code to run the interpreter on this target.
Changes:
--------------------------------------
[arm64_32] set register size to 8 in cross compiler too
-----------------------------------------
[machine] update `target_mgreg_t` definition
`SIZEOF_REGISTER` is usually the same as `TARGET_SIZEOF_VOID_P`, except when `MONO_ARCH_ILP32 is defined.
`target_mgreg_t` should represent the width of the hardware register, that is, `SIZEOF_REGISTER`.
---------------------------------------------
[arm64_32] fix AOT image layout
---------------------------------------------
[arm64_32] make trampolines bitwidth aware
* replace pointer loads/stores with bitwidth-dependent macro
* reflect `specific` trampolines so that only two instructions are used for ILP32, since the related pair in the data page only needs 2 * 32bits too
* replace some `sizeof (target_mgreg_t)` with `TARGET_SIZEOF_VOID_P` (former is hardware register size, latter is pointer size)
---------------------------------------------
These regression tests are _not_ passing: https://github.com/mono/mono/issues/16864 Also some of monotouch-tests are crashing, see https://github.com/mono/mono/issues/16819
Here is a screenshot of a debug session in VSMac:
<img width="1321" alt="Screenshot 2019-09-16 at 19 13 22" src="https://user-images.githubusercontent.com/75403/
64981326-
1dfbc000-d8bc-11e9-9d16-
48036f36b638.png">
Contributes to https://github.com/mono/mono/issues/10641
Commit migrated from https://github.com/mono/mono/commit/
578e1a9dda135516d51f00680939facbc63061ba