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.

cgemv_t_4.c 16 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581
  1. /***************************************************************************
  2. Copyright (c) 2014, 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. #include "common.h"
  28. #if defined(HASWELL) || defined(ZEN) || defined (SKYLAKEX) || defined (COOPERLAKE)
  29. #include "cgemv_t_microk_haswell-4.c"
  30. #elif defined(BULLDOZER) || defined(PILEDRIVER) || defined(STEAMROLLER) || defined(EXCAVATOR)
  31. #include "cgemv_t_microk_bulldozer-4.c"
  32. #endif
  33. #define NBMAX 2048
  34. #ifndef HAVE_KERNEL_4x4
  35. static void cgemv_kernel_4x4(BLASLONG n, FLOAT **ap, FLOAT *x, FLOAT *y, FLOAT *alpha)
  36. {
  37. BLASLONG i;
  38. FLOAT *a0,*a1,*a2,*a3;
  39. a0 = ap[0];
  40. a1 = ap[1];
  41. a2 = ap[2];
  42. a3 = ap[3];
  43. FLOAT alpha_r = alpha[0];
  44. FLOAT alpha_i = alpha[1];
  45. FLOAT temp_r0 = 0.0;
  46. FLOAT temp_r1 = 0.0;
  47. FLOAT temp_r2 = 0.0;
  48. FLOAT temp_r3 = 0.0;
  49. FLOAT temp_i0 = 0.0;
  50. FLOAT temp_i1 = 0.0;
  51. FLOAT temp_i2 = 0.0;
  52. FLOAT temp_i3 = 0.0;
  53. for ( i=0; i< 2*n; i+=2 )
  54. {
  55. #if ( !defined(CONJ) && !defined(XCONJ) ) || ( defined(CONJ) && defined(XCONJ) )
  56. temp_r0 += a0[i]*x[i] - a0[i+1]*x[i+1];
  57. temp_i0 += a0[i]*x[i+1] + a0[i+1]*x[i];
  58. temp_r1 += a1[i]*x[i] - a1[i+1]*x[i+1];
  59. temp_i1 += a1[i]*x[i+1] + a1[i+1]*x[i];
  60. temp_r2 += a2[i]*x[i] - a2[i+1]*x[i+1];
  61. temp_i2 += a2[i]*x[i+1] + a2[i+1]*x[i];
  62. temp_r3 += a3[i]*x[i] - a3[i+1]*x[i+1];
  63. temp_i3 += a3[i]*x[i+1] + a3[i+1]*x[i];
  64. #else
  65. temp_r0 += a0[i]*x[i] + a0[i+1]*x[i+1];
  66. temp_i0 += a0[i]*x[i+1] - a0[i+1]*x[i];
  67. temp_r1 += a1[i]*x[i] + a1[i+1]*x[i+1];
  68. temp_i1 += a1[i]*x[i+1] - a1[i+1]*x[i];
  69. temp_r2 += a2[i]*x[i] + a2[i+1]*x[i+1];
  70. temp_i2 += a2[i]*x[i+1] - a2[i+1]*x[i];
  71. temp_r3 += a3[i]*x[i] + a3[i+1]*x[i+1];
  72. temp_i3 += a3[i]*x[i+1] - a3[i+1]*x[i];
  73. #endif
  74. }
  75. #if !defined(XCONJ)
  76. y[0] += alpha_r * temp_r0 - alpha_i * temp_i0;
  77. y[1] += alpha_r * temp_i0 + alpha_i * temp_r0;
  78. y[2] += alpha_r * temp_r1 - alpha_i * temp_i1;
  79. y[3] += alpha_r * temp_i1 + alpha_i * temp_r1;
  80. y[4] += alpha_r * temp_r2 - alpha_i * temp_i2;
  81. y[5] += alpha_r * temp_i2 + alpha_i * temp_r2;
  82. y[6] += alpha_r * temp_r3 - alpha_i * temp_i3;
  83. y[7] += alpha_r * temp_i3 + alpha_i * temp_r3;
  84. #else
  85. y[0] += alpha_r * temp_r0 + alpha_i * temp_i0;
  86. y[1] -= alpha_r * temp_i0 - alpha_i * temp_r0;
  87. y[2] += alpha_r * temp_r1 + alpha_i * temp_i1;
  88. y[3] -= alpha_r * temp_i1 - alpha_i * temp_r1;
  89. y[4] += alpha_r * temp_r2 + alpha_i * temp_i2;
  90. y[5] -= alpha_r * temp_i2 - alpha_i * temp_r2;
  91. y[6] += alpha_r * temp_r3 + alpha_i * temp_i3;
  92. y[7] -= alpha_r * temp_i3 - alpha_i * temp_r3;
  93. #endif
  94. }
  95. #endif
  96. #ifndef HAVE_KERNEL_4x2
  97. static void cgemv_kernel_4x2(BLASLONG n, FLOAT **ap, FLOAT *x, FLOAT *y, FLOAT *alpha)
  98. {
  99. BLASLONG i;
  100. FLOAT *a0,*a1;
  101. a0 = ap[0];
  102. a1 = ap[1];
  103. FLOAT alpha_r = alpha[0];
  104. FLOAT alpha_i = alpha[1];
  105. FLOAT temp_r0 = 0.0;
  106. FLOAT temp_r1 = 0.0;
  107. FLOAT temp_i0 = 0.0;
  108. FLOAT temp_i1 = 0.0;
  109. for ( i=0; i< 2*n; i+=2 )
  110. {
  111. #if ( !defined(CONJ) && !defined(XCONJ) ) || ( defined(CONJ) && defined(XCONJ) )
  112. temp_r0 += a0[i]*x[i] - a0[i+1]*x[i+1];
  113. temp_i0 += a0[i]*x[i+1] + a0[i+1]*x[i];
  114. temp_r1 += a1[i]*x[i] - a1[i+1]*x[i+1];
  115. temp_i1 += a1[i]*x[i+1] + a1[i+1]*x[i];
  116. #else
  117. temp_r0 += a0[i]*x[i] + a0[i+1]*x[i+1];
  118. temp_i0 += a0[i]*x[i+1] - a0[i+1]*x[i];
  119. temp_r1 += a1[i]*x[i] + a1[i+1]*x[i+1];
  120. temp_i1 += a1[i]*x[i+1] - a1[i+1]*x[i];
  121. #endif
  122. }
  123. #if !defined(XCONJ)
  124. y[0] += alpha_r * temp_r0 - alpha_i * temp_i0;
  125. y[1] += alpha_r * temp_i0 + alpha_i * temp_r0;
  126. y[2] += alpha_r * temp_r1 - alpha_i * temp_i1;
  127. y[3] += alpha_r * temp_i1 + alpha_i * temp_r1;
  128. #else
  129. y[0] += alpha_r * temp_r0 + alpha_i * temp_i0;
  130. y[1] -= alpha_r * temp_i0 - alpha_i * temp_r0;
  131. y[2] += alpha_r * temp_r1 + alpha_i * temp_i1;
  132. y[3] -= alpha_r * temp_i1 - alpha_i * temp_r1;
  133. #endif
  134. }
  135. #endif
  136. #ifndef HAVE_KERNEL_4x1
  137. static void cgemv_kernel_4x1(BLASLONG n, FLOAT *ap, FLOAT *x, FLOAT *y, FLOAT *alpha)
  138. {
  139. BLASLONG i;
  140. FLOAT *a0;
  141. a0 = ap;
  142. FLOAT alpha_r = alpha[0];
  143. FLOAT alpha_i = alpha[1];
  144. FLOAT temp_r0 = 0.0;
  145. FLOAT temp_i0 = 0.0;
  146. for ( i=0; i< 2*n; i+=2 )
  147. {
  148. #if ( !defined(CONJ) && !defined(XCONJ) ) || ( defined(CONJ) && defined(XCONJ) )
  149. temp_r0 += a0[i]*x[i] - a0[i+1]*x[i+1];
  150. temp_i0 += a0[i]*x[i+1] + a0[i+1]*x[i];
  151. #else
  152. temp_r0 += a0[i]*x[i] + a0[i+1]*x[i+1];
  153. temp_i0 += a0[i]*x[i+1] - a0[i+1]*x[i];
  154. #endif
  155. }
  156. #if !defined(XCONJ)
  157. y[0] += alpha_r * temp_r0 - alpha_i * temp_i0;
  158. y[1] += alpha_r * temp_i0 + alpha_i * temp_r0;
  159. #else
  160. y[0] += alpha_r * temp_r0 + alpha_i * temp_i0;
  161. y[1] -= alpha_r * temp_i0 - alpha_i * temp_r0;
  162. #endif
  163. }
  164. #endif
  165. static void copy_x(BLASLONG n, FLOAT *src, FLOAT *dest, BLASLONG inc_src)
  166. {
  167. BLASLONG i;
  168. for ( i=0; i<n; i++ )
  169. {
  170. *dest = *src;
  171. *(dest+1) = *(src+1);
  172. dest+=2;
  173. src += inc_src;
  174. }
  175. }
  176. int CNAME(BLASLONG m, BLASLONG n, BLASLONG dummy1, FLOAT alpha_r, FLOAT alpha_i, FLOAT *a, BLASLONG lda, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG inc_y, FLOAT *buffer)
  177. {
  178. BLASLONG i;
  179. BLASLONG j;
  180. FLOAT *a_ptr;
  181. FLOAT *x_ptr;
  182. FLOAT *y_ptr;
  183. FLOAT *ap[8];
  184. BLASLONG n1;
  185. BLASLONG m1;
  186. BLASLONG m2;
  187. BLASLONG m3;
  188. BLASLONG n2;
  189. BLASLONG lda4;
  190. FLOAT ybuffer[8],*xbuffer;
  191. FLOAT alpha[2];
  192. if ( m < 1 ) return(0);
  193. if ( n < 1 ) return(0);
  194. inc_x *= 2;
  195. inc_y *= 2;
  196. lda *= 2;
  197. lda4 = lda << 2;
  198. xbuffer = buffer;
  199. n1 = n >> 2 ;
  200. n2 = n & 3 ;
  201. m3 = m & 3 ;
  202. m1 = m - m3;
  203. m2 = (m & (NBMAX-1)) - m3 ;
  204. alpha[0] = alpha_r;
  205. alpha[1] = alpha_i;
  206. BLASLONG NB = NBMAX;
  207. while ( NB == NBMAX )
  208. {
  209. m1 -= NB;
  210. if ( m1 < 0)
  211. {
  212. if ( m2 == 0 ) break;
  213. NB = m2;
  214. }
  215. y_ptr = y;
  216. a_ptr = a;
  217. x_ptr = x;
  218. ap[0] = a_ptr;
  219. ap[1] = a_ptr + lda;
  220. ap[2] = ap[1] + lda;
  221. ap[3] = ap[2] + lda;
  222. if ( inc_x != 2 )
  223. copy_x(NB,x_ptr,xbuffer,inc_x);
  224. else
  225. xbuffer = x_ptr;
  226. if ( inc_y == 2 )
  227. {
  228. for( i = 0; i < n1 ; i++)
  229. {
  230. cgemv_kernel_4x4(NB,ap,xbuffer,y_ptr,alpha);
  231. ap[0] += lda4;
  232. ap[1] += lda4;
  233. ap[2] += lda4;
  234. ap[3] += lda4;
  235. a_ptr += lda4;
  236. y_ptr += 8;
  237. }
  238. if ( n2 & 2 )
  239. {
  240. cgemv_kernel_4x2(NB,ap,xbuffer,y_ptr,alpha);
  241. a_ptr += lda * 2;
  242. y_ptr += 4;
  243. }
  244. if ( n2 & 1 )
  245. {
  246. cgemv_kernel_4x1(NB,a_ptr,xbuffer,y_ptr,alpha);
  247. /* a_ptr += lda;
  248. y_ptr += 2; */
  249. }
  250. }
  251. else
  252. {
  253. for( i = 0; i < n1 ; i++)
  254. {
  255. memset(ybuffer,0,32);
  256. cgemv_kernel_4x4(NB,ap,xbuffer,ybuffer,alpha);
  257. ap[0] += lda4;
  258. ap[1] += lda4;
  259. ap[2] += lda4;
  260. ap[3] += lda4;
  261. a_ptr += lda4;
  262. y_ptr[0] += ybuffer[0];
  263. y_ptr[1] += ybuffer[1];
  264. y_ptr += inc_y;
  265. y_ptr[0] += ybuffer[2];
  266. y_ptr[1] += ybuffer[3];
  267. y_ptr += inc_y;
  268. y_ptr[0] += ybuffer[4];
  269. y_ptr[1] += ybuffer[5];
  270. y_ptr += inc_y;
  271. y_ptr[0] += ybuffer[6];
  272. y_ptr[1] += ybuffer[7];
  273. y_ptr += inc_y;
  274. }
  275. for( i = 0; i < n2 ; i++)
  276. {
  277. memset(ybuffer,0,32);
  278. cgemv_kernel_4x1(NB,a_ptr,xbuffer,ybuffer,alpha);
  279. a_ptr += lda;
  280. y_ptr[0] += ybuffer[0];
  281. y_ptr[1] += ybuffer[1];
  282. y_ptr += inc_y;
  283. }
  284. }
  285. a += 2 * NB;
  286. x += NB * inc_x;
  287. }
  288. if ( m3 == 0 ) return(0);
  289. x_ptr = x;
  290. j=0;
  291. a_ptr = a;
  292. y_ptr = y;
  293. if ( m3 == 3 )
  294. {
  295. FLOAT temp_r ;
  296. FLOAT temp_i ;
  297. FLOAT x0 = x_ptr[0];
  298. FLOAT x1 = x_ptr[1];
  299. x_ptr += inc_x;
  300. FLOAT x2 = x_ptr[0];
  301. FLOAT x3 = x_ptr[1];
  302. x_ptr += inc_x;
  303. FLOAT x4 = x_ptr[0];
  304. FLOAT x5 = x_ptr[1];
  305. while ( j < n)
  306. {
  307. #if ( !defined(CONJ) && !defined(XCONJ) ) || ( defined(CONJ) && defined(XCONJ) )
  308. temp_r = a_ptr[0] * x0 - a_ptr[1] * x1;
  309. temp_i = a_ptr[0] * x1 + a_ptr[1] * x0;
  310. temp_r += a_ptr[2] * x2 - a_ptr[3] * x3;
  311. temp_i += a_ptr[2] * x3 + a_ptr[3] * x2;
  312. temp_r += a_ptr[4] * x4 - a_ptr[5] * x5;
  313. temp_i += a_ptr[4] * x5 + a_ptr[5] * x4;
  314. #else
  315. temp_r = a_ptr[0] * x0 + a_ptr[1] * x1;
  316. temp_i = a_ptr[0] * x1 - a_ptr[1] * x0;
  317. temp_r += a_ptr[2] * x2 + a_ptr[3] * x3;
  318. temp_i += a_ptr[2] * x3 - a_ptr[3] * x2;
  319. temp_r += a_ptr[4] * x4 + a_ptr[5] * x5;
  320. temp_i += a_ptr[4] * x5 - a_ptr[5] * x4;
  321. #endif
  322. #if !defined(XCONJ)
  323. y_ptr[0] += alpha_r * temp_r - alpha_i * temp_i;
  324. y_ptr[1] += alpha_r * temp_i + alpha_i * temp_r;
  325. #else
  326. y_ptr[0] += alpha_r * temp_r + alpha_i * temp_i;
  327. y_ptr[1] -= alpha_r * temp_i - alpha_i * temp_r;
  328. #endif
  329. a_ptr += lda;
  330. y_ptr += inc_y;
  331. j++;
  332. }
  333. return(0);
  334. }
  335. if ( m3 == 2 )
  336. {
  337. FLOAT temp_r ;
  338. FLOAT temp_i ;
  339. FLOAT temp_r1 ;
  340. FLOAT temp_i1 ;
  341. FLOAT x0 = x_ptr[0];
  342. FLOAT x1 = x_ptr[1];
  343. x_ptr += inc_x;
  344. FLOAT x2 = x_ptr[0];
  345. FLOAT x3 = x_ptr[1];
  346. FLOAT ar = alpha[0];
  347. FLOAT ai = alpha[1];
  348. while ( j < ( n & -2 ))
  349. {
  350. #if ( !defined(CONJ) && !defined(XCONJ) ) || ( defined(CONJ) && defined(XCONJ) )
  351. temp_r = a_ptr[0] * x0 - a_ptr[1] * x1;
  352. temp_i = a_ptr[0] * x1 + a_ptr[1] * x0;
  353. temp_r += a_ptr[2] * x2 - a_ptr[3] * x3;
  354. temp_i += a_ptr[2] * x3 + a_ptr[3] * x2;
  355. a_ptr += lda;
  356. temp_r1 = a_ptr[0] * x0 - a_ptr[1] * x1;
  357. temp_i1 = a_ptr[0] * x1 + a_ptr[1] * x0;
  358. temp_r1 += a_ptr[2] * x2 - a_ptr[3] * x3;
  359. temp_i1 += a_ptr[2] * x3 + a_ptr[3] * x2;
  360. #else
  361. temp_r = a_ptr[0] * x0 + a_ptr[1] * x1;
  362. temp_i = a_ptr[0] * x1 - a_ptr[1] * x0;
  363. temp_r += a_ptr[2] * x2 + a_ptr[3] * x3;
  364. temp_i += a_ptr[2] * x3 - a_ptr[3] * x2;
  365. a_ptr += lda;
  366. temp_r1 = a_ptr[0] * x0 + a_ptr[1] * x1;
  367. temp_i1 = a_ptr[0] * x1 - a_ptr[1] * x0;
  368. temp_r1 += a_ptr[2] * x2 + a_ptr[3] * x3;
  369. temp_i1 += a_ptr[2] * x3 - a_ptr[3] * x2;
  370. #endif
  371. #if !defined(XCONJ)
  372. y_ptr[0] += ar * temp_r - ai * temp_i;
  373. y_ptr[1] += ar * temp_i + ai * temp_r;
  374. y_ptr += inc_y;
  375. y_ptr[0] += ar * temp_r1 - ai * temp_i1;
  376. y_ptr[1] += ar * temp_i1 + ai * temp_r1;
  377. #else
  378. y_ptr[0] += ar * temp_r + ai * temp_i;
  379. y_ptr[1] -= ar * temp_i - ai * temp_r;
  380. y_ptr += inc_y;
  381. y_ptr[0] += ar * temp_r1 + ai * temp_i1;
  382. y_ptr[1] -= ar * temp_i1 - ai * temp_r1;
  383. #endif
  384. a_ptr += lda;
  385. y_ptr += inc_y;
  386. j+=2;
  387. }
  388. while ( j < n)
  389. {
  390. #if ( !defined(CONJ) && !defined(XCONJ) ) || ( defined(CONJ) && defined(XCONJ) )
  391. temp_r = a_ptr[0] * x0 - a_ptr[1] * x1;
  392. temp_i = a_ptr[0] * x1 + a_ptr[1] * x0;
  393. temp_r += a_ptr[2] * x2 - a_ptr[3] * x3;
  394. temp_i += a_ptr[2] * x3 + a_ptr[3] * x2;
  395. #else
  396. temp_r = a_ptr[0] * x0 + a_ptr[1] * x1;
  397. temp_i = a_ptr[0] * x1 - a_ptr[1] * x0;
  398. temp_r += a_ptr[2] * x2 + a_ptr[3] * x3;
  399. temp_i += a_ptr[2] * x3 - a_ptr[3] * x2;
  400. #endif
  401. #if !defined(XCONJ)
  402. y_ptr[0] += ar * temp_r - ai * temp_i;
  403. y_ptr[1] += ar * temp_i + ai * temp_r;
  404. #else
  405. y_ptr[0] += ar * temp_r + ai * temp_i;
  406. y_ptr[1] -= ar * temp_i - ai * temp_r;
  407. #endif
  408. a_ptr += lda;
  409. y_ptr += inc_y;
  410. j++;
  411. }
  412. return(0);
  413. }
  414. if ( m3 == 1 )
  415. {
  416. FLOAT temp_r ;
  417. FLOAT temp_i ;
  418. FLOAT temp_r1 ;
  419. FLOAT temp_i1 ;
  420. FLOAT x0 = x_ptr[0];
  421. FLOAT x1 = x_ptr[1];
  422. FLOAT ar = alpha[0];
  423. FLOAT ai = alpha[1];
  424. while ( j < ( n & -2 ))
  425. {
  426. #if ( !defined(CONJ) && !defined(XCONJ) ) || ( defined(CONJ) && defined(XCONJ) )
  427. temp_r = a_ptr[0] * x0 - a_ptr[1] * x1;
  428. temp_i = a_ptr[0] * x1 + a_ptr[1] * x0;
  429. a_ptr += lda;
  430. temp_r1 = a_ptr[0] * x0 - a_ptr[1] * x1;
  431. temp_i1 = a_ptr[0] * x1 + a_ptr[1] * x0;
  432. #else
  433. temp_r = a_ptr[0] * x0 + a_ptr[1] * x1;
  434. temp_i = a_ptr[0] * x1 - a_ptr[1] * x0;
  435. a_ptr += lda;
  436. temp_r1 = a_ptr[0] * x0 + a_ptr[1] * x1;
  437. temp_i1 = a_ptr[0] * x1 - a_ptr[1] * x0;
  438. #endif
  439. #if !defined(XCONJ)
  440. y_ptr[0] += ar * temp_r - ai * temp_i;
  441. y_ptr[1] += ar * temp_i + ai * temp_r;
  442. y_ptr += inc_y;
  443. y_ptr[0] += ar * temp_r1 - ai * temp_i1;
  444. y_ptr[1] += ar * temp_i1 + ai * temp_r1;
  445. #else
  446. y_ptr[0] += ar * temp_r + ai * temp_i;
  447. y_ptr[1] -= ar * temp_i - ai * temp_r;
  448. y_ptr += inc_y;
  449. y_ptr[0] += ar * temp_r1 + ai * temp_i1;
  450. y_ptr[1] -= ar * temp_i1 - ai * temp_r1;
  451. #endif
  452. a_ptr += lda;
  453. y_ptr += inc_y;
  454. j+=2;
  455. }
  456. while ( j < n)
  457. {
  458. #if ( !defined(CONJ) && !defined(XCONJ) ) || ( defined(CONJ) && defined(XCONJ) )
  459. temp_r = a_ptr[0] * x0 - a_ptr[1] * x1;
  460. temp_i = a_ptr[0] * x1 + a_ptr[1] * x0;
  461. #else
  462. temp_r = a_ptr[0] * x0 + a_ptr[1] * x1;
  463. temp_i = a_ptr[0] * x1 - a_ptr[1] * x0;
  464. #endif
  465. #if !defined(XCONJ)
  466. y_ptr[0] += ar * temp_r - ai * temp_i;
  467. y_ptr[1] += ar * temp_i + ai * temp_r;
  468. #else
  469. y_ptr[0] += ar * temp_r + ai * temp_i;
  470. y_ptr[1] -= ar * temp_i - ai * temp_r;
  471. #endif
  472. a_ptr += lda;
  473. y_ptr += inc_y;
  474. j++;
  475. }
  476. return(0);
  477. }
  478. return(0);
  479. }