square-x86_64.S.in 709 B

123456789101112131415161718192021222324252627282930313233343536373839
  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. /* Only supported with GAS */
  16. # if defined(__linux__) || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__)
  17. .type square_unsigned,@function
  18. # endif
  19. # if defined(_WIN32) || defined(__CYGWIN__) /* msabi */
  20. SYMBOL_NAME(square_unsigned):
  21. imull %ecx, %ecx
  22. movl %ecx, %eax
  23. retq
  24. # else /* sysvabi */
  25. SYMBOL_NAME(square_unsigned):
  26. imull %edi, %edi
  27. movl %edi, %eax
  28. retq
  29. # endif
  30. #endif