]> git.proxmox.com Git - mirror_edk2.git/blob - EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/LRotU64.asm
Add in the 1st version of ECP.
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Library / EdkIIGlueLib / Library / BaseLib / Ia32 / LRotU64.asm
1 ; Copyright (c) 2004, Intel Corporation
2 ; All rights reserved. This program and the accompanying materials
3 ; are licensed and made available under the terms and conditions of the BSD License
4 ; which accompanies this distribution. The full text of the license may be found at
5 ; http://opensource.org/licenses/bsd-license.php
6 ;
7 ; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
8 ; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
9 ;
10 ; Module Name:
11 ;
12 ; LRotU64.asm
13 ;
14 ; Abstract:
15 ;
16 ; 64-bit left rotation for Ia32
17 ;
18 ;------------------------------------------------------------------------------
19
20 .686
21 .model flat,C
22 .code
23
24 ;------------------------------------------------------------------------------
25 ; UINT64
26 ; EFIAPI
27 ; InternalMathLRotU64 (
28 ; IN UINT64 Operand,
29 ; IN UINTN Count
30 ; );
31 ;------------------------------------------------------------------------------
32 InternalMathLRotU64 PROC USES ebx
33 mov cl, [esp + 16]
34 mov edx, [esp + 12]
35 mov eax, [esp + 8]
36 shld ebx, edx, cl
37 shld edx, eax, cl
38 ror ebx, cl
39 shld eax, ebx, cl
40 test cl, 32 ; Count >= 32?
41 cmovnz ecx, eax
42 cmovnz eax, edx
43 cmovnz edx, ecx
44 ret
45 InternalMathLRotU64 ENDP
46
47 END