MathLShiftS64.nasm 979 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. ;------------------------------------------------------------------------------
  2. ;
  3. ; Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
  4. ; SPDX-License-Identifier: BSD-2-Clause-Patent
  5. ;
  6. ; Module Name:
  7. ;
  8. ; MathLShiftS64.nasm
  9. ;
  10. ; Abstract:
  11. ;
  12. ; 64-bit Math Worker Function.
  13. ; Shifts a 64-bit signed value left by a certain number of bits.
  14. ;
  15. ;------------------------------------------------------------------------------
  16. SECTION .text
  17. global ASM_PFX(__ashldi3)
  18. ;------------------------------------------------------------------------------
  19. ;
  20. ; void __cdecl __ashldi3 (void)
  21. ;
  22. ;------------------------------------------------------------------------------
  23. ASM_PFX(__ashldi3):
  24. cmp cl,0x40
  25. jnc ReturnZero
  26. cmp cl,0x20
  27. jnc More32
  28. shld edx,eax,cl
  29. shl eax,cl
  30. ret
  31. More32:
  32. mov edx,eax
  33. xor eax,eax
  34. and cl,0x1f
  35. shl edx,cl
  36. ret
  37. ReturnZero:
  38. xor eax,eax
  39. xor edx,edx
  40. ret