]> git.proxmox.com Git - mirror_edk2.git/blame - EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/RShiftU64.asm
1) Sync EdkCompatibilityPkg with EDK 1.04. The changes includes:
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Library / EdkIIGlueLib / Library / BaseLib / Ia32 / RShiftU64.asm
CommitLineData
3eb9473e 1; Copyright (c) 2004, Intel Corporation \r
2; All rights reserved. This program and the accompanying materials \r
3; are licensed and made available under the terms and conditions of the BSD License \r
4; which accompanies this distribution. The full text of the license may be found at \r
5; http://opensource.org/licenses/bsd-license.php \r
6; \r
7; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
8; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
9;\r
10; Module Name:\r
11;\r
12; RShiftU64.asm\r
13;\r
14; Abstract:\r
15;\r
16; 64-bit logical right shift function for IA-32\r
17;\r
18;------------------------------------------------------------------------------\r
19\r
20 .686\r
21 .model flat,C\r
22 .code\r
23\r
24;------------------------------------------------------------------------------\r
25; UINT64\r
26; EFIAPI\r
27; InternalMathRShiftU64 (\r
28; IN UINT64 Operand,\r
29; IN UINTN Count\r
30; );\r
31;------------------------------------------------------------------------------\r
32InternalMathRShiftU64 PROC\r
33 mov cl, [esp + 12] ; cl <- Count\r
34 xor edx, edx\r
35 mov eax, [esp + 8]\r
36 test cl, 32 ; Count >= 32?\r
37 cmovz edx, eax\r
38 cmovz eax, [esp + 4]\r
39 shrd eax, edx, cl\r
40 shr edx, cl\r
41 ret\r
42InternalMathRShiftU64 ENDP\r
43\r
44 END\r