]> git.proxmox.com Git - mirror_edk2.git/blame - CryptoPkg/Library/BaseCryptLib/SysCall/Ia32/MathLShiftS64.S
BaseTools: Fix a cleanall issue.
[mirror_edk2.git] / CryptoPkg / Library / BaseCryptLib / SysCall / Ia32 / MathLShiftS64.S
CommitLineData
97f98500
HT
1#------------------------------------------------------------------------------\r
2#\r
3# Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
4# This program and the accompanying materials\r
5# are licensed and made available under the terms and conditions of the BSD License\r
6# which accompanies this distribution. The full text of the license may be found at\r
7# http://opensource.org/licenses/bsd-license.php.\r
8#\r
9# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
10# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
11#\r
12# Module Name:\r
13#\r
14# MathLShiftS64.S\r
15#\r
16# Abstract:\r
17#\r
18# 64-bit Math Worker Function.\r
19# Shifts a 64-bit signed value left by a certain number of bits.\r
20#\r
21#------------------------------------------------------------------------------\r
22\r
23 .686:\r
24 .code:\r
25\r
26ASM_GLOBAL ASM_PFX(__ashldi3)\r
27\r
28#------------------------------------------------------------------------------\r
29#\r
30# void __cdecl __ashldi3 (void)\r
31#\r
32#------------------------------------------------------------------------------\r
33ASM_PFX(__ashldi3):\r
34 #\r
35 # Handle shifting of 64 or more bits (return 0)\r
36 #\r
37 cmpb $64, %cl\r
38 jae ReturnZero\r
39\r
40 #\r
41 # Handle shifting of between 0 and 31 bits\r
42 #\r
43 cmpb $32, %cl\r
44 jae More32\r
45 shld %cl, %eax, %edx\r
46 shl %cl, %eax\r
47 ret\r
48\r
49 #\r
50 # Handle shifting of between 32 and 63 bits\r
51 #\r
52More32:\r
53 movl %eax, %edx\r
54 xor %eax, %eax\r
55 and $31, %cl\r
56 shl %cl, %edx\r
57 ret\r
58\r
59ReturnZero:\r
60 xor %eax, %eax\r
61 xor %edx, %edx\r
62 ret\r