+++ /dev/null
-/*++\r
-\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials \r
-are licensed and made available under the terms and conditions of the BSD License \r
-which accompanies this distribution. The full text of the license may be found at \r
-http://opensource.org/licenses/bsd-license.php \r
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
-\r
-Module Name:\r
-\r
- MultU64x32.c\r
-\r
-Abstract:\r
-\r
- 64-bit Multiplication function for IA-32\r
-\r
---*/\r
-\r
-#include "Tiano.h"\r
-\r
-UINT64\r
-MultU64x32 (\r
- IN UINT64 Multiplicand,\r
- IN UINTN Multiplier\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- This routine allows a 64 bit value to be multiplied with a 32 bit \r
- value returns 64bit result.\r
- No checking if the result is greater than 64bits\r
-\r
-Arguments:\r
-\r
- Multiplicand - multiplicand\r
- Multiplier - multiplier\r
-\r
-Returns:\r
-\r
- Multiplicand * Multiplier\r
-\r
---*/\r
-{\r
- __asm {\r
- mov eax, dword ptr Multiplicand[0]\r
- mul Multiplier\r
- push eax\r
- push edx\r
- mov eax, dword ptr Multiplicand[4]\r
- mul Multiplier\r
- ;\r
- ; The value in edx stored by second multiplication overflows\r
- ; the output and should be discarded. So here we overwrite it\r
- ; with the edx value of first multiplication.\r
- ;\r
- pop edx\r
- add edx, eax\r
- pop eax\r
- }\r
-}\r