File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -59,14 +59,21 @@ namespace swift {
5959template <typename Ret, typename Param>
6060Param returnTypeHelper(Ret (*)(Param)) {}
6161
62+ #if defined(__LP64__) || defined(_LP64)
63+ #define REGISTER_SUBSTITUTION_PREFIX " "
64+ #define REGISTER_PREFIX " x"
65+ #else
66+ #define REGISTER_SUBSTITUTION_PREFIX " w"
67+ #define REGISTER_PREFIX " w"
68+ #endif
69+
6270// Helper macro that defines one entrypoint that takes the parameter in reg and
6371// calls through to function.
6472#define CUSTOM_RR_ENTRYPOINTS_DEFINE_ONE_ENTRYPOINT (reg, function ) \
65- SWIFT_RUNTIME_EXPORT decltype (function( \
66- nullptr )) function##_x##reg() { \
73+ SWIFT_RUNTIME_EXPORT decltype (function(nullptr )) function##_x##reg() { \
6774 decltype (returnTypeHelper (function)) ptr; \
68- asm (" .ifnc %0, x " #reg " \n " \
69- " mov %0, x " #reg " \n " \
75+ asm (" .ifnc %" REGISTER_SUBSTITUTION_PREFIX " 0, " REGISTER_PREFIX #reg " \n " \
76+ " mov %" REGISTER_SUBSTITUTION_PREFIX " 0, " REGISTER_PREFIX #reg " \n " \
7077 " .endif" \
7178 : " =r" (ptr)); \
7279 return function (ptr); \
You can’t perform that action at this time.
0 commit comments