fix build error
[platform/upstream/openblas.git] / kernel / mips / zgemv_n.c
1 /***************************************************************************
2 Copyright (c) 2016, The OpenBLAS Project
3 All rights reserved.
4 Redistribution and use in source and binary forms, with or without
5 modification, are permitted provided that the following conditions are
6 met:
7 1. Redistributions of source code must retain the above copyright
8 notice, this list of conditions and the following disclaimer.
9 2. Redistributions in binary form must reproduce the above copyright
10 notice, this list of conditions and the following disclaimer in
11 the documentation and/or other materials provided with the
12 distribution.
13 3. Neither the name of the OpenBLAS project nor the names of
14 its contributors may be used to endorse or promote products
15 derived from this software without specific prior written permission.
16 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE
20 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
25 USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 *****************************************************************************/
27
28 #include "common.h"
29
30 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)
31 {
32         BLASLONG i;
33         BLASLONG ix,iy;
34         BLASLONG j;
35         FLOAT *a_ptr;
36         FLOAT temp_r,temp_i;
37         BLASLONG inc_x2,inc_y2;
38         BLASLONG lda2;
39         BLASLONG i2;
40
41         lda2 = 2*lda;
42
43         ix = 0;
44         a_ptr = a;
45
46         if ( inc_x == 1 && inc_y == 1 )
47         {
48
49            for (j=0; j<n; j++)
50            {
51
52 #if !defined(XCONJ)
53                 temp_r = alpha_r * x[ix]   - alpha_i * x[ix+1];
54                 temp_i = alpha_r * x[ix+1] + alpha_i * x[ix];
55 #else
56                 temp_r = alpha_r * x[ix]   + alpha_i * x[ix+1];
57                 temp_i = alpha_r * x[ix+1] - alpha_i * x[ix];
58 #endif
59                 iy = 0;
60                 i2=0;
61
62                 for (i=0; i<m; i++)
63                 {
64 #if !defined(CONJ)
65
66 #if !defined(XCONJ)
67                         y[iy]   += temp_r * a_ptr[i2]   - temp_i * a_ptr[i2+1];
68                         y[iy+1] += temp_r * a_ptr[i2+1] + temp_i * a_ptr[i2];
69 #else
70                         y[iy]   += temp_r * a_ptr[i2]   + temp_i * a_ptr[i2+1];
71                         y[iy+1] += temp_r * a_ptr[i2+1] - temp_i * a_ptr[i2];
72 #endif
73
74 #else
75
76 #if !defined(XCONJ)
77                         y[iy]   += temp_r * a_ptr[i2]   + temp_i * a_ptr[i2+1];
78                         y[iy+1] -= temp_r * a_ptr[i2+1] - temp_i * a_ptr[i2];
79 #else
80                         y[iy]   += temp_r * a_ptr[i2]   - temp_i * a_ptr[i2+1];
81                         y[iy+1] -= temp_r * a_ptr[i2+1] + temp_i * a_ptr[i2];
82 #endif
83
84 #endif
85                         i2 += 2;
86                         iy += 2;
87                 }
88                 a_ptr += lda2;
89                 ix    += 2;
90            }
91
92            return(0);
93
94         }
95
96
97         inc_x2 = 2 * inc_x;
98         inc_y2 = 2 * inc_y;
99
100         for (j=0; j<n; j++)
101         {
102
103 #if !defined(XCONJ)
104                 temp_r = alpha_r * x[ix]   - alpha_i * x[ix+1];
105                 temp_i = alpha_r * x[ix+1] + alpha_i * x[ix];
106 #else
107                 temp_r = alpha_r * x[ix]   + alpha_i * x[ix+1];
108                 temp_i = alpha_r * x[ix+1] - alpha_i * x[ix];
109 #endif
110                 iy = 0;
111                 i2=0;
112
113                 for (i=0; i<m; i++)
114                 {
115 #if !defined(CONJ)
116
117 #if !defined(XCONJ)
118                         y[iy]   += temp_r * a_ptr[i2]   - temp_i * a_ptr[i2+1];
119                         y[iy+1] += temp_r * a_ptr[i2+1] + temp_i * a_ptr[i2];
120 #else
121                         y[iy]   += temp_r * a_ptr[i2]   + temp_i * a_ptr[i2+1];
122                         y[iy+1] += temp_r * a_ptr[i2+1] - temp_i * a_ptr[i2];
123 #endif
124
125 #else
126
127 #if !defined(XCONJ)
128                         y[iy]   += temp_r * a_ptr[i2]   + temp_i * a_ptr[i2+1];
129                         y[iy+1] -= temp_r * a_ptr[i2+1] - temp_i * a_ptr[i2];
130 #else
131                         y[iy]   += temp_r * a_ptr[i2]   - temp_i * a_ptr[i2+1];
132                         y[iy+1] -= temp_r * a_ptr[i2+1] + temp_i * a_ptr[i2];
133 #endif
134
135 #endif
136                         i2 += 2;
137                         iy += inc_y2;
138                 }
139                 a_ptr += lda2;
140                 ix    += inc_x2;
141         }
142
143
144         return(0);
145 }
146
147