]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseLib/Ia32/RShiftU64.S
Add some definitions in Framework FV 0.9 spec but not in PI 1.0.
[mirror_edk2.git] / MdePkg / Library / BaseLib / Ia32 / RShiftU64.S
CommitLineData
e1f414b6 1//\r
2// Include common header file for this module.\r
3//\r
4#include "CommonHeader.h"\r
5\r
6#------------------------------------------------------------------------------\r
7#\r
8# Copyright (c) 2006, Intel Corporation\r
9# All rights reserved. This program and the accompanying materials\r
10# are licensed and made available under the terms and conditions of the BSD License\r
11# which accompanies this distribution. The full text of the license may be found at\r
12# http://opensource.org/licenses/bsd-license.php\r
13#\r
14# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
15# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
16#\r
17# Module Name:\r
18#\r
19# RShiftU64.asm\r
20#\r
21# Abstract:\r
22#\r
23# 64-bit logical right shift function for IA-32\r
24#\r
25#------------------------------------------------------------------------------\r
26\r
27 .686:\r
28 .code:\r
29\r
30.globl ASM_PFX(InternalMathRShiftU64)\r
31\r
32#------------------------------------------------------------------------------\r
33# UINT64\r
34# EFIAPI\r
35# InternalMathRShiftU64 (\r
36# IN UINT64 Operand,\r
37# IN UINTN Count\r
38# );\r
39#------------------------------------------------------------------------------\r
40ASM_PFX(InternalMathRShiftU64):\r
41 movb 12(%esp), %cl\r
42 xorl %edx, %edx\r
43 movl 8(%esp), %eax\r
44 testb $32, %cl\r
45 cmovz %eax, %edx\r
46 cmovz 0x4(%esp), %eax\r
47 shrdl %cl, %edx, %eax\r
48 shr %cl, %edx\r
49 ret\r