]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseLib/Ia32/ARShiftU64.nasm
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Library / BaseLib / Ia32 / ARShiftU64.nasm
CommitLineData
649509ef
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
649509ef
JJ
5;\r
6; Module Name:\r
7;\r
8; ARShiftU64.nasm\r
9;\r
10; Abstract:\r
11;\r
12; 64-bit arithmetic right 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; InternalMathARShiftU64 (\r
22; IN UINT64 Operand,\r
23; IN UINTN Count\r
24; );\r
25;------------------------------------------------------------------------------\r
26global ASM_PFX(InternalMathARShiftU64)\r
27ASM_PFX(InternalMathARShiftU64):\r
28 mov cl, [esp + 12]\r
29 mov eax, [esp + 8]\r
30 cdq\r
31 test cl, 32\r
32 jnz .0\r
33 mov edx, eax\r
34 mov eax, [esp + 4]\r
35.0:\r
36 shrd eax, edx, cl\r
37 sar edx, cl\r
38 ret\r
39\r