]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseLib/Ia32/MultU64x32.c
MdePkg: Apply uncrustify changes
[mirror_edk2.git] / MdePkg / Library / BaseLib / Ia32 / MultU64x32.c
1 /** @file
2 Calculate the product of a 64-bit integer and a 32-bit integer
3
4 Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 **/
8
9 /**
10 Multiples a 64-bit unsigned integer by a 32-bit unsigned integer
11 and generates a 64-bit unsigned result.
12
13 This function multiples the 64-bit unsigned value Multiplicand by the 32-bit
14 unsigned value Multiplier and generates a 64-bit unsigned result. This 64-
15 bit unsigned result is returned.
16
17 @param Multiplicand A 64-bit unsigned value.
18 @param Multiplier A 32-bit unsigned value.
19
20 @return Multiplicand * Multiplier
21
22 **/
23 UINT64
24 EFIAPI
25 InternalMathMultU64x32 (
26 IN UINT64 Multiplicand,
27 IN UINT32 Multiplier
28 )
29 {
30 _asm {
31 mov ecx, Multiplier
32 mov eax, ecx
33 imul ecx, dword ptr [Multiplicand + 4] // overflow not detectable
34 mul dword ptr [Multiplicand + 0]
35 add edx, ecx
36 }
37 }