JavascriptConversionA.asm 935 B

123456789101112131415161718192021222324252627282930
  1. ;-------------------------------------------------------------------------------------------------------
  2. ; Copyright (C) Microsoft. All rights reserved.
  3. ; Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. ;-------------------------------------------------------------------------------------------------------
  5. include ksamd64.inc
  6. _TEXT SEGMENT
  7. align 16
  8. ?ULongToDouble@JavascriptConversion@Js@@SAN_K@Z PROC FRAME
  9. .endprolog
  10. test rcx, rcx
  11. js msbSet
  12. cvtsi2sd xmm0, rcx
  13. jmp doneULongToDouble
  14. msbSet:
  15. mov rdx, rcx
  16. and rcx, 1 ; Save lsb
  17. shr rdx, 1 ; divide by 2
  18. or rcx, rdx ; put back lsb if it was set
  19. cvtsi2sd xmm0, rcx ; do conversion
  20. addsd xmm0, xmm0 ; xmm0 * 2
  21. doneULongToDouble:
  22. ret
  23. ?ULongToDouble@JavascriptConversion@Js@@SAN_K@Z ENDP
  24. _TEXT ENDS
  25. end