• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1;------------------------------------------------------------------------------
2;
3; Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
4; This program and the accompanying materials
5; are licensed and made available under the terms and conditions of the BSD License
6; which accompanies this distribution.  The full text of the license may be found at
7; http://opensource.org/licenses/bsd-license.php.
8;
9; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11;
12; Module Name:
13;
14;   MathLShiftS64.nasm
15;
16; Abstract:
17;
18;   64-bit Math Worker Function.
19;   Shifts a 64-bit signed value left by a certain number of bits.
20;
21;------------------------------------------------------------------------------
22
23    SECTION .text
24
25global ASM_PFX(__ashldi3)
26;------------------------------------------------------------------------------
27;
28; void __cdecl __ashldi3 (void)
29;
30;------------------------------------------------------------------------------
31ASM_PFX(__ashldi3):
32    cmp cl,0x40
33    jnc ReturnZero
34    cmp cl,0x20
35    jnc More32
36    shld edx,eax,cl
37    shl eax,cl
38    ret
39More32:
40    mov edx,eax
41    xor eax,eax
42    and cl,0x1f
43    shl edx,cl
44    ret
45ReturnZero:
46    xor eax,eax
47    xor edx,edx
48    ret
49