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.

zswap_microk_power8.c 5.5 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  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/27 Werner Saar (wernsaar@googlemail.com)
  29. * BLASTEST : OK
  30. * CTEST : OK
  31. * TEST : OK
  32. * LAPACK-TEST : OK
  33. **************************************************************************************/
  34. #define HAVE_KERNEL_16 1
  35. static void zswap_kernel_16( BLASLONG n, FLOAT *x, FLOAT *y) __attribute__ ((noinline));
  36. static void zswap_kernel_16( BLASLONG n, FLOAT *x, FLOAT *y)
  37. {
  38. BLASLONG i = n;
  39. BLASLONG o16 = 16;
  40. BLASLONG o32 = 32;
  41. BLASLONG o48 = 48;
  42. BLASLONG o64 = 64;
  43. BLASLONG o80 = 80;
  44. BLASLONG o96 = 96;
  45. BLASLONG o112 = 112;
  46. FLOAT *x1=x;
  47. FLOAT *y1=y;
  48. FLOAT *x2=x+1;
  49. FLOAT *y2=y+1;
  50. BLASLONG pre = 384;
  51. BLASLONG alpha=0;
  52. __asm__ __volatile__
  53. (
  54. "addi %3, %3, -8 \n\t"
  55. "addi %4, %4, -8 \n\t"
  56. ".align 5 \n\t"
  57. "1: \n\t"
  58. "lxvd2x 32, 0, %2 \n\t"
  59. "lxvd2x 33, %5, %2 \n\t"
  60. "lxvd2x 34, %6, %2 \n\t"
  61. "lxvd2x 35, %7, %2 \n\t"
  62. "lxvd2x 36, %8, %2 \n\t"
  63. "lxvd2x 37, %9, %2 \n\t"
  64. "lxvd2x 38, %10, %2 \n\t"
  65. "lxvd2x 39, %11, %2 \n\t"
  66. "addi %2, %2, 128 \n\t"
  67. "lxvd2x 40, 0, %2 \n\t"
  68. "lxvd2x 41, %5, %2 \n\t"
  69. "lxvd2x 42, %6, %2 \n\t"
  70. "lxvd2x 43, %7, %2 \n\t"
  71. "lxvd2x 44, %8, %2 \n\t"
  72. "lxvd2x 45, %9, %2 \n\t"
  73. "lxvd2x 46, %10, %2 \n\t"
  74. "lxvd2x 47, %11, %2 \n\t"
  75. "addi %2, %2, 128 \n\t"
  76. "lxvd2x 48, 0, %1 \n\t"
  77. "lxvd2x 49, %5, %1 \n\t"
  78. "lxvd2x 50, %6, %1 \n\t"
  79. "lxvd2x 51, %7, %1 \n\t"
  80. "lxvd2x 52, %8, %1 \n\t"
  81. "lxvd2x 53, %9, %1 \n\t"
  82. "lxvd2x 54, %10, %1 \n\t"
  83. "lxvd2x 55, %11, %1 \n\t"
  84. "addi %1, %1, 128 \n\t"
  85. "lxvd2x 56, 0, %1 \n\t"
  86. "lxvd2x 57, %5, %1 \n\t"
  87. "lxvd2x 58, %6, %1 \n\t"
  88. "lxvd2x 59, %7, %1 \n\t"
  89. "lxvd2x 60, %8, %1 \n\t"
  90. "lxvd2x 61, %9, %1 \n\t"
  91. "lxvd2x 62, %10, %1 \n\t"
  92. "lxvd2x 63, %11, %1 \n\t"
  93. "addi %1, %1, 128 \n\t"
  94. "stxvd2x 32, 0, %3 \n\t"
  95. "stxvd2x 33, %5, %3 \n\t"
  96. "stxvd2x 34, %6, %3 \n\t"
  97. "stxvd2x 35, %7, %3 \n\t"
  98. "stxvd2x 36, %8, %3 \n\t"
  99. "stxvd2x 37, %9, %3 \n\t"
  100. "stxvd2x 38, %10, %3 \n\t"
  101. "stxvd2x 39, %11, %3 \n\t"
  102. "addi %3, %3, 128 \n\t"
  103. "stxvd2x 40, 0, %3 \n\t"
  104. "stxvd2x 41, %5, %3 \n\t"
  105. "stxvd2x 42, %6, %3 \n\t"
  106. "stxvd2x 43, %7, %3 \n\t"
  107. "stxvd2x 44, %8, %3 \n\t"
  108. "stxvd2x 45, %9, %3 \n\t"
  109. "stxvd2x 46, %10, %3 \n\t"
  110. "stxvd2x 47, %11, %3 \n\t"
  111. "addi %3, %3, 128 \n\t"
  112. "stxvd2x 48, 0, %4 \n\t"
  113. "stxvd2x 49, %5, %4 \n\t"
  114. "stxvd2x 50, %6, %4 \n\t"
  115. "stxvd2x 51, %7, %4 \n\t"
  116. "stxvd2x 52, %8, %4 \n\t"
  117. "stxvd2x 53, %9, %4 \n\t"
  118. "stxvd2x 54, %10, %4 \n\t"
  119. "stxvd2x 55, %11, %4 \n\t"
  120. "addi %4, %4, 128 \n\t"
  121. "stxvd2x 56, 0, %4 \n\t"
  122. "stxvd2x 57, %5, %4 \n\t"
  123. "stxvd2x 58, %6, %4 \n\t"
  124. "stxvd2x 59, %7, %4 \n\t"
  125. "stxvd2x 60, %8, %4 \n\t"
  126. "stxvd2x 61, %9, %4 \n\t"
  127. "stxvd2x 62, %10, %4 \n\t"
  128. "stxvd2x 63, %11, %4 \n\t"
  129. "addi %4, %4, 128 \n\t"
  130. "addic. %0 , %0 , -16 \n\t"
  131. "bgt 1b \n\t"
  132. "2: \n\t"
  133. :
  134. :
  135. "r" (i), // 0
  136. "r" (y1), // 1
  137. "r" (x1), // 2
  138. "r" (y2), // 3
  139. "r" (x2), // 4
  140. "r" (o16), // 5
  141. "r" (o32), // 6
  142. "r" (o48), // 7
  143. "r" (o64), // 8
  144. "r" (o80), // 9
  145. "r" (o96), // 10
  146. "r" (o112) // 11
  147. : "cr0", "%0", "%2" , "%1", "%3", "%4", "memory"
  148. );
  149. }