com.asm
Upload User: qaz666999
Upload Date: 2022-08-06
Package Size: 2570k
Code Size: 2k
Category:

Algorithm

Development Platform:

Unix_Linux

  1. dnl  AMD64 mpn_com.
  2. dnl  Copyright 2004, 2005, 2006 Free Software Foundation, Inc.
  3. dnl  This file is part of the GNU MP Library.
  4. dnl  The GNU MP Library is free software; you can redistribute it and/or modify
  5. dnl  it under the terms of the GNU Lesser General Public License as published
  6. dnl  by the Free Software Foundation; either version 3 of the License, or (at
  7. dnl  your option) any later version.
  8. dnl  The GNU MP Library is distributed in the hope that it will be useful, but
  9. dnl  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  10. dnl  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
  11. dnl  License for more details.
  12. dnl  You should have received a copy of the GNU Lesser General Public License
  13. dnl  along with the GNU MP Library.  If not, see http://www.gnu.org/licenses/.
  14. include(`../config.m4')
  15. C     cycles/limb
  16. C K8,K9: 1.25
  17. C K10: 1.25
  18. C P4: 2.78
  19. C P6-15: 1.1
  20. C INPUT PARAMETERS
  21. define(`rp',`%rdi')
  22. define(`up',`%rsi')
  23. define(`n',`%rdx')
  24. ASM_START()
  25. TEXT
  26. ALIGN(32)
  27. PROLOGUE(mpn_com)
  28. movq (up), %r8
  29. movl %edx, %eax
  30. leaq (up,n,8), up
  31. leaq (rp,n,8), rp
  32. negq n
  33. andl $3, %eax
  34. je L(b00)
  35. cmpl $2, %eax
  36. jc L(b01)
  37. je L(b10)
  38. L(b11): notq %r8
  39. movq %r8, (rp,n,8)
  40. decq n
  41. jmp L(e11)
  42. L(b10): addq $-2, n
  43. jmp L(e10)
  44. .byte 0x90,0x90,0x90,0x90,0x90,0x90
  45. L(b01): notq %r8
  46. movq %r8, (rp,n,8)
  47. incq n
  48. jz L(ret)
  49. L(oop): movq (up,n,8), %r8
  50. L(b00): movq 8(up,n,8), %r9
  51. notq %r8
  52. notq %r9
  53. movq %r8, (rp,n,8)
  54. movq %r9, 8(rp,n,8)
  55. L(e11): movq 16(up,n,8), %r8
  56. L(e10): movq 24(up,n,8), %r9
  57. notq %r8
  58. notq %r9
  59. movq %r8, 16(rp,n,8)
  60. movq %r9, 24(rp,n,8)
  61. addq $4, n
  62. jnc L(oop)
  63. L(ret): ret
  64. EPILOGUE()