]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseLib/Ia32/LShiftU64.nasm
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Library / BaseLib / Ia32 / LShiftU64.nasm
CommitLineData
76a77878
JJ
1;------------------------------------------------------------------------------\r
2;\r
3; Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
9344f092 4; SPDX-License-Identifier: BSD-2-Clause-Patent\r
76a77878
JJ
5;\r
6; Module Name:\r
7;\r
8; LShiftU64.nasm\r
9;\r
10; Abstract:\r
11;\r
12; 64-bit left shift function for IA-32\r
13;\r
14;------------------------------------------------------------------------------\r
15\r
16 SECTION .text\r
17\r
18;------------------------------------------------------------------------------\r
19; UINT64\r
20; EFIAPI\r
21; InternalMathLShiftU64 (\r
22; IN UINT64 Operand,\r
23; IN UINTN Count\r
24; );\r
25;------------------------------------------------------------------------------\r
26global ASM_PFX(InternalMathLShiftU64)\r
27ASM_PFX(InternalMathLShiftU64):\r
28 mov cl, [esp + 12]\r
29 xor eax, eax\r
30 mov edx, [esp + 4]\r
31 test cl, 32 ; Count >= 32?\r
32 jnz .0\r
33 mov eax, edx\r
34 mov edx, [esp + 8]\r
35.0:\r
36 shld edx, eax, cl\r
37 shl eax, cl\r
38 ret\r
39\r