]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseLib/Ia32/MultU64x64.c
MdePkg/UefiDebugLibDebugPortProtocol: Add destructor to CloseEvent
[mirror_edk2.git] / MdePkg / Library / BaseLib / Ia32 / MultU64x64.c
CommitLineData
e1f414b6 1/** @file\r
2 Calculate the product of a 64-bit integer and another 64-bit integer\r
3\r
e4a34497 4 Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
9344f092 5 SPDX-License-Identifier: BSD-2-Clause-Patent\r
e1f414b6 6\r
7**/\r
8\r
1efcc4ae 9\r
f734a10a 10\r
e1f414b6 11\r
42eedea9 12/**\r
e4a34497 13 Multiplies a 64-bit unsigned integer by a 64-bit unsigned integer\r
42eedea9 14 and generates a 64-bit unsigned result.\r
15\r
e4a34497 16 This function multiplies the 64-bit unsigned value Multiplicand by the 64-bit\r
42eedea9 17 unsigned value Multiplier and generates a 64-bit unsigned result. This 64-\r
18 bit unsigned result is returned.\r
19\r
20 @param Multiplicand A 64-bit unsigned value.\r
21 @param Multiplier A 64-bit unsigned value.\r
22\r
23 @return Multiplicand * Multiplier\r
24\r
25**/\r
e1f414b6 26UINT64\r
27EFIAPI\r
28InternalMathMultU64x64 (\r
29 IN UINT64 Multiplicand,\r
30 IN UINT64 Multiplier\r
31 )\r
32{\r
33 _asm {\r
34 mov ebx, dword ptr [Multiplicand + 0]\r
35 mov edx, dword ptr [Multiplier + 0]\r
36 mov ecx, ebx\r
37 mov eax, edx\r
38 imul ebx, dword ptr [Multiplier + 4]\r
39 imul edx, dword ptr [Multiplicand + 4]\r
40 add ebx, edx\r
41 mul ecx\r
42 add edx, ebx\r
43 }\r
44}\r
45\r