itrans32_dspr2.c 69 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218
  1. /*
  2. * Copyright (c) 2013 The WebM project authors. All Rights Reserved.
  3. *
  4. * Use of this source code is governed by a BSD-style license
  5. * that can be found in the LICENSE file in the root of the source
  6. * tree. An additional intellectual property rights grant can be found
  7. * in the file PATENTS. All contributing project authors may
  8. * be found in the AUTHORS file in the root of the source tree.
  9. */
  10. #include <assert.h>
  11. #include <stdio.h>
  12. #include "./vpx_config.h"
  13. #include "vpx_dsp/mips/inv_txfm_dspr2.h"
  14. #include "vpx_dsp/txfm_common.h"
  15. #if HAVE_DSPR2
  16. static void idct32_rows_dspr2(const int16_t *input, int16_t *output,
  17. uint32_t no_rows) {
  18. int step1_0, step1_1, step1_2, step1_3, step1_4, step1_5, step1_6;
  19. int step1_7, step1_8, step1_9, step1_10, step1_11, step1_12, step1_13;
  20. int step1_14, step1_15, step1_16, step1_17, step1_18, step1_19, step1_20;
  21. int step1_21, step1_22, step1_23, step1_24, step1_25, step1_26, step1_27;
  22. int step1_28, step1_29, step1_30, step1_31;
  23. int step2_0, step2_1, step2_2, step2_3, step2_4, step2_5, step2_6;
  24. int step2_7, step2_8, step2_9, step2_10, step2_11, step2_12, step2_13;
  25. int step2_14, step2_15, step2_16, step2_17, step2_18, step2_19, step2_20;
  26. int step2_21, step2_22, step2_23, step2_24, step2_25, step2_26, step2_27;
  27. int step2_28, step2_29, step2_30, step2_31;
  28. int step3_8, step3_9, step3_10, step3_11, step3_12, step3_13, step3_14;
  29. int step3_15, step3_16, step3_17, step3_18, step3_19, step3_20, step3_21;
  30. int step3_22, step3_23, step3_24, step3_25, step3_26, step3_27, step3_28;
  31. int step3_29, step3_30, step3_31;
  32. int temp0, temp1, temp2, temp3;
  33. int load1, load2, load3, load4;
  34. int result1, result2;
  35. int i;
  36. const int const_2_power_13 = 8192;
  37. const int32_t *input_int;
  38. for (i = no_rows; i--;) {
  39. input_int = (const int32_t *)input;
  40. if (!(input_int[0] | input_int[1] | input_int[2] | input_int[3] |
  41. input_int[4] | input_int[5] | input_int[6] | input_int[7] |
  42. input_int[8] | input_int[9] | input_int[10] | input_int[11] |
  43. input_int[12] | input_int[13] | input_int[14] | input_int[15])) {
  44. input += 32;
  45. __asm__ __volatile__(
  46. "sh $zero, 0(%[output]) \n\t"
  47. "sh $zero, 64(%[output]) \n\t"
  48. "sh $zero, 128(%[output]) \n\t"
  49. "sh $zero, 192(%[output]) \n\t"
  50. "sh $zero, 256(%[output]) \n\t"
  51. "sh $zero, 320(%[output]) \n\t"
  52. "sh $zero, 384(%[output]) \n\t"
  53. "sh $zero, 448(%[output]) \n\t"
  54. "sh $zero, 512(%[output]) \n\t"
  55. "sh $zero, 576(%[output]) \n\t"
  56. "sh $zero, 640(%[output]) \n\t"
  57. "sh $zero, 704(%[output]) \n\t"
  58. "sh $zero, 768(%[output]) \n\t"
  59. "sh $zero, 832(%[output]) \n\t"
  60. "sh $zero, 896(%[output]) \n\t"
  61. "sh $zero, 960(%[output]) \n\t"
  62. "sh $zero, 1024(%[output]) \n\t"
  63. "sh $zero, 1088(%[output]) \n\t"
  64. "sh $zero, 1152(%[output]) \n\t"
  65. "sh $zero, 1216(%[output]) \n\t"
  66. "sh $zero, 1280(%[output]) \n\t"
  67. "sh $zero, 1344(%[output]) \n\t"
  68. "sh $zero, 1408(%[output]) \n\t"
  69. "sh $zero, 1472(%[output]) \n\t"
  70. "sh $zero, 1536(%[output]) \n\t"
  71. "sh $zero, 1600(%[output]) \n\t"
  72. "sh $zero, 1664(%[output]) \n\t"
  73. "sh $zero, 1728(%[output]) \n\t"
  74. "sh $zero, 1792(%[output]) \n\t"
  75. "sh $zero, 1856(%[output]) \n\t"
  76. "sh $zero, 1920(%[output]) \n\t"
  77. "sh $zero, 1984(%[output]) \n\t"
  78. :
  79. : [output] "r"(output));
  80. output += 1;
  81. continue;
  82. }
  83. /* prefetch row */
  84. prefetch_load((const uint8_t *)(input + 32));
  85. prefetch_load((const uint8_t *)(input + 48));
  86. __asm__ __volatile__(
  87. "lh %[load1], 2(%[input]) \n\t"
  88. "lh %[load2], 62(%[input]) \n\t"
  89. "lh %[load3], 34(%[input]) \n\t"
  90. "lh %[load4], 30(%[input]) \n\t"
  91. "mtlo %[const_2_power_13], $ac1 \n\t"
  92. "mthi $zero, $ac1 \n\t"
  93. "mtlo %[const_2_power_13], $ac3 \n\t"
  94. "mthi $zero, $ac3 \n\t"
  95. "madd $ac1, %[load1], %[cospi_31_64] \n\t"
  96. "msub $ac1, %[load2], %[cospi_1_64] \n\t"
  97. "extp %[temp0], $ac1, 31 \n\t"
  98. "madd $ac3, %[load1], %[cospi_1_64] \n\t"
  99. "madd $ac3, %[load2], %[cospi_31_64] \n\t"
  100. "extp %[temp3], $ac3, 31 \n\t"
  101. "mtlo %[const_2_power_13], $ac1 \n\t"
  102. "mthi $zero, $ac1 \n\t"
  103. "mtlo %[const_2_power_13], $ac2 \n\t"
  104. "mthi $zero, $ac2 \n\t"
  105. "madd $ac2, %[load3], %[cospi_15_64] \n\t"
  106. "msub $ac2, %[load4], %[cospi_17_64] \n\t"
  107. "extp %[temp1], $ac2, 31 \n\t"
  108. "madd $ac1, %[load3], %[cospi_17_64] \n\t"
  109. "madd $ac1, %[load4], %[cospi_15_64] \n\t"
  110. "extp %[temp2], $ac1, 31 \n\t"
  111. "mtlo %[const_2_power_13], $ac1 \n\t"
  112. "mthi $zero, $ac1 \n\t"
  113. "mtlo %[const_2_power_13], $ac3 \n\t"
  114. "mthi $zero, $ac3 \n\t"
  115. "sub %[load1], %[temp3], %[temp2] \n\t"
  116. "sub %[load2], %[temp0], %[temp1] \n\t"
  117. "madd $ac1, %[load1], %[cospi_28_64] \n\t"
  118. "msub $ac1, %[load2], %[cospi_4_64] \n\t"
  119. "madd $ac3, %[load1], %[cospi_4_64] \n\t"
  120. "madd $ac3, %[load2], %[cospi_28_64] \n\t"
  121. "extp %[step1_17], $ac1, 31 \n\t"
  122. "extp %[step1_30], $ac3, 31 \n\t"
  123. "add %[step1_16], %[temp0], %[temp1] \n\t"
  124. "add %[step1_31], %[temp2], %[temp3] \n\t"
  125. : [load1] "=&r"(load1), [load2] "=&r"(load2), [load3] "=&r"(load3),
  126. [load4] "=&r"(load4), [temp0] "=&r"(temp0), [temp1] "=&r"(temp1),
  127. [temp2] "=&r"(temp2), [temp3] "=&r"(temp3),
  128. [step1_16] "=&r"(step1_16), [step1_17] "=&r"(step1_17),
  129. [step1_30] "=&r"(step1_30), [step1_31] "=&r"(step1_31)
  130. : [const_2_power_13] "r"(const_2_power_13), [input] "r"(input),
  131. [cospi_31_64] "r"(cospi_31_64), [cospi_1_64] "r"(cospi_1_64),
  132. [cospi_4_64] "r"(cospi_4_64), [cospi_17_64] "r"(cospi_17_64),
  133. [cospi_15_64] "r"(cospi_15_64), [cospi_28_64] "r"(cospi_28_64));
  134. __asm__ __volatile__(
  135. "lh %[load1], 18(%[input]) \n\t"
  136. "lh %[load2], 46(%[input]) \n\t"
  137. "lh %[load3], 50(%[input]) \n\t"
  138. "lh %[load4], 14(%[input]) \n\t"
  139. "mtlo %[const_2_power_13], $ac1 \n\t"
  140. "mthi $zero, $ac1 \n\t"
  141. "mtlo %[const_2_power_13], $ac3 \n\t"
  142. "mthi $zero, $ac3 \n\t"
  143. "madd $ac1, %[load1], %[cospi_23_64] \n\t"
  144. "msub $ac1, %[load2], %[cospi_9_64] \n\t"
  145. "extp %[temp0], $ac1, 31 \n\t"
  146. "madd $ac3, %[load1], %[cospi_9_64] \n\t"
  147. "madd $ac3, %[load2], %[cospi_23_64] \n\t"
  148. "extp %[temp3], $ac3, 31 \n\t"
  149. "mtlo %[const_2_power_13], $ac1 \n\t"
  150. "mthi $zero, $ac1 \n\t"
  151. "mtlo %[const_2_power_13], $ac2 \n\t"
  152. "mthi $zero, $ac2 \n\t"
  153. "madd $ac2, %[load3], %[cospi_7_64] \n\t"
  154. "msub $ac2, %[load4], %[cospi_25_64] \n\t"
  155. "extp %[temp1], $ac2, 31 \n\t"
  156. "madd $ac1, %[load3], %[cospi_25_64] \n\t"
  157. "madd $ac1, %[load4], %[cospi_7_64] \n\t"
  158. "extp %[temp2], $ac1, 31 \n\t"
  159. "mtlo %[const_2_power_13], $ac1 \n\t"
  160. "mthi $zero, $ac1 \n\t"
  161. "mtlo %[const_2_power_13], $ac3 \n\t"
  162. "mthi $zero, $ac3 \n\t"
  163. "sub %[load1], %[temp1], %[temp0] \n\t"
  164. "sub %[load2], %[temp2], %[temp3] \n\t"
  165. "msub $ac1, %[load1], %[cospi_28_64] \n\t"
  166. "msub $ac1, %[load2], %[cospi_4_64] \n\t"
  167. "msub $ac3, %[load1], %[cospi_4_64] \n\t"
  168. "madd $ac3, %[load2], %[cospi_28_64] \n\t"
  169. "extp %[step1_18], $ac1, 31 \n\t"
  170. "extp %[step1_29], $ac3, 31 \n\t"
  171. "add %[step1_19], %[temp0], %[temp1] \n\t"
  172. "add %[step1_28], %[temp2], %[temp3] \n\t"
  173. : [load1] "=&r"(load1), [load2] "=&r"(load2), [load3] "=&r"(load3),
  174. [load4] "=&r"(load4), [temp0] "=&r"(temp0), [temp1] "=&r"(temp1),
  175. [temp2] "=&r"(temp2), [temp3] "=&r"(temp3),
  176. [step1_18] "=&r"(step1_18), [step1_19] "=&r"(step1_19),
  177. [step1_28] "=&r"(step1_28), [step1_29] "=&r"(step1_29)
  178. : [const_2_power_13] "r"(const_2_power_13), [input] "r"(input),
  179. [cospi_23_64] "r"(cospi_23_64), [cospi_9_64] "r"(cospi_9_64),
  180. [cospi_4_64] "r"(cospi_4_64), [cospi_7_64] "r"(cospi_7_64),
  181. [cospi_25_64] "r"(cospi_25_64), [cospi_28_64] "r"(cospi_28_64));
  182. __asm__ __volatile__(
  183. "lh %[load1], 10(%[input]) \n\t"
  184. "lh %[load2], 54(%[input]) \n\t"
  185. "lh %[load3], 42(%[input]) \n\t"
  186. "lh %[load4], 22(%[input]) \n\t"
  187. "mtlo %[const_2_power_13], $ac1 \n\t"
  188. "mthi $zero, $ac1 \n\t"
  189. "mtlo %[const_2_power_13], $ac3 \n\t"
  190. "mthi $zero, $ac3 \n\t"
  191. "madd $ac1, %[load1], %[cospi_27_64] \n\t"
  192. "msub $ac1, %[load2], %[cospi_5_64] \n\t"
  193. "extp %[temp0], $ac1, 31 \n\t"
  194. "madd $ac3, %[load1], %[cospi_5_64] \n\t"
  195. "madd $ac3, %[load2], %[cospi_27_64] \n\t"
  196. "extp %[temp3], $ac3, 31 \n\t"
  197. "mtlo %[const_2_power_13], $ac1 \n\t"
  198. "mthi $zero, $ac1 \n\t"
  199. "mtlo %[const_2_power_13], $ac2 \n\t"
  200. "mthi $zero, $ac2 \n\t"
  201. "madd $ac2, %[load3], %[cospi_11_64] \n\t"
  202. "msub $ac2, %[load4], %[cospi_21_64] \n\t"
  203. "extp %[temp1], $ac2, 31 \n\t"
  204. "madd $ac1, %[load3], %[cospi_21_64] \n\t"
  205. "madd $ac1, %[load4], %[cospi_11_64] \n\t"
  206. "extp %[temp2], $ac1, 31 \n\t"
  207. "mtlo %[const_2_power_13], $ac1 \n\t"
  208. "mthi $zero, $ac1 \n\t"
  209. "mtlo %[const_2_power_13], $ac3 \n\t"
  210. "mthi $zero, $ac3 \n\t"
  211. "sub %[load1], %[temp0], %[temp1] \n\t"
  212. "sub %[load2], %[temp3], %[temp2] \n\t"
  213. "madd $ac1, %[load2], %[cospi_12_64] \n\t"
  214. "msub $ac1, %[load1], %[cospi_20_64] \n\t"
  215. "madd $ac3, %[load1], %[cospi_12_64] \n\t"
  216. "madd $ac3, %[load2], %[cospi_20_64] \n\t"
  217. "extp %[step1_21], $ac1, 31 \n\t"
  218. "extp %[step1_26], $ac3, 31 \n\t"
  219. "add %[step1_20], %[temp0], %[temp1] \n\t"
  220. "add %[step1_27], %[temp2], %[temp3] \n\t"
  221. : [load1] "=&r"(load1), [load2] "=&r"(load2), [load3] "=&r"(load3),
  222. [load4] "=&r"(load4), [temp0] "=&r"(temp0), [temp1] "=&r"(temp1),
  223. [temp2] "=&r"(temp2), [temp3] "=&r"(temp3),
  224. [step1_20] "=&r"(step1_20), [step1_21] "=&r"(step1_21),
  225. [step1_26] "=&r"(step1_26), [step1_27] "=&r"(step1_27)
  226. : [const_2_power_13] "r"(const_2_power_13), [input] "r"(input),
  227. [cospi_27_64] "r"(cospi_27_64), [cospi_5_64] "r"(cospi_5_64),
  228. [cospi_11_64] "r"(cospi_11_64), [cospi_21_64] "r"(cospi_21_64),
  229. [cospi_12_64] "r"(cospi_12_64), [cospi_20_64] "r"(cospi_20_64));
  230. __asm__ __volatile__(
  231. "lh %[load1], 26(%[input]) \n\t"
  232. "lh %[load2], 38(%[input]) \n\t"
  233. "lh %[load3], 58(%[input]) \n\t"
  234. "lh %[load4], 6(%[input]) \n\t"
  235. "mtlo %[const_2_power_13], $ac1 \n\t"
  236. "mthi $zero, $ac1 \n\t"
  237. "mtlo %[const_2_power_13], $ac3 \n\t"
  238. "mthi $zero, $ac3 \n\t"
  239. "madd $ac1, %[load1], %[cospi_19_64] \n\t"
  240. "msub $ac1, %[load2], %[cospi_13_64] \n\t"
  241. "extp %[temp0], $ac1, 31 \n\t"
  242. "madd $ac3, %[load1], %[cospi_13_64] \n\t"
  243. "madd $ac3, %[load2], %[cospi_19_64] \n\t"
  244. "extp %[temp3], $ac3, 31 \n\t"
  245. "mtlo %[const_2_power_13], $ac1 \n\t"
  246. "mthi $zero, $ac1 \n\t"
  247. "mtlo %[const_2_power_13], $ac2 \n\t"
  248. "mthi $zero, $ac2 \n\t"
  249. "madd $ac2, %[load3], %[cospi_3_64] \n\t"
  250. "msub $ac2, %[load4], %[cospi_29_64] \n\t"
  251. "extp %[temp1], $ac2, 31 \n\t"
  252. "madd $ac1, %[load3], %[cospi_29_64] \n\t"
  253. "madd $ac1, %[load4], %[cospi_3_64] \n\t"
  254. "extp %[temp2], $ac1, 31 \n\t"
  255. "mtlo %[const_2_power_13], $ac1 \n\t"
  256. "mthi $zero, $ac1 \n\t"
  257. "mtlo %[const_2_power_13], $ac3 \n\t"
  258. "mthi $zero, $ac3 \n\t"
  259. "sub %[load1], %[temp1], %[temp0] \n\t"
  260. "sub %[load2], %[temp2], %[temp3] \n\t"
  261. "msub $ac1, %[load1], %[cospi_12_64] \n\t"
  262. "msub $ac1, %[load2], %[cospi_20_64] \n\t"
  263. "msub $ac3, %[load1], %[cospi_20_64] \n\t"
  264. "madd $ac3, %[load2], %[cospi_12_64] \n\t"
  265. "extp %[step1_22], $ac1, 31 \n\t"
  266. "extp %[step1_25], $ac3, 31 \n\t"
  267. "add %[step1_23], %[temp0], %[temp1] \n\t"
  268. "add %[step1_24], %[temp2], %[temp3] \n\t"
  269. : [load1] "=&r"(load1), [load2] "=&r"(load2), [load3] "=&r"(load3),
  270. [load4] "=&r"(load4), [temp0] "=&r"(temp0), [temp1] "=&r"(temp1),
  271. [temp2] "=&r"(temp2), [temp3] "=&r"(temp3),
  272. [step1_22] "=&r"(step1_22), [step1_23] "=&r"(step1_23),
  273. [step1_24] "=&r"(step1_24), [step1_25] "=&r"(step1_25)
  274. : [const_2_power_13] "r"(const_2_power_13), [input] "r"(input),
  275. [cospi_19_64] "r"(cospi_19_64), [cospi_13_64] "r"(cospi_13_64),
  276. [cospi_3_64] "r"(cospi_3_64), [cospi_29_64] "r"(cospi_29_64),
  277. [cospi_12_64] "r"(cospi_12_64), [cospi_20_64] "r"(cospi_20_64));
  278. __asm__ __volatile__(
  279. "lh %[load1], 4(%[input]) \n\t"
  280. "lh %[load2], 60(%[input]) \n\t"
  281. "lh %[load3], 36(%[input]) \n\t"
  282. "lh %[load4], 28(%[input]) \n\t"
  283. "mtlo %[const_2_power_13], $ac1 \n\t"
  284. "mthi $zero, $ac1 \n\t"
  285. "mtlo %[const_2_power_13], $ac3 \n\t"
  286. "mthi $zero, $ac3 \n\t"
  287. "madd $ac1, %[load1], %[cospi_30_64] \n\t"
  288. "msub $ac1, %[load2], %[cospi_2_64] \n\t"
  289. "extp %[temp0], $ac1, 31 \n\t"
  290. "madd $ac3, %[load1], %[cospi_2_64] \n\t"
  291. "madd $ac3, %[load2], %[cospi_30_64] \n\t"
  292. "extp %[temp3], $ac3, 31 \n\t"
  293. "mtlo %[const_2_power_13], $ac1 \n\t"
  294. "mthi $zero, $ac1 \n\t"
  295. "mtlo %[const_2_power_13], $ac2 \n\t"
  296. "mthi $zero, $ac2 \n\t"
  297. "madd $ac2, %[load3], %[cospi_14_64] \n\t"
  298. "msub $ac2, %[load4], %[cospi_18_64] \n\t"
  299. "extp %[temp1], $ac2, 31 \n\t"
  300. "madd $ac1, %[load3], %[cospi_18_64] \n\t"
  301. "madd $ac1, %[load4], %[cospi_14_64] \n\t"
  302. "extp %[temp2], $ac1, 31 \n\t"
  303. "mtlo %[const_2_power_13], $ac1 \n\t"
  304. "mthi $zero, $ac1 \n\t"
  305. "mtlo %[const_2_power_13], $ac3 \n\t"
  306. "mthi $zero, $ac3 \n\t"
  307. "sub %[load1], %[temp0], %[temp1] \n\t"
  308. "sub %[load2], %[temp3], %[temp2] \n\t"
  309. "msub $ac1, %[load1], %[cospi_8_64] \n\t"
  310. "madd $ac1, %[load2], %[cospi_24_64] \n\t"
  311. "madd $ac3, %[load1], %[cospi_24_64] \n\t"
  312. "madd $ac3, %[load2], %[cospi_8_64] \n\t"
  313. "extp %[step2_9], $ac1, 31 \n\t"
  314. "extp %[step2_14], $ac3, 31 \n\t"
  315. "add %[step2_8], %[temp0], %[temp1] \n\t"
  316. "add %[step2_15], %[temp2], %[temp3] \n\t"
  317. : [load1] "=&r"(load1), [load2] "=&r"(load2), [load3] "=&r"(load3),
  318. [load4] "=&r"(load4), [temp0] "=&r"(temp0), [temp1] "=&r"(temp1),
  319. [temp2] "=&r"(temp2), [temp3] "=&r"(temp3), [step2_8] "=&r"(step2_8),
  320. [step2_9] "=&r"(step2_9), [step2_14] "=&r"(step2_14),
  321. [step2_15] "=&r"(step2_15)
  322. : [const_2_power_13] "r"(const_2_power_13), [input] "r"(input),
  323. [cospi_30_64] "r"(cospi_30_64), [cospi_2_64] "r"(cospi_2_64),
  324. [cospi_14_64] "r"(cospi_14_64), [cospi_18_64] "r"(cospi_18_64),
  325. [cospi_8_64] "r"(cospi_8_64), [cospi_24_64] "r"(cospi_24_64));
  326. __asm__ __volatile__(
  327. "lh %[load1], 20(%[input]) \n\t"
  328. "lh %[load2], 44(%[input]) \n\t"
  329. "lh %[load3], 52(%[input]) \n\t"
  330. "lh %[load4], 12(%[input]) \n\t"
  331. "mtlo %[const_2_power_13], $ac1 \n\t"
  332. "mthi $zero, $ac1 \n\t"
  333. "mtlo %[const_2_power_13], $ac3 \n\t"
  334. "mthi $zero, $ac3 \n\t"
  335. "madd $ac1, %[load1], %[cospi_22_64] \n\t"
  336. "msub $ac1, %[load2], %[cospi_10_64] \n\t"
  337. "extp %[temp0], $ac1, 31 \n\t"
  338. "madd $ac3, %[load1], %[cospi_10_64] \n\t"
  339. "madd $ac3, %[load2], %[cospi_22_64] \n\t"
  340. "extp %[temp3], $ac3, 31 \n\t"
  341. "mtlo %[const_2_power_13], $ac1 \n\t"
  342. "mthi $zero, $ac1 \n\t"
  343. "mtlo %[const_2_power_13], $ac2 \n\t"
  344. "mthi $zero, $ac2 \n\t"
  345. "madd $ac2, %[load3], %[cospi_6_64] \n\t"
  346. "msub $ac2, %[load4], %[cospi_26_64] \n\t"
  347. "extp %[temp1], $ac2, 31 \n\t"
  348. "madd $ac1, %[load3], %[cospi_26_64] \n\t"
  349. "madd $ac1, %[load4], %[cospi_6_64] \n\t"
  350. "extp %[temp2], $ac1, 31 \n\t"
  351. "mtlo %[const_2_power_13], $ac1 \n\t"
  352. "mthi $zero, $ac1 \n\t"
  353. "mtlo %[const_2_power_13], $ac3 \n\t"
  354. "mthi $zero, $ac3 \n\t"
  355. "sub %[load1], %[temp1], %[temp0] \n\t"
  356. "sub %[load2], %[temp2], %[temp3] \n\t"
  357. "msub $ac1, %[load1], %[cospi_24_64] \n\t"
  358. "msub $ac1, %[load2], %[cospi_8_64] \n\t"
  359. "madd $ac3, %[load2], %[cospi_24_64] \n\t"
  360. "msub $ac3, %[load1], %[cospi_8_64] \n\t"
  361. "extp %[step2_10], $ac1, 31 \n\t"
  362. "extp %[step2_13], $ac3, 31 \n\t"
  363. "add %[step2_11], %[temp0], %[temp1] \n\t"
  364. "add %[step2_12], %[temp2], %[temp3] \n\t"
  365. : [load1] "=&r"(load1), [load2] "=&r"(load2), [load3] "=&r"(load3),
  366. [load4] "=&r"(load4), [temp0] "=&r"(temp0), [temp1] "=&r"(temp1),
  367. [temp2] "=&r"(temp2), [temp3] "=&r"(temp3),
  368. [step2_10] "=&r"(step2_10), [step2_11] "=&r"(step2_11),
  369. [step2_12] "=&r"(step2_12), [step2_13] "=&r"(step2_13)
  370. : [const_2_power_13] "r"(const_2_power_13), [input] "r"(input),
  371. [cospi_22_64] "r"(cospi_22_64), [cospi_10_64] "r"(cospi_10_64),
  372. [cospi_6_64] "r"(cospi_6_64), [cospi_26_64] "r"(cospi_26_64),
  373. [cospi_8_64] "r"(cospi_8_64), [cospi_24_64] "r"(cospi_24_64));
  374. __asm__ __volatile__(
  375. "mtlo %[const_2_power_13], $ac0 \n\t"
  376. "mthi $zero, $ac0 \n\t"
  377. "sub %[temp0], %[step2_14], %[step2_13] \n\t"
  378. "sub %[temp0], %[temp0], %[step2_9] \n\t"
  379. "add %[temp0], %[temp0], %[step2_10] \n\t"
  380. "madd $ac0, %[temp0], %[cospi_16_64] \n\t"
  381. "mtlo %[const_2_power_13], $ac1 \n\t"
  382. "mthi $zero, $ac1 \n\t"
  383. "sub %[temp1], %[step2_14], %[step2_13] \n\t"
  384. "add %[temp1], %[temp1], %[step2_9] \n\t"
  385. "sub %[temp1], %[temp1], %[step2_10] \n\t"
  386. "madd $ac1, %[temp1], %[cospi_16_64] \n\t"
  387. "mtlo %[const_2_power_13], $ac2 \n\t"
  388. "mthi $zero, $ac2 \n\t"
  389. "sub %[temp0], %[step2_15], %[step2_12] \n\t"
  390. "sub %[temp0], %[temp0], %[step2_8] \n\t"
  391. "add %[temp0], %[temp0], %[step2_11] \n\t"
  392. "madd $ac2, %[temp0], %[cospi_16_64] \n\t"
  393. "mtlo %[const_2_power_13], $ac3 \n\t"
  394. "mthi $zero, $ac3 \n\t"
  395. "sub %[temp1], %[step2_15], %[step2_12] \n\t"
  396. "add %[temp1], %[temp1], %[step2_8] \n\t"
  397. "sub %[temp1], %[temp1], %[step2_11] \n\t"
  398. "madd $ac3, %[temp1], %[cospi_16_64] \n\t"
  399. "add %[step3_8], %[step2_8], %[step2_11] \n\t"
  400. "add %[step3_9], %[step2_9], %[step2_10] \n\t"
  401. "add %[step3_14], %[step2_13], %[step2_14] \n\t"
  402. "add %[step3_15], %[step2_12], %[step2_15] \n\t"
  403. "extp %[step3_10], $ac0, 31 \n\t"
  404. "extp %[step3_13], $ac1, 31 \n\t"
  405. "extp %[step3_11], $ac2, 31 \n\t"
  406. "extp %[step3_12], $ac3, 31 \n\t"
  407. : [temp0] "=&r"(temp0), [temp1] "=&r"(temp1), [step3_8] "=&r"(step3_8),
  408. [step3_9] "=&r"(step3_9), [step3_10] "=&r"(step3_10),
  409. [step3_11] "=&r"(step3_11), [step3_12] "=&r"(step3_12),
  410. [step3_13] "=&r"(step3_13), [step3_14] "=&r"(step3_14),
  411. [step3_15] "=&r"(step3_15)
  412. : [const_2_power_13] "r"(const_2_power_13), [step2_8] "r"(step2_8),
  413. [step2_9] "r"(step2_9), [step2_10] "r"(step2_10),
  414. [step2_11] "r"(step2_11), [step2_12] "r"(step2_12),
  415. [step2_13] "r"(step2_13), [step2_14] "r"(step2_14),
  416. [step2_15] "r"(step2_15), [cospi_16_64] "r"(cospi_16_64));
  417. __asm__ __volatile__(
  418. "mtlo %[const_2_power_13], $ac0 \n\t"
  419. "mthi $zero, $ac0 \n\t"
  420. "mtlo %[const_2_power_13], $ac1 \n\t"
  421. "mthi $zero, $ac1 \n\t"
  422. "sub %[temp0], %[step1_17], %[step1_18] \n\t"
  423. "sub %[temp1], %[step1_30], %[step1_29] \n\t"
  424. "add %[step3_17], %[step1_17], %[step1_18] \n\t"
  425. "add %[step3_30], %[step1_30], %[step1_29] \n\t"
  426. "msub $ac0, %[temp0], %[cospi_8_64] \n\t"
  427. "madd $ac0, %[temp1], %[cospi_24_64] \n\t"
  428. "extp %[step3_18], $ac0, 31 \n\t"
  429. "madd $ac1, %[temp0], %[cospi_24_64] \n\t"
  430. "madd $ac1, %[temp1], %[cospi_8_64] \n\t"
  431. "extp %[step3_29], $ac1, 31 \n\t"
  432. : [temp0] "=&r"(temp0), [temp1] "=&r"(temp1),
  433. [step3_18] "=&r"(step3_18), [step3_29] "=&r"(step3_29),
  434. [step3_17] "=&r"(step3_17), [step3_30] "=&r"(step3_30)
  435. : [const_2_power_13] "r"(const_2_power_13), [step1_17] "r"(step1_17),
  436. [step1_18] "r"(step1_18), [step1_30] "r"(step1_30),
  437. [step1_29] "r"(step1_29), [cospi_24_64] "r"(cospi_24_64),
  438. [cospi_8_64] "r"(cospi_8_64));
  439. __asm__ __volatile__(
  440. "mtlo %[const_2_power_13], $ac0 \n\t"
  441. "mthi $zero, $ac0 \n\t"
  442. "mtlo %[const_2_power_13], $ac1 \n\t"
  443. "mthi $zero, $ac1 \n\t"
  444. "sub %[temp0], %[step1_16], %[step1_19] \n\t"
  445. "sub %[temp1], %[step1_31], %[step1_28] \n\t"
  446. "add %[step3_16], %[step1_16], %[step1_19] \n\t"
  447. "add %[step3_31], %[step1_31], %[step1_28] \n\t"
  448. "msub $ac0, %[temp0], %[cospi_8_64] \n\t"
  449. "madd $ac0, %[temp1], %[cospi_24_64] \n\t"
  450. "extp %[step3_19], $ac0, 31 \n\t"
  451. "madd $ac1, %[temp0], %[cospi_24_64] \n\t"
  452. "madd $ac1, %[temp1], %[cospi_8_64] \n\t"
  453. "extp %[step3_28], $ac1, 31 \n\t"
  454. : [temp0] "=&r"(temp0), [temp1] "=&r"(temp1),
  455. [step3_16] "=&r"(step3_16), [step3_31] "=&r"(step3_31),
  456. [step3_19] "=&r"(step3_19), [step3_28] "=&r"(step3_28)
  457. : [const_2_power_13] "r"(const_2_power_13), [step1_16] "r"(step1_16),
  458. [step1_19] "r"(step1_19), [step1_31] "r"(step1_31),
  459. [step1_28] "r"(step1_28), [cospi_24_64] "r"(cospi_24_64),
  460. [cospi_8_64] "r"(cospi_8_64));
  461. __asm__ __volatile__(
  462. "mtlo %[const_2_power_13], $ac0 \n\t"
  463. "mthi $zero, $ac0 \n\t"
  464. "mtlo %[const_2_power_13], $ac1 \n\t"
  465. "mthi $zero, $ac1 \n\t"
  466. "sub %[temp0], %[step1_23], %[step1_20] \n\t"
  467. "sub %[temp1], %[step1_24], %[step1_27] \n\t"
  468. "add %[step3_23], %[step1_23], %[step1_20] \n\t"
  469. "add %[step3_24], %[step1_24], %[step1_27] \n\t"
  470. "msub $ac0, %[temp0], %[cospi_8_64] \n\t"
  471. "madd $ac0, %[temp1], %[cospi_24_64] \n\t"
  472. "extp %[step3_27], $ac0, 31 \n\t"
  473. "msub $ac1, %[temp0], %[cospi_24_64] \n\t"
  474. "msub $ac1, %[temp1], %[cospi_8_64] \n\t"
  475. "extp %[step3_20], $ac1, 31 \n\t"
  476. : [temp0] "=&r"(temp0), [temp1] "=&r"(temp1),
  477. [step3_23] "=&r"(step3_23), [step3_24] "=&r"(step3_24),
  478. [step3_20] "=&r"(step3_20), [step3_27] "=&r"(step3_27)
  479. : [const_2_power_13] "r"(const_2_power_13), [step1_23] "r"(step1_23),
  480. [step1_20] "r"(step1_20), [step1_24] "r"(step1_24),
  481. [step1_27] "r"(step1_27), [cospi_24_64] "r"(cospi_24_64),
  482. [cospi_8_64] "r"(cospi_8_64));
  483. __asm__ __volatile__(
  484. "mtlo %[const_2_power_13], $ac0 \n\t"
  485. "mthi $zero, $ac0 \n\t"
  486. "mtlo %[const_2_power_13], $ac1 \n\t"
  487. "mthi $zero, $ac1 \n\t"
  488. "sub %[temp0], %[step1_22], %[step1_21] \n\t"
  489. "sub %[temp1], %[step1_25], %[step1_26] \n\t"
  490. "add %[step3_22], %[step1_22], %[step1_21] \n\t"
  491. "add %[step3_25], %[step1_25], %[step1_26] \n\t"
  492. "msub $ac0, %[temp0], %[cospi_24_64] \n\t"
  493. "msub $ac0, %[temp1], %[cospi_8_64] \n\t"
  494. "extp %[step3_21], $ac0, 31 \n\t"
  495. "msub $ac1, %[temp0], %[cospi_8_64] \n\t"
  496. "madd $ac1, %[temp1], %[cospi_24_64] \n\t"
  497. "extp %[step3_26], $ac1, 31 \n\t"
  498. : [temp0] "=&r"(temp0), [temp1] "=&r"(temp1),
  499. [step3_22] "=&r"(step3_22), [step3_25] "=&r"(step3_25),
  500. [step3_21] "=&r"(step3_21), [step3_26] "=&r"(step3_26)
  501. : [const_2_power_13] "r"(const_2_power_13), [step1_22] "r"(step1_22),
  502. [step1_21] "r"(step1_21), [step1_25] "r"(step1_25),
  503. [step1_26] "r"(step1_26), [cospi_24_64] "r"(cospi_24_64),
  504. [cospi_8_64] "r"(cospi_8_64));
  505. __asm__ __volatile__(
  506. "add %[step2_16], %[step3_16], %[step3_23] \n\t"
  507. "add %[step2_17], %[step3_17], %[step3_22] \n\t"
  508. "add %[step2_18], %[step3_18], %[step3_21] \n\t"
  509. "add %[step2_19], %[step3_19], %[step3_20] \n\t"
  510. "sub %[step2_20], %[step3_19], %[step3_20] \n\t"
  511. "sub %[step2_21], %[step3_18], %[step3_21] \n\t"
  512. "sub %[step2_22], %[step3_17], %[step3_22] \n\t"
  513. "sub %[step2_23], %[step3_16], %[step3_23] \n\t"
  514. : [step2_16] "=&r"(step2_16), [step2_17] "=&r"(step2_17),
  515. [step2_18] "=&r"(step2_18), [step2_19] "=&r"(step2_19),
  516. [step2_20] "=&r"(step2_20), [step2_21] "=&r"(step2_21),
  517. [step2_22] "=&r"(step2_22), [step2_23] "=&r"(step2_23)
  518. : [step3_16] "r"(step3_16), [step3_23] "r"(step3_23),
  519. [step3_17] "r"(step3_17), [step3_22] "r"(step3_22),
  520. [step3_18] "r"(step3_18), [step3_21] "r"(step3_21),
  521. [step3_19] "r"(step3_19), [step3_20] "r"(step3_20));
  522. __asm__ __volatile__(
  523. "sub %[step2_24], %[step3_31], %[step3_24] \n\t"
  524. "sub %[step2_25], %[step3_30], %[step3_25] \n\t"
  525. "sub %[step2_26], %[step3_29], %[step3_26] \n\t"
  526. "sub %[step2_27], %[step3_28], %[step3_27] \n\t"
  527. "add %[step2_28], %[step3_28], %[step3_27] \n\t"
  528. "add %[step2_29], %[step3_29], %[step3_26] \n\t"
  529. "add %[step2_30], %[step3_30], %[step3_25] \n\t"
  530. "add %[step2_31], %[step3_31], %[step3_24] \n\t"
  531. : [step2_24] "=&r"(step2_24), [step2_28] "=&r"(step2_28),
  532. [step2_25] "=&r"(step2_25), [step2_29] "=&r"(step2_29),
  533. [step2_26] "=&r"(step2_26), [step2_30] "=&r"(step2_30),
  534. [step2_27] "=&r"(step2_27), [step2_31] "=&r"(step2_31)
  535. : [step3_31] "r"(step3_31), [step3_24] "r"(step3_24),
  536. [step3_30] "r"(step3_30), [step3_25] "r"(step3_25),
  537. [step3_29] "r"(step3_29), [step3_26] "r"(step3_26),
  538. [step3_28] "r"(step3_28), [step3_27] "r"(step3_27));
  539. __asm__ __volatile__(
  540. "lh %[load1], 0(%[input]) \n\t"
  541. "lh %[load2], 32(%[input]) \n\t"
  542. "lh %[load3], 16(%[input]) \n\t"
  543. "lh %[load4], 48(%[input]) \n\t"
  544. "mtlo %[const_2_power_13], $ac1 \n\t"
  545. "mthi $zero, $ac1 \n\t"
  546. "mtlo %[const_2_power_13], $ac2 \n\t"
  547. "mthi $zero, $ac2 \n\t"
  548. "add %[result1], %[load1], %[load2] \n\t"
  549. "sub %[result2], %[load1], %[load2] \n\t"
  550. "madd $ac1, %[result1], %[cospi_16_64] \n\t"
  551. "madd $ac2, %[result2], %[cospi_16_64] \n\t"
  552. "extp %[temp0], $ac1, 31 \n\t"
  553. "extp %[temp1], $ac2, 31 \n\t"
  554. "mtlo %[const_2_power_13], $ac3 \n\t"
  555. "mthi $zero, $ac3 \n\t"
  556. "madd $ac3, %[load3], %[cospi_24_64] \n\t"
  557. "msub $ac3, %[load4], %[cospi_8_64] \n\t"
  558. "extp %[temp2], $ac3, 31 \n\t"
  559. "mtlo %[const_2_power_13], $ac1 \n\t"
  560. "mthi $zero, $ac1 \n\t"
  561. "madd $ac1, %[load3], %[cospi_8_64] \n\t"
  562. "madd $ac1, %[load4], %[cospi_24_64] \n\t"
  563. "extp %[temp3], $ac1, 31 \n\t"
  564. "add %[step1_0], %[temp0], %[temp3] \n\t"
  565. "add %[step1_1], %[temp1], %[temp2] \n\t"
  566. "sub %[step1_2], %[temp1], %[temp2] \n\t"
  567. "sub %[step1_3], %[temp0], %[temp3] \n\t"
  568. : [load1] "=&r"(load1), [load2] "=&r"(load2), [load3] "=&r"(load3),
  569. [load4] "=&r"(load4), [result1] "=&r"(result1),
  570. [result2] "=&r"(result2), [temp0] "=&r"(temp0), [temp1] "=&r"(temp1),
  571. [temp2] "=&r"(temp2), [temp3] "=&r"(temp3), [step1_0] "=&r"(step1_0),
  572. [step1_1] "=&r"(step1_1), [step1_2] "=&r"(step1_2),
  573. [step1_3] "=&r"(step1_3)
  574. : [const_2_power_13] "r"(const_2_power_13), [input] "r"(input),
  575. [cospi_24_64] "r"(cospi_24_64), [cospi_8_64] "r"(cospi_8_64),
  576. [cospi_16_64] "r"(cospi_16_64));
  577. __asm__ __volatile__(
  578. "lh %[load1], 8(%[input]) \n\t"
  579. "lh %[load2], 56(%[input]) \n\t"
  580. "lh %[load3], 40(%[input]) \n\t"
  581. "lh %[load4], 24(%[input]) \n\t"
  582. "mtlo %[const_2_power_13], $ac1 \n\t"
  583. "mthi $zero, $ac1 \n\t"
  584. "mtlo %[const_2_power_13], $ac3 \n\t"
  585. "mthi $zero, $ac3 \n\t"
  586. "madd $ac1, %[load1], %[cospi_28_64] \n\t"
  587. "msub $ac1, %[load2], %[cospi_4_64] \n\t"
  588. "extp %[temp0], $ac1, 31 \n\t"
  589. "madd $ac3, %[load1], %[cospi_4_64] \n\t"
  590. "madd $ac3, %[load2], %[cospi_28_64] \n\t"
  591. "extp %[temp3], $ac3, 31 \n\t"
  592. "mtlo %[const_2_power_13], $ac1 \n\t"
  593. "mthi $zero, $ac1 \n\t"
  594. "mtlo %[const_2_power_13], $ac2 \n\t"
  595. "mthi $zero, $ac2 \n\t"
  596. "madd $ac2, %[load3], %[cospi_12_64] \n\t"
  597. "msub $ac2, %[load4], %[cospi_20_64] \n\t"
  598. "extp %[temp1], $ac2, 31 \n\t"
  599. "madd $ac1, %[load3], %[cospi_20_64] \n\t"
  600. "madd $ac1, %[load4], %[cospi_12_64] \n\t"
  601. "extp %[temp2], $ac1, 31 \n\t"
  602. "mtlo %[const_2_power_13], $ac1 \n\t"
  603. "mthi $zero, $ac1 \n\t"
  604. "mtlo %[const_2_power_13], $ac3 \n\t"
  605. "mthi $zero, $ac3 \n\t"
  606. "sub %[load1], %[temp3], %[temp2] \n\t"
  607. "sub %[load1], %[load1], %[temp0] \n\t"
  608. "add %[load1], %[load1], %[temp1] \n\t"
  609. "sub %[load2], %[temp0], %[temp1] \n\t"
  610. "sub %[load2], %[load2], %[temp2] \n\t"
  611. "add %[load2], %[load2], %[temp3] \n\t"
  612. "madd $ac1, %[load1], %[cospi_16_64] \n\t"
  613. "madd $ac3, %[load2], %[cospi_16_64] \n\t"
  614. "extp %[step1_5], $ac1, 31 \n\t"
  615. "extp %[step1_6], $ac3, 31 \n\t"
  616. "add %[step1_4], %[temp0], %[temp1] \n\t"
  617. "add %[step1_7], %[temp3], %[temp2] \n\t"
  618. : [load1] "=&r"(load1), [load2] "=&r"(load2), [load3] "=&r"(load3),
  619. [load4] "=&r"(load4), [temp0] "=&r"(temp0), [temp1] "=&r"(temp1),
  620. [temp2] "=&r"(temp2), [temp3] "=&r"(temp3), [step1_4] "=&r"(step1_4),
  621. [step1_5] "=&r"(step1_5), [step1_6] "=&r"(step1_6),
  622. [step1_7] "=&r"(step1_7)
  623. : [const_2_power_13] "r"(const_2_power_13), [input] "r"(input),
  624. [cospi_20_64] "r"(cospi_20_64), [cospi_12_64] "r"(cospi_12_64),
  625. [cospi_4_64] "r"(cospi_4_64), [cospi_28_64] "r"(cospi_28_64),
  626. [cospi_16_64] "r"(cospi_16_64));
  627. __asm__ __volatile__(
  628. "add %[step2_0], %[step1_0], %[step1_7] \n\t"
  629. "add %[step2_1], %[step1_1], %[step1_6] \n\t"
  630. "add %[step2_2], %[step1_2], %[step1_5] \n\t"
  631. "add %[step2_3], %[step1_3], %[step1_4] \n\t"
  632. "sub %[step2_4], %[step1_3], %[step1_4] \n\t"
  633. "sub %[step2_5], %[step1_2], %[step1_5] \n\t"
  634. "sub %[step2_6], %[step1_1], %[step1_6] \n\t"
  635. "sub %[step2_7], %[step1_0], %[step1_7] \n\t"
  636. : [step2_0] "=&r"(step2_0), [step2_4] "=&r"(step2_4),
  637. [step2_1] "=&r"(step2_1), [step2_5] "=&r"(step2_5),
  638. [step2_2] "=&r"(step2_2), [step2_6] "=&r"(step2_6),
  639. [step2_3] "=&r"(step2_3), [step2_7] "=&r"(step2_7)
  640. : [step1_0] "r"(step1_0), [step1_7] "r"(step1_7),
  641. [step1_1] "r"(step1_1), [step1_6] "r"(step1_6),
  642. [step1_2] "r"(step1_2), [step1_5] "r"(step1_5),
  643. [step1_3] "r"(step1_3), [step1_4] "r"(step1_4));
  644. // stage 7
  645. __asm__ __volatile__(
  646. "add %[step1_0], %[step2_0], %[step3_15] \n\t"
  647. "add %[step1_1], %[step2_1], %[step3_14] \n\t"
  648. "add %[step1_2], %[step2_2], %[step3_13] \n\t"
  649. "add %[step1_3], %[step2_3], %[step3_12] \n\t"
  650. "sub %[step1_12], %[step2_3], %[step3_12] \n\t"
  651. "sub %[step1_13], %[step2_2], %[step3_13] \n\t"
  652. "sub %[step1_14], %[step2_1], %[step3_14] \n\t"
  653. "sub %[step1_15], %[step2_0], %[step3_15] \n\t"
  654. : [step1_0] "=&r"(step1_0), [step1_12] "=&r"(step1_12),
  655. [step1_1] "=&r"(step1_1), [step1_13] "=&r"(step1_13),
  656. [step1_2] "=&r"(step1_2), [step1_14] "=&r"(step1_14),
  657. [step1_3] "=&r"(step1_3), [step1_15] "=&r"(step1_15)
  658. : [step2_0] "r"(step2_0), [step3_15] "r"(step3_15),
  659. [step2_1] "r"(step2_1), [step3_14] "r"(step3_14),
  660. [step2_2] "r"(step2_2), [step3_13] "r"(step3_13),
  661. [step2_3] "r"(step2_3), [step3_12] "r"(step3_12));
  662. __asm__ __volatile__(
  663. "add %[step1_4], %[step2_4], %[step3_11] \n\t"
  664. "add %[step1_5], %[step2_5], %[step3_10] \n\t"
  665. "add %[step1_6], %[step2_6], %[step3_9] \n\t"
  666. "add %[step1_7], %[step2_7], %[step3_8] \n\t"
  667. "sub %[step1_8], %[step2_7], %[step3_8] \n\t"
  668. "sub %[step1_9], %[step2_6], %[step3_9] \n\t"
  669. "sub %[step1_10], %[step2_5], %[step3_10] \n\t"
  670. "sub %[step1_11], %[step2_4], %[step3_11] \n\t"
  671. : [step1_4] "=&r"(step1_4), [step1_8] "=&r"(step1_8),
  672. [step1_5] "=&r"(step1_5), [step1_9] "=&r"(step1_9),
  673. [step1_6] "=&r"(step1_6), [step1_10] "=&r"(step1_10),
  674. [step1_7] "=&r"(step1_7), [step1_11] "=&r"(step1_11)
  675. : [step2_4] "r"(step2_4), [step3_11] "r"(step3_11),
  676. [step2_5] "r"(step2_5), [step3_10] "r"(step3_10),
  677. [step2_6] "r"(step2_6), [step3_9] "r"(step3_9),
  678. [step2_7] "r"(step2_7), [step3_8] "r"(step3_8));
  679. __asm__ __volatile__(
  680. "sub %[temp0], %[step2_27], %[step2_20] \n\t"
  681. "add %[temp1], %[step2_27], %[step2_20] \n\t"
  682. "sub %[temp2], %[step2_26], %[step2_21] \n\t"
  683. "add %[temp3], %[step2_26], %[step2_21] \n\t"
  684. "mtlo %[const_2_power_13], $ac0 \n\t"
  685. "mthi $zero, $ac0 \n\t"
  686. "mtlo %[const_2_power_13], $ac1 \n\t"
  687. "mthi $zero, $ac1 \n\t"
  688. "mtlo %[const_2_power_13], $ac2 \n\t"
  689. "mthi $zero, $ac2 \n\t"
  690. "mtlo %[const_2_power_13], $ac3 \n\t"
  691. "mthi $zero, $ac3 \n\t"
  692. "madd $ac0, %[temp0], %[cospi_16_64] \n\t"
  693. "madd $ac1, %[temp1], %[cospi_16_64] \n\t"
  694. "madd $ac2, %[temp2], %[cospi_16_64] \n\t"
  695. "madd $ac3, %[temp3], %[cospi_16_64] \n\t"
  696. "extp %[step1_20], $ac0, 31 \n\t"
  697. "extp %[step1_27], $ac1, 31 \n\t"
  698. "extp %[step1_21], $ac2, 31 \n\t"
  699. "extp %[step1_26], $ac3, 31 \n\t"
  700. : [temp0] "=&r"(temp0), [temp1] "=&r"(temp1), [temp2] "=&r"(temp2),
  701. [temp3] "=&r"(temp3), [step1_20] "=&r"(step1_20),
  702. [step1_27] "=&r"(step1_27), [step1_21] "=&r"(step1_21),
  703. [step1_26] "=&r"(step1_26)
  704. : [const_2_power_13] "r"(const_2_power_13), [step2_20] "r"(step2_20),
  705. [step2_27] "r"(step2_27), [step2_21] "r"(step2_21),
  706. [step2_26] "r"(step2_26), [cospi_16_64] "r"(cospi_16_64));
  707. __asm__ __volatile__(
  708. "sub %[temp0], %[step2_25], %[step2_22] \n\t"
  709. "add %[temp1], %[step2_25], %[step2_22] \n\t"
  710. "sub %[temp2], %[step2_24], %[step2_23] \n\t"
  711. "add %[temp3], %[step2_24], %[step2_23] \n\t"
  712. "mtlo %[const_2_power_13], $ac0 \n\t"
  713. "mthi $zero, $ac0 \n\t"
  714. "mtlo %[const_2_power_13], $ac1 \n\t"
  715. "mthi $zero, $ac1 \n\t"
  716. "mtlo %[const_2_power_13], $ac2 \n\t"
  717. "mthi $zero, $ac2 \n\t"
  718. "mtlo %[const_2_power_13], $ac3 \n\t"
  719. "mthi $zero, $ac3 \n\t"
  720. "madd $ac0, %[temp0], %[cospi_16_64] \n\t"
  721. "madd $ac1, %[temp1], %[cospi_16_64] \n\t"
  722. "madd $ac2, %[temp2], %[cospi_16_64] \n\t"
  723. "madd $ac3, %[temp3], %[cospi_16_64] \n\t"
  724. "extp %[step1_22], $ac0, 31 \n\t"
  725. "extp %[step1_25], $ac1, 31 \n\t"
  726. "extp %[step1_23], $ac2, 31 \n\t"
  727. "extp %[step1_24], $ac3, 31 \n\t"
  728. : [temp0] "=&r"(temp0), [temp1] "=&r"(temp1), [temp2] "=&r"(temp2),
  729. [temp3] "=&r"(temp3), [step1_22] "=&r"(step1_22),
  730. [step1_25] "=&r"(step1_25), [step1_23] "=&r"(step1_23),
  731. [step1_24] "=&r"(step1_24)
  732. : [const_2_power_13] "r"(const_2_power_13), [step2_22] "r"(step2_22),
  733. [step2_25] "r"(step2_25), [step2_23] "r"(step2_23),
  734. [step2_24] "r"(step2_24), [cospi_16_64] "r"(cospi_16_64));
  735. // final stage
  736. __asm__ __volatile__(
  737. "add %[temp0], %[step1_0], %[step2_31] \n\t"
  738. "add %[temp1], %[step1_1], %[step2_30] \n\t"
  739. "add %[temp2], %[step1_2], %[step2_29] \n\t"
  740. "add %[temp3], %[step1_3], %[step2_28] \n\t"
  741. "sub %[load1], %[step1_3], %[step2_28] \n\t"
  742. "sub %[load2], %[step1_2], %[step2_29] \n\t"
  743. "sub %[load3], %[step1_1], %[step2_30] \n\t"
  744. "sub %[load4], %[step1_0], %[step2_31] \n\t"
  745. "sh %[temp0], 0(%[output]) \n\t"
  746. "sh %[temp1], 64(%[output]) \n\t"
  747. "sh %[temp2], 128(%[output]) \n\t"
  748. "sh %[temp3], 192(%[output]) \n\t"
  749. "sh %[load1], 1792(%[output]) \n\t"
  750. "sh %[load2], 1856(%[output]) \n\t"
  751. "sh %[load3], 1920(%[output]) \n\t"
  752. "sh %[load4], 1984(%[output]) \n\t"
  753. : [temp0] "=&r"(temp0), [load1] "=&r"(load1), [temp1] "=&r"(temp1),
  754. [load2] "=&r"(load2), [temp2] "=&r"(temp2), [load3] "=&r"(load3),
  755. [temp3] "=&r"(temp3), [load4] "=&r"(load4)
  756. : [step1_0] "r"(step1_0), [step2_31] "r"(step2_31),
  757. [step1_1] "r"(step1_1), [step2_30] "r"(step2_30),
  758. [step1_2] "r"(step1_2), [step2_29] "r"(step2_29),
  759. [step1_3] "r"(step1_3), [step2_28] "r"(step2_28),
  760. [output] "r"(output));
  761. __asm__ __volatile__(
  762. "add %[temp0], %[step1_4], %[step1_27] \n\t"
  763. "add %[temp1], %[step1_5], %[step1_26] \n\t"
  764. "add %[temp2], %[step1_6], %[step1_25] \n\t"
  765. "add %[temp3], %[step1_7], %[step1_24] \n\t"
  766. "sub %[load1], %[step1_7], %[step1_24] \n\t"
  767. "sub %[load2], %[step1_6], %[step1_25] \n\t"
  768. "sub %[load3], %[step1_5], %[step1_26] \n\t"
  769. "sub %[load4], %[step1_4], %[step1_27] \n\t"
  770. "sh %[temp0], 256(%[output]) \n\t"
  771. "sh %[temp1], 320(%[output]) \n\t"
  772. "sh %[temp2], 384(%[output]) \n\t"
  773. "sh %[temp3], 448(%[output]) \n\t"
  774. "sh %[load1], 1536(%[output]) \n\t"
  775. "sh %[load2], 1600(%[output]) \n\t"
  776. "sh %[load3], 1664(%[output]) \n\t"
  777. "sh %[load4], 1728(%[output]) \n\t"
  778. : [temp0] "=&r"(temp0), [load1] "=&r"(load1), [temp1] "=&r"(temp1),
  779. [load2] "=&r"(load2), [temp2] "=&r"(temp2), [load3] "=&r"(load3),
  780. [temp3] "=&r"(temp3), [load4] "=&r"(load4)
  781. : [step1_4] "r"(step1_4), [step1_27] "r"(step1_27),
  782. [step1_5] "r"(step1_5), [step1_26] "r"(step1_26),
  783. [step1_6] "r"(step1_6), [step1_25] "r"(step1_25),
  784. [step1_7] "r"(step1_7), [step1_24] "r"(step1_24),
  785. [output] "r"(output));
  786. __asm__ __volatile__(
  787. "add %[temp0], %[step1_8], %[step1_23] \n\t"
  788. "add %[temp1], %[step1_9], %[step1_22] \n\t"
  789. "add %[temp2], %[step1_10], %[step1_21] \n\t"
  790. "add %[temp3], %[step1_11], %[step1_20] \n\t"
  791. "sub %[load1], %[step1_11], %[step1_20] \n\t"
  792. "sub %[load2], %[step1_10], %[step1_21] \n\t"
  793. "sub %[load3], %[step1_9], %[step1_22] \n\t"
  794. "sub %[load4], %[step1_8], %[step1_23] \n\t"
  795. "sh %[temp0], 512(%[output]) \n\t"
  796. "sh %[temp1], 576(%[output]) \n\t"
  797. "sh %[temp2], 640(%[output]) \n\t"
  798. "sh %[temp3], 704(%[output]) \n\t"
  799. "sh %[load1], 1280(%[output]) \n\t"
  800. "sh %[load2], 1344(%[output]) \n\t"
  801. "sh %[load3], 1408(%[output]) \n\t"
  802. "sh %[load4], 1472(%[output]) \n\t"
  803. : [temp0] "=&r"(temp0), [load1] "=&r"(load1), [temp1] "=&r"(temp1),
  804. [load2] "=&r"(load2), [temp2] "=&r"(temp2), [load3] "=&r"(load3),
  805. [temp3] "=&r"(temp3), [load4] "=&r"(load4)
  806. : [step1_8] "r"(step1_8), [step1_23] "r"(step1_23),
  807. [step1_9] "r"(step1_9), [step1_22] "r"(step1_22),
  808. [step1_10] "r"(step1_10), [step1_21] "r"(step1_21),
  809. [step1_11] "r"(step1_11), [step1_20] "r"(step1_20),
  810. [output] "r"(output));
  811. __asm__ __volatile__(
  812. "add %[temp0], %[step1_12], %[step2_19] \n\t"
  813. "add %[temp1], %[step1_13], %[step2_18] \n\t"
  814. "add %[temp2], %[step1_14], %[step2_17] \n\t"
  815. "add %[temp3], %[step1_15], %[step2_16] \n\t"
  816. "sub %[load1], %[step1_15], %[step2_16] \n\t"
  817. "sub %[load2], %[step1_14], %[step2_17] \n\t"
  818. "sub %[load3], %[step1_13], %[step2_18] \n\t"
  819. "sub %[load4], %[step1_12], %[step2_19] \n\t"
  820. "sh %[temp0], 768(%[output]) \n\t"
  821. "sh %[temp1], 832(%[output]) \n\t"
  822. "sh %[temp2], 896(%[output]) \n\t"
  823. "sh %[temp3], 960(%[output]) \n\t"
  824. "sh %[load1], 1024(%[output]) \n\t"
  825. "sh %[load2], 1088(%[output]) \n\t"
  826. "sh %[load3], 1152(%[output]) \n\t"
  827. "sh %[load4], 1216(%[output]) \n\t"
  828. : [temp0] "=&r"(temp0), [load1] "=&r"(load1), [temp1] "=&r"(temp1),
  829. [load2] "=&r"(load2), [temp2] "=&r"(temp2), [load3] "=&r"(load3),
  830. [temp3] "=&r"(temp3), [load4] "=&r"(load4)
  831. : [step1_12] "r"(step1_12), [step2_19] "r"(step2_19),
  832. [step1_13] "r"(step1_13), [step2_18] "r"(step2_18),
  833. [step1_14] "r"(step1_14), [step2_17] "r"(step2_17),
  834. [step1_15] "r"(step1_15), [step2_16] "r"(step2_16),
  835. [output] "r"(output));
  836. input += 32;
  837. output += 1;
  838. }
  839. }
  840. void vpx_idct32x32_1024_add_dspr2(const int16_t *input, uint8_t *dest,
  841. int stride) {
  842. DECLARE_ALIGNED(32, int16_t, out[32 * 32]);
  843. int16_t *outptr = out;
  844. uint32_t pos = 45;
  845. /* bit positon for extract from acc */
  846. __asm__ __volatile__("wrdsp %[pos], 1 \n\t"
  847. :
  848. : [pos] "r"(pos));
  849. // Rows
  850. idct32_rows_dspr2(input, outptr, 32);
  851. // Columns
  852. vpx_idct32_cols_add_blk_dspr2(out, dest, stride);
  853. }
  854. void vpx_idct32x32_34_add_dspr2(const int16_t *input, uint8_t *dest,
  855. int stride) {
  856. DECLARE_ALIGNED(32, int16_t, out[32 * 32]);
  857. int16_t *outptr = out;
  858. uint32_t i;
  859. uint32_t pos = 45;
  860. /* bit positon for extract from acc */
  861. __asm__ __volatile__("wrdsp %[pos], 1 \n\t"
  862. :
  863. : [pos] "r"(pos));
  864. // Rows
  865. idct32_rows_dspr2(input, outptr, 8);
  866. outptr += 8;
  867. __asm__ __volatile__(
  868. "sw $zero, 0(%[outptr]) \n\t"
  869. "sw $zero, 4(%[outptr]) \n\t"
  870. "sw $zero, 8(%[outptr]) \n\t"
  871. "sw $zero, 12(%[outptr]) \n\t"
  872. "sw $zero, 16(%[outptr]) \n\t"
  873. "sw $zero, 20(%[outptr]) \n\t"
  874. "sw $zero, 24(%[outptr]) \n\t"
  875. "sw $zero, 28(%[outptr]) \n\t"
  876. "sw $zero, 32(%[outptr]) \n\t"
  877. "sw $zero, 36(%[outptr]) \n\t"
  878. "sw $zero, 40(%[outptr]) \n\t"
  879. "sw $zero, 44(%[outptr]) \n\t"
  880. :
  881. : [outptr] "r"(outptr));
  882. for (i = 0; i < 31; ++i) {
  883. outptr += 32;
  884. __asm__ __volatile__(
  885. "sw $zero, 0(%[outptr]) \n\t"
  886. "sw $zero, 4(%[outptr]) \n\t"
  887. "sw $zero, 8(%[outptr]) \n\t"
  888. "sw $zero, 12(%[outptr]) \n\t"
  889. "sw $zero, 16(%[outptr]) \n\t"
  890. "sw $zero, 20(%[outptr]) \n\t"
  891. "sw $zero, 24(%[outptr]) \n\t"
  892. "sw $zero, 28(%[outptr]) \n\t"
  893. "sw $zero, 32(%[outptr]) \n\t"
  894. "sw $zero, 36(%[outptr]) \n\t"
  895. "sw $zero, 40(%[outptr]) \n\t"
  896. "sw $zero, 44(%[outptr]) \n\t"
  897. :
  898. : [outptr] "r"(outptr));
  899. }
  900. // Columns
  901. vpx_idct32_cols_add_blk_dspr2(out, dest, stride);
  902. }
  903. void vpx_idct32x32_1_add_dspr2(const int16_t *input, uint8_t *dest,
  904. int stride) {
  905. int r, out;
  906. int32_t a1, absa1;
  907. int32_t vector_a1;
  908. int32_t t1, t2, t3, t4;
  909. int32_t vector_1, vector_2, vector_3, vector_4;
  910. uint32_t pos = 45;
  911. /* bit positon for extract from acc */
  912. __asm__ __volatile__("wrdsp %[pos], 1 \n\t"
  913. :
  914. : [pos] "r"(pos));
  915. out = DCT_CONST_ROUND_SHIFT_TWICE_COSPI_16_64(input[0]);
  916. __asm__ __volatile__(
  917. "addi %[out], %[out], 32 \n\t"
  918. "sra %[a1], %[out], 6 \n\t"
  919. : [out] "+r"(out), [a1] "=r"(a1)
  920. :);
  921. if (a1 < 0) {
  922. /* use quad-byte
  923. * input and output memory are four byte aligned */
  924. __asm__ __volatile__(
  925. "abs %[absa1], %[a1] \n\t"
  926. "replv.qb %[vector_a1], %[absa1] \n\t"
  927. : [absa1] "=&r"(absa1), [vector_a1] "=&r"(vector_a1)
  928. : [a1] "r"(a1));
  929. for (r = 32; r--;) {
  930. __asm__ __volatile__(
  931. "lw %[t1], 0(%[dest]) \n\t"
  932. "lw %[t2], 4(%[dest]) \n\t"
  933. "lw %[t3], 8(%[dest]) \n\t"
  934. "lw %[t4], 12(%[dest]) \n\t"
  935. "subu_s.qb %[vector_1], %[t1], %[vector_a1] \n\t"
  936. "subu_s.qb %[vector_2], %[t2], %[vector_a1] \n\t"
  937. "subu_s.qb %[vector_3], %[t3], %[vector_a1] \n\t"
  938. "subu_s.qb %[vector_4], %[t4], %[vector_a1] \n\t"
  939. "sw %[vector_1], 0(%[dest]) \n\t"
  940. "sw %[vector_2], 4(%[dest]) \n\t"
  941. "sw %[vector_3], 8(%[dest]) \n\t"
  942. "sw %[vector_4], 12(%[dest]) \n\t"
  943. "lw %[t1], 16(%[dest]) \n\t"
  944. "lw %[t2], 20(%[dest]) \n\t"
  945. "lw %[t3], 24(%[dest]) \n\t"
  946. "lw %[t4], 28(%[dest]) \n\t"
  947. "subu_s.qb %[vector_1], %[t1], %[vector_a1] \n\t"
  948. "subu_s.qb %[vector_2], %[t2], %[vector_a1] \n\t"
  949. "subu_s.qb %[vector_3], %[t3], %[vector_a1] \n\t"
  950. "subu_s.qb %[vector_4], %[t4], %[vector_a1] \n\t"
  951. "sw %[vector_1], 16(%[dest]) \n\t"
  952. "sw %[vector_2], 20(%[dest]) \n\t"
  953. "sw %[vector_3], 24(%[dest]) \n\t"
  954. "sw %[vector_4], 28(%[dest]) \n\t"
  955. "add %[dest], %[dest], %[stride] \n\t"
  956. : [t1] "=&r"(t1), [t2] "=&r"(t2), [t3] "=&r"(t3), [t4] "=&r"(t4),
  957. [vector_1] "=&r"(vector_1), [vector_2] "=&r"(vector_2),
  958. [vector_3] "=&r"(vector_3), [vector_4] "=&r"(vector_4),
  959. [dest] "+&r"(dest)
  960. : [stride] "r"(stride), [vector_a1] "r"(vector_a1));
  961. }
  962. } else if (a1 > 255) {
  963. int32_t a11, a12, vector_a11, vector_a12;
  964. /* use quad-byte
  965. * input and output memory are four byte aligned */
  966. a11 = a1 >> 1;
  967. a12 = a1 - a11;
  968. __asm__ __volatile__(
  969. "replv.qb %[vector_a11], %[a11] \n\t"
  970. "replv.qb %[vector_a12], %[a12] \n\t"
  971. : [vector_a11] "=&r"(vector_a11), [vector_a12] "=&r"(vector_a12)
  972. : [a11] "r"(a11), [a12] "r"(a12));
  973. for (r = 32; r--;) {
  974. __asm__ __volatile__(
  975. "lw %[t1], 0(%[dest]) \n\t"
  976. "lw %[t2], 4(%[dest]) \n\t"
  977. "lw %[t3], 8(%[dest]) \n\t"
  978. "lw %[t4], 12(%[dest]) \n\t"
  979. "addu_s.qb %[vector_1], %[t1], %[vector_a11] \n\t"
  980. "addu_s.qb %[vector_2], %[t2], %[vector_a11] \n\t"
  981. "addu_s.qb %[vector_3], %[t3], %[vector_a11] \n\t"
  982. "addu_s.qb %[vector_4], %[t4], %[vector_a11] \n\t"
  983. "addu_s.qb %[vector_1], %[vector_1], %[vector_a12] \n\t"
  984. "addu_s.qb %[vector_2], %[vector_2], %[vector_a12] \n\t"
  985. "addu_s.qb %[vector_3], %[vector_3], %[vector_a12] \n\t"
  986. "addu_s.qb %[vector_4], %[vector_4], %[vector_a12] \n\t"
  987. "sw %[vector_1], 0(%[dest]) \n\t"
  988. "sw %[vector_2], 4(%[dest]) \n\t"
  989. "sw %[vector_3], 8(%[dest]) \n\t"
  990. "sw %[vector_4], 12(%[dest]) \n\t"
  991. "lw %[t1], 16(%[dest]) \n\t"
  992. "lw %[t2], 20(%[dest]) \n\t"
  993. "lw %[t3], 24(%[dest]) \n\t"
  994. "lw %[t4], 28(%[dest]) \n\t"
  995. "addu_s.qb %[vector_1], %[t1], %[vector_a11] \n\t"
  996. "addu_s.qb %[vector_2], %[t2], %[vector_a11] \n\t"
  997. "addu_s.qb %[vector_3], %[t3], %[vector_a11] \n\t"
  998. "addu_s.qb %[vector_4], %[t4], %[vector_a11] \n\t"
  999. "addu_s.qb %[vector_1], %[vector_1], %[vector_a12] \n\t"
  1000. "addu_s.qb %[vector_2], %[vector_2], %[vector_a12] \n\t"
  1001. "addu_s.qb %[vector_3], %[vector_3], %[vector_a12] \n\t"
  1002. "addu_s.qb %[vector_4], %[vector_4], %[vector_a12] \n\t"
  1003. "sw %[vector_1], 16(%[dest]) \n\t"
  1004. "sw %[vector_2], 20(%[dest]) \n\t"
  1005. "sw %[vector_3], 24(%[dest]) \n\t"
  1006. "sw %[vector_4], 28(%[dest]) \n\t"
  1007. "add %[dest], %[dest], %[stride] \n\t"
  1008. : [t1] "=&r"(t1), [t2] "=&r"(t2), [t3] "=&r"(t3), [t4] "=&r"(t4),
  1009. [vector_1] "=&r"(vector_1), [vector_2] "=&r"(vector_2),
  1010. [vector_3] "=&r"(vector_3), [vector_4] "=&r"(vector_4),
  1011. [dest] "+&r"(dest)
  1012. : [stride] "r"(stride), [vector_a11] "r"(vector_a11),
  1013. [vector_a12] "r"(vector_a12));
  1014. }
  1015. } else {
  1016. /* use quad-byte
  1017. * input and output memory are four byte aligned */
  1018. __asm__ __volatile__("replv.qb %[vector_a1], %[a1] \n\t"
  1019. : [vector_a1] "=&r"(vector_a1)
  1020. : [a1] "r"(a1));
  1021. for (r = 32; r--;) {
  1022. __asm__ __volatile__(
  1023. "lw %[t1], 0(%[dest]) \n\t"
  1024. "lw %[t2], 4(%[dest]) \n\t"
  1025. "lw %[t3], 8(%[dest]) \n\t"
  1026. "lw %[t4], 12(%[dest]) \n\t"
  1027. "addu_s.qb %[vector_1], %[t1], %[vector_a1] \n\t"
  1028. "addu_s.qb %[vector_2], %[t2], %[vector_a1] \n\t"
  1029. "addu_s.qb %[vector_3], %[t3], %[vector_a1] \n\t"
  1030. "addu_s.qb %[vector_4], %[t4], %[vector_a1] \n\t"
  1031. "sw %[vector_1], 0(%[dest]) \n\t"
  1032. "sw %[vector_2], 4(%[dest]) \n\t"
  1033. "sw %[vector_3], 8(%[dest]) \n\t"
  1034. "sw %[vector_4], 12(%[dest]) \n\t"
  1035. "lw %[t1], 16(%[dest]) \n\t"
  1036. "lw %[t2], 20(%[dest]) \n\t"
  1037. "lw %[t3], 24(%[dest]) \n\t"
  1038. "lw %[t4], 28(%[dest]) \n\t"
  1039. "addu_s.qb %[vector_1], %[t1], %[vector_a1] \n\t"
  1040. "addu_s.qb %[vector_2], %[t2], %[vector_a1] \n\t"
  1041. "addu_s.qb %[vector_3], %[t3], %[vector_a1] \n\t"
  1042. "addu_s.qb %[vector_4], %[t4], %[vector_a1] \n\t"
  1043. "sw %[vector_1], 16(%[dest]) \n\t"
  1044. "sw %[vector_2], 20(%[dest]) \n\t"
  1045. "sw %[vector_3], 24(%[dest]) \n\t"
  1046. "sw %[vector_4], 28(%[dest]) \n\t"
  1047. "add %[dest], %[dest], %[stride] \n\t"
  1048. : [t1] "=&r"(t1), [t2] "=&r"(t2), [t3] "=&r"(t3), [t4] "=&r"(t4),
  1049. [vector_1] "=&r"(vector_1), [vector_2] "=&r"(vector_2),
  1050. [vector_3] "=&r"(vector_3), [vector_4] "=&r"(vector_4),
  1051. [dest] "+&r"(dest)
  1052. : [stride] "r"(stride), [vector_a1] "r"(vector_a1));
  1053. }
  1054. }
  1055. }
  1056. #endif // #if HAVE_DSPR2