]> git.proxmox.com Git - mirror_edk2.git/blob - ArmPkg/Library/CompilerIntrinsicsLib/Arm/muldi3.S
a28f0d67b86351d29941e36b20827deef818245e
[mirror_edk2.git] / ArmPkg / Library / CompilerIntrinsicsLib / Arm / muldi3.S
1 #------------------------------------------------------------------------------
2 #
3 # Copyright (c) 2008-2009 Apple Inc. All rights reserved.
4 #
5 # All rights reserved. This program and the accompanying materials
6 # are licensed and made available under the terms and conditions of the BSD License
7 # which accompanies this distribution. The full text of the license may be found at
8 # http://opensource.org/licenses/bsd-license.php
9 #
10 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12 #
13 #------------------------------------------------------------------------------
14
15 .text
16 .align 2
17 .globl ASM_PFX(__muldi3)
18
19 ASM_PFX(__muldi3):
20 stmfd sp!, {r4, r5, r6, r7, lr}
21 add r7, sp, #12
22 stmfd sp!, {r8, r10, r11}
23 ldr r11, L4
24 mov r4, r0, lsr #16
25 and r8, r0, r11
26 and ip, r2, r11
27 mul lr, ip, r8
28 mul ip, r4, ip
29 sub sp, sp, #8
30 add r10, ip, lr, lsr #16
31 and ip, r10, r11
32 and lr, lr, r11
33 mov r6, r2, lsr #16
34 str r4, [sp, #4]
35 add r4, lr, ip, asl #16
36 mul ip, r8, r6
37 mov r5, r10, lsr #16
38 add r10, ip, r4, lsr #16
39 and ip, r10, r11
40 and lr, r4, r11
41 add r4, lr, ip, asl #16
42 mul r0, r3, r0
43 add ip, r5, r10, lsr #16
44 ldr r5, [sp, #4]
45 mla r0, r2, r1, r0
46 mla r5, r6, r5, ip
47 mov r10, r4
48 add r11, r0, r5
49 mov r1, r11
50 mov r0, r4
51 sub sp, r7, #24
52 ldmfd sp!, {r8, r10, r11}
53 ldmfd sp!, {r4, r5, r6, r7, pc}
54 .p2align 2
55 L5:
56 .align 2
57 L4:
58 .long 65535