]> git.proxmox.com Git - mirror_edk2.git/blob - ArmPkg/Library/CompilerIntrinsicsLib/Arm/muldi3.S
adee64782e56c278489f7c98d2c33f91708a6b41
[mirror_edk2.git] / ArmPkg / Library / CompilerIntrinsicsLib / Arm / muldi3.S
1 #------------------------------------------------------------------------------
2 #
3 # Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
4 #
5 # SPDX-License-Identifier: BSD-2-Clause-Patent
6 #
7 #------------------------------------------------------------------------------
8
9 #include <AsmMacroIoLib.h>
10
11 ASM_FUNC(__muldi3)
12 stmfd sp!, {r4, r5, r6, r7, lr}
13 add r7, sp, #12
14 stmfd sp!, {r8, r10, r11}
15 ldr r11, L4
16 mov r4, r0, lsr #16
17 and r8, r0, r11
18 and ip, r2, r11
19 mul lr, ip, r8
20 mul ip, r4, ip
21 sub sp, sp, #8
22 add r10, ip, lr, lsr #16
23 and ip, r10, r11
24 and lr, lr, r11
25 mov r6, r2, lsr #16
26 str r4, [sp, #4]
27 add r4, lr, ip, asl #16
28 mul ip, r8, r6
29 mov r5, r10, lsr #16
30 add r10, ip, r4, lsr #16
31 and ip, r10, r11
32 and lr, r4, r11
33 add r4, lr, ip, asl #16
34 mul r0, r3, r0
35 add ip, r5, r10, lsr #16
36 ldr r5, [sp, #4]
37 mla r0, r2, r1, r0
38 mla r5, r6, r5, ip
39 mov r10, r4
40 add r11, r0, r5
41 mov r1, r11
42 mov r0, r4
43 sub sp, r7, #24
44 ldmfd sp!, {r8, r10, r11}
45 ldmfd sp!, {r4, r5, r6, r7, pc}
46 .p2align 2
47 L5:
48 .align 2
49 L4:
50 .long 65535