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