GK SDK 源码库: XMIPCLinuxV100R005C00SPC030 (kernel/tools/open_source excluded)
This commit is contained in:
+45
@@ -0,0 +1,45 @@
|
||||
//===-- aeabi_ldivmod.S - EABI ldivmod implementation ---------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
// struct { int64_t quot, int64_t rem}
|
||||
// __aeabi_ldivmod(int64_t numerator, int64_t denominator) {
|
||||
// int64_t rem, quot;
|
||||
// quot = __divmoddi4(numerator, denominator, &rem);
|
||||
// return {quot, rem};
|
||||
// }
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#define __aeabi_ldivmod __rt_sdiv64
|
||||
#endif
|
||||
|
||||
.syntax unified
|
||||
.p2align 2
|
||||
DEFINE_COMPILERRT_FUNCTION(__aeabi_ldivmod)
|
||||
push {r6, lr}
|
||||
sub sp, sp, #16
|
||||
add r6, sp, #8
|
||||
str r6, [sp]
|
||||
#if defined(__MINGW32__)
|
||||
movs r6, r0
|
||||
movs r0, r2
|
||||
movs r2, r6
|
||||
movs r6, r1
|
||||
movs r1, r3
|
||||
movs r3, r6
|
||||
#endif
|
||||
bl SYMBOL_NAME(__divmoddi4)
|
||||
ldr r2, [sp, #8]
|
||||
ldr r3, [sp, #12]
|
||||
add sp, sp, #16
|
||||
pop {r6, pc}
|
||||
END_COMPILERRT_FUNCTION(__aeabi_ldivmod)
|
||||
|
||||
NO_EXEC_STACK_DIRECTIVE
|
||||
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
//===-- aeabi_memcpy.S - EABI memcpy implementation -----------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
// void __aeabi_memcpy(void *dest, void *src, size_t n) { memcpy(dest, src, n); }
|
||||
|
||||
.syntax unified
|
||||
.p2align 2
|
||||
DEFINE_COMPILERRT_FUNCTION(__aeabi_memcpy)
|
||||
#ifdef USE_THUMB_1
|
||||
push {r7, lr}
|
||||
bl memcpy
|
||||
pop {r7, pc}
|
||||
#else
|
||||
b memcpy
|
||||
#endif
|
||||
END_COMPILERRT_FUNCTION(__aeabi_memcpy)
|
||||
|
||||
DEFINE_AEABI_FUNCTION_ALIAS(__aeabi_memcpy4, __aeabi_memcpy)
|
||||
DEFINE_AEABI_FUNCTION_ALIAS(__aeabi_memcpy8, __aeabi_memcpy)
|
||||
|
||||
NO_EXEC_STACK_DIRECTIVE
|
||||
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
//===-- aeabi_memset.S - EABI memset implementation -----------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
// void __aeabi_memset(void *dest, size_t n, int c) { memset(dest, c, n); }
|
||||
// void __aeabi_memclr(void *dest, size_t n) { __aeabi_memset(dest, n, 0); }
|
||||
|
||||
.syntax unified
|
||||
.p2align 2
|
||||
DEFINE_COMPILERRT_FUNCTION(__aeabi_memset)
|
||||
mov r3, r1
|
||||
mov r1, r2
|
||||
mov r2, r3
|
||||
#ifdef USE_THUMB_1
|
||||
push {r7, lr}
|
||||
bl memset
|
||||
pop {r7, pc}
|
||||
#else
|
||||
b memset
|
||||
#endif
|
||||
END_COMPILERRT_FUNCTION(__aeabi_memset)
|
||||
|
||||
DEFINE_AEABI_FUNCTION_ALIAS(__aeabi_memset4, __aeabi_memset)
|
||||
DEFINE_AEABI_FUNCTION_ALIAS(__aeabi_memset8, __aeabi_memset)
|
||||
|
||||
.p2align 2
|
||||
DEFINE_COMPILERRT_FUNCTION(__aeabi_memclr)
|
||||
mov r2, r1
|
||||
movs r1, #0
|
||||
#ifdef USE_THUMB_1
|
||||
push {r7, lr}
|
||||
bl memset
|
||||
pop {r7, pc}
|
||||
#else
|
||||
b memset
|
||||
#endif
|
||||
END_COMPILERRT_FUNCTION(__aeabi_memclr)
|
||||
|
||||
DEFINE_AEABI_FUNCTION_ALIAS(__aeabi_memclr4, __aeabi_memclr)
|
||||
DEFINE_AEABI_FUNCTION_ALIAS(__aeabi_memclr8, __aeabi_memclr)
|
||||
|
||||
NO_EXEC_STACK_DIRECTIVE
|
||||
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
//===-- aeabi_uldivmod.S - EABI uldivmod implementation -------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
// struct { uint64_t quot, uint64_t rem}
|
||||
// __aeabi_uldivmod(uint64_t numerator, uint64_t denominator) {
|
||||
// uint64_t rem, quot;
|
||||
// quot = __udivmoddi4(numerator, denominator, &rem);
|
||||
// return {quot, rem};
|
||||
// }
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#define __aeabi_uldivmod __rt_udiv64
|
||||
#endif
|
||||
|
||||
.syntax unified
|
||||
.p2align 2
|
||||
DEFINE_COMPILERRT_FUNCTION(__aeabi_uldivmod)
|
||||
push {r6, lr}
|
||||
sub sp, sp, #16
|
||||
add r6, sp, #8
|
||||
str r6, [sp]
|
||||
#if defined(__MINGW32__)
|
||||
movs r6, r0
|
||||
movs r0, r2
|
||||
movs r2, r6
|
||||
movs r6, r1
|
||||
movs r1, r3
|
||||
movs r3, r6
|
||||
#endif
|
||||
bl SYMBOL_NAME(__udivmoddi4)
|
||||
ldr r2, [sp, #8]
|
||||
ldr r3, [sp, #12]
|
||||
add sp, sp, #16
|
||||
pop {r6, pc}
|
||||
END_COMPILERRT_FUNCTION(__aeabi_uldivmod)
|
||||
|
||||
NO_EXEC_STACK_DIRECTIVE
|
||||
|
||||
Reference in New Issue
Block a user