You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

dcopy_microk_power8.c 5.1 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. /***************************************************************************
  2. Copyright (c) 2013-2016, The OpenBLAS Project
  3. All rights reserved.
  4. Redistribution and use in source and binary forms, with or without
  5. modification, are permitted provided that the following conditions are
  6. met:
  7. 1. Redistributions of source code must retain the above copyright
  8. notice, this list of conditions and the following disclaimer.
  9. 2. Redistributions in binary form must reproduce the above copyright
  10. notice, this list of conditions and the following disclaimer in
  11. the documentation and/or other materials provided with the
  12. distribution.
  13. 3. Neither the name of the OpenBLAS project nor the names of
  14. its contributors may be used to endorse or promote products
  15. derived from this software without specific prior written permission.
  16. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  17. AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  18. IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  19. ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE
  20. LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  21. DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  22. SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  23. CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  24. OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
  25. USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26. *****************************************************************************/
  27. /**************************************************************************************
  28. * 2016/03/25 Werner Saar (wernsaar@googlemail.com)
  29. * BLASTEST : OK
  30. * CTEST : OK
  31. * TEST : OK
  32. * LAPACK-TEST : OK
  33. **************************************************************************************/
  34. #define HAVE_KERNEL_32 1
  35. static void dcopy_kernel_32 (long n, double *x, double *y)
  36. {
  37. __asm__
  38. (
  39. "lxvd2x 32, 0, %2 \n\t"
  40. "lxvd2x 33, %5, %2 \n\t"
  41. "lxvd2x 34, %6, %2 \n\t"
  42. "lxvd2x 35, %7, %2 \n\t"
  43. "lxvd2x 36, %8, %2 \n\t"
  44. "lxvd2x 37, %9, %2 \n\t"
  45. "lxvd2x 38, %10, %2 \n\t"
  46. "lxvd2x 39, %11, %2 \n\t"
  47. "addi %2, %2, 128 \n\t"
  48. "lxvd2x 40, 0, %2 \n\t"
  49. "lxvd2x 41, %5, %2 \n\t"
  50. "lxvd2x 42, %6, %2 \n\t"
  51. "lxvd2x 43, %7, %2 \n\t"
  52. "lxvd2x 44, %8, %2 \n\t"
  53. "lxvd2x 45, %9, %2 \n\t"
  54. "lxvd2x 46, %10, %2 \n\t"
  55. "lxvd2x 47, %11, %2 \n\t"
  56. "addi %2, %2, 128 \n\t"
  57. "addic. %1, %1, -32 \n\t"
  58. "ble two%= \n\t"
  59. ".align 5 \n"
  60. "one%=: \n\t"
  61. "stxvd2x 32, 0, %3 \n\t"
  62. "stxvd2x 33, %5, %3 \n\t"
  63. "lxvd2x 32, 0, %2 \n\t"
  64. "lxvd2x 33, %5, %2 \n\t"
  65. "stxvd2x 34, %6, %3 \n\t"
  66. "stxvd2x 35, %7, %3 \n\t"
  67. "lxvd2x 34, %6, %2 \n\t"
  68. "lxvd2x 35, %7, %2 \n\t"
  69. "stxvd2x 36, %8, %3 \n\t"
  70. "stxvd2x 37, %9, %3 \n\t"
  71. "lxvd2x 36, %8, %2 \n\t"
  72. "lxvd2x 37, %9, %2 \n\t"
  73. "stxvd2x 38, %10, %3 \n\t"
  74. "stxvd2x 39, %11, %3 \n\t"
  75. "lxvd2x 38, %10, %2 \n\t"
  76. "lxvd2x 39, %11, %2 \n\t"
  77. "addi %3, %3, 128 \n\t"
  78. "addi %2, %2, 128 \n\t"
  79. "stxvd2x 40, 0, %3 \n\t"
  80. "stxvd2x 41, %5, %3 \n\t"
  81. "lxvd2x 40, 0, %2 \n\t"
  82. "lxvd2x 41, %5, %2 \n\t"
  83. "stxvd2x 42, %6, %3 \n\t"
  84. "stxvd2x 43, %7, %3 \n\t"
  85. "lxvd2x 42, %6, %2 \n\t"
  86. "lxvd2x 43, %7, %2 \n\t"
  87. "stxvd2x 44, %8, %3 \n\t"
  88. "stxvd2x 45, %9, %3 \n\t"
  89. "lxvd2x 44, %8, %2 \n\t"
  90. "lxvd2x 45, %9, %2 \n\t"
  91. "stxvd2x 46, %10, %3 \n\t"
  92. "stxvd2x 47, %11, %3 \n\t"
  93. "lxvd2x 46, %10, %2 \n\t"
  94. "lxvd2x 47, %11, %2 \n\t"
  95. "addi %3, %3, 128 \n\t"
  96. "addi %2, %2, 128 \n\t"
  97. "addic. %1, %1, -32 \n\t"
  98. "bgt one%= \n"
  99. "two%=: \n\t"
  100. "stxvd2x 32, 0, %3 \n\t"
  101. "stxvd2x 33, %5, %3 \n\t"
  102. "stxvd2x 34, %6, %3 \n\t"
  103. "stxvd2x 35, %7, %3 \n\t"
  104. "stxvd2x 36, %8, %3 \n\t"
  105. "stxvd2x 37, %9, %3 \n\t"
  106. "stxvd2x 38, %10, %3 \n\t"
  107. "stxvd2x 39, %11, %3 \n\t"
  108. "addi %3, %3, 128 \n\t"
  109. "stxvd2x 40, 0, %3 \n\t"
  110. "stxvd2x 41, %5, %3 \n\t"
  111. "stxvd2x 42, %6, %3 \n\t"
  112. "stxvd2x 43, %7, %3 \n\t"
  113. "stxvd2x 44, %8, %3 \n\t"
  114. "stxvd2x 45, %9, %3 \n\t"
  115. "stxvd2x 46, %10, %3 \n\t"
  116. "stxvd2x 47, %11, %3 \n"
  117. "#n=%1 x=%4=%2 y=%0=%3 o16=%5 o32=%6 o48=%7 o64=%8 o80=%9 o96=%10 o112=%11"
  118. :
  119. "=m" (*y),
  120. "+r" (n), // 1
  121. "+b" (x), // 2
  122. "+b" (y) // 3
  123. :
  124. "m" (*x),
  125. "b" (16), // 5
  126. "b" (32), // 6
  127. "b" (48), // 7
  128. "b" (64), // 8
  129. "b" (80), // 9
  130. "b" (96), // 10
  131. "b" (112) // 11
  132. :
  133. "cr0",
  134. "vs32","vs33","vs34","vs35","vs36","vs37","vs38","vs39",
  135. "vs40","vs41","vs42","vs43","vs44","vs45","vs46","vs47"
  136. );
  137. }