real_vsx_6hv_template.c 56 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
//    This file is part of ELPA.
//
//    The ELPA library was originally created by the ELPA consortium,
//    consisting of the following organizations:
//
//    - Max Planck Computing and Data Facility (MPCDF), formerly known as
//	Rechenzentrum Garching der Max-Planck-Gesellschaft (RZG),
//    - Bergische Universität Wuppertal, Lehrstuhl für angewandte
//	Informatik,
//    - Technische Universität München, Lehrstuhl für Informatik mit
//	Schwerpunkt Wissenschaftliches Rechnen ,
//    - Fritz-Haber-Institut, Berlin, Abt. Theorie,
//    - Max-Plack-Institut für Mathematik in den Naturwissenschaften,
//	Leipzig, Abt. Komplexe Strukutren in Biologie und Kognition,
//	and
//    - IBM Deutschland GmbH
//
//    This particular source code file contains additions, changes and
//    enhancements authored by Intel Corporation which is not part of
//    the ELPA consortium.
//
//    More information can be found here:
//    http://elpa.mpcdf.mpg.de/
//
//    ELPA is free software: you can redistribute it and/or modify
//    it under the terms of the version 3 of the license of the
//    GNU Lesser General Public License as published by the Free
//    Software Foundation.
//
//    ELPA is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public License
//    along with ELPA.	If not, see <http://www.gnu.org/licenses/>
//
//    ELPA reflects a substantial effort on the part of the original
//    ELPA consortium, and we ask you to respect the spirit of the
//    license that we chose: i.e., please contribute any changes you
//    may have back to the original ELPA library distribution, and keep
//    any derivatives of ELPA under the same license that we chose for
//    the original distribution, the GNU Lesser General Public License.
//
//
// --------------------------------------------------------------------------------------------------
//
// This file contains the compute intensive kernels for the Householder transformations.
// It should be compiled with the highest possible optimization level.
//
// On Intel Nehalem or Intel Westmere or AMD Magny Cours use -O3 -msse3
// On Intel Sandy Bridge use -O3 -mavx
//
// Copyright of the original code rests with the authors inside the ELPA
// consortium. The copyright of any additional modifications shall rest
// with their original authors, but shall adhere to the licensing terms
// distributed along with the original code in the file "COPYING".
//
// Author: Andreas Marek, MPCDF (andreas.marek@mpcdf.mpg.de), based on Alexander Heinecke (alexander.heinecke@mytum.de)
// --------------------------------------------------------------------------------------------------

#include "config-f90.h"

#ifdef HAVE_VSX_SSE
#include <altivec.h>
#endif
#include <stdio.h>
#include <stdlib.h>

#define __forceinline __attribute__((always_inline)) static

#ifdef DOUBLE_PRECISION_REAL
#define offset 2
74
#define __SSE_DATATYPE __vector double
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#define _SSE_LOAD (__vector double) vec_ld
#define _SSE_ADD vec_add
#define _SSE_SUB vec_sub
#define _SSE_MUL vec_mul
#define _SSE_STORE vec_st
#endif
#ifdef SINGLE_PRECISION_REAL
#define offset 4
#define __SSE_DATATYPE __vector float
#define _SSE_LOAD (__vector float) vec_ld
#define _SSE_ADD vec_add
#define _SSE_SUB vec_sub
#define _SSE_MUL vec_mul
#define _SSE_STORE vec_st
#endif

#ifdef HAVE_SSE_INTRINSICS
#undef __AVX__
#endif

#ifdef DOUBLE_PRECISION_REAL
//Forward declaration
97
98
static void hh_trafo_kernel_2_VSX_6hv_double(double* q, double* hh, int nb, int ldq, int ldh, double* scalarprods);
static void hh_trafo_kernel_4_VSX_6hv_double(double* q, double* hh, int nb, int ldq, int ldh, double* scalarprods);
99
100
101
102
void hexa_hh_trafo_real_vsx_6hv_double(double* q, double* hh, int* pnb, int* pnq, int* pldq, int* pldh);
#endif

#ifdef SINGLE_PRECISION_REAL
103
104
static void hh_trafo_kernel_4_VSX_6hv_single(float* q, float* hh, int nb, int ldq, int ldh, float* scalarprods);
static void hh_trafo_kernel_8_VSX_6hv_single(float* q, float* hh, int nb, int ldq, int ldh, float* scalarprods);
105

106
void hexa_hh_trafo_real_vsx_6hv_single(float* q, float* hh, int* pnb, int* pnq, int* pldq, int* pldh);
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
#endif

#ifdef DOUBLE_PRECISION_REAL
/*
!f>#ifdef HAVE_VSX_SSE
!f> interface
!f>   subroutine hexa_hh_trafo_real_vsx_6hv_double(q, hh, pnb, pnq, pldq, pldh) &
!f>				bind(C, name="hexa_hh_trafo_real_vsx_6hv_double")
!f>	use, intrinsic :: iso_c_binding
!f>	integer(kind=c_int)	:: pnb, pnq, pldq, pldh
!f>	type(c_ptr), value	:: q
!f>	real(kind=c_double)	:: hh(pnb,6)
!f>   end subroutine
!f> end interface
!f>#endif
*/
#endif
#ifdef SINGLE_PRECISION_REAL
/*
!f>#ifdef HAVE_VSX_SSE
!f> interface
!f>   subroutine hexa_hh_trafo_real_vsx_6hv_single(q, hh, pnb, pnq, pldq, pldh) &
!f>				bind(C, name="hexa_hh_trafo_real_vsx_6hv_single")
!f>	use, intrinsic :: iso_c_binding
!f>	integer(kind=c_int)	:: pnb, pnq, pldq, pldh
!f>	type(c_ptr), value	:: q
!f>	real(kind=c_float)	:: hh(pnb,6)
!f>   end subroutine
!f> end interface
!f>#endif
*/
#endif

#ifdef DOUBLE_PRECISION_REAL
void hexa_hh_trafo_real_vsx_6hv_double(double* q, double* hh, int* pnb, int* pnq, int* pldq, int* pldh)
#endif
#ifdef SINGLE_PRECISION_REAL
void hexa_hh_trafo_real_vsx_6hv_single(float* q, float* hh, int* pnb, int* pnq, int* pldq, int* pldh)
#endif
{
	int i;
	int nb = *pnb;
	int nq = *pldq;
	int ldq = *pldq;
	int ldh = *pldh;
	int worked_on ;

	worked_on = 0;

	// calculating scalar products to compute
	// 6 householder vectors simultaneously
#ifdef DOUBLE_PRECISION_REAL
	double scalarprods[15];
#endif
#ifdef SINGLE_PRECISION_REAL
	float scalarprods[15];
#endif

	scalarprods[0] = hh[(ldh+1)];
	scalarprods[1] = hh[(ldh*2)+2];
	scalarprods[2] = hh[(ldh*2)+1];
	scalarprods[3] = hh[(ldh*3)+3];
	scalarprods[4] = hh[(ldh*3)+2];
	scalarprods[5] = hh[(ldh*3)+1];
	scalarprods[6] = hh[(ldh*4)+4];
	scalarprods[7] = hh[(ldh*4)+3];
	scalarprods[8] = hh[(ldh*4)+2];
	scalarprods[9] = hh[(ldh*4)+1];
	scalarprods[10] = hh[(ldh*5)+5];
	scalarprods[11] = hh[(ldh*5)+4];
	scalarprods[12] = hh[(ldh*5)+3];
	scalarprods[13] = hh[(ldh*5)+2];
	scalarprods[14] = hh[(ldh*5)+1];

	// calculate scalar product of first and fourth householder Vector
	// loop counter = 2
	scalarprods[0] += hh[1] * hh[(2+ldh)];
	scalarprods[2] += hh[(ldh)+1] * hh[2+(ldh*2)];
	scalarprods[5] += hh[(ldh*2)+1] * hh[2+(ldh*3)];
	scalarprods[9] += hh[(ldh*3)+1] * hh[2+(ldh*4)];
	scalarprods[14] += hh[(ldh*4)+1] * hh[2+(ldh*5)];

	// loop counter = 3
	scalarprods[0] += hh[2] * hh[(3+ldh)];
	scalarprods[2] += hh[(ldh)+2] * hh[3+(ldh*2)];
	scalarprods[5] += hh[(ldh*2)+2] * hh[3+(ldh*3)];
	scalarprods[9] += hh[(ldh*3)+2] * hh[3+(ldh*4)];
	scalarprods[14] += hh[(ldh*4)+2] * hh[3+(ldh*5)];

	scalarprods[1] += hh[1] * hh[3+(ldh*2)];
	scalarprods[4] += hh[(ldh*1)+1] * hh[3+(ldh*3)];
	scalarprods[8] += hh[(ldh*2)+1] * hh[3+(ldh*4)];
	scalarprods[13] += hh[(ldh*3)+1] * hh[3+(ldh*5)];

	// loop counter = 4
	scalarprods[0] += hh[3] * hh[(4+ldh)];
	scalarprods[2] += hh[(ldh)+3] * hh[4+(ldh*2)];
	scalarprods[5] += hh[(ldh*2)+3] * hh[4+(ldh*3)];
	scalarprods[9] += hh[(ldh*3)+3] * hh[4+(ldh*4)];
	scalarprods[14] += hh[(ldh*4)+3] * hh[4+(ldh*5)];

	scalarprods[1] += hh[2] * hh[4+(ldh*2)];
	scalarprods[4] += hh[(ldh*1)+2] * hh[4+(ldh*3)];
	scalarprods[8] += hh[(ldh*2)+2] * hh[4+(ldh*4)];
	scalarprods[13] += hh[(ldh*3)+2] * hh[4+(ldh*5)];

	scalarprods[3] += hh[1] * hh[4+(ldh*3)];
	scalarprods[7] += hh[(ldh)+1] * hh[4+(ldh*4)];
	scalarprods[12] += hh[(ldh*2)+1] * hh[4+(ldh*5)];

	// loop counter = 5
	scalarprods[0] += hh[4] * hh[(5+ldh)];
	scalarprods[2] += hh[(ldh)+4] * hh[5+(ldh*2)];
	scalarprods[5] += hh[(ldh*2)+4] * hh[5+(ldh*3)];
	scalarprods[9] += hh[(ldh*3)+4] * hh[5+(ldh*4)];
	scalarprods[14] += hh[(ldh*4)+4] * hh[5+(ldh*5)];

	scalarprods[1] += hh[3] * hh[5+(ldh*2)];
	scalarprods[4] += hh[(ldh*1)+3] * hh[5+(ldh*3)];
	scalarprods[8] += hh[(ldh*2)+3] * hh[5+(ldh*4)];
	scalarprods[13] += hh[(ldh*3)+3] * hh[5+(ldh*5)];

	scalarprods[3] += hh[2] * hh[5+(ldh*3)];
	scalarprods[7] += hh[(ldh)+2] * hh[5+(ldh*4)];
	scalarprods[12] += hh[(ldh*2)+2] * hh[5+(ldh*5)];

	scalarprods[6] += hh[1] * hh[5+(ldh*4)];
	scalarprods[11] += hh[(ldh)+1] * hh[5+(ldh*5)];

	#pragma ivdep
	for (i = 6; i < nb; i++)
	{
		scalarprods[0] += hh[i-1] * hh[(i+ldh)];
		scalarprods[2] += hh[(ldh)+i-1] * hh[i+(ldh*2)];
		scalarprods[5] += hh[(ldh*2)+i-1] * hh[i+(ldh*3)];
		scalarprods[9] += hh[(ldh*3)+i-1] * hh[i+(ldh*4)];
		scalarprods[14] += hh[(ldh*4)+i-1] * hh[i+(ldh*5)];

		scalarprods[1] += hh[i-2] * hh[i+(ldh*2)];
		scalarprods[4] += hh[(ldh*1)+i-2] * hh[i+(ldh*3)];
		scalarprods[8] += hh[(ldh*2)+i-2] * hh[i+(ldh*4)];
		scalarprods[13] += hh[(ldh*3)+i-2] * hh[i+(ldh*5)];

		scalarprods[3] += hh[i-3] * hh[i+(ldh*3)];
		scalarprods[7] += hh[(ldh)+i-3] * hh[i+(ldh*4)];
		scalarprods[12] += hh[(ldh*2)+i-3] * hh[i+(ldh*5)];

		scalarprods[6] += hh[i-4] * hh[i+(ldh*4)];
		scalarprods[11] += hh[(ldh)+i-4] * hh[i+(ldh*5)];

		scalarprods[10] += hh[i-5] * hh[i+(ldh*5)];
	}

	// Production level kernel calls with padding
#ifdef DOUBLE_PRECISION_REAL
	for (i = 0; i < nq-2; i+=4)
	{
		hh_trafo_kernel_4_VSX_6hv_double(&q[i], hh, nb, ldq, ldh, scalarprods);
		worked_on += 4;
	}
#endif
#ifdef SINGLE_PRECISION_REAL
	for (i = 0; i < nq-4; i+=8)
	{
		hh_trafo_kernel_8_VSX_6hv_single(&q[i], hh, nb, ldq, ldh, scalarprods);
		worked_on += 8;
	}
#endif
	if (nq == i)
	{
		return;
	}
#ifdef DOUBLE_PRECISION_REAL
	if (nq -i == 2)
	{
		hh_trafo_kernel_2_VSX_6hv_double(&q[i], hh, nb, ldq, ldh, scalarprods);
		worked_on += 2;
	}
#endif
#ifdef SINGLE_PRECISION_REAL
	if (nq -i == 4)
	{
		hh_trafo_kernel_4_VSX_6hv_single(&q[i], hh, nb, ldq, ldh, scalarprods);
		worked_on += 4;
	}
#endif
#ifdef WITH_DEBUG
	if (worked_on != nq)
	{
		printf("Error in real SSE BLOCK6 kernel \n");
		abort();
	}
#endif
}

/**
 * Unrolled kernel that computes
#ifdef DOUBLE_PRECISION_REAL
 * 4 rows of Q simultaneously, a
#endif
#ifdef SINGLE_PRECISION_REAL
 * 8 rows of Q simultaneously, a
#endif
 * matrix Vector product with two householder
 * vectors + a rank 1 update is performed
 */
#ifdef DOUBLE_PRECISION_REAL
__forceinline void hh_trafo_kernel_4_VSX_6hv_double(double* q, double* hh, int nb, int ldq, int ldh, double* scalarprods)
#endif
#ifdef SINGLE_PRECISION_REAL
__forceinline void hh_trafo_kernel_8_VSX_6hv_single(float* q, float* hh, int nb, int ldq, int ldh, float* scalarprods)
#endif
{
	/////////////////////////////////////////////////////
	// Matrix Vector Multiplication, Q [4 x nb+3] * hh
	// hh contains four householder vectors
	/////////////////////////////////////////////////////
	int i;

326
327
328
329
330
331
	__SSE_DATATYPE a1_1 = _SSE_LOAD(0, (unsigned long int *) &q[ldq*5]);
	__SSE_DATATYPE a2_1 = _SSE_LOAD(0, (unsigned long int *) &q[ldq*4]);
	__SSE_DATATYPE a3_1 = _SSE_LOAD(0, (unsigned long int *) &q[ldq*3]);
	__SSE_DATATYPE a4_1 = _SSE_LOAD(0, (unsigned long int *) &q[ldq*2]);
	__SSE_DATATYPE a5_1 = _SSE_LOAD(0, (unsigned long int *) &q[ldq]);
	__SSE_DATATYPE a6_1 = _SSE_LOAD(0, (unsigned long int *) &q[0]);
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404

#ifdef DOUBLE_PRECISION_REAL
	__SSE_DATATYPE h_6_5 = vec_splats(hh[(ldh*5)+1]);
	__SSE_DATATYPE h_6_4 = vec_splats(hh[(ldh*5)+2]);
	__SSE_DATATYPE h_6_3 = vec_splats(hh[(ldh*5)+3]);
	__SSE_DATATYPE h_6_2 = vec_splats(hh[(ldh*5)+4]);
	__SSE_DATATYPE h_6_1 = vec_splats(hh[(ldh*5)+5]);
#endif
#ifdef SINGLE_PRECISION_REAL
	__SSE_DATATYPE h_6_5 =	 vec_splats(hh[(ldh*5)+1]) ;
	__SSE_DATATYPE h_6_4 =	 vec_splats(hh[(ldh*5)+2]) ;
	__SSE_DATATYPE h_6_3 =	 vec_splats(hh[(ldh*5)+3]) ;
	__SSE_DATATYPE h_6_2 =	 vec_splats(hh[(ldh*5)+4]) ;
	__SSE_DATATYPE h_6_1 =	 vec_splats(hh[(ldh*5)+5]) ;
#endif


	register __SSE_DATATYPE t1 = _SSE_ADD(a6_1, _SSE_MUL(a5_1, h_6_5));
	t1 = _SSE_ADD(t1, _SSE_MUL(a4_1, h_6_4));
	t1 = _SSE_ADD(t1, _SSE_MUL(a3_1, h_6_3));
	t1 = _SSE_ADD(t1, _SSE_MUL(a2_1, h_6_2));
	t1 = _SSE_ADD(t1, _SSE_MUL(a1_1, h_6_1));

#ifdef DOUBLE_PRECISION_REAL
	__SSE_DATATYPE h_5_4 = vec_splats(hh[(ldh*4)+1]);
	__SSE_DATATYPE h_5_3 = vec_splats(hh[(ldh*4)+2]);
	__SSE_DATATYPE h_5_2 = vec_splats(hh[(ldh*4)+3]);
	__SSE_DATATYPE h_5_1 = vec_splats(hh[(ldh*4)+4]);
#endif
#ifdef SINGLE_PRECISION_REAL
	__SSE_DATATYPE h_5_4 =	 vec_splats(hh[(ldh*4)+1]) ;
	__SSE_DATATYPE h_5_3 =	 vec_splats(hh[(ldh*4)+2]) ;
	__SSE_DATATYPE h_5_2 =	 vec_splats(hh[(ldh*4)+3]) ;
	__SSE_DATATYPE h_5_1 =	 vec_splats(hh[(ldh*4)+4]) ;
#endif

	register __SSE_DATATYPE v1 = _SSE_ADD(a5_1, _SSE_MUL(a4_1, h_5_4));
	v1 = _SSE_ADD(v1, _SSE_MUL(a3_1, h_5_3));
	v1 = _SSE_ADD(v1, _SSE_MUL(a2_1, h_5_2));
	v1 = _SSE_ADD(v1, _SSE_MUL(a1_1, h_5_1));

#ifdef DOUBLE_PRECISION_REAL
	__SSE_DATATYPE h_4_3 = vec_splats(hh[(ldh*3)+1]);
	__SSE_DATATYPE h_4_2 = vec_splats(hh[(ldh*3)+2]);
	__SSE_DATATYPE h_4_1 = vec_splats(hh[(ldh*3)+3]);
#endif
#ifdef SINGLE_PRECISION_REAL
	__SSE_DATATYPE h_4_3 =	 vec_splats(hh[(ldh*3)+1]) ;
	__SSE_DATATYPE h_4_2 =	 vec_splats(hh[(ldh*3)+2]) ;
	__SSE_DATATYPE h_4_1 =	 vec_splats(hh[(ldh*3)+3]) ;
#endif

	register __SSE_DATATYPE w1 = _SSE_ADD(a4_1, _SSE_MUL(a3_1, h_4_3));
	w1 = _SSE_ADD(w1, _SSE_MUL(a2_1, h_4_2));
	w1 = _SSE_ADD(w1, _SSE_MUL(a1_1, h_4_1));

#ifdef DOUBLE_PRECISION_REAL
	__SSE_DATATYPE h_2_1 = vec_splats(hh[ldh+1]);
	__SSE_DATATYPE h_3_2 = vec_splats(hh[(ldh*2)+1]);
	__SSE_DATATYPE h_3_1 = vec_splats(hh[(ldh*2)+2]);
#endif
#ifdef SINGLE_PRECISION_REAL
	__SSE_DATATYPE h_2_1 =	 vec_splats(hh[ldh+1]) ;
	__SSE_DATATYPE h_3_2 =	 vec_splats(hh[(ldh*2)+1]) ;
	__SSE_DATATYPE h_3_1 =	 vec_splats(hh[(ldh*2)+2]) ;
#endif

	register __SSE_DATATYPE z1 = _SSE_ADD(a3_1, _SSE_MUL(a2_1, h_3_2));
	z1 = _SSE_ADD(z1, _SSE_MUL(a1_1, h_3_1));
	register __SSE_DATATYPE y1 = _SSE_ADD(a2_1, _SSE_MUL(a1_1, h_2_1));

	register __SSE_DATATYPE x1 = a1_1;

405
406
407
408
409
410
	__SSE_DATATYPE a1_2 = _SSE_LOAD(0, (unsigned long int *) &q[(ldq*5)+offset]);
	__SSE_DATATYPE a2_2 = _SSE_LOAD(0, (unsigned long int *) &q[(ldq*4)+offset]);
	__SSE_DATATYPE a3_2 = _SSE_LOAD(0, (unsigned long int *) &q[(ldq*3)+offset]);
	__SSE_DATATYPE a4_2 = _SSE_LOAD(0, (unsigned long int *) &q[(ldq*2)+offset]);
	__SSE_DATATYPE a5_2 = _SSE_LOAD(0, (unsigned long int *) &q[(ldq)+offset]);
	__SSE_DATATYPE a6_2 = _SSE_LOAD(0, (unsigned long int *) &q[offset]);
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447

	register __SSE_DATATYPE t2 = _SSE_ADD(a6_2, _SSE_MUL(a5_2, h_6_5));
	t2 = _SSE_ADD(t2, _SSE_MUL(a4_2, h_6_4));
	t2 = _SSE_ADD(t2, _SSE_MUL(a3_2, h_6_3));
	t2 = _SSE_ADD(t2, _SSE_MUL(a2_2, h_6_2));
	t2 = _SSE_ADD(t2, _SSE_MUL(a1_2, h_6_1));
	register __SSE_DATATYPE v2 = _SSE_ADD(a5_2, _SSE_MUL(a4_2, h_5_4));
	v2 = _SSE_ADD(v2, _SSE_MUL(a3_2, h_5_3));
	v2 = _SSE_ADD(v2, _SSE_MUL(a2_2, h_5_2));
	v2 = _SSE_ADD(v2, _SSE_MUL(a1_2, h_5_1));
	register __SSE_DATATYPE w2 = _SSE_ADD(a4_2, _SSE_MUL(a3_2, h_4_3));
	w2 = _SSE_ADD(w2, _SSE_MUL(a2_2, h_4_2));
	w2 = _SSE_ADD(w2, _SSE_MUL(a1_2, h_4_1));
	register __SSE_DATATYPE z2 = _SSE_ADD(a3_2, _SSE_MUL(a2_2, h_3_2));
	z2 = _SSE_ADD(z2, _SSE_MUL(a1_2, h_3_1));
	register __SSE_DATATYPE y2 = _SSE_ADD(a2_2, _SSE_MUL(a1_2, h_2_1));

	register __SSE_DATATYPE x2 = a1_2;

	__SSE_DATATYPE q1;
	__SSE_DATATYPE q2;

	__SSE_DATATYPE h1;
	__SSE_DATATYPE h2;
	__SSE_DATATYPE h3;
	__SSE_DATATYPE h4;
	__SSE_DATATYPE h5;
	__SSE_DATATYPE h6;

	for(i = 6; i < nb; i++)
	{
#ifdef DOUBLE_PRECISION_REAL
		h1 = vec_splats(hh[i-5]);
#endif
#ifdef SINGLE_PRECISION_REAL
		h1 = vec_splats(hh[i-5] );
#endif
448
449
		q1 = _SSE_LOAD(0, (unsigned long int *) &q[i*ldq]);
		q2 = _SSE_LOAD(0, (unsigned long int *) &q[(i*ldq)+offset]);
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505

		x1 = _SSE_ADD(x1, _SSE_MUL(q1,h1));
		x2 = _SSE_ADD(x2, _SSE_MUL(q2,h1));

#ifdef DOUBLE_PRECISION_REAL
		h2 = vec_splats(hh[ldh+i-4]);
#endif
#ifdef SINGLE_PRECISION_REAL
		h2 = vec_splats(hh[ldh+i-4] );
#endif
		y1 = _SSE_ADD(y1, _SSE_MUL(q1,h2));
		y2 = _SSE_ADD(y2, _SSE_MUL(q2,h2));

#ifdef DOUBLE_PRECISION_REAL
		h3 = vec_splats(hh[(ldh*2)+i-3]);
#endif
#ifdef SINGLE_PRECISION_REAL
		h3 = vec_splats(hh[(ldh*2)+i-3] );
#endif
		z1 = _SSE_ADD(z1, _SSE_MUL(q1,h3));
		z2 = _SSE_ADD(z2, _SSE_MUL(q2,h3));

#ifdef DOUBLE_PRECISION_REAL
		h4 = vec_splats(hh[(ldh*3)+i-2]);
#endif
#ifdef SINGLE_PRECISION_REAL
		h4 = vec_splats(hh[(ldh*3)+i-2] );
#endif
		w1 = _SSE_ADD(w1, _SSE_MUL(q1,h4));
		w2 = _SSE_ADD(w2, _SSE_MUL(q2,h4));

#ifdef DOUBLE_PRECISION_REAL
		h5 = vec_splats(hh[(ldh*4)+i-1]);
#endif
#ifdef SINGLE_PRECISION_REAL
		h5 = vec_splats(hh[(ldh*4)+i-1] );
#endif
		v1 = _SSE_ADD(v1, _SSE_MUL(q1,h5));
		v2 = _SSE_ADD(v2, _SSE_MUL(q2,h5));

#ifdef DOUBLE_PRECISION_REAL
		h6 = vec_splats(hh[(ldh*5)+i]);
#endif
#ifdef SINGLE_PRECISION_REAL
		h6 = vec_splats(hh[(ldh*5)+i] );
#endif
		t1 = _SSE_ADD(t1, _SSE_MUL(q1,h6));
		t2 = _SSE_ADD(t2, _SSE_MUL(q2,h6));
	}

#ifdef DOUBLE_PRECISION_REAL
	h1 = vec_splats(hh[nb-5]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h1 = vec_splats(hh[nb-5] );
#endif
506
507
	q1 = _SSE_LOAD(0, (unsigned long int *) &q[nb*ldq]);
	q2 = _SSE_LOAD(0, (unsigned long int *) &q[(nb*ldq)+offset]);
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554

	x1 = _SSE_ADD(x1, _SSE_MUL(q1,h1));
	x2 = _SSE_ADD(x2, _SSE_MUL(q2,h1));

#ifdef DOUBLE_PRECISION_REAL
	h2 = vec_splats(hh[ldh+nb-4]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h2 = vec_splats(hh[ldh+nb-4] );
#endif
	y1 = _SSE_ADD(y1, _SSE_MUL(q1,h2));
	y2 = _SSE_ADD(y2, _SSE_MUL(q2,h2));

#ifdef DOUBLE_PRECISION_REAL
	h3 = vec_splats(hh[(ldh*2)+nb-3]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h3 = vec_splats(hh[(ldh*2)+nb-3] );
#endif
	z1 = _SSE_ADD(z1, _SSE_MUL(q1,h3));
	z2 = _SSE_ADD(z2, _SSE_MUL(q2,h3));

#ifdef DOUBLE_PRECISION_REAL
	h4 = vec_splats(hh[(ldh*3)+nb-2]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h4 = vec_splats(hh[(ldh*3)+nb-2] );
#endif
	w1 = _SSE_ADD(w1, _SSE_MUL(q1,h4));
	w2 = _SSE_ADD(w2, _SSE_MUL(q2,h4));

#ifdef DOUBLE_PRECISION_REAL
	h5 = vec_splats(hh[(ldh*4)+nb-1]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h5 = vec_splats(hh[(ldh*4)+nb-1] );
#endif

	v1 = _SSE_ADD(v1, _SSE_MUL(q1,h5));
	v2 = _SSE_ADD(v2, _SSE_MUL(q2,h5));

#ifdef DOUBLE_PRECISION_REAL
	h1 = vec_splats(hh[nb-4]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h1 = vec_splats(hh[nb-4] );
#endif
555
556
	q1 = _SSE_LOAD(0, (unsigned long int *) &q[(nb+1)*ldq]);
	q2 = _SSE_LOAD(0, (unsigned long int *) &q[((nb+1)*ldq)+offset]);
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597

	x1 = _SSE_ADD(x1, _SSE_MUL(q1,h1));
	x2 = _SSE_ADD(x2, _SSE_MUL(q2,h1));

#ifdef DOUBLE_PRECISION_REAL
	h2 = vec_splats(hh[ldh+nb-3]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h2 = vec_splats(hh[ldh+nb-3] );
#endif

	y1 = _SSE_ADD(y1, _SSE_MUL(q1,h2));
	y2 = _SSE_ADD(y2, _SSE_MUL(q2,h2));

#ifdef DOUBLE_PRECISION
	h3 = vec_splats(hh[(ldh*2)+nb-2]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h3 = vec_splats(hh[(ldh*2)+nb-2] );
#endif

	z1 = _SSE_ADD(z1, _SSE_MUL(q1,h3));
	z2 = _SSE_ADD(z2, _SSE_MUL(q2,h3));

#ifdef DOUBLE_PRECISION_REAL
	h4 = vec_splats(hh[(ldh*3)+nb-1]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h4 = vec_splats(hh[(ldh*3)+nb-1] );
#endif

	w1 = _SSE_ADD(w1, _SSE_MUL(q1,h4));
	w2 = _SSE_ADD(w2, _SSE_MUL(q2,h4));

#ifdef DOUBLE_PRECISION_REAL
	h1 = vec_splats(hh[nb-3]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h1 = vec_splats(hh[nb-3] );
#endif

598
599
	q1 = _SSE_LOAD(0, (unsigned long int *) &q[(nb+2)*ldq]);
	q2 = _SSE_LOAD(0, (unsigned long int *) &q[((nb+2)*ldq)+offset]);
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630

	x1 = _SSE_ADD(x1, _SSE_MUL(q1,h1));
	x2 = _SSE_ADD(x2, _SSE_MUL(q2,h1));

#ifdef DOUBLE_PRECISION_REAL
	h2 = vec_splats(hh[ldh+nb-2]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h2 = vec_splats(hh[ldh+nb-2] );
#endif

	y1 = _SSE_ADD(y1, _SSE_MUL(q1,h2));
	y2 = _SSE_ADD(y2, _SSE_MUL(q2,h2));

#ifdef DOUBLE_PRECISION_REAL
	h3 = vec_splats(hh[(ldh*2)+nb-1]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h3 = vec_splats(hh[(ldh*2)+nb-1] );
#endif

	z1 = _SSE_ADD(z1, _SSE_MUL(q1,h3));
	z2 = _SSE_ADD(z2, _SSE_MUL(q2,h3));

#ifdef DOUBLE_PRECISION_REAL
	h1 = vec_splats(hh[nb-2]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h1 = vec_splats(hh[nb-2] );
#endif

631
632
	q1 = _SSE_LOAD(0, (unsigned long int *) &q[(nb+3)*ldq]);
	q2 = _SSE_LOAD(0, (unsigned long int *) &q[((nb+3)*ldq)+offset]);
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654

	x1 = _SSE_ADD(x1, _SSE_MUL(q1,h1));
	x2 = _SSE_ADD(x2, _SSE_MUL(q2,h1));

#ifdef DOUBLE_PRECISION_REAL
	h2 = vec_splats(hh[ldh+nb-1]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h2 = vec_splats(hh[ldh+nb-1] );
#endif


	y1 = _SSE_ADD(y1, _SSE_MUL(q1,h2));
	y2 = _SSE_ADD(y2, _SSE_MUL(q2,h2));

#ifdef DOUBLE_PRECISION_REAL
	h1 = vec_splats(hh[nb-1]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h1 = vec_splats(hh[nb-1] );
#endif

655
656
	q1 = _SSE_LOAD(0, (unsigned long int *) &q[(nb+4)*ldq]);
	q2 = _SSE_LOAD(0, (unsigned long int *) &q[((nb+4)*ldq)+offset]);
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792

	x1 = _SSE_ADD(x1, _SSE_MUL(q1,h1));
	x2 = _SSE_ADD(x2, _SSE_MUL(q2,h1));

	/////////////////////////////////////////////////////
	// Apply tau, correct wrong calculation using pre-calculated scalar products
	/////////////////////////////////////////////////////

#ifdef DOUBLE_PRECISION_REAL
	__SSE_DATATYPE tau1 = vec_splats(hh[0]);
	x1 = _SSE_MUL(x1, tau1);
	x2 = _SSE_MUL(x2, tau1);

	__SSE_DATATYPE tau2 = vec_splats(hh[ldh]);
	__SSE_DATATYPE vs_1_2 = vec_splats(scalarprods[0]);
	h2 = _SSE_MUL(tau2, vs_1_2);
#endif
#ifdef SINGLE_PRECISION_REAL
	__SSE_DATATYPE tau1 = vec_splats(hh[0] );
	x1 = _SSE_MUL(x1, tau1);
	x2 = _SSE_MUL(x2, tau1);

	__SSE_DATATYPE tau2 = vec_splats(hh[ldh] );
	__SSE_DATATYPE vs_1_2 = vec_splats(scalarprods[0] );
	h2 = _SSE_MUL(tau2, vs_1_2);
#endif

	y1 = _SSE_SUB(_SSE_MUL(y1,tau2), _SSE_MUL(x1,h2));
	y2 = _SSE_SUB(_SSE_MUL(y2,tau2), _SSE_MUL(x2,h2));

#ifdef DOUBLE_PRECISION_REAL
	__SSE_DATATYPE tau3 = vec_splats(hh[ldh*2]);
	__SSE_DATATYPE vs_1_3 = vec_splats(scalarprods[1]);
	__SSE_DATATYPE vs_2_3 = vec_splats(scalarprods[2]);
	h2 = _SSE_MUL(tau3, vs_1_3);
	h3 = _SSE_MUL(tau3, vs_2_3);
#endif
#ifdef SINGLE_PRECISION_REAL
	__SSE_DATATYPE tau3 = vec_splats(hh[ldh*2] );
	__SSE_DATATYPE vs_1_3 = vec_splats(scalarprods[1] );
	__SSE_DATATYPE vs_2_3 = vec_splats(scalarprods[2] );
	h2 = _SSE_MUL(tau3, vs_1_3);
	h3 = _SSE_MUL(tau3, vs_2_3);
#endif

	z1 = _SSE_SUB(_SSE_MUL(z1,tau3), _SSE_ADD(_SSE_MUL(y1,h3), _SSE_MUL(x1,h2)));
	z2 = _SSE_SUB(_SSE_MUL(z2,tau3), _SSE_ADD(_SSE_MUL(y2,h3), _SSE_MUL(x2,h2)));

#ifdef DOUBLE_PRECISION_REAL
	__SSE_DATATYPE tau4 = vec_splats(hh[ldh*3]);
	__SSE_DATATYPE vs_1_4 = vec_splats(scalarprods[3]);
	__SSE_DATATYPE vs_2_4 = vec_splats(scalarprods[4]);
	h2 = _SSE_MUL(tau4, vs_1_4);
	h3 = _SSE_MUL(tau4, vs_2_4);
	__SSE_DATATYPE vs_3_4 = vec_splats(scalarprods[5]);
	h4 = _SSE_MUL(tau4, vs_3_4);
#endif
#ifdef SINGLE_PRECISION_REAL
       __SSE_DATATYPE tau4 = vec_splats(hh[ldh*3] );
	__SSE_DATATYPE vs_1_4 = vec_splats(scalarprods[3] );
	__SSE_DATATYPE vs_2_4 = vec_splats(scalarprods[4] );
	h2 = _SSE_MUL(tau4, vs_1_4);
	h3 = _SSE_MUL(tau4, vs_2_4);

	__SSE_DATATYPE vs_3_4 = vec_splats(scalarprods[5] );
	h4 = _SSE_MUL(tau4, vs_3_4);
#endif

	w1 = _SSE_SUB(_SSE_MUL(w1,tau4), _SSE_ADD(_SSE_MUL(z1,h4), _SSE_ADD(_SSE_MUL(y1,h3), _SSE_MUL(x1,h2))));
	w2 = _SSE_SUB(_SSE_MUL(w2,tau4), _SSE_ADD(_SSE_MUL(z2,h4), _SSE_ADD(_SSE_MUL(y2,h3), _SSE_MUL(x2,h2))));

#ifdef DOUBLE_PRECISION_REAL
	__SSE_DATATYPE tau5 = vec_splats(hh[ldh*4]);
	__SSE_DATATYPE vs_1_5 = vec_splats(scalarprods[6]);
	__SSE_DATATYPE vs_2_5 = vec_splats(scalarprods[7]);
	h2 = _SSE_MUL(tau5, vs_1_5);
	h3 = _SSE_MUL(tau5, vs_2_5);
	__SSE_DATATYPE vs_3_5 = vec_splats(scalarprods[8]);
	__SSE_DATATYPE vs_4_5 = vec_splats(scalarprods[9]);
	h4 = _SSE_MUL(tau5, vs_3_5);
	h5 = _SSE_MUL(tau5, vs_4_5);
#endif
#ifdef SINGLE_PRECISION_REAL
	__SSE_DATATYPE tau5 = vec_splats(hh[ldh*4] );
	__SSE_DATATYPE vs_1_5 = vec_splats(scalarprods[6] );
	__SSE_DATATYPE vs_2_5 = vec_splats(scalarprods[7] );
	h2 = _SSE_MUL(tau5, vs_1_5);
	h3 = _SSE_MUL(tau5, vs_2_5);

	__SSE_DATATYPE vs_3_5 = vec_splats(scalarprods[8] );
	__SSE_DATATYPE vs_4_5 = vec_splats(scalarprods[9] );

	h4 = _SSE_MUL(tau5, vs_3_5);
	h5 = _SSE_MUL(tau5, vs_4_5);
#endif

	v1 = _SSE_SUB(_SSE_MUL(v1,tau5), _SSE_ADD(_SSE_ADD(_SSE_MUL(w1,h5), _SSE_MUL(z1,h4)), _SSE_ADD(_SSE_MUL(y1,h3), _SSE_MUL(x1,h2))));
	v2 = _SSE_SUB(_SSE_MUL(v2,tau5), _SSE_ADD(_SSE_ADD(_SSE_MUL(w2,h5), _SSE_MUL(z2,h4)), _SSE_ADD(_SSE_MUL(y2,h3), _SSE_MUL(x2,h2))));

#ifdef DOUBLE_PRECISION_REAL
	__SSE_DATATYPE tau6 = vec_splats(hh[ldh*5]);
	__SSE_DATATYPE vs_1_6 = vec_splats(scalarprods[10]);
	__SSE_DATATYPE vs_2_6 = vec_splats(scalarprods[11]);
	h2 = _SSE_MUL(tau6, vs_1_6);
	h3 = _SSE_MUL(tau6, vs_2_6);
	__SSE_DATATYPE vs_3_6 = vec_splats(scalarprods[12]);
	__SSE_DATATYPE vs_4_6 = vec_splats(scalarprods[13]);
	__SSE_DATATYPE vs_5_6 = vec_splats(scalarprods[14]);
	h4 = _SSE_MUL(tau6, vs_3_6);
	h5 = _SSE_MUL(tau6, vs_4_6);
	h6 = _SSE_MUL(tau6, vs_5_6);
#endif
#ifdef SINGLE_PRECISION_REAL
	__SSE_DATATYPE tau6 = vec_splats(hh[ldh*5] );
	__SSE_DATATYPE vs_1_6 = vec_splats(scalarprods[10] );
	__SSE_DATATYPE vs_2_6 = vec_splats(scalarprods[11] );

	h2 = _SSE_MUL(tau6, vs_1_6);
	h3 = _SSE_MUL(tau6, vs_2_6);

	__SSE_DATATYPE vs_3_6 = vec_splats(scalarprods[12] );
	__SSE_DATATYPE vs_4_6 = vec_splats(scalarprods[13] );
	__SSE_DATATYPE vs_5_6 = vec_splats(scalarprods[14] );

	h4 = _SSE_MUL(tau6, vs_3_6);
	h5 = _SSE_MUL(tau6, vs_4_6);
	h6 = _SSE_MUL(tau6, vs_5_6);
#endif

	t1 = _SSE_SUB(_SSE_MUL(t1,tau6), _SSE_ADD( _SSE_MUL(v1,h6), _SSE_ADD(_SSE_ADD(_SSE_MUL(w1,h5), _SSE_MUL(z1,h4)), _SSE_ADD(_SSE_MUL(y1,h3), _SSE_MUL(x1,h2)))));
	t2 = _SSE_SUB(_SSE_MUL(t2,tau6), _SSE_ADD( _SSE_MUL(v2,h6), _SSE_ADD(_SSE_ADD(_SSE_MUL(w2,h5), _SSE_MUL(z2,h4)), _SSE_ADD(_SSE_MUL(y2,h3), _SSE_MUL(x2,h2)))));

	/////////////////////////////////////////////////////
	// Rank-1 update of Q [4 x nb+3]
	/////////////////////////////////////////////////////

793
794
	q1 = _SSE_LOAD(0, (unsigned long int *) &q[0]);
	q2 = _SSE_LOAD(0, (unsigned long int *) &q[offset]);
795
796
797
798
799
800
801
802
803
804
805
806
807
808
	q1 = _SSE_SUB(q1, t1);
	q2 = _SSE_SUB(q2, t2);
	_SSE_STORE((__vector unsigned int) q1, 0, (unsigned int *) &q[0]);
	_SSE_STORE((__vector unsigned int) q2, 0, (unsigned int *) &q[offset]);


#ifdef DOUBLE_PRECISION_REAL
	h6 = vec_splats(hh[(ldh*5)+1]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h6 = vec_splats(hh[(ldh*5)+1] );
#endif


809
810
	q1 = _SSE_LOAD(0, (unsigned long int *) &q[ldq]);
	q2 = _SSE_LOAD(0, (unsigned long int *) &q[(ldq+offset)]);
811
812
813
814
815
816
	q1 = _SSE_SUB(q1, v1);
	q2 = _SSE_SUB(q2, v2);

	q1 = _SSE_SUB(q1, _SSE_MUL(t1, h6));
	q2 = _SSE_SUB(q2, _SSE_MUL(t2, h6));

817
818
	_SSE_STORE((__vector unsigned int) q1, 0, (unsigned int *) &q[ldq]);
	_SSE_STORE((__vector unsigned int) q2, 0, (unsigned int *) &q[(ldq+offset)]);
819
820
821
822
823
824
825

#ifdef DOUBLE_PRECISION_REAL
	h5 = vec_splats(hh[(ldh*4)+1]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h5 = vec_splats(hh[(ldh*4)+1] );
#endif
826
827
	q1 = _SSE_LOAD(0, (unsigned long int *) &q[ldq*2]);
	q2 = _SSE_LOAD(0, (unsigned long int *) &q[(ldq*2)+offset]);
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
	q1 = _SSE_SUB(q1, w1);
	q2 = _SSE_SUB(q2, w2);
	q1 = _SSE_SUB(q1, _SSE_MUL(v1, h5));
	q2 = _SSE_SUB(q2, _SSE_MUL(v2, h5));

#ifdef DOUBLE_PRECISION_REAL
	h6 = vec_splats(hh[(ldh*5)+2]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h6 = vec_splats(hh[(ldh*5)+2] );
#endif

	q1 = _SSE_SUB(q1, _SSE_MUL(t1, h6));
	q2 = _SSE_SUB(q2, _SSE_MUL(t2, h6));

	_SSE_STORE((__vector unsigned int) q1, 0, (unsigned int *) &q[ldq*2]);
	_SSE_STORE((__vector unsigned int) q2, 0, (unsigned int *) &q[(ldq*2)+offset]);

#ifdef DOUBLE_PRECISION_REAL
	h4 = vec_splats(hh[(ldh*3)+1]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h4 = vec_splats(hh[(ldh*3)+1] );
#endif

853
854
	q1 = _SSE_LOAD(0, (unsigned long int *) &q[ldq*3]);
	q2 = _SSE_LOAD(0, (unsigned long int *) &q[(ldq*3)+offset]);
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
	q1 = _SSE_SUB(q1, z1);
	q2 = _SSE_SUB(q2, z2);

	q1 = _SSE_SUB(q1, _SSE_MUL(w1, h4));
	q2 = _SSE_SUB(q2, _SSE_MUL(w2, h4));

#ifdef DOUBLE_PRECISION_REAL
	h5 = vec_splats(hh[(ldh*4)+2]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h5 = vec_splats(hh[(ldh*4)+2] );
#endif

	q1 = _SSE_SUB(q1, _SSE_MUL(v1, h5));
	q2 = _SSE_SUB(q2, _SSE_MUL(v2, h5));

#ifdef DOUBLE_PRECISION_REAL
	h6 = vec_splats(hh[(ldh*5)+3]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h6 = vec_splats(hh[(ldh*5)+3] );
#endif

	q1 = _SSE_SUB(q1, _SSE_MUL(t1, h6));
	q2 = _SSE_SUB(q2, _SSE_MUL(t2, h6));

	_SSE_STORE((__vector unsigned int) q1, 0, (unsigned int *) &q[ldq*3]);
882
	_SSE_STORE((__vector unsigned int) q2, 0, (unsigned int *) &q[(ldq*3)+offset]);
883
884
885
886
887
888
889
890

#ifdef DOUBLE_PRECISION_REAL
	h3 = vec_splats(hh[(ldh*2)+1]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h3 = vec_splats(hh[(ldh*2)+1] );
#endif

891
892
	q1 = _SSE_LOAD(0, (unsigned long int *) &q[ldq*4]);
	q2 = _SSE_LOAD(0, (unsigned long int *) &q[(ldq*4)+offset]);
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
	q1 = _SSE_SUB(q1, y1);
	q2 = _SSE_SUB(q2, y2);

	q1 = _SSE_SUB(q1, _SSE_MUL(z1, h3));
	q2 = _SSE_SUB(q2, _SSE_MUL(z2, h3));

#ifdef DOUBLE_PRECISION_REAL
	h4 = vec_splats(hh[(ldh*3)+2]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h4 = vec_splats(hh[(ldh*3)+2] );
#endif

	q1 = _SSE_SUB(q1, _SSE_MUL(w1, h4));
	q2 = _SSE_SUB(q2, _SSE_MUL(w2, h4));

#ifdef DOUBLE_PRECISION_REAL
	h5 = vec_splats(hh[(ldh*4)+3]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h5 = vec_splats(hh[(ldh*4)+3] );
#endif

	q1 = _SSE_SUB(q1, _SSE_MUL(v1, h5));
	q2 = _SSE_SUB(q2, _SSE_MUL(v2, h5));

#ifdef DOUBLE_PRECISION_REAL
	h6 = vec_splats(hh[(ldh*5)+4]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h6 = vec_splats(hh[(ldh*5)+4] );
#endif

	q1 = _SSE_SUB(q1, _SSE_MUL(t1, h6));
	q2 = _SSE_SUB(q2, _SSE_MUL(t2, h6));

	_SSE_STORE((__vector unsigned int) q1, 0, (unsigned int *) &q[ldq*4]);
	_SSE_STORE((__vector unsigned int) q2, 0, (unsigned int *) &q[(ldq*4)+offset]);

#ifdef DOUBLE_PRECISION_REAL
	h2 = vec_splats(hh[(ldh)+1]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h2 = vec_splats(hh[(ldh)+1] );
#endif

939
940
	q1 = _SSE_LOAD(0, (unsigned long int *) &q[ldq*5]);
	q2 = _SSE_LOAD(0, (unsigned long int *) &q[(ldq*5)+offset]);
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
	q1 = _SSE_SUB(q1, x1);
	q2 = _SSE_SUB(q2, x2);

	q1 = _SSE_SUB(q1, _SSE_MUL(y1, h2));
	q2 = _SSE_SUB(q2, _SSE_MUL(y2, h2));

#ifdef DOUBLE_PRECISION_REAL
	h3 = vec_splats(hh[(ldh*2)+2]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h3 = vec_splats(hh[(ldh*2)+2] );
#endif

	q1 = _SSE_SUB(q1, _SSE_MUL(z1, h3));
	q2 = _SSE_SUB(q2, _SSE_MUL(z2, h3));

#ifdef DOUBLE_PRECISION_REAL
	h4 = vec_splats(hh[(ldh*3)+3]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h4 = vec_splats(hh[(ldh*3)+3] );
#endif

	q1 = _SSE_SUB(q1, _SSE_MUL(w1, h4));
	q2 = _SSE_SUB(q2, _SSE_MUL(w2, h4));

#ifdef DOUBLE_PRECISION_REAL
	h5 = vec_splats(hh[(ldh*4)+4]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h5 = vec_splats(hh[(ldh*4)+4] );
#endif

	q1 = _SSE_SUB(q1, _SSE_MUL(v1, h5));
	q2 = _SSE_SUB(q2, _SSE_MUL(v2, h5));

#ifdef DOUBLE_PRECISION_REAL
	h6 = vec_splats(hh[(ldh*5)+5]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h6 = vec_splats(hh[(ldh*5)+5] );
#endif

	q1 = _SSE_SUB(q1, _SSE_MUL(t1, h6));
	q2 = _SSE_SUB(q2, _SSE_MUL(t2, h6));

	_SSE_STORE((__vector unsigned int) q1, 0, (unsigned int *) &q[ldq*5]);
	_SSE_STORE((__vector unsigned int) q2, 0, (unsigned int *) &q[(ldq*5)+offset]);

	for (i = 6; i < nb; i++)
	{
992
993
		q1 = _SSE_LOAD(0, (unsigned long int *) &q[i*ldq]);
		q2 = _SSE_LOAD(0, (unsigned long int *) &q[(i*ldq)+offset]);
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
#ifdef DOUBLE_PRECISION_REAL
		h1 = vec_splats(hh[i-5]);
#endif
#ifdef SINGLE_PRECISION_REAL
		h1 = vec_splats(hh[i-5] );
#endif

		q1 = _SSE_SUB(q1, _SSE_MUL(x1, h1));
		q2 = _SSE_SUB(q2, _SSE_MUL(x2, h1));

#ifdef DOUBLE_PRECISION_REAL
		h2 = vec_splats(hh[ldh+i-4]);
#endif
#ifdef SINGLE_PRECISION_REAL
		h2 = vec_splats(hh[ldh+i-4] );
#endif

		q1 = _SSE_SUB(q1, _SSE_MUL(y1, h2));
		q2 = _SSE_SUB(q2, _SSE_MUL(y2, h2));

#ifdef DOUBLE_PRECISION_REAL
		h3 = vec_splats(hh[(ldh*2)+i-3]);
#endif
#ifdef SINGLE_PRECISION_REAL
		h3 = vec_splats(hh[(ldh*2)+i-3] );
#endif

		q1 = _SSE_SUB(q1, _SSE_MUL(z1, h3));
		q2 = _SSE_SUB(q2, _SSE_MUL(z2, h3));

#ifdef DOUBLE_PRECISION_REAL
		h4 = vec_splats(hh[(ldh*3)+i-2]);
#endif
#ifdef SINGLE_PRECISION_REAL
		h4 = vec_splats(hh[(ldh*3)+i-2] );
#endif

		q1 = _SSE_SUB(q1, _SSE_MUL(w1, h4));
		q2 = _SSE_SUB(q2, _SSE_MUL(w2, h4));

#ifdef DOUBLE_PRECISION_REAL
		h5 = vec_splats(hh[(ldh*4)+i-1]);
#endif
#ifdef SINGLE_PRECISION_REAL
		h5 = vec_splats(hh[(ldh*4)+i-1] );
#endif

		q1 = _SSE_SUB(q1, _SSE_MUL(v1, h5));
		q2 = _SSE_SUB(q2, _SSE_MUL(v2, h5));

#ifdef DOUBLE_PRECISION_REAL
		h6 = vec_splats(hh[(ldh*5)+i]);
#endif
#ifdef SINGLE_PRECISION_REAL
		h6 = vec_splats(hh[(ldh*5)+i] );
#endif

		q1 = _SSE_SUB(q1, _SSE_MUL(t1, h6));
		q2 = _SSE_SUB(q2, _SSE_MUL(t2, h6));

		_SSE_STORE((__vector unsigned int) q1, 0, (unsigned int *) &q[i*ldq]);
		_SSE_STORE((__vector unsigned int) q2, 0, (unsigned int *) &q[(i*ldq)+offset]);
	}

#ifdef DOUBLE_PRECISION_REAL
	h1 = vec_splats(hh[nb-5]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h1 = vec_splats(hh[nb-5] );
#endif

1065
1066
	q1 = _SSE_LOAD(0, (unsigned long int *) &q[nb*ldq]);
	q2 = _SSE_LOAD(0, (unsigned long int *) &q[(nb*ldq)+offset]);
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120

	q1 = _SSE_SUB(q1, _SSE_MUL(x1, h1));
	q2 = _SSE_SUB(q2, _SSE_MUL(x2, h1));

#ifdef DOUBLE_PRECISION_REAL
	h2 = vec_splats(hh[ldh+nb-4]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h2 = vec_splats(hh[ldh+nb-4] );
#endif

	q1 = _SSE_SUB(q1, _SSE_MUL(y1, h2));
	q2 = _SSE_SUB(q2, _SSE_MUL(y2, h2));

#ifdef DOUBLE_PRECISION_REAL
	h3 = vec_splats(hh[(ldh*2)+nb-3]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h3 = vec_splats(hh[(ldh*2)+nb-3] );
#endif

	q1 = _SSE_SUB(q1, _SSE_MUL(z1, h3));
	q2 = _SSE_SUB(q2, _SSE_MUL(z2, h3));

#ifdef DOUBLE_PRECISION_REAL
	h4 = vec_splats(hh[(ldh*3)+nb-2]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h4 = vec_splats(hh[(ldh*3)+nb-2] );
#endif

	q1 = _SSE_SUB(q1, _SSE_MUL(w1, h4));
	q2 = _SSE_SUB(q2, _SSE_MUL(w2, h4));

#ifdef DOUBLE_PRECISION_REAL
	h5 = vec_splats(hh[(ldh*4)+nb-1]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h5 = vec_splats(hh[(ldh*4)+nb-1] );
#endif

	q1 = _SSE_SUB(q1, _SSE_MUL(v1, h5));
	q2 = _SSE_SUB(q2, _SSE_MUL(v2, h5));

	_SSE_STORE((__vector unsigned int) q1, 0, (unsigned int *) &q[nb*ldq]);
	_SSE_STORE((__vector unsigned int) q2, 0, (unsigned int *) &q[(nb*ldq)+offset]);

#ifdef DOUBLE_PRECISION_REAL
	h1 = vec_splats(hh[nb-4]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h1 = vec_splats(hh[nb-4] );
#endif

1121
1122
	q1 = _SSE_LOAD(0, (unsigned long int *) &q[(nb+1)*ldq]);
	q2 = _SSE_LOAD(0, (unsigned long int *) &q[((nb+1)*ldq)+offset]);
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166

	q1 = _SSE_SUB(q1, _SSE_MUL(x1, h1));
	q2 = _SSE_SUB(q2, _SSE_MUL(x2, h1));

#ifdef DOUBLE_PRECISION_REAL
	h2 = vec_splats(hh[ldh+nb-3]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h2 = vec_splats(hh[ldh+nb-3] );
#endif

	q1 = _SSE_SUB(q1, _SSE_MUL(y1, h2));
	q2 = _SSE_SUB(q2, _SSE_MUL(y2, h2));

#ifdef DOUBLE_PRECISION_REAL
	h3 = vec_splats(hh[(ldh*2)+nb-2]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h3 = vec_splats(hh[(ldh*2)+nb-2] );
#endif

	q1 = _SSE_SUB(q1, _SSE_MUL(z1, h3));
	q2 = _SSE_SUB(q2, _SSE_MUL(z2, h3));

#ifdef DOUBLE_PRECISION_REAL
	h4 = vec_splats(hh[(ldh*3)+nb-1]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h4 = vec_splats(hh[(ldh*3)+nb-1] );
#endif

	q1 = _SSE_SUB(q1, _SSE_MUL(w1, h4));
	q2 = _SSE_SUB(q2, _SSE_MUL(w2, h4));

	_SSE_STORE((__vector unsigned int) q1, 0, (unsigned int *) &q[(nb+1)*ldq]);
	_SSE_STORE((__vector unsigned int) q2, 0, (unsigned int *) &q[((nb+1)*ldq)+offset]);

#ifdef DOUBLE_PRECISION_REAL
	h1 = vec_splats(hh[nb-3]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h1 = vec_splats(hh[nb-3] );
#endif

1167
1168
	q1 = _SSE_LOAD(0, (unsigned long int *) &q[(nb+2)*ldq]);
	q2 = _SSE_LOAD(0, (unsigned long int *) &q[((nb+2)*ldq)+offset]);
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202

	q1 = _SSE_SUB(q1, _SSE_MUL(x1, h1));
	q2 = _SSE_SUB(q2, _SSE_MUL(x2, h1));

#ifdef DOUBLE_PRECISION_REAL
	h2 = vec_splats(hh[ldh+nb-2]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h2 = vec_splats(hh[ldh+nb-2] );
#endif

	q1 = _SSE_SUB(q1, _SSE_MUL(y1, h2));
	q2 = _SSE_SUB(q2, _SSE_MUL(y2, h2));

#ifdef DOUBLE_PRECISION_REAL
	h3 = vec_splats(hh[(ldh*2)+nb-1]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h3 = vec_splats(hh[(ldh*2)+nb-1] );
#endif

	q1 = _SSE_SUB(q1, _SSE_MUL(z1, h3));
	q2 = _SSE_SUB(q2, _SSE_MUL(z2, h3));

	_SSE_STORE((__vector unsigned int) q1, 0, (unsigned int *) &q[(nb+2)*ldq]);
	_SSE_STORE((__vector unsigned int) q2, 0, (unsigned int *) &q[((nb+2)*ldq)+offset]);

#ifdef DOUBLE_PRECISION_REAL
	h1 = vec_splats(hh[nb-2]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h1 = vec_splats(hh[nb-2] );
#endif

1203
1204
	q1 = _SSE_LOAD(0, (unsigned long int *) &q[(nb+3)*ldq]);
	q2 = _SSE_LOAD(0, (unsigned long int *) &q[((nb+3)*ldq)+offset]);
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228

	q1 = _SSE_SUB(q1, _SSE_MUL(x1, h1));
	q2 = _SSE_SUB(q2, _SSE_MUL(x2, h1));

#ifdef DOUBLE_PRECISION_REAL
	h2 = vec_splats(hh[ldh+nb-1]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h2 = vec_splats(hh[ldh+nb-1] );
#endif

	q1 = _SSE_SUB(q1, _SSE_MUL(y1, h2));
	q2 = _SSE_SUB(q2, _SSE_MUL(y2, h2));

	_SSE_STORE((__vector unsigned int) q1, 0, (unsigned int *) &q[(nb+3)*ldq]);
	_SSE_STORE((__vector unsigned int) q2, 0, (unsigned int *) &q[((nb+3)*ldq)+offset]);

#ifdef DOUBLE_PRECISION_REAL
	h1 = vec_splats(hh[nb-1]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h1 = vec_splats(hh[nb-1] );
#endif

1229
1230
	q1 = _SSE_LOAD(0, (unsigned long int *) &q[(nb+4)*ldq]);
	q2 = _SSE_LOAD(0, (unsigned long int *) &q[((nb+4)*ldq)+offset]);
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249

	q1 = _SSE_SUB(q1, _SSE_MUL(x1, h1));
	q2 = _SSE_SUB(q2, _SSE_MUL(x2, h1));

	_SSE_STORE((__vector unsigned int) q1, 0, (unsigned int *) &q[(nb+4)*ldq]);
	_SSE_STORE((__vector unsigned int) q2, 0, (unsigned int *) &q[((nb+4)*ldq)+offset]);
}
/**
 * Unrolled kernel that computes
#ifdef DOUBLE_PRECISION_REAL
 * 2 rows of Q simultaneously, a
#endif
#ifdef SINGLE_PRECISION_REAL
 * 4 rows of Q simultaneously, a
#endif
 * matrix Vector product with two householder
 * vectors + a rank 1 update is performed
 */
#ifdef DOUBLE_PRECISION_REAL
1250
__forceinline void hh_trafo_kernel_2_VSX_6hv_double(double* q, double* hh, int nb, int ldq, int ldh, double* scalarprods)
1251
1252
#endif
#ifdef SINGLE_PRECISION_REAL
1253
__forceinline void hh_trafo_kernel_4_VSX_6hv_single(float* q, float* hh, int nb, int ldq, int ldh, float* scalarprods)
1254
1255
1256
1257
1258
1259
1260
1261
#endif
{
	/////////////////////////////////////////////////////
	// Matrix Vector Multiplication, Q [2 x nb+3] * hh
	// hh contains four householder vectors
	/////////////////////////////////////////////////////
	int i;

1262
1263
1264
1265
1266
1267
	__SSE_DATATYPE a1_1 = _SSE_LOAD(0, (unsigned long int *) &q[ldq*5]);
	__SSE_DATATYPE a2_1 = _SSE_LOAD(0, (unsigned long int *) &q[ldq*4]);
	__SSE_DATATYPE a3_1 = _SSE_LOAD(0, (unsigned long int *) &q[ldq*3]);
	__SSE_DATATYPE a4_1 = _SSE_LOAD(0, (unsigned long int *) &q[ldq*2]);
	__SSE_DATATYPE a5_1 = _SSE_LOAD(0, (unsigned long int *) &q[ldq]);
	__SSE_DATATYPE a6_1 = _SSE_LOAD(0, (unsigned long int *) &q[0]);
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355

#ifdef DOUBLE_PRECISION_REAL
	__SSE_DATATYPE h_6_5 = vec_splats(hh[(ldh*5)+1]);
	__SSE_DATATYPE h_6_4 = vec_splats(hh[(ldh*5)+2]);
	__SSE_DATATYPE h_6_3 = vec_splats(hh[(ldh*5)+3]);
	__SSE_DATATYPE h_6_2 = vec_splats(hh[(ldh*5)+4]);
	__SSE_DATATYPE h_6_1 = vec_splats(hh[(ldh*5)+5]);
#endif
#ifdef SINGLE_PRECISION_REAL
	__SSE_DATATYPE h_6_5 = vec_splats(hh[(ldh*5)+1]) ;
	__SSE_DATATYPE h_6_4 = vec_splats(hh[(ldh*5)+2]) ;
	__SSE_DATATYPE h_6_3 = vec_splats(hh[(ldh*5)+3]) ;
	__SSE_DATATYPE h_6_2 = vec_splats(hh[(ldh*5)+4]) ;
	__SSE_DATATYPE h_6_1 = vec_splats(hh[(ldh*5)+5]) ;
#endif

	register __SSE_DATATYPE t1 = _SSE_ADD(a6_1, _SSE_MUL(a5_1, h_6_5));
	t1 = _SSE_ADD(t1, _SSE_MUL(a4_1, h_6_4));
	t1 = _SSE_ADD(t1, _SSE_MUL(a3_1, h_6_3));
	t1 = _SSE_ADD(t1, _SSE_MUL(a2_1, h_6_2));
	t1 = _SSE_ADD(t1, _SSE_MUL(a1_1, h_6_1));

#ifdef DOUBLE_PRECISION_REAL
	__SSE_DATATYPE h_5_4 = vec_splats(hh[(ldh*4)+1]);
	__SSE_DATATYPE h_5_3 = vec_splats(hh[(ldh*4)+2]);
	__SSE_DATATYPE h_5_2 = vec_splats(hh[(ldh*4)+3]);
	__SSE_DATATYPE h_5_1 = vec_splats(hh[(ldh*4)+4]);
#endif
#ifdef SINGLE_PRECISION_REAL
	__SSE_DATATYPE h_5_4 = vec_splats(hh[(ldh*4)+1]) ;
	__SSE_DATATYPE h_5_3 = vec_splats(hh[(ldh*4)+2]) ;
	__SSE_DATATYPE h_5_2 = vec_splats(hh[(ldh*4)+3]) ;
	__SSE_DATATYPE h_5_1 = vec_splats(hh[(ldh*4)+4]) ;
#endif

	register __SSE_DATATYPE v1 = _SSE_ADD(a5_1, _SSE_MUL(a4_1, h_5_4));
	v1 = _SSE_ADD(v1, _SSE_MUL(a3_1, h_5_3));
	v1 = _SSE_ADD(v1, _SSE_MUL(a2_1, h_5_2));
	v1 = _SSE_ADD(v1, _SSE_MUL(a1_1, h_5_1));

#ifdef DOUBLE_PRECISION_REAL
	__SSE_DATATYPE h_4_3 = vec_splats(hh[(ldh*3)+1]);
	__SSE_DATATYPE h_4_2 = vec_splats(hh[(ldh*3)+2]);
	__SSE_DATATYPE h_4_1 = vec_splats(hh[(ldh*3)+3]);
#endif
#ifdef SINGLE_PRECISION_REAL
	__SSE_DATATYPE h_4_3 = vec_splats(hh[(ldh*3)+1]) ;
	__SSE_DATATYPE h_4_2 = vec_splats(hh[(ldh*3)+2]) ;
	__SSE_DATATYPE h_4_1 = vec_splats(hh[(ldh*3)+3]) ;
#endif
	register __SSE_DATATYPE w1 = _SSE_ADD(a4_1, _SSE_MUL(a3_1, h_4_3));
	w1 = _SSE_ADD(w1, _SSE_MUL(a2_1, h_4_2));
	w1 = _SSE_ADD(w1, _SSE_MUL(a1_1, h_4_1));

#ifdef DOUBLE_PRECISION_REAL
	__SSE_DATATYPE h_2_1 = vec_splats(hh[ldh+1]);
	__SSE_DATATYPE h_3_2 = vec_splats(hh[(ldh*2)+1]);
	__SSE_DATATYPE h_3_1 = vec_splats(hh[(ldh*2)+2]);
#endif
#ifdef SINGLE_PRECISION_REAL
	__SSE_DATATYPE h_2_1 = vec_splats(hh[ldh+1]) ;
	__SSE_DATATYPE h_3_2 = vec_splats(hh[(ldh*2)+1]) ;
	__SSE_DATATYPE h_3_1 = vec_splats(hh[(ldh*2)+2]) ;
#endif

	register __SSE_DATATYPE z1 = _SSE_ADD(a3_1, _SSE_MUL(a2_1, h_3_2));
	z1 = _SSE_ADD(z1, _SSE_MUL(a1_1, h_3_1));
	register __SSE_DATATYPE y1 = _SSE_ADD(a2_1, _SSE_MUL(a1_1, h_2_1));

	register __SSE_DATATYPE x1 = a1_1;

	__SSE_DATATYPE q1;

	__SSE_DATATYPE h1;
	__SSE_DATATYPE h2;
	__SSE_DATATYPE h3;
	__SSE_DATATYPE h4;
	__SSE_DATATYPE h5;
	__SSE_DATATYPE h6;

	for(i = 6; i < nb; i++)
	{
#ifdef DOUBLE_PRECISION_REAL
		h1 = vec_splats(hh[i-5]);
#endif
#ifdef SINGLE_PRECISION_REAL
		h1 = vec_splats(hh[i-5]) ;
#endif
1356
		q1 = _SSE_LOAD(0, (unsigned long int *) &q[i*ldq]);
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413

		x1 = _SSE_ADD(x1, _SSE_MUL(q1,h1));

#ifdef DOUBLE_PRECISION_REAL
		h2 = vec_splats(hh[ldh+i-4]);
#endif
#ifdef SINGLE_PRECISION_REAL
		h2 = vec_splats(hh[ldh+i-4]) ;
#endif

		y1 = _SSE_ADD(y1, _SSE_MUL(q1,h2));

#ifdef DOUBLE_PRECISION_REAL
		h3 = vec_splats(hh[(ldh*2)+i-3]);
#endif
#ifdef SINGLE_PRECISION_REAL
		h3 = vec_splats(hh[(ldh*2)+i-3]) ;
#endif

		z1 = _SSE_ADD(z1, _SSE_MUL(q1,h3));

#ifdef DOUBLE_PRECISION_REAL
		h4 = vec_splats(hh[(ldh*3)+i-2]);
#endif
#ifdef SINGLE_PRECISION_REAL
		h4 = vec_splats(hh[(ldh*3)+i-2]) ;
#endif

		w1 = _SSE_ADD(w1, _SSE_MUL(q1,h4));

#ifdef DOUBLE_PRECISION_REAL
		h5 = vec_splats(hh[(ldh*4)+i-1]);
#endif
#ifdef SINGLE_PRECISION_REAL
		h5 = vec_splats(hh[(ldh*4)+i-1]) ;
#endif

		v1 = _SSE_ADD(v1, _SSE_MUL(q1,h5));

#ifdef DOUBLE_PRECISION_REAL
		h6 = vec_splats(hh[(ldh*5)+i]);
#endif
#ifdef SINGLE_PRECISION_REAL
		h6 = vec_splats(hh[(ldh*5)+i]) ;
#endif

		t1 = _SSE_ADD(t1, _SSE_MUL(q1,h6));

	}

#ifdef DOUBLE_PRECISION_REAL
	h1 = vec_splats(hh[nb-5]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h1 = vec_splats(hh[nb-5]) ;
#endif

1414
	q1 = _SSE_LOAD(0, (unsigned long int *) &q[nb*ldq]);
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461

	x1 = _SSE_ADD(x1, _SSE_MUL(q1,h1));

#ifdef DOUBLE_PRECISION_REAL
	h2 = vec_splats(hh[ldh+nb-4]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h2 = vec_splats(hh[ldh+nb-4]) ;
#endif

	y1 = _SSE_ADD(y1, _SSE_MUL(q1,h2));

#ifdef DOUBLE_PRECISION_REAL
	h3 = vec_splats(hh[(ldh*2)+nb-3]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h3 = vec_splats(hh[(ldh*2)+nb-3]) ;
#endif

	z1 = _SSE_ADD(z1, _SSE_MUL(q1,h3));

#ifdef DOUBLE_PRECISION_REAL
	h4 = vec_splats(hh[(ldh*3)+nb-2]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h4 = vec_splats(hh[(ldh*3)+nb-2]) ;
#endif


	w1 = _SSE_ADD(w1, _SSE_MUL(q1,h4));

#ifdef DOUBLE_PRECISION_REAL
	h5 = vec_splats(hh[(ldh*4)+nb-1]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h5 = vec_splats(hh[(ldh*4)+nb-1]) ;
#endif

	v1 = _SSE_ADD(v1, _SSE_MUL(q1,h5));

#ifdef DOUBLE_PRECISION_REAL
	h1 = vec_splats(hh[nb-4]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h1 = vec_splats(hh[nb-4]) ;
#endif

1462
	q1 = _SSE_LOAD(0, (unsigned long int *) &q[(nb+1)*ldq]);
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499

	x1 = _SSE_ADD(x1, _SSE_MUL(q1,h1));

#ifdef DOUBLE_PRECISION_REAL
	h2 = vec_splats(hh[ldh+nb-3]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h2 = vec_splats(hh[ldh+nb-3]) ;
#endif

	y1 = _SSE_ADD(y1, _SSE_MUL(q1,h2));

#ifdef DOUBLE_PRECISION_REAL
	h3 = vec_splats(hh[(ldh*2)+nb-2]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h3 = vec_splats(hh[(ldh*2)+nb-2]) ;
#endif

	z1 = _SSE_ADD(z1, _SSE_MUL(q1,h3));

#ifdef DOUBLE_PRECISION_REAL
	h4 = vec_splats(hh[(ldh*3)+nb-1]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h4 = vec_splats(hh[(ldh*3)+nb-1]) ;
#endif

	w1 = _SSE_ADD(w1, _SSE_MUL(q1,h4));

#ifdef DOUBLE_PRECISION_REAL
	h1 = vec_splats(hh[nb-3]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h1 = vec_splats(hh[nb-3]) ;
#endif

1500
	q1 = _SSE_LOAD(0, (unsigned long int *) &q[(nb+2)*ldq]);
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528

	x1 = _SSE_ADD(x1, _SSE_MUL(q1,h1));

#ifdef DOUBLE_PRECISION_REAL
	h2 = vec_splats(hh[ldh+nb-2]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h2 = vec_splats(hh[ldh+nb-2]) ;
#endif

	y1 = _SSE_ADD(y1, _SSE_MUL(q1,h2));

#ifdef DOUBLE_PRECISION_REAL
	h3 = vec_splats(hh[(ldh*2)+nb-1]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h3 = vec_splats(hh[(ldh*2)+nb-1]) ;
#endif

	z1 = _SSE_ADD(z1, _SSE_MUL(q1,h3));

#ifdef DOUBLE_PRECISION_REAL
	h1 = vec_splats(hh[nb-2]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h1 = vec_splats(hh[nb-2]) ;
#endif

1529
	q1 = _SSE_LOAD(0, (unsigned long int *) &q[(nb+3)*ldq]);
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548

	x1 = _SSE_ADD(x1, _SSE_MUL(q1,h1));

#ifdef DOUBLE_PRECISION_REAL
	h2 = vec_splats(hh[ldh+nb-1]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h2 = vec_splats(hh[ldh+nb-1]) ;
#endif

	y1 = _SSE_ADD(y1, _SSE_MUL(q1,h2));

#ifdef DOUBLE_PRECISION_REAL
	h1 = vec_splats(hh[nb-1]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h1 = vec_splats(hh[nb-1]) ;
#endif

1549
	q1 = _SSE_LOAD(0, (unsigned long int *) &q[(nb+4)*ldq]);
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677

	x1 = _SSE_ADD(x1, _SSE_MUL(q1,h1));

	/////////////////////////////////////////////////////
	// Apply tau, correct wrong calculation using pre-calculated scalar products
	/////////////////////////////////////////////////////

#ifdef DOUBLE_PRECISION_REAL
	__SSE_DATATYPE tau1 = vec_splats(hh[0]);
#endif
#ifdef SINGLE_PRECISION_REAL
	__SSE_DATATYPE tau1 = vec_splats(hh[0]) ;
#endif
	x1 = _SSE_MUL(x1, tau1);

#ifdef DOUBLE_PRECISION_REAL
	__SSE_DATATYPE tau2 = vec_splats(hh[ldh]);
	__SSE_DATATYPE vs_1_2 = vec_splats(scalarprods[0]);
#endif
#ifdef SINGLE_PRECISION_REAL
	__SSE_DATATYPE tau2 = vec_splats(hh[ldh]) ;
	__SSE_DATATYPE vs_1_2 = vec_splats(scalarprods[0]) ;
#endif

	h2 = _SSE_MUL(tau2, vs_1_2);

	y1 = _SSE_SUB(_SSE_MUL(y1,tau2), _SSE_MUL(x1,h2));

#ifdef DOUBLE_PRECISION_REAL
	__SSE_DATATYPE tau3 = vec_splats(hh[ldh*2]);
	__SSE_DATATYPE vs_1_3 = vec_splats(scalarprods[1]);
	__SSE_DATATYPE vs_2_3 = vec_splats(scalarprods[2]);
#endif
#ifdef SINGLE_PRECISION_REAL
	__SSE_DATATYPE tau3 = vec_splats(hh[ldh*2]) ;
	__SSE_DATATYPE vs_1_3 = vec_splats(scalarprods[1]) ;
	__SSE_DATATYPE vs_2_3 = vec_splats(scalarprods[2]) ;
#endif

	h2 = _SSE_MUL(tau3, vs_1_3);
	h3 = _SSE_MUL(tau3, vs_2_3);

	z1 = _SSE_SUB(_SSE_MUL(z1,tau3), _SSE_ADD(_SSE_MUL(y1,h3), _SSE_MUL(x1,h2)));

#ifdef DOUBLE_PRECISION_REAL
	__SSE_DATATYPE tau4 = vec_splats(hh[ldh*3]);
	__SSE_DATATYPE vs_1_4 = vec_splats(scalarprods[3]);
	__SSE_DATATYPE vs_2_4 = vec_splats(scalarprods[4]);
#endif
#ifdef SINGLE_PRECISION_REAL
	__SSE_DATATYPE tau4 = vec_splats(hh[ldh*3]) ;
	__SSE_DATATYPE vs_1_4 = vec_splats(scalarprods[3]) ;
	__SSE_DATATYPE vs_2_4 = vec_splats(scalarprods[4]) ;
#endif
	h2 = _SSE_MUL(tau4, vs_1_4);
	h3 = _SSE_MUL(tau4, vs_2_4);

#ifdef DOUBLE_PRECISION_REAL
	__SSE_DATATYPE vs_3_4 = vec_splats(scalarprods[5]);
#endif
#ifdef SINGLE_PRECISION_REAL
	__SSE_DATATYPE vs_3_4 = vec_splats(scalarprods[5]) ;
#endif

	h4 = _SSE_MUL(tau4, vs_3_4);

	w1 = _SSE_SUB(_SSE_MUL(w1,tau4), _SSE_ADD(_SSE_MUL(z1,h4), _SSE_ADD(_SSE_MUL(y1,h3), _SSE_MUL(x1,h2))));

#ifdef DOUBLE_PRECISION_REAL
	__SSE_DATATYPE tau5 = vec_splats(hh[ldh*4]);
	__SSE_DATATYPE vs_1_5 = vec_splats(scalarprods[6]);
	__SSE_DATATYPE vs_2_5 = vec_splats(scalarprods[7]);
#endif
#ifdef SINGLE_PRECISION_REAL
	__SSE_DATATYPE tau5 = vec_splats(hh[ldh*4]) ;
	__SSE_DATATYPE vs_1_5 = vec_splats(scalarprods[6]) ;
	__SSE_DATATYPE vs_2_5 = vec_splats(scalarprods[7]) ;
#endif
	h2 = _SSE_MUL(tau5, vs_1_5);
	h3 = _SSE_MUL(tau5, vs_2_5);

#ifdef DOUBLE_PRECISION_REAL
	__SSE_DATATYPE vs_3_5 = vec_splats(scalarprods[8]);
	__SSE_DATATYPE vs_4_5 = vec_splats(scalarprods[9]);
#endif
#ifdef SINGLE_PRECISION_REAL
	__SSE_DATATYPE vs_3_5 = vec_splats(scalarprods[8]) ;
	__SSE_DATATYPE vs_4_5 = vec_splats(scalarprods[9]) ;
#endif
	h4 = _SSE_MUL(tau5, vs_3_5);
	h5 = _SSE_MUL(tau5, vs_4_5);

	v1 = _SSE_SUB(_SSE_MUL(v1,tau5), _SSE_ADD(_SSE_ADD(_SSE_MUL(w1,h5), _SSE_MUL(z1,h4)), _SSE_ADD(_SSE_MUL(y1,h3), _SSE_MUL(x1,h2))));

#ifdef DOUBLE_PRECISION_REAL
	__SSE_DATATYPE tau6 = vec_splats(hh[ldh*5]);
	__SSE_DATATYPE vs_1_6 = vec_splats(scalarprods[10]);
	__SSE_DATATYPE vs_2_6 = vec_splats(scalarprods[11]);
#endif
#ifdef SINGLE_PRECISION_REAL
	__SSE_DATATYPE tau6 = vec_splats(hh[ldh*5]) ;
	__SSE_DATATYPE vs_1_6 = vec_splats(scalarprods[10]) ;
	__SSE_DATATYPE vs_2_6 = vec_splats(scalarprods[11]) ;
#endif
	h2 = _SSE_MUL(tau6, vs_1_6);
	h3 = _SSE_MUL(tau6, vs_2_6);

#ifdef DOUBLE_PRECISION_REAL
	__SSE_DATATYPE vs_3_6 = vec_splats(scalarprods[12]);
	__SSE_DATATYPE vs_4_6 = vec_splats(scalarprods[13]);
	__SSE_DATATYPE vs_5_6 = vec_splats(scalarprods[14]);
#endif
#ifdef SINGLE_PRECISION_REAL
	__SSE_DATATYPE vs_3_6 = vec_splats(scalarprods[12]) ;
	__SSE_DATATYPE vs_4_6 = vec_splats(scalarprods[13]) ;
	__SSE_DATATYPE vs_5_6 = vec_splats(scalarprods[14]) ;
#endif

	h4 = _SSE_MUL(tau6, vs_3_6);
	h5 = _SSE_MUL(tau6, vs_4_6);
	h6 = _SSE_MUL(tau6, vs_5_6);

	t1 = _SSE_SUB(_SSE_MUL(t1,tau6), _SSE_ADD( _SSE_MUL(v1,h6), _SSE_ADD(_SSE_ADD(_SSE_MUL(w1,h5), _SSE_MUL(z1,h4)), _SSE_ADD(_SSE_MUL(y1,h3), _SSE_MUL(x1,h2)))));

	/////////////////////////////////////////////////////
	// Rank-1 update of Q [2 x nb+3]
	/////////////////////////////////////////////////////

1678
	q1 = _SSE_LOAD(0, (unsigned long int *) &q[0]);
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
	q1 = _SSE_SUB(q1, t1);
	_SSE_STORE((__vector unsigned int) q1, 0, (unsigned int *) &q[0]);

#ifdef DOUBLE_PRECISION_REAL
	h6 = vec_splats(hh[(ldh*5)+1]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h6 = vec_splats(hh[(ldh*5)+1]) ;
#endif

1689
	q1 = _SSE_LOAD(0, (unsigned long int *) &q[ldq]);
1690
1691
1692
1693
	q1 = _SSE_SUB(q1, v1);

	q1 = _SSE_SUB(q1, _SSE_MUL(t1, h6));

1694
	_SSE_STORE((__vector unsigned int) q1, 0, (unsigned int *) &q[ldq]);
1695
1696
1697
1698
1699
1700
1701

#ifdef DOUBLE_PRECISION_REAL
	h5 = vec_splats(hh[(ldh*4)+1]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h5 = vec_splats(hh[(ldh*4)+1]) ;
#endif
1702
	q1 = _SSE_LOAD(0, (unsigned long int *) &q[ldq*2]);
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
	q1 = _SSE_SUB(q1, w1);

	q1 = _SSE_SUB(q1, _SSE_MUL(v1, h5));

#ifdef DOUBLE_PRECISION_REAL
	h6 = vec_splats(hh[(ldh*5)+2]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h6 = vec_splats(hh[(ldh*5)+2]) ;
#endif

	q1 = _SSE_SUB(q1, _SSE_MUL(t1, h6));

	_SSE_STORE((__vector unsigned int) q1, 0, (unsigned int *) &q[ldq*2]);

#ifdef DOUBLE_PRECISION_REAL
	h4 = vec_splats(hh[(ldh*3)+1]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h4 = vec_splats(hh[(ldh*3)+1]) ;
#endif

1725
	q1 = _SSE_LOAD(0, (unsigned long int *) &q[ldq*3]);
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
	q1 = _SSE_SUB(q1, z1);

	q1 = _SSE_SUB(q1, _SSE_MUL(w1, h4));

#ifdef DOUBLE_PRECISION_REAL
	h5 = vec_splats(hh[(ldh*4)+2]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h5 = vec_splats(hh[(ldh*4)+2]) ;
#endif

	q1 = _SSE_SUB(q1, _SSE_MUL(v1, h5));

#ifdef DOUBLE_PRECISION_REAL
	h6 = vec_splats(hh[(ldh*5)+3]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h6 = vec_splats(hh[(ldh*5)+3]) ;
#endif

	q1 = _SSE_SUB(q1, _SSE_MUL(t1, h6));

	_SSE_STORE((__vector unsigned int) q1, 0, (unsigned int *) &q[ldq*3]);

#ifdef DOUBLE_PRECISION_REAL
	h3 = vec_splats(hh[(ldh*2)+1]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h3 = vec_splats(hh[(ldh*2)+1]) ;
#endif

1757
	q1 = _SSE_LOAD(0, (unsigned long int *) &q[ldq*4]);
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
	q1 = _SSE_SUB(q1, y1);

	q1 = _SSE_SUB(q1, _SSE_MUL(z1, h3));

#ifdef DOUBLE_PRECISION_REAL
	h4 = vec_splats(hh[(ldh*3)+2]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h4 = vec_splats(hh[(ldh*3)+2]) ;
#endif

	q1 = _SSE_SUB(q1, _SSE_MUL(w1, h4));

#ifdef DOUBLE_PRECISION_REAL
	h5 = vec_splats(hh[(ldh*4)+3]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h5 = vec_splats(hh[(ldh*4)+3]) ;
#endif

	q1 = _SSE_SUB(q1, _SSE_MUL(v1, h5));

#ifdef DOUBLE_PRECISION_REAL
	h6 = vec_splats(hh[(ldh*5)+4]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h6 = vec_splats(hh[(ldh*5)+4]) ;
#endif

	q1 = _SSE_SUB(q1, _SSE_MUL(t1, h6));

	_SSE_STORE((__vector unsigned int) q1, 0, (unsigned int *) &q[ldq*4]);

#ifdef DOUBLE_PRECISION_REAL
	h2 = vec_splats(hh[(ldh)+1]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h2 = vec_splats(hh[(ldh)+1]) ;
#endif

1798
	q1 = _SSE_LOAD(0, (unsigned long int *) &q[ldq*5]);
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
	q1 = _SSE_SUB(q1, x1);

	q1 = _SSE_SUB(q1, _SSE_MUL(y1, h2));

#ifdef DOUBLE_PRECISION_REAL
	h3 = vec_splats(hh[(ldh*2)+2]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h3 = vec_splats(hh[(ldh*2)+2]) ;
#endif

	q1 = _SSE_SUB(q1, _SSE_MUL(z1, h3));

#ifdef DOUBLE_PRECISION_REAL
	h4 = vec_splats(hh[(ldh*3)+3]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h4 = vec_splats(hh[(ldh*3)+3]) ;
#endif

	q1 = _SSE_SUB(q1, _SSE_MUL(w1, h4));

#ifdef DOUBLE_PRECISION_REAL
	h5 = vec_splats(hh[(ldh*4)+4]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h5 = vec_splats(hh[(ldh*4)+4]) ;
#endif

	q1 = _SSE_SUB(q1, _SSE_MUL(v1, h5));

#ifdef DOUBLE_PRECISION_REAL
	h6 = vec_splats(hh[(ldh*5)+5]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h6 = vec_splats(hh[(ldh*5)+5]) ;
#endif

	q1 = _SSE_SUB(q1, _SSE_MUL(t1, h6));

	_SSE_STORE((__vector unsigned int) q1, 0, (unsigned int *) &q[ldq*5]);

	for (i = 6; i < nb; i++)
	{
1843
		q1 = _SSE_LOAD(0, (unsigned long int *) &q[i*ldq]);
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
#ifdef DOUBLE_PRECISION_REAL
		h1 = vec_splats(hh[i-5]);
#endif
#ifdef SINGLE_PRECISION_REAL
		h1 = vec_splats(hh[i-5]) ;
#endif

		q1 = _SSE_SUB(q1, _SSE_MUL(x1, h1));

#ifdef DOUBLE_PRECISION_REAL
		h2 = vec_splats(hh[ldh+i-4]);
#endif
#ifdef SINGLE_PRECISION_REAL
		h2 = vec_splats(hh[ldh+i-4]) ;
#endif

		q1 = _SSE_SUB(q1, _SSE_MUL(y1, h2));

#ifdef DOUBLE_PRECISION_REAL
		h3 = vec_splats(hh[(ldh*2)+i-3]);
#endif
#ifdef SINGLE_PRECISION_REAL
		h3 = vec_splats(hh[(ldh*2)+i-3]) ;
#endif

		q1 = _SSE_SUB(q1, _SSE_MUL(z1, h3));

#ifdef DOUBLE_PRECISION_REAL
		h4 = vec_splats(hh[(ldh*3)+i-2]);
#endif
#ifdef SINGLE_PRECISION_REAL
		h4 = vec_splats(hh[(ldh*3)+i-2]) ;
#endif

		q1 = _SSE_SUB(q1, _SSE_MUL(w1, h4));

#ifdef DOUBLE_PRECISION_REAL
		h5 = vec_splats(hh[(ldh*4)+i-1]);
#endif
#ifdef SINGLE_PRECISION_REAL
		h5 = vec_splats(hh[(ldh*4)+i-1]) ;
#endif

		q1 = _SSE_SUB(q1, _SSE_MUL(v1, h5));

#ifdef DOUBLE_PRECISION_REAL
		h6 = vec_splats(hh[(ldh*5)+i]);
#endif
#ifdef SINGLE_PRECISION_REAL
		h6 = vec_splats(hh[(ldh*5)+i]) ;
#endif

		q1 = _SSE_SUB(q1, _SSE_MUL(t1, h6));

		_SSE_STORE((__vector unsigned int) q1, 0, (unsigned int *) &q[i*ldq]);
	}

#ifdef DOUBLE_PRECISION_REAL
	h1 = vec_splats(hh[nb-5]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h1 = vec_splats(hh[nb-5]) ;
#endif

1908
	q1 = _SSE_LOAD(0, (unsigned long int *) &q[nb*ldq]);
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956

	q1 = _SSE_SUB(q1, _SSE_MUL(x1, h1));

#ifdef DOUBLE_PRECISION_REAL
	h2 = vec_splats(hh[ldh+nb-4]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h2 = vec_splats(hh[ldh+nb-4]) ;
#endif

	q1 = _SSE_SUB(q1, _SSE_MUL(y1, h2));

#ifdef DOUBLE_PRECISION_REAL
	h3 = vec_splats(hh[(ldh*2)+nb-3]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h3 = vec_splats(hh[(ldh*2)+nb-3]) ;
#endif

	q1 = _SSE_SUB(q1, _SSE_MUL(z1, h3));

#ifdef DOUBLE_PRECISION_REAL
	h4 = vec_splats(hh[(ldh*3)+nb-2]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h4 = vec_splats(hh[(ldh*3)+nb-2]) ;
#endif

	q1 = _SSE_SUB(q1, _SSE_MUL(w1, h4));

#ifdef DOUBLE_PRECISION_REAL
	h5 = vec_splats(hh[(ldh*4)+nb-1]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h5 = vec_splats(hh[(ldh*4)+nb-1]) ;
#endif

	q1 = _SSE_SUB(q1, _SSE_MUL(v1, h5));

	_SSE_STORE((__vector unsigned int) q1, 0,  (unsigned int *) &q[nb*ldq]);

#ifdef DOUBLE_PRECISION_REAL
	h1 = vec_splats(hh[nb-4]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h1 = vec_splats(hh[nb-4]) ;
#endif

1957
	q1 = _SSE_LOAD(0, (unsigned long int *) &q[(nb+1)*ldq]);
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987

	q1 = _SSE_SUB(q1, _SSE_MUL(x1, h1));

#ifdef DOUBLE_PRECISION_REAL
	h2 = vec_splats(hh[ldh+nb-3]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h2 = vec_splats(hh[ldh+nb-3]) ;
#endif

	q1 = _SSE_SUB(q1, _SSE_MUL(y1, h2));

#ifdef DOUBLE_PRECISION_REAL
	h3 = vec_splats(hh[(ldh*2)+nb-2]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h3 = vec_splats(hh[(ldh*2)+nb-2]) ;
#endif

	q1 = _SSE_SUB(q1, _SSE_MUL(z1, h3));

#ifdef DOUBLE_PRECISION_REAL
	h4 = vec_splats(hh[(ldh*3)+nb-1]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h4 = vec_splats(hh[(ldh*3)+nb-1]) ;
#endif

	q1 = _SSE_SUB(q1, _SSE_MUL(w1, h4));

1988
	_SSE_STORE((__vector unsigned int) q1, 0, (unsigned int *)&q[(nb+1)*ldq]);
1989
1990
1991
1992
1993
1994
1995
1996

#ifdef DOUBLE_PRECISION_REAL
	h1 = vec_splats(hh[nb-3]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h1 = vec_splats(hh[nb-3]) ;
#endif

1997
	q1 = _SSE_LOAD(0, (unsigned long int *) &q[(nb+2)*ldq]);
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018

	q1 = _SSE_SUB(q1, _SSE_MUL(x1, h1));

#ifdef DOUBLE_PRECISION_REAL
	h2 = vec_splats(hh[ldh+nb-2]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h2 = vec_splats(hh[ldh+nb-2]) ;
#endif

	q1 = _SSE_SUB(q1, _SSE_MUL(y1, h2));

#ifdef DOUBLE_PRECISION_REAL
	h3 = vec_splats(hh[(ldh*2)+nb-1]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h3 = vec_splats(hh[(ldh*2)+nb-1]) ;
#endif

	q1 = _SSE_SUB(q1, _SSE_MUL(z1, h3));

2019
	_SSE_STORE((__vector unsigned int) q1, 0, (unsigned int *) &q[(nb+2)*ldq]);
2020
2021
2022
2023
2024
2025
2026
2027

#ifdef DOUBLE_PRECISION_REAL
	h1 = vec_splats(hh[nb-2]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h1 = vec_splats(hh[nb-2]) ;
#endif

2028
	q1 = _SSE_LOAD(0, (unsigned long int *) &q[(nb+3)*ldq]);
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049

	q1 = _SSE_SUB(q1, _SSE_MUL(x1, h1));

#ifdef DOUBLE_PRECISION_REAL
	h2 = vec_splats(hh[ldh+nb-1]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h2 = vec_splats(hh[ldh+nb-1]) ;
#endif

	q1 = _SSE_SUB(q1, _SSE_MUL(y1, h2));

	_SSE_STORE((__vector unsigned int) q1, 0, (unsigned int *) &q[(nb+3)*ldq]);

#ifdef DOUBLE_PRECISION_REAL
	h1 = vec_splats(hh[nb-1]);
#endif
#ifdef SINGLE_PRECISION_REAL
	h1 = vec_splats(hh[nb-1]) ;
#endif

2050
	q1 = _SSE_LOAD(0, (unsigned long int *) &q[(nb+4)*ldq]);
2051
2052
2053
2054
2055

	q1 = _SSE_SUB(q1, _SSE_MUL(x1, h1));

	_SSE_STORE((__vector unsigned int) q1, 0,  (unsigned int *) &q[(nb+4)*ldq]);
}