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