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