]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseLib/Ia32/RRotU64.nasm
MdePkg: Replace Opcode with the corresponding instructions.
[mirror_edk2.git] / MdePkg / Library / BaseLib / Ia32 / RRotU64.nasm
CommitLineData
7905d234
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
7905d234
JJ
5;\r
6; Module Name:\r
7;\r
8; RRotU64.nasm\r
9;\r
10; Abstract:\r
11;\r
12; 64-bit right 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; InternalMathRRotU64 (\r
22; IN UINT64 Operand,\r
23; IN UINTN Count\r
24; );\r
25;------------------------------------------------------------------------------\r
26global ASM_PFX(InternalMathRRotU64)\r
27ASM_PFX(InternalMathRRotU64):\r
28 push ebx\r
29 mov cl, [esp + 16]\r
30 mov eax, [esp + 8]\r
31 mov edx, [esp + 12]\r
32 shrd ebx, eax, cl\r
33 shrd eax, edx, cl\r
34 rol ebx, cl\r
35 shrd edx, ebx, cl\r
36 test cl, 32 ; Count >= 32?\r
37 jz .0\r
38 mov ecx, eax ; switch eax & edx if Count >= 32\r
39 mov eax, edx\r
40 mov edx, ecx\r
41.0:\r
42 pop ebx\r
43 ret\r
44\r