genericopenlibs/liboil/src/ref/splat.c
changeset 31 ce057bb09d0b
parent 18 47c74d1534e1
equal deleted inserted replaced
30:e20de85af2ee 31:ce057bb09d0b
       
     1 /*
       
     2  * LIBOIL - Library of Optimized Inner Loops
       
     3  * Copyright (c) 2001,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 #include <liboil/liboilfunction.h>
       
    33 #include <string.h>
       
    34 
       
    35 /**
       
    36  * oil_splat_u8:
       
    37  * @dest:
       
    38  * @dstr:
       
    39  * @s1_1:
       
    40  * @n:
       
    41  *
       
    42  * Copies the constant source value @s1_1 to each element in @dest.
       
    43  */
       
    44 OIL_DEFINE_CLASS(splat_u8,"uint8_t *dest, int dstr, uint8_t *s1_1, int n");
       
    45 /**
       
    46  * oil_splat_u32:
       
    47  * @dest:
       
    48  * @dstr:
       
    49  * @s1_1:
       
    50  * @n:
       
    51  *
       
    52  * Copies the constant source value @s1_1 to each element in @dest.
       
    53  */
       
    54 OIL_DEFINE_CLASS(splat_u32,"uint32_t *dest, int dstr, uint32_t *s1_1, int n");
       
    55 /**
       
    56  * oil_splat_u8_ns:
       
    57  * @dest:
       
    58  * @s1_1:
       
    59  * @n:
       
    60  *
       
    61  * Copies the constant source value @s1_1 to each element in @dest.
       
    62  */
       
    63 OIL_DEFINE_CLASS(splat_u8_ns,"uint8_t *dest, uint8_t *s1_1, int n");
       
    64 /**
       
    65  * oil_splat_u16_ns:
       
    66  * @dest:
       
    67  * @s1_1:
       
    68  * @n:
       
    69  *
       
    70  * Copies the constant source value @s1_1 to each element in @dest.
       
    71  */
       
    72 OIL_DEFINE_CLASS(splat_u16_ns,"uint16_t *dest, uint16_t *s1_1, int n");
       
    73 /**
       
    74  * oil_splat_u32_ns:
       
    75  * @dest:
       
    76  * @s1_1:
       
    77  * @n:
       
    78  *
       
    79  * Copies the constant source value @s1_1 to each element in @dest.
       
    80  */
       
    81 OIL_DEFINE_CLASS(splat_u32_ns,"uint32_t *dest, uint32_t *s1_1, int n");
       
    82 
       
    83 
       
    84 static void splat_u8_ref (uint8_t *dest, int dstr, uint8_t *param, int n)
       
    85 {
       
    86   int i;
       
    87   for(i=0;i<n;i++){
       
    88     OIL_GET(dest,i*dstr, uint8_t) = *param;
       
    89   }
       
    90 }
       
    91 OIL_DEFINE_IMPL_REF(splat_u8_ref, splat_u8);
       
    92 
       
    93 static void splat_u32_ref (uint32_t *dest, int dstr, uint32_t *param, int n)
       
    94 {
       
    95   int i;
       
    96   for(i=0;i<n;i++){
       
    97     OIL_GET(dest,i*dstr, uint32_t) = *param;
       
    98   }
       
    99 }
       
   100 OIL_DEFINE_IMPL_REF(splat_u32_ref, splat_u32);
       
   101 
       
   102 
       
   103 static void splat_u8_ns_ref (uint8_t *dest, uint8_t *param, int n)
       
   104 {
       
   105   int i;
       
   106   for(i=0;i<n;i++){
       
   107     dest[i] = *param;
       
   108   }
       
   109 }
       
   110 OIL_DEFINE_IMPL_REF(splat_u8_ns_ref, splat_u8_ns);
       
   111 
       
   112 static void splat_u16_ns_ref (uint16_t *dest, uint16_t *param, int n)
       
   113 {
       
   114   int i;
       
   115   for(i=0;i<n;i++){
       
   116     dest[i] = *param;
       
   117   }
       
   118 }
       
   119 OIL_DEFINE_IMPL_REF(splat_u16_ns_ref, splat_u16_ns);
       
   120 
       
   121 static void splat_u32_ns_ref (uint32_t *dest, uint32_t *param, int n)
       
   122 {
       
   123   int i;
       
   124   for(i=0;i<n;i++){
       
   125     dest[i] = *param;
       
   126   }
       
   127 }
       
   128 OIL_DEFINE_IMPL_REF(splat_u32_ns_ref, splat_u32_ns);
       
   129 
       
   130 
       
   131 
       
   132 
       
   133 
       
   134 #ifdef	__SYMBIAN32__
       
   135  
       
   136 OilFunctionClass* __oil_function_class_splat_u8() {
       
   137 		return &_oil_function_class_splat_u8;
       
   138 }
       
   139 #endif
       
   140 
       
   141 #ifdef	__SYMBIAN32__
       
   142  
       
   143 OilFunctionClass* __oil_function_class_splat_u32() {
       
   144 		return &_oil_function_class_splat_u32;
       
   145 }
       
   146 #endif
       
   147 
       
   148 #ifdef	__SYMBIAN32__
       
   149  
       
   150 OilFunctionClass* __oil_function_class_splat_u8_ns() {
       
   151 		return &_oil_function_class_splat_u8_ns;
       
   152 }
       
   153 #endif
       
   154 
       
   155 #ifdef	__SYMBIAN32__
       
   156  
       
   157 OilFunctionClass* __oil_function_class_splat_u16_ns() {
       
   158 		return &_oil_function_class_splat_u16_ns;
       
   159 }
       
   160 #endif
       
   161 
       
   162 #ifdef	__SYMBIAN32__
       
   163  
       
   164 OilFunctionClass* __oil_function_class_splat_u32_ns() {
       
   165 		return &_oil_function_class_splat_u32_ns;
       
   166 }
       
   167 #endif
       
   168 
       
   169 
       
   170 
       
   171 #ifdef	__SYMBIAN32__
       
   172  
       
   173 OilFunctionImpl* __oil_function_impl_splat_u8_ref() {
       
   174 		return &_oil_function_impl_splat_u8_ref;
       
   175 }
       
   176 #endif
       
   177 
       
   178 #ifdef	__SYMBIAN32__
       
   179  
       
   180 OilFunctionImpl* __oil_function_impl_splat_u32_ref() {
       
   181 		return &_oil_function_impl_splat_u32_ref;
       
   182 }
       
   183 #endif
       
   184 
       
   185 #ifdef	__SYMBIAN32__
       
   186  
       
   187 OilFunctionImpl* __oil_function_impl_splat_u8_ns_ref() {
       
   188 		return &_oil_function_impl_splat_u8_ns_ref;
       
   189 }
       
   190 #endif
       
   191 
       
   192 #ifdef	__SYMBIAN32__
       
   193  
       
   194 OilFunctionImpl* __oil_function_impl_splat_u16_ns_ref() {
       
   195 		return &_oil_function_impl_splat_u16_ns_ref;
       
   196 }
       
   197 #endif
       
   198 
       
   199 #ifdef	__SYMBIAN32__
       
   200  
       
   201 OilFunctionImpl* __oil_function_impl_splat_u32_ns_ref() {
       
   202 		return &_oil_function_impl_splat_u32_ns_ref;
       
   203 }
       
   204 #endif
       
   205 
       
   206 
       
   207 
       
   208 #ifdef	__SYMBIAN32__
       
   209  
       
   210 EXPORT_C void** _oil_function_class_ptr_splat_u8 ()	{
       
   211 	oil_function_class_ptr_splat_u8 = __oil_function_class_splat_u8();
       
   212 	return &oil_function_class_ptr_splat_u8->func;
       
   213 	}
       
   214 #endif
       
   215 
       
   216 #ifdef	__SYMBIAN32__
       
   217  
       
   218 EXPORT_C void** _oil_function_class_ptr_splat_u32 ()	{
       
   219 	oil_function_class_ptr_splat_u32 = __oil_function_class_splat_u32();
       
   220 	return &oil_function_class_ptr_splat_u32->func;
       
   221 	}
       
   222 #endif
       
   223 
       
   224 #ifdef	__SYMBIAN32__
       
   225  
       
   226 EXPORT_C void** _oil_function_class_ptr_splat_u8_ns ()	{
       
   227 	oil_function_class_ptr_splat_u8_ns = __oil_function_class_splat_u8_ns();
       
   228 	return &oil_function_class_ptr_splat_u8_ns->func;
       
   229 	}
       
   230 #endif
       
   231 
       
   232 #ifdef	__SYMBIAN32__
       
   233  
       
   234 EXPORT_C void** _oil_function_class_ptr_splat_u16_ns ()	{
       
   235 	oil_function_class_ptr_splat_u16_ns = __oil_function_class_splat_u16_ns();
       
   236 	return &oil_function_class_ptr_splat_u16_ns->func;
       
   237 	}
       
   238 #endif
       
   239 
       
   240 #ifdef	__SYMBIAN32__
       
   241  
       
   242 EXPORT_C void** _oil_function_class_ptr_splat_u32_ns ()	{
       
   243 	oil_function_class_ptr_splat_u32_ns = __oil_function_class_splat_u32_ns();
       
   244 	return &oil_function_class_ptr_splat_u32_ns->func;
       
   245 	}
       
   246 #endif
       
   247