]> git.proxmox.com Git - mirror_edk2.git/blob - CryptoPkg/Library/IntrinsicLib/Ia32/MathRShiftU64.nasm
CryptoPkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / CryptoPkg / Library / IntrinsicLib / Ia32 / MathRShiftU64.nasm
1 ;------------------------------------------------------------------------------
2 ;
3 ; Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
4 ; SPDX-License-Identifier: BSD-2-Clause-Patent
5 ;
6 ; Module Name:
7 ;
8 ; MathRShiftU64.nasm
9 ;
10 ; Abstract:
11 ;
12 ; 64-bit Math Worker Function.
13 ; Shifts a 64-bit unsigned value right by a certain number of bits.
14 ;
15 ;------------------------------------------------------------------------------
16
17 SECTION .text
18
19 ;------------------------------------------------------------------------------
20 ;
21 ; void __cdecl __ashrdi3 (void)
22 ;
23 ;------------------------------------------------------------------------------
24 global ASM_PFX(__ashrdi3)
25 ASM_PFX(__ashrdi3):
26 cmp cl,0x40
27 jnc _Exit
28 cmp cl,0x20
29 jnc More32
30 shrd eax,edx,cl
31 shr edx,cl
32 ret
33 More32:
34 mov eax,edx
35 xor edx,edx
36 and cl,0x1f
37 shr eax,cl
38 ret
39 _Exit:
40 xor eax,eax
41 xor edx,edx
42 ret
43