xamarin-macios/runtime/trampolines-arm64.h

70 строки
1.2 KiB
C
Исходник Обычный вид История

#ifndef __TRAMPOLINES_ARM64_H__
#define __TRAMPOLINES_ARM64_H__
#ifdef __cplusplus
extern "C" {
#endif
struct BigDouble {
Xamarin.Mac native Apple Silicon targetting support (#10115) * Add support for Xamarin.Mac arm64 * Add compile product definition task Xamarin.Mac can be provided with a ProductDefinition file for the generated pkg. Normally, providing a product definition was optional. However, with Apple Silicon, we have an extra issue : `productbuild` needs to know what architectures your package target. If not provided with them, it will guess to the best of its abilities. However, on Catalina and lower, the guess is x86_64, even if you have an arm64 slice. To fix this, we add a new task to compile the product definition and use this file to create the pkg. If you provide your own Product Definition, we can check and warn if the architectures don't match what we expect. If the file doesn't exist or there is no architecture, we set it ourselves based on our target architectures. * Don't reference dynamic objC_send on arm64 When building in debug, we currently try to link dynamic objC_send symbols when targeting a 64-bit architecture. However, this is actually only defined on Intel architectures, not on arm64, so we end up failing because we're referring symbols that don't exist. Rework the `GetRequiredSymbols` to take an abi, and tag those symbols to only be valid on i386/x86_64, so they don't get referred at all when building on arm64, but still get referred in x86_64. * Fix improper delete/move with already existing directories * Fix stret requirement for Xamarin.Mac in arm64. The generator supposes that we're running in x64 mode, refactor to take into account the possibility of running in arm64. * Implement OS version generation in Product.plist, based on MinimumSystemVersion of the app * Re-generalize some mmp registrar rules `Microsoft.macOS.registrar` was missed by the current rule set * Fix mmp tests * Set E7072 as not translated Tests were failing otherwise * Rename Xamarin.Mac lib/x86_64 folder to 64bits (currently all targeted archs are the same) * Fix style issues * Fix `ToLower` usage for invariant usage * Fix xtro-sharpie test
2021-03-18 04:48:02 +03:00
struct _f {
float f1;
float f2;
};
union {
__int128 bits;
long double d;
Xamarin.Mac native Apple Silicon targetting support (#10115) * Add support for Xamarin.Mac arm64 * Add compile product definition task Xamarin.Mac can be provided with a ProductDefinition file for the generated pkg. Normally, providing a product definition was optional. However, with Apple Silicon, we have an extra issue : `productbuild` needs to know what architectures your package target. If not provided with them, it will guess to the best of its abilities. However, on Catalina and lower, the guess is x86_64, even if you have an arm64 slice. To fix this, we add a new task to compile the product definition and use this file to create the pkg. If you provide your own Product Definition, we can check and warn if the architectures don't match what we expect. If the file doesn't exist or there is no architecture, we set it ourselves based on our target architectures. * Don't reference dynamic objC_send on arm64 When building in debug, we currently try to link dynamic objC_send symbols when targeting a 64-bit architecture. However, this is actually only defined on Intel architectures, not on arm64, so we end up failing because we're referring symbols that don't exist. Rework the `GetRequiredSymbols` to take an abi, and tag those symbols to only be valid on i386/x86_64, so they don't get referred at all when building on arm64, but still get referred in x86_64. * Fix improper delete/move with already existing directories * Fix stret requirement for Xamarin.Mac in arm64. The generator supposes that we're running in x64 mode, refactor to take into account the possibility of running in arm64. * Implement OS version generation in Product.plist, based on MinimumSystemVersion of the app * Re-generalize some mmp registrar rules `Microsoft.macOS.registrar` was missed by the current rule set * Fix mmp tests * Set E7072 as not translated Tests were failing otherwise * Rename Xamarin.Mac lib/x86_64 folder to 64bits (currently all targeted archs are the same) * Fix style issues * Fix `ToLower` usage for invariant usage * Fix xtro-sharpie test
2021-03-18 04:48:02 +03:00
_f f;
};
};
struct XamarinCallState {
uint64_t type;
uint64_t sp;
uint64_t x0;
uint64_t x1;
uint64_t x2;
uint64_t x3;
uint64_t x4;
uint64_t x5;
uint64_t x6;
uint64_t x7;
uint64_t x8;
struct BigDouble q0;
struct BigDouble q1;
struct BigDouble q2;
struct BigDouble q3;
struct BigDouble q4;
struct BigDouble q5;
struct BigDouble q6;
struct BigDouble q7;
// Make a copy of x0/x1, so the sel() and self () functions return the correct values even after putting return values to x0/x1.
id _self;
SEL _sel;
bool is_stret () { return false; }
id self () { return _self; }
SEL sel () { return _sel; }
};
struct ParamIterator {
struct XamarinCallState *state;
int ngrn; // Next General-purpose Register Number
int nsrn; // Next SIMD and Floating-point Register Number
uint8_t *nsaa; // Next stacked argument address.
// computed values
uint64_t *x;
struct BigDouble *q;
};
void xamarin_arch_trampoline (struct XamarinCallState *state);
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* __TRAMPOLINES_ARM64_H__ */