]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseLib/Ia32/LRotU64.nasm
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / MdePkg / Library / BaseLib / Ia32 / LRotU64.nasm
1 ;------------------------------------------------------------------------------
2 ;
3 ; Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
4 ; SPDX-License-Identifier: BSD-2-Clause-Patent
5 ;
6 ; Module Name:
7 ;
8 ; LRotU64.nasm
9 ;
10 ; Abstract:
11 ;
12 ; 64-bit left rotation for Ia32
13 ;
14 ;------------------------------------------------------------------------------
15
16 SECTION .text
17
18 ;------------------------------------------------------------------------------
19 ; UINT64
20 ; EFIAPI
21 ; InternalMathLRotU64 (
22 ; IN UINT64 Operand,
23 ; IN UINTN Count
24 ; );
25 ;------------------------------------------------------------------------------
26 global ASM_PFX(InternalMathLRotU64)
27 ASM_PFX(InternalMathLRotU64):
28 push ebx
29 mov cl, [esp + 16]
30 mov edx, [esp + 12]
31 mov eax, [esp + 8]
32 shld ebx, edx, cl
33 shld edx, eax, cl
34 ror ebx, cl
35 shld eax, ebx, cl
36 test cl, 32 ; Count >= 32?
37 jz .0
38 mov ecx, eax
39 mov eax, edx
40 mov edx, ecx
41 .0:
42 pop ebx
43 ret
44