square-x86_64.S 623 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #include "symbol-underscore.h"
  2. #ifdef _MSC_VER /* MSVC on Windows */
  3. PUBLIC SYMBOL_NAME(square_unsigned)
  4. _TEXT SEGMENT
  5. SYMBOL_NAME(square_unsigned) PROC
  6. mov eax, ecx
  7. imul eax, eax
  8. ret
  9. SYMBOL_NAME(square_unsigned) ENDP
  10. _TEXT ENDS
  11. END
  12. #else
  13. .text
  14. .globl SYMBOL_NAME(square_unsigned)
  15. # ifdef __linux__
  16. .type square_unsigned, %function
  17. #endif
  18. # if defined(_WIN32) || defined(__CYGWIN__) /* msabi */
  19. SYMBOL_NAME(square_unsigned):
  20. imull %ecx, %ecx
  21. movl %ecx, %eax
  22. retq
  23. # else /* sysvabi */
  24. SYMBOL_NAME(square_unsigned):
  25. imull %edi, %edi
  26. movl %edi, %eax
  27. retq
  28. # endif
  29. #endif