Update contrib.
2 * LIBOIL - Library of Optimized Inner Loops
3 * Copyright (c) 2003,2004 David A. Schleef <ds@schleef.org>
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
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.
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.
27 //Portions Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
33 #include <liboil/liboilfunction.h>
34 #include "liboil/simdpack/simdpack.h"
38 #pragma warn_emptydecl off
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) \
50 OIL_GET(dest,dstr*i, oil_type_ ## type) = \
51 OIL_GET(src,sstr*i, oil_type_ ## type) + *val; \
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);
70 * Adds the constant value @s2_1 to each value in @s1 and places the
73 * FIXME: This function is difficult to optimize and will likely be
76 SCALARADD_DEFINE_REF (s8);
86 * Adds the constant value @s2_1 to each value in @s1 and places the
89 * FIXME: This function is difficult to optimize and will likely be
92 SCALARADD_DEFINE_REF (u8);
102 * Adds the constant value @s2_1 to each value in @s1 and places the
105 * FIXME: This function is difficult to optimize and will likely be
108 SCALARADD_DEFINE_REF (s16);
118 * Adds the constant value @s2_1 to each value in @s1 and places the
121 * FIXME: This function is difficult to optimize and will likely be
124 SCALARADD_DEFINE_REF (u16);
134 * Adds the constant value @s2_1 to each value in @s1 and places the
137 * FIXME: This function is difficult to optimize and will likely be
140 SCALARADD_DEFINE_REF (s32);
150 * Adds the constant value @s2_1 to each value in @s1 and places the
153 * FIXME: This function is difficult to optimize and will likely be
156 SCALARADD_DEFINE_REF (u32);
166 * Adds the constant value @s2_1 to each value in @s1 and places the
169 * FIXME: This function is difficult to optimize and will likely be
172 SCALARADD_DEFINE_REF (f32);
182 * Adds the constant value @s2_1 to each value in @s1 and places the
185 * FIXME: This function is difficult to optimize and will likely be
188 SCALARADD_DEFINE_REF (f64);
191 OilFunctionClass* __oil_function_class_scalaradd_f32()
193 return &_oil_function_class_scalaradd_f32;
197 OilFunctionClass* __oil_function_class_scalaradd_f32_ns()
199 return &_oil_function_class_scalaradd_f32_ns;
206 OilFunctionClass* __oil_function_class_scalaradd_f64()
208 return &_oil_function_class_scalaradd_f64;
214 OilFunctionClass* __oil_function_class_scalaradd_s16()
216 return &_oil_function_class_scalaradd_s16;
222 OilFunctionClass* __oil_function_class_scalaradd_s32()
224 return &_oil_function_class_scalaradd_s32;
230 OilFunctionClass* __oil_function_class_scalaradd_s8()
232 return &_oil_function_class_scalaradd_s8;
238 OilFunctionClass* __oil_function_class_scalaradd_u16()
240 return &_oil_function_class_scalaradd_u16;
246 OilFunctionClass* __oil_function_class_scalaradd_u32()
248 return &_oil_function_class_scalaradd_u32;
254 OilFunctionClass* __oil_function_class_scalaradd_u8()
256 return &_oil_function_class_scalaradd_u8;
263 OilFunctionImpl* __oil_function_impl_scalaradd_s8_ref() {
264 return &_oil_function_impl_scalaradd_s8_ref;
270 OilFunctionImpl* __oil_function_impl_scalaradd_u8_ref() {
271 return &_oil_function_impl_scalaradd_u8_ref;
277 OilFunctionImpl* __oil_function_impl_scalaradd_s16_ref() {
278 return &_oil_function_impl_scalaradd_s16_ref;
284 OilFunctionImpl* __oil_function_impl_scalaradd_u16_ref() {
285 return &_oil_function_impl_scalaradd_u16_ref;
291 OilFunctionImpl* __oil_function_impl_scalaradd_s32_ref() {
292 return &_oil_function_impl_scalaradd_s32_ref;
298 OilFunctionImpl* __oil_function_impl_scalaradd_u32_ref() {
299 return &_oil_function_impl_scalaradd_u32_ref;
305 OilFunctionImpl* __oil_function_impl_scalaradd_f32_ref() {
306 return &_oil_function_impl_scalaradd_f32_ref;
312 OilFunctionImpl* __oil_function_impl_scalaradd_f64_ref() {
313 return &_oil_function_impl_scalaradd_f64_ref;