|
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 SCALARADD_DEFINE_REF(type) \ |
|
43 static void scalaradd_ ## 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) = \ |
|
51 OIL_GET(src,sstr*i, oil_type_ ## type) + *val; \ |
|
52 } \ |
|
53 } \ |
|
54 OIL_DEFINE_CLASS (scalaradd_ ## type, \ |
|
55 "oil_type_" #type " *d, int dstr, " \ |
|
56 "oil_type_" #type " *s1, int sstr, " \ |
|
57 "oil_type_" #type " *s2_1 int n"); \ |
|
58 OIL_DEFINE_IMPL_REF (scalaradd_ ## type ## _ref, scalaradd_ ## type); |
|
59 |
|
60 |
|
61 /** |
|
62 * oil_scalaradd_s8: |
|
63 * @d: |
|
64 * @dstr: |
|
65 * @s1: |
|
66 * @sstr: |
|
67 * @s2_1: |
|
68 * @n: |
|
69 * |
|
70 * Adds the constant value @s2_1 to each value in @s1 and places the |
|
71 * result in @d. |
|
72 * |
|
73 * FIXME: This function is difficult to optimize and will likely be |
|
74 * replaced. |
|
75 */ |
|
76 SCALARADD_DEFINE_REF (s8); |
|
77 /** |
|
78 * oil_scalaradd_u8: |
|
79 * @d: |
|
80 * @dstr: |
|
81 * @s1: |
|
82 * @sstr: |
|
83 * @s2_1: |
|
84 * @n: |
|
85 * |
|
86 * Adds the constant value @s2_1 to each value in @s1 and places the |
|
87 * result in @d. |
|
88 * |
|
89 * FIXME: This function is difficult to optimize and will likely be |
|
90 * replaced. |
|
91 */ |
|
92 SCALARADD_DEFINE_REF (u8); |
|
93 /** |
|
94 * oil_scalaradd_s16: |
|
95 * @d: |
|
96 * @dstr: |
|
97 * @s1: |
|
98 * @sstr: |
|
99 * @s2_1: |
|
100 * @n: |
|
101 * |
|
102 * Adds the constant value @s2_1 to each value in @s1 and places the |
|
103 * result in @d. |
|
104 * |
|
105 * FIXME: This function is difficult to optimize and will likely be |
|
106 * replaced. |
|
107 */ |
|
108 SCALARADD_DEFINE_REF (s16); |
|
109 /** |
|
110 * oil_scalaradd_u16: |
|
111 * @d: |
|
112 * @dstr: |
|
113 * @s1: |
|
114 * @sstr: |
|
115 * @s2_1: |
|
116 * @n: |
|
117 * |
|
118 * Adds the constant value @s2_1 to each value in @s1 and places the |
|
119 * result in @d. |
|
120 * |
|
121 * FIXME: This function is difficult to optimize and will likely be |
|
122 * replaced. |
|
123 */ |
|
124 SCALARADD_DEFINE_REF (u16); |
|
125 /** |
|
126 * oil_scalaradd_s32: |
|
127 * @d: |
|
128 * @dstr: |
|
129 * @s1: |
|
130 * @sstr: |
|
131 * @s2_1: |
|
132 * @n: |
|
133 * |
|
134 * Adds the constant value @s2_1 to each value in @s1 and places the |
|
135 * result in @d. |
|
136 * |
|
137 * FIXME: This function is difficult to optimize and will likely be |
|
138 * replaced. |
|
139 */ |
|
140 SCALARADD_DEFINE_REF (s32); |
|
141 /** |
|
142 * oil_scalaradd_u32: |
|
143 * @d: |
|
144 * @dstr: |
|
145 * @s1: |
|
146 * @sstr: |
|
147 * @s2_1: |
|
148 * @n: |
|
149 * |
|
150 * Adds the constant value @s2_1 to each value in @s1 and places the |
|
151 * result in @d. |
|
152 * |
|
153 * FIXME: This function is difficult to optimize and will likely be |
|
154 * replaced. |
|
155 */ |
|
156 SCALARADD_DEFINE_REF (u32); |
|
157 /** |
|
158 * oil_scalaradd_f32: |
|
159 * @d: |
|
160 * @dstr: |
|
161 * @s1: |
|
162 * @sstr: |
|
163 * @s2_1: |
|
164 * @n: |
|
165 * |
|
166 * Adds the constant value @s2_1 to each value in @s1 and places the |
|
167 * result in @d. |
|
168 * |
|
169 * FIXME: This function is difficult to optimize and will likely be |
|
170 * replaced. |
|
171 */ |
|
172 SCALARADD_DEFINE_REF (f32); |
|
173 /** |
|
174 * oil_scalaradd_f64: |
|
175 * @d: |
|
176 * @dstr: |
|
177 * @s1: |
|
178 * @sstr: |
|
179 * @s2_1: |
|
180 * @n: |
|
181 * |
|
182 * Adds the constant value @s2_1 to each value in @s1 and places the |
|
183 * result in @d. |
|
184 * |
|
185 * FIXME: This function is difficult to optimize and will likely be |
|
186 * replaced. |
|
187 */ |
|
188 SCALARADD_DEFINE_REF (f64); |
|
189 #ifdef __SYMBIAN32__ |
|
190 |
|
191 OilFunctionClass* __oil_function_class_scalaradd_f32() |
|
192 { |
|
193 return &_oil_function_class_scalaradd_f32; |
|
194 } |
|
195 #endif |
|
196 /* |
|
197 OilFunctionClass* __oil_function_class_scalaradd_f32_ns() |
|
198 { |
|
199 return &_oil_function_class_scalaradd_f32_ns; |
|
200 } |
|
201 */ |
|
202 |
|
203 #ifdef __SYMBIAN32__ |
|
204 |
|
205 #endif |
|
206 OilFunctionClass* __oil_function_class_scalaradd_f64() |
|
207 { |
|
208 return &_oil_function_class_scalaradd_f64; |
|
209 } |
|
210 |
|
211 #ifdef __SYMBIAN32__ |
|
212 |
|
213 #endif |
|
214 OilFunctionClass* __oil_function_class_scalaradd_s16() |
|
215 { |
|
216 return &_oil_function_class_scalaradd_s16; |
|
217 } |
|
218 |
|
219 #ifdef __SYMBIAN32__ |
|
220 |
|
221 #endif |
|
222 OilFunctionClass* __oil_function_class_scalaradd_s32() |
|
223 { |
|
224 return &_oil_function_class_scalaradd_s32; |
|
225 } |
|
226 |
|
227 #ifdef __SYMBIAN32__ |
|
228 |
|
229 #endif |
|
230 OilFunctionClass* __oil_function_class_scalaradd_s8() |
|
231 { |
|
232 return &_oil_function_class_scalaradd_s8; |
|
233 } |
|
234 |
|
235 #ifdef __SYMBIAN32__ |
|
236 |
|
237 #endif |
|
238 OilFunctionClass* __oil_function_class_scalaradd_u16() |
|
239 { |
|
240 return &_oil_function_class_scalaradd_u16; |
|
241 } |
|
242 |
|
243 #ifdef __SYMBIAN32__ |
|
244 |
|
245 #endif |
|
246 OilFunctionClass* __oil_function_class_scalaradd_u32() |
|
247 { |
|
248 return &_oil_function_class_scalaradd_u32; |
|
249 } |
|
250 |
|
251 #ifdef __SYMBIAN32__ |
|
252 |
|
253 #endif |
|
254 OilFunctionClass* __oil_function_class_scalaradd_u8() |
|
255 { |
|
256 return &_oil_function_class_scalaradd_u8; |
|
257 } |
|
258 |
|
259 |
|
260 |
|
261 #ifdef __SYMBIAN32__ |
|
262 |
|
263 OilFunctionImpl* __oil_function_impl_scalaradd_s8_ref() { |
|
264 return &_oil_function_impl_scalaradd_s8_ref; |
|
265 } |
|
266 #endif |
|
267 |
|
268 #ifdef __SYMBIAN32__ |
|
269 |
|
270 OilFunctionImpl* __oil_function_impl_scalaradd_u8_ref() { |
|
271 return &_oil_function_impl_scalaradd_u8_ref; |
|
272 } |
|
273 #endif |
|
274 |
|
275 #ifdef __SYMBIAN32__ |
|
276 |
|
277 OilFunctionImpl* __oil_function_impl_scalaradd_s16_ref() { |
|
278 return &_oil_function_impl_scalaradd_s16_ref; |
|
279 } |
|
280 #endif |
|
281 |
|
282 #ifdef __SYMBIAN32__ |
|
283 |
|
284 OilFunctionImpl* __oil_function_impl_scalaradd_u16_ref() { |
|
285 return &_oil_function_impl_scalaradd_u16_ref; |
|
286 } |
|
287 #endif |
|
288 |
|
289 #ifdef __SYMBIAN32__ |
|
290 |
|
291 OilFunctionImpl* __oil_function_impl_scalaradd_s32_ref() { |
|
292 return &_oil_function_impl_scalaradd_s32_ref; |
|
293 } |
|
294 #endif |
|
295 |
|
296 #ifdef __SYMBIAN32__ |
|
297 |
|
298 OilFunctionImpl* __oil_function_impl_scalaradd_u32_ref() { |
|
299 return &_oil_function_impl_scalaradd_u32_ref; |
|
300 } |
|
301 #endif |
|
302 |
|
303 #ifdef __SYMBIAN32__ |
|
304 |
|
305 OilFunctionImpl* __oil_function_impl_scalaradd_f32_ref() { |
|
306 return &_oil_function_impl_scalaradd_f32_ref; |
|
307 } |
|
308 #endif |
|
309 |
|
310 #ifdef __SYMBIAN32__ |
|
311 |
|
312 OilFunctionImpl* __oil_function_impl_scalaradd_f64_ref() { |
|
313 return &_oil_function_impl_scalaradd_f64_ref; |
|
314 } |
|
315 #endif |
|
316 |