Advertisement
Guest User

Untitled

a guest
Jan 18th, 2012
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. $ cat sincos.c
  2. #include <math.h>
  3.  
  4. void sincos(double theta, double *s, double *c) {
  5. *s = sin(theta);
  6. *c = cos(theta);
  7. }
  8. $ gcc -O3 -S sincos.c
  9. $ cat sincos.s
  10. .file "sincos.c"
  11. .text
  12. .p2align 4,,15
  13. .globl sincos
  14. .type sincos, @function
  15. sincos:
  16. .LFB3:
  17. .cfi_startproc
  18. movq %rbx, -16(%rsp)
  19. movq %rbp, -8(%rsp)
  20. subq $40, %rsp
  21. .cfi_def_cfa_offset 48
  22. movq %rdi, %rbp
  23. .cfi_offset 6, -16
  24. .cfi_offset 3, -24
  25. leaq 8(%rsp), %rdi
  26. movq %rsi, %rbx
  27. movq %rsp, %rsi
  28. call sincos
  29. movq 8(%rsp), %rax
  30. movq %rax, (%rbp)
  31. movq (%rsp), %rax
  32. movq 32(%rsp), %rbp
  33. movq %rax, (%rbx)
  34. movq 24(%rsp), %rbx
  35. addq $40, %rsp
  36. ret
  37. .cfi_endproc
  38. .LFE3:
  39. .size sincos, .-sincos
  40. .ident "GCC: (Debian 4.4.5-8) 4.4.5"
  41. .section .note.GNU-stack,"",@progbits
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement