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 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) \
50 OIL_GET(dest,dstr*i,oil_type_ ## type) = OIL_GET(src,sstr*i,oil_type_ ## type) * *val; \
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);
69 * Multiplies the constant value @s2_1 to each value in @s1 and places the
72 * FIXME: This function is difficult to optimize and will likely be
75 SCALARMULT_DEFINE_REF (s8);
85 * Multiplies the constant value @s2_1 to each value in @s1 and places the
88 * FIXME: This function is difficult to optimize and will likely be
91 SCALARMULT_DEFINE_REF (u8);
101 * Multiplies the constant value @s2_1 to each value in @s1 and places the
104 * FIXME: This function is difficult to optimize and will likely be
107 SCALARMULT_DEFINE_REF (s16);
109 * oil_scalarmult_u16:
117 * Multiplies the constant value @s2_1 to each value in @s1 and places the
120 * FIXME: This function is difficult to optimize and will likely be
123 SCALARMULT_DEFINE_REF (u16);
125 * oil_scalarmult_s32:
133 * Multiplies the constant value @s2_1 to each value in @s1 and places the
136 * FIXME: This function is difficult to optimize and will likely be
139 SCALARMULT_DEFINE_REF (s32);
141 * oil_scalarmult_u32:
149 * Multiplies the constant value @s2_1 to each value in @s1 and places the
152 * FIXME: This function is difficult to optimize and will likely be
155 SCALARMULT_DEFINE_REF (u32);
157 * oil_scalarmult_f32:
165 * Multiplies the constant value @s2_1 to each value in @s1 and places the
168 * FIXME: This function is difficult to optimize and will likely be
171 SCALARMULT_DEFINE_REF (f32);
173 * oil_scalarmult_f64:
181 * Multiplies the constant value @s2_1 to each value in @s1 and places the
184 * FIXME: This function is difficult to optimize and will likely be
187 SCALARMULT_DEFINE_REF (f64);
192 OilFunctionClass* __oil_function_class_scalarmult_f32()
194 return &_oil_function_class_scalarmult_f32;
201 OilFunctionClass* __oil_function_class_scalarmult_f64()
203 return &_oil_function_class_scalarmult_f64;
209 OilFunctionClass* __oil_function_class_scalarmult_s16()
211 return &_oil_function_class_scalarmult_s16;
217 OilFunctionClass* __oil_function_class_scalarmult_s32()
219 return &_oil_function_class_scalarmult_s32;
225 OilFunctionClass* __oil_function_class_scalarmult_s8()
227 return &_oil_function_class_scalarmult_s8;
233 OilFunctionClass* __oil_function_class_scalarmult_u16()
235 return &_oil_function_class_scalarmult_u16;
241 OilFunctionClass* __oil_function_class_scalarmult_u32()
243 return &_oil_function_class_scalarmult_u32;
249 OilFunctionClass* __oil_function_class_scalarmult_u8()
251 return &_oil_function_class_scalarmult_u8;
255 OilFunctionClass* __oil_function_class_scalarmult_f32_ns()
257 return &_oil_function_class_scalarmult_f32_ns;
260 OilFunctionClass* __oil_function_class_scalarmult_f64_ns()
262 return &_oil_function_class_scalarmult_f64_ns;
270 OilFunctionImpl* __oil_function_impl_scalarmult_s8_ref() {
271 return &_oil_function_impl_scalarmult_s8_ref;
277 OilFunctionImpl* __oil_function_impl_scalarmult_u8_ref() {
278 return &_oil_function_impl_scalarmult_u8_ref;
284 OilFunctionImpl* __oil_function_impl_scalarmult_s16_ref() {
285 return &_oil_function_impl_scalarmult_s16_ref;
291 OilFunctionImpl* __oil_function_impl_scalarmult_u16_ref() {
292 return &_oil_function_impl_scalarmult_u16_ref;
298 OilFunctionImpl* __oil_function_impl_scalarmult_s32_ref() {
299 return &_oil_function_impl_scalarmult_s32_ref;
305 OilFunctionImpl* __oil_function_impl_scalarmult_u32_ref() {
306 return &_oil_function_impl_scalarmult_u32_ref;
312 OilFunctionImpl* __oil_function_impl_scalarmult_f32_ref() {
313 return &_oil_function_impl_scalarmult_f32_ref;
319 OilFunctionImpl* __oil_function_impl_scalarmult_f64_ref() {
320 return &_oil_function_impl_scalarmult_f64_ref;