]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseLib/Ia32/LRotU64.nasm
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Library / BaseLib / Ia32 / LRotU64.nasm
CommitLineData
c41d8eb0
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
c41d8eb0
JJ
5;\r
6; Module Name:\r
7;\r
8; LRotU64.nasm\r
9;\r
10; Abstract:\r
11;\r
12; 64-bit left rotation for Ia32\r
13;\r
14;------------------------------------------------------------------------------\r
15\r
16 SECTION .text\r
17\r
18;------------------------------------------------------------------------------\r
19; UINT64\r
20; EFIAPI\r
21; InternalMathLRotU64 (\r
22; IN UINT64 Operand,\r
23; IN UINTN Count\r
24; );\r
25;------------------------------------------------------------------------------\r
26global ASM_PFX(InternalMathLRotU64)\r
27ASM_PFX(InternalMathLRotU64):\r
28 push ebx\r
29 mov cl, [esp + 16]\r
30 mov edx, [esp + 12]\r
31 mov eax, [esp + 8]\r
32 shld ebx, edx, cl\r
33 shld edx, eax, cl\r
34 ror ebx, cl\r
35 shld eax, ebx, cl\r
36 test cl, 32 ; Count >= 32?\r
37 jz .0\r
38 mov ecx, eax\r
39 mov eax, edx\r
40 mov edx, ecx\r
41.0:\r
42 pop ebx\r
43 ret\r
44\r