mpih-rshift.S 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /* hppa rshift
  2. * optimized for the PA7100, where it runs at 3.25 cycles/limb
  3. *
  4. * Copyright (C) 1992, 1994, 1998,
  5. * 2001, 2002 Free Software Foundation, Inc.
  6. *
  7. * This file is part of Libgcrypt.
  8. *
  9. * Libgcrypt is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU Lesser General Public License as
  11. * published by the Free Software Foundation; either version 2.1 of
  12. * the License, or (at your option) any later version.
  13. *
  14. * Libgcrypt is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU Lesser General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Lesser General Public
  20. * License along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
  22. */
  23. /*******************
  24. * mpi_limb_t
  25. * _gcry_mpih_rshift( mpi_ptr_t wp, (gr26)
  26. * mpi_ptr_t up, (gr25)
  27. * mpi_size_t usize, (gr24)
  28. * unsigned cnt) (gr23)
  29. */
  30. .code
  31. .export _gcry_mpih_rshift
  32. .label _gcry_mpih_rshift
  33. .proc
  34. .callinfo frame=64,no_calls
  35. .entry
  36. ldws,ma 4(0,%r25),%r22
  37. mtsar %r23
  38. addib,= -1,%r24,L$r004
  39. vshd %r22,%r0,%r28 ; compute carry out limb
  40. ldws,ma 4(0,%r25),%r29
  41. addib,<= -5,%r24,L$rrest
  42. vshd %r29,%r22,%r20
  43. .label L$roop
  44. ldws,ma 4(0,%r25),%r22
  45. stws,ma %r20,4(0,%r26)
  46. vshd %r22,%r29,%r20
  47. ldws,ma 4(0,%r25),%r29
  48. stws,ma %r20,4(0,%r26)
  49. vshd %r29,%r22,%r20
  50. ldws,ma 4(0,%r25),%r22
  51. stws,ma %r20,4(0,%r26)
  52. vshd %r22,%r29,%r20
  53. ldws,ma 4(0,%r25),%r29
  54. stws,ma %r20,4(0,%r26)
  55. addib,> -4,%r24,L$roop
  56. vshd %r29,%r22,%r20
  57. .label L$rrest
  58. addib,= 4,%r24,L$rend1
  59. nop
  60. .label L$eroop
  61. ldws,ma 4(0,%r25),%r22
  62. stws,ma %r20,4(0,%r26)
  63. addib,<= -1,%r24,L$rend2
  64. vshd %r22,%r29,%r20
  65. ldws,ma 4(0,%r25),%r29
  66. stws,ma %r20,4(0,%r26)
  67. addib,> -1,%r24,L$eroop
  68. vshd %r29,%r22,%r20
  69. .label L$rend1
  70. stws,ma %r20,4(0,%r26)
  71. vshd %r0,%r29,%r20
  72. bv 0(%r2)
  73. stw %r20,0(0,%r26)
  74. .label L$rend2
  75. stws,ma %r20,4(0,%r26)
  76. .label L$r004
  77. vshd %r0,%r22,%r20
  78. bv 0(%r2)
  79. stw %r20,0(0,%r26)
  80. .exit
  81. .procend