Index: lib/builtins/CMakeLists.txt =================================================================== --- lib/builtins/CMakeLists.txt +++ lib/builtins/CMakeLists.txt @@ -320,6 +320,7 @@ ${GENERIC_SOURCES}) set(aarch64_SOURCES + arm64/epilogues.S comparetf2.c extenddftf2.c extendsftf2.c Index: lib/builtins/arm64/epilogues.S =================================================================== --- /dev/null +++ lib/builtins/arm64/epilogues.S @@ -0,0 +1,134 @@ +#include "../assembly.h" + + .text + + .p2align 2 +DEFINE_COMPILERRT_FUNCTION(__epilogue_X19_X20) + ldp x20, x19, [sp], #16 + ret +END_COMPILERRT_FUNCTION(__epilogue_X19_X20) + + .p2align 2 +DEFINE_COMPILERRT_FUNCTION(__epilogue_LR_FP) + ldp x29, x30, [sp], #16 + ret +END_COMPILERRT_FUNCTION(__epilogue_LR_FP) + + .p2align 2 +DEFINE_COMPILERRT_FUNCTION(__epilogue_X27_X28) + ldp x28, x27, [sp], #16 + ret +END_COMPILERRT_FUNCTION(__epilogue_X27_X28) + + .p2align 2 +DEFINE_COMPILERRT_FUNCTION(__epilogue_X19_X20_X21_X22) + ldp x20, x19, [sp, #16] + ldp x22, x21, [sp], #32 + ret +END_COMPILERRT_FUNCTION(__epilogue_X19_X20_X21_X22) + + .p2align 2 +DEFINE_COMPILERRT_FUNCTION(__epilogue_LR_FP_X19_X20) + ldp x29, x30, [sp, #16] + ldp x20, x19, [sp], #32 + ret +END_COMPILERRT_FUNCTION(__epilogue_LR_FP_X19_X20) + + .p2align 2 +DEFINE_COMPILERRT_FUNCTION(__epilogue_LR_FP_X27_X28) + ldp x29, x30, [sp, #16] + ldp x28, x27, [sp], #32 + ret +END_COMPILERRT_FUNCTION(__epilogue_LR_FP_X27_X28) + + .p2align 2 +DEFINE_COMPILERRT_FUNCTION(__epilogue_X19_X20_X21_X22_X23_X24) + ldp x20, x19, [sp, #32] + ldp x22, x21, [sp, #16] + ldp x24, x23, [sp], #48 + ret +END_COMPILERRT_FUNCTION(__epilogue_X19_X20_X21_X22_X23_X24) + + .p2align 2 +DEFINE_COMPILERRT_FUNCTION(__epilogue_LR_FP_X19_X20_X21_X22) + ldp x29, x30, [sp, #32] + ldp x20, x19, [sp, #16] + ldp x22, x21, [sp], #48 + ret +END_COMPILERRT_FUNCTION(__epilogue_LR_FP_X19_X20_X21_X22) + + .p2align 2 +DEFINE_COMPILERRT_FUNCTION(__epilogue_LR_FP_X19_X20_X27_X28) + ldp x29, x30, [sp, #32] + ldp x20, x19, [sp, #16] + ldp x28, x27, [sp], #48 + ret +END_COMPILERRT_FUNCTION(__epilogue_LR_FP_X19_X20_X27_X28) + + .p2align 2 +DEFINE_COMPILERRT_FUNCTION(__epilogue_X19_X20_X21_X22_X23_X24_X25_X26) + ldp x20, x19, [sp, #48] + ldp x22, x21, [sp, #32] + ldp x24, x23, [sp, #16] + ldp x26, x25, [sp], #64 + ret +END_COMPILERRT_FUNCTION(__epilogue_X19_X20_X21_X22_X23_X24_X25_X26) + + .p2align 2 +DEFINE_COMPILERRT_FUNCTION(__epilogue_LR_FP_X19_X20_X21_X22_X23_X24) + ldp x29, x30, [sp, #48] + ldp x20, x19, [sp, #32] + ldp x22, x21, [sp, #16] + ldp x24, x23, [sp], #64 + ret +END_COMPILERRT_FUNCTION(__epilogue_LR_FP_X19_X20_X21_X22_X23_X24) + + .p2align 2 +DEFINE_COMPILERRT_FUNCTION(__epilogue_LR_FP_X19_X20_X21_X22_X27_X28) + ldp x29, x30, [sp, #48] + ldp x20, x19, [sp, #32] + ldp x22, x21, [sp, #16] + ldp x28, x27, [sp], #64 + ret +END_COMPILERRT_FUNCTION(__epilogue_LR_FP_X19_X20_X21_X22_X27_X28) + +.p2align 2 +DEFINE_COMPILERRT_FUNCTION(__epilogue_X19_X20_X21_X22_X23_X24_X25_X26_X27_X28) + ldp x20, x19, [sp, #64] + ldp x22, x21, [sp, #48] + ldp x24, x23, [sp, #32] + ldp x26, x25, [sp, #16] + ldp x28, x27, [sp], #80 + ret +END_COMPILERRT_FUNCTION(__epilogue_X19_X20_X21_X22_X23_X24_X25_X26_X27_X28) + +.p2align 2 +DEFINE_COMPILERRT_FUNCTION(__epilogue_LR_FP_X19_X20_X21_X22_X23_X24_X25_X26) + ldp x29, x30, [sp, #64] + ldp x20, x19, [sp, #48] + ldp x22, x21, [sp, #32] + ldp x24, x23, [sp, #16] + ldp x26, x25, [sp], #80 + ret +END_COMPILERRT_FUNCTION(__epilogue_LR_FP_X19_X20_X21_X22_X23_X24_X25_X26) + +.p2align 2 +DEFINE_COMPILERRT_FUNCTION(__epilogue_LR_FP_X19_X20_X21_X22_X23_X24_X27_X28) + ldp x29, x30, [sp, #64] + ldp x20, x19, [sp, #48] + ldp x22, x21, [sp, #32] + ldp x24, x23, [sp, #16] + ldp x28, x27, [sp], #80 + ret +END_COMPILERRT_FUNCTION(__epilogue_LR_FP_X19_X20_X21_X22_X23_X24_X27_X28) + +.p2align 2 +DEFINE_COMPILERRT_FUNCTION(__epilogue_LR_FP_X19_X20_X21_X22_X23_X24_X25_X26_X27_X28) + ldp x29, x30, [sp, #80] + ldp x20, x19, [sp, #64] + ldp x22, x21, [sp, #48] + ldp x24, x23, [sp, #32] + ldp x26, x25, [sp, #16] + ldp x28, x27, [sp], #96 + ret +END_COMPILERRT_FUNCTION(__epilogue_LR_FP_X19_X20_X21_X22_X23_X24_X25_X26_X27_X28) Index: lib/builtins/assembly.h =================================================================== --- lib/builtins/assembly.h +++ lib/builtins/assembly.h @@ -18,6 +18,8 @@ #if defined(__POWERPC__) || defined(__powerpc__) || defined(__ppc__) #define SEPARATOR @ +#elif defined(__APPLE__) && defined(__aarch64__) +#define SEPARATOR %% #else #define SEPARATOR ; #endif