]> git.proxmox.com Git - mirror_edk2.git/blob - CryptoPkg/Library/IntrinsicLib/Ia32/MathLShiftS64.nasm
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / CryptoPkg / Library / IntrinsicLib / Ia32 / MathLShiftS64.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 ; MathLShiftS64.nasm
9 ;
10 ; Abstract:
11 ;
12 ; 64-bit Math Worker Function.
13 ; Shifts a 64-bit signed value left by a certain number of bits.
14 ;
15 ;------------------------------------------------------------------------------
16
17 SECTION .text
18
19 global ASM_PFX(__ashldi3)
20 ;------------------------------------------------------------------------------
21 ;
22 ; void __cdecl __ashldi3 (void)
23 ;
24 ;------------------------------------------------------------------------------
25 ASM_PFX(__ashldi3):
26 cmp cl,0x40
27 jnc ReturnZero
28 cmp cl,0x20
29 jnc More32
30 shld edx,eax,cl
31 shl eax,cl
32 ret
33 More32:
34 mov edx,eax
35 xor eax,eax
36 and cl,0x1f
37 shl edx,cl
38 ret
39 ReturnZero:
40 xor eax,eax
41 xor edx,edx
42 ret