libflame  revision_anchor
FLA_Apply_G_mx2_opt.h
Go to the documentation of this file.
1 /*
2 
3  Copyright (C) 2014, The University of Texas at Austin
4 
5  This file is part of libflame and is available under the 3-Clause
6  BSD license, which can be found in the LICENSE file at the top-level
7  directory, or at http://opensource.org/licenses/BSD-3-Clause
8 
9 */
10 
11 #define MAC_Apply_G_mx2_ops( m_A, \
12  gamma12, \
13  sigma12, \
14  a1, inc_a1, \
15  a2, inc_a2 ) \
16 { \
17  float ga = *gamma12; \
18  float si = *sigma12; \
19  float* restrict alpha1 = a1; \
20  float* restrict alpha2 = a2; \
21  float temp1; \
22  float temp2; \
23  int i; \
24 \
25  for ( i = 0; i < m_A; ++i ) \
26  { \
27  temp1 = *alpha1; \
28  temp2 = *alpha2; \
29 \
30  *alpha1 = ga * temp1 + si * temp2; \
31  *alpha2 = -si * temp1 + ga * temp2; \
32 \
33  alpha1 += inc_a1; \
34  alpha2 += inc_a2; \
35  } \
36 }
37 
38 #define MAC_Apply_G_mx2_opc( m_A, \
39  gamma12, \
40  sigma12, \
41  a1, inc_a1, \
42  a2, inc_a2 ) \
43 { \
44  float ga12 = *gamma12; \
45  float si12 = *sigma12; \
46  scomplex* restrict alpha1 = a1; \
47  scomplex* restrict alpha2 = a2; \
48  scomplex temp1; \
49  scomplex temp2; \
50  int i; \
51 \
52  for ( i = 0; i < m_A; ++i ) \
53  { \
54  temp1 = *alpha1; \
55  temp2 = *alpha2; \
56 \
57  alpha1->real = ga12 * temp1.real + si12 * temp2.real; \
58  alpha1->imag = ga12 * temp1.imag + si12 * temp2.imag; \
59 \
60  alpha2->real = -si12 * temp1.real + ga12 * temp2.real; \
61  alpha2->imag = -si12 * temp1.imag + ga12 * temp2.imag; \
62 \
63  alpha1 += inc_a1; \
64  alpha2 += inc_a2; \
65  } \
66 }
67 
68 #define MAC_Apply_G_mx2_opd( m_A, \
69  gamma12, \
70  sigma12, \
71  a1, inc_a1, \
72  a2, inc_a2 ) \
73 { \
74  double ga = *gamma12; \
75  double si = *sigma12; \
76  double* restrict alpha1 = a1; \
77  double* restrict alpha2 = a2; \
78  double temp1; \
79  double temp2; \
80  int i; \
81 \
82  for ( i = 0; i < m_A; ++i ) \
83  { \
84  temp1 = *alpha1; \
85  temp2 = *alpha2; \
86 \
87  *alpha1 = ga * temp1 + si * temp2; \
88  *alpha2 = -si * temp1 + ga * temp2; \
89 \
90  alpha1 += inc_a1; \
91  alpha2 += inc_a2; \
92  } \
93 }
94 
95 #define MAC_Apply_G_mx2_opz( m_A, \
96  gamma12, \
97  sigma12, \
98  a1, inc_a1, \
99  a2, inc_a2 ) \
100 {\
101  double ga12 = *gamma12; \
102  double si12 = *sigma12; \
103  dcomplex* restrict alpha1 = a1; \
104  dcomplex* restrict alpha2 = a2; \
105  dcomplex temp1; \
106  dcomplex temp2; \
107  int i; \
108 \
109  for ( i = 0; i < m_A; ++i ) \
110  { \
111  temp1 = *alpha1; \
112  temp2 = *alpha2; \
113 \
114  alpha1->real = ga12 * temp1.real + si12 * temp2.real; \
115  alpha1->imag = ga12 * temp1.imag + si12 * temp2.imag; \
116 \
117  alpha2->real = -si12 * temp1.real + ga12 * temp2.real; \
118  alpha2->imag = -si12 * temp1.imag + ga12 * temp2.imag; \
119 \
120  alpha1 += inc_a1; \
121  alpha2 += inc_a2; \
122  } \
123 }
124