]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseLib/Ia32/ARShiftU64.nasm
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / MdePkg / Library / BaseLib / Ia32 / ARShiftU64.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 ; ARShiftU64.nasm
9 ;
10 ; Abstract:
11 ;
12 ; 64-bit arithmetic right shift function for IA-32
13 ;
14 ;------------------------------------------------------------------------------
15
16 SECTION .text
17
18 ;------------------------------------------------------------------------------
19 ; UINT64
20 ; EFIAPI
21 ; InternalMathARShiftU64 (
22 ; IN UINT64 Operand,
23 ; IN UINTN Count
24 ; );
25 ;------------------------------------------------------------------------------
26 global ASM_PFX(InternalMathARShiftU64)
27 ASM_PFX(InternalMathARShiftU64):
28 mov cl, [esp + 12]
29 mov eax, [esp + 8]
30 cdq
31 test cl, 32
32 jnz .0
33 mov edx, eax
34 mov eax, [esp + 4]
35 .0:
36 shrd eax, edx, cl
37 sar edx, cl
38 ret
39