]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseLib/Ia32/MultU64x64.c
MdePkg: Apply uncrustify changes
[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
42eedea9 9/**\r
e4a34497 10 Multiplies a 64-bit unsigned integer by a 64-bit unsigned integer\r
42eedea9 11 and generates a 64-bit unsigned result.\r
12\r
e4a34497 13 This function multiplies the 64-bit unsigned value Multiplicand by the 64-bit\r
42eedea9 14 unsigned value Multiplier and generates a 64-bit unsigned result. This 64-\r
15 bit unsigned result is returned.\r
16\r
17 @param Multiplicand A 64-bit unsigned value.\r
18 @param Multiplier A 64-bit unsigned value.\r
19\r
20 @return Multiplicand * Multiplier\r
21\r
22**/\r
e1f414b6 23UINT64\r
24EFIAPI\r
25InternalMathMultU64x64 (\r
2f88bd3a
MK
26 IN UINT64 Multiplicand,\r
27 IN UINT64 Multiplier\r
e1f414b6 28 )\r
29{\r
30 _asm {\r
31 mov ebx, dword ptr [Multiplicand + 0]\r
32 mov edx, dword ptr [Multiplier + 0]\r
33 mov ecx, ebx\r
34 mov eax, edx\r
35 imul ebx, dword ptr [Multiplier + 4]\r
36 imul edx, dword ptr [Multiplicand + 4]\r
37 add ebx, edx\r
38 mul ecx\r
39 add edx, ebx\r
40 }\r
41}\r