soc/intel/denverton_ns: Remove unused memcpy_s function
[coreboot.git] / src / arch / arm / libgcc / muldi3.S
blob4eabf2733d2e16df5ed64df66d1c6e8f330371af
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /* Based on linux/arch/arm/lib/muldi3.S */
4 #if defined __GNUC__
6 #include <arch/asm.h>
8 #ifdef __ARMEB__
9 #define xh r0
10 #define xl r1
11 #define yh r2
12 #define yl r3
13 #else
14 #define xl r0
15 #define xh r1
16 #define yl r2
17 #define yh r3
18 #endif
20 ENTRY(__muldi3)
21 .global __aeabi_lmul
22 __aeabi_lmul:
24         mul     xh, yl, xh
25         mla     xh, xl, yh, xh
26         mov     ip, xl, lsr #16
27         mov     yh, yl, lsr #16
28         bic     xl, xl, ip, lsl #16
29         bic     yl, yl, yh, lsl #16
30         mla     xh, yh, ip, xh
31         mul     yh, xl, yh
32         mul     xl, yl, xl
33         mul     ip, yl, ip
34         adds    xl, xl, yh, lsl #16
35         adc     xh, xh, yh, lsr #16
36         adds    xl, xl, ip, lsl #16
37         adc     xh, xh, ip, lsr #16
38         mov     pc, lr
40 .type __aeabi_lmul, %function
41 .size __aeabi_lmul, .-__aeabi_lmul
42 ENDPROC(__muldi3)
44 #endif