|
1 /* |
|
2 * LIBOIL - Library of Optimized Inner Loops |
|
3 * Copyright (c) 2003,2004 David A. Schleef <ds@schleef.org> |
|
4 * All rights reserved. |
|
5 * |
|
6 * Redistribution and use in source and binary forms, with or without |
|
7 * modification, are permitted provided that the following conditions |
|
8 * are met: |
|
9 * 1. Redistributions of source code must retain the above copyright |
|
10 * notice, this list of conditions and the following disclaimer. |
|
11 * 2. Redistributions in binary form must reproduce the above copyright |
|
12 * notice, this list of conditions and the following disclaimer in the |
|
13 * documentation and/or other materials provided with the distribution. |
|
14 * |
|
15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
|
16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
|
17 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
|
18 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, |
|
19 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
|
20 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
|
21 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
|
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, |
|
23 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING |
|
24 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
|
25 * POSSIBILITY OF SUCH DAMAGE. |
|
26 */ |
|
27 //Portions Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. |
|
28 |
|
29 #ifdef HAVE_CONFIG_H |
|
30 #include "config.h" |
|
31 #endif |
|
32 |
|
33 #include <liboil/liboilfunction.h> |
|
34 #include "liboil/simdpack/simdpack.h" |
|
35 |
|
36 #ifdef __SYMBIAN32__ |
|
37 #ifdef __WINSCW__ |
|
38 #pragma warn_emptydecl off |
|
39 #endif//__WINSCW__ |
|
40 #endif//__SYMBIAN32__ |
|
41 |
|
42 #define SCALARMULT_DEFINE_REF(type) \ |
|
43 static void scalarmult_ ## type ## _ref( \ |
|
44 oil_type_ ## type *dest, int dstr, \ |
|
45 oil_type_ ## type *src, int sstr, \ |
|
46 oil_type_ ## type *val, int n) \ |
|
47 { \ |
|
48 int i; \ |
|
49 for(i=0;i<n;i++){ \ |
|
50 OIL_GET(dest,dstr*i,oil_type_ ## type) = OIL_GET(src,sstr*i,oil_type_ ## type) * *val; \ |
|
51 } \ |
|
52 } \ |
|
53 OIL_DEFINE_CLASS(scalarmult_ ## type, \ |
|
54 "oil_type_" #type " *d, int dstr, " \ |
|
55 "oil_type_" #type " *s1, int sstr, " \ |
|
56 "oil_type_" #type " *s2_1, int n"); \ |
|
57 OIL_DEFINE_IMPL_REF (scalarmult_ ## type ## _ref, scalarmult_ ## type); |
|
58 |
|
59 |
|
60 /** |
|
61 * oil_scalarmult_s8: |
|
62 * @d: |
|
63 * @dstr: |
|
64 * @s1: |
|
65 * @sstr: |
|
66 * @s2_1: |
|
67 * @n: |
|
68 * |
|
69 * Multiplies the constant value @s2_1 to each value in @s1 and places the |
|
70 * result in @d. |
|
71 * |
|
72 * FIXME: This function is difficult to optimize and will likely be |
|
73 * replaced. |
|
74 */ |
|
75 SCALARMULT_DEFINE_REF (s8); |
|
76 /** |
|
77 * oil_scalarmult_u8: |
|
78 * @d: |
|
79 * @dstr: |
|
80 * @s1: |
|
81 * @sstr: |
|
82 * @s2_1: |
|
83 * @n: |
|
84 * |
|
85 * Multiplies the constant value @s2_1 to each value in @s1 and places the |
|
86 * result in @d. |
|
87 * |
|
88 * FIXME: This function is difficult to optimize and will likely be |
|
89 * replaced. |
|
90 */ |
|
91 SCALARMULT_DEFINE_REF (u8); |
|
92 /** |
|
93 * oil_scalarmult_s16: |
|
94 * @d: |
|
95 * @dstr: |
|
96 * @s1: |
|
97 * @sstr: |
|
98 * @s2_1: |
|
99 * @n: |
|
100 * |
|
101 * Multiplies the constant value @s2_1 to each value in @s1 and places the |
|
102 * result in @d. |
|
103 * |
|
104 * FIXME: This function is difficult to optimize and will likely be |
|
105 * replaced. |
|
106 */ |
|
107 SCALARMULT_DEFINE_REF (s16); |
|
108 /** |
|
109 * oil_scalarmult_u16: |
|
110 * @d: |
|
111 * @dstr: |
|
112 * @s1: |
|
113 * @sstr: |
|
114 * @s2_1: |
|
115 * @n: |
|
116 * |
|
117 * Multiplies the constant value @s2_1 to each value in @s1 and places the |
|
118 * result in @d. |
|
119 * |
|
120 * FIXME: This function is difficult to optimize and will likely be |
|
121 * replaced. |
|
122 */ |
|
123 SCALARMULT_DEFINE_REF (u16); |
|
124 /** |
|
125 * oil_scalarmult_s32: |
|
126 * @d: |
|
127 * @dstr: |
|
128 * @s1: |
|
129 * @sstr: |
|
130 * @s2_1: |
|
131 * @n: |
|
132 * |
|
133 * Multiplies the constant value @s2_1 to each value in @s1 and places the |
|
134 * result in @d. |
|
135 * |
|
136 * FIXME: This function is difficult to optimize and will likely be |
|
137 * replaced. |
|
138 */ |
|
139 SCALARMULT_DEFINE_REF (s32); |
|
140 /** |
|
141 * oil_scalarmult_u32: |
|
142 * @d: |
|
143 * @dstr: |
|
144 * @s1: |
|
145 * @sstr: |
|
146 * @s2_1: |
|
147 * @n: |
|
148 * |
|
149 * Multiplies the constant value @s2_1 to each value in @s1 and places the |
|
150 * result in @d. |
|
151 * |
|
152 * FIXME: This function is difficult to optimize and will likely be |
|
153 * replaced. |
|
154 */ |
|
155 SCALARMULT_DEFINE_REF (u32); |
|
156 /** |
|
157 * oil_scalarmult_f32: |
|
158 * @d: |
|
159 * @dstr: |
|
160 * @s1: |
|
161 * @sstr: |
|
162 * @s2_1: |
|
163 * @n: |
|
164 * |
|
165 * Multiplies the constant value @s2_1 to each value in @s1 and places the |
|
166 * result in @d. |
|
167 * |
|
168 * FIXME: This function is difficult to optimize and will likely be |
|
169 * replaced. |
|
170 */ |
|
171 SCALARMULT_DEFINE_REF (f32); |
|
172 /** |
|
173 * oil_scalarmult_f64: |
|
174 * @d: |
|
175 * @dstr: |
|
176 * @s1: |
|
177 * @sstr: |
|
178 * @s2_1: |
|
179 * @n: |
|
180 * |
|
181 * Multiplies the constant value @s2_1 to each value in @s1 and places the |
|
182 * result in @d. |
|
183 * |
|
184 * FIXME: This function is difficult to optimize and will likely be |
|
185 * replaced. |
|
186 */ |
|
187 SCALARMULT_DEFINE_REF (f64); |
|
188 |
|
189 #ifdef __SYMBIAN32__ |
|
190 |
|
191 #endif |
|
192 OilFunctionClass* __oil_function_class_scalarmult_f32() |
|
193 { |
|
194 return &_oil_function_class_scalarmult_f32; |
|
195 } |
|
196 |
|
197 |
|
198 #ifdef __SYMBIAN32__ |
|
199 |
|
200 #endif |
|
201 OilFunctionClass* __oil_function_class_scalarmult_f64() |
|
202 { |
|
203 return &_oil_function_class_scalarmult_f64; |
|
204 } |
|
205 |
|
206 #ifdef __SYMBIAN32__ |
|
207 |
|
208 #endif |
|
209 OilFunctionClass* __oil_function_class_scalarmult_s16() |
|
210 { |
|
211 return &_oil_function_class_scalarmult_s16; |
|
212 } |
|
213 |
|
214 #ifdef __SYMBIAN32__ |
|
215 |
|
216 #endif |
|
217 OilFunctionClass* __oil_function_class_scalarmult_s32() |
|
218 { |
|
219 return &_oil_function_class_scalarmult_s32; |
|
220 } |
|
221 |
|
222 #ifdef __SYMBIAN32__ |
|
223 |
|
224 #endif |
|
225 OilFunctionClass* __oil_function_class_scalarmult_s8() |
|
226 { |
|
227 return &_oil_function_class_scalarmult_s8; |
|
228 } |
|
229 |
|
230 #ifdef __SYMBIAN32__ |
|
231 |
|
232 #endif |
|
233 OilFunctionClass* __oil_function_class_scalarmult_u16() |
|
234 { |
|
235 return &_oil_function_class_scalarmult_u16; |
|
236 } |
|
237 |
|
238 #ifdef __SYMBIAN32__ |
|
239 |
|
240 #endif |
|
241 OilFunctionClass* __oil_function_class_scalarmult_u32() |
|
242 { |
|
243 return &_oil_function_class_scalarmult_u32; |
|
244 } |
|
245 |
|
246 #ifdef __SYMBIAN32__ |
|
247 |
|
248 #endif |
|
249 OilFunctionClass* __oil_function_class_scalarmult_u8() |
|
250 { |
|
251 return &_oil_function_class_scalarmult_u8; |
|
252 } |
|
253 |
|
254 /* |
|
255 OilFunctionClass* __oil_function_class_scalarmult_f32_ns() |
|
256 { |
|
257 return &_oil_function_class_scalarmult_f32_ns; |
|
258 } |
|
259 |
|
260 OilFunctionClass* __oil_function_class_scalarmult_f64_ns() |
|
261 { |
|
262 return &_oil_function_class_scalarmult_f64_ns; |
|
263 } |
|
264 */ |
|
265 |
|
266 |
|
267 |
|
268 #ifdef __SYMBIAN32__ |
|
269 |
|
270 OilFunctionImpl* __oil_function_impl_scalarmult_s8_ref() { |
|
271 return &_oil_function_impl_scalarmult_s8_ref; |
|
272 } |
|
273 #endif |
|
274 |
|
275 #ifdef __SYMBIAN32__ |
|
276 |
|
277 OilFunctionImpl* __oil_function_impl_scalarmult_u8_ref() { |
|
278 return &_oil_function_impl_scalarmult_u8_ref; |
|
279 } |
|
280 #endif |
|
281 |
|
282 #ifdef __SYMBIAN32__ |
|
283 |
|
284 OilFunctionImpl* __oil_function_impl_scalarmult_s16_ref() { |
|
285 return &_oil_function_impl_scalarmult_s16_ref; |
|
286 } |
|
287 #endif |
|
288 |
|
289 #ifdef __SYMBIAN32__ |
|
290 |
|
291 OilFunctionImpl* __oil_function_impl_scalarmult_u16_ref() { |
|
292 return &_oil_function_impl_scalarmult_u16_ref; |
|
293 } |
|
294 #endif |
|
295 |
|
296 #ifdef __SYMBIAN32__ |
|
297 |
|
298 OilFunctionImpl* __oil_function_impl_scalarmult_s32_ref() { |
|
299 return &_oil_function_impl_scalarmult_s32_ref; |
|
300 } |
|
301 #endif |
|
302 |
|
303 #ifdef __SYMBIAN32__ |
|
304 |
|
305 OilFunctionImpl* __oil_function_impl_scalarmult_u32_ref() { |
|
306 return &_oil_function_impl_scalarmult_u32_ref; |
|
307 } |
|
308 #endif |
|
309 |
|
310 #ifdef __SYMBIAN32__ |
|
311 |
|
312 OilFunctionImpl* __oil_function_impl_scalarmult_f32_ref() { |
|
313 return &_oil_function_impl_scalarmult_f32_ref; |
|
314 } |
|
315 #endif |
|
316 |
|
317 #ifdef __SYMBIAN32__ |
|
318 |
|
319 OilFunctionImpl* __oil_function_impl_scalarmult_f64_ref() { |
|
320 return &_oil_function_impl_scalarmult_f64_ref; |
|
321 } |
|
322 #endif |
|
323 |