os/ossrv/genericopenlibs/liboil/src/ref/splat.c
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/ossrv/genericopenlibs/liboil/src/ref/splat.c	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,247 @@
     1.4 +/*
     1.5 + * LIBOIL - Library of Optimized Inner Loops
     1.6 + * Copyright (c) 2001,2003,2004 David A. Schleef <ds@schleef.org>
     1.7 + * All rights reserved.
     1.8 + *
     1.9 + * Redistribution and use in source and binary forms, with or without
    1.10 + * modification, are permitted provided that the following conditions
    1.11 + * are met:
    1.12 + * 1. Redistributions of source code must retain the above copyright
    1.13 + *    notice, this list of conditions and the following disclaimer.
    1.14 + * 2. Redistributions in binary form must reproduce the above copyright
    1.15 + *    notice, this list of conditions and the following disclaimer in the
    1.16 + *    documentation and/or other materials provided with the distribution.
    1.17 + * 
    1.18 + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
    1.19 + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
    1.20 + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    1.21 + * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
    1.22 + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
    1.23 + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
    1.24 + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
    1.25 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
    1.26 + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
    1.27 + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
    1.28 + * POSSIBILITY OF SUCH DAMAGE.
    1.29 + */
    1.30 +//Portions Copyright (c)  2008-2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. 
    1.31 +
    1.32 +#ifdef HAVE_CONFIG_H
    1.33 +#include "config.h"
    1.34 +#endif
    1.35 +#include <liboil/liboilfunction.h>
    1.36 +#include <string.h>
    1.37 +
    1.38 +/**
    1.39 + * oil_splat_u8:
    1.40 + * @dest:
    1.41 + * @dstr:
    1.42 + * @s1_1:
    1.43 + * @n:
    1.44 + *
    1.45 + * Copies the constant source value @s1_1 to each element in @dest.
    1.46 + */
    1.47 +OIL_DEFINE_CLASS(splat_u8,"uint8_t *dest, int dstr, uint8_t *s1_1, int n");
    1.48 +/**
    1.49 + * oil_splat_u32:
    1.50 + * @dest:
    1.51 + * @dstr:
    1.52 + * @s1_1:
    1.53 + * @n:
    1.54 + *
    1.55 + * Copies the constant source value @s1_1 to each element in @dest.
    1.56 + */
    1.57 +OIL_DEFINE_CLASS(splat_u32,"uint32_t *dest, int dstr, uint32_t *s1_1, int n");
    1.58 +/**
    1.59 + * oil_splat_u8_ns:
    1.60 + * @dest:
    1.61 + * @s1_1:
    1.62 + * @n:
    1.63 + *
    1.64 + * Copies the constant source value @s1_1 to each element in @dest.
    1.65 + */
    1.66 +OIL_DEFINE_CLASS(splat_u8_ns,"uint8_t *dest, uint8_t *s1_1, int n");
    1.67 +/**
    1.68 + * oil_splat_u16_ns:
    1.69 + * @dest:
    1.70 + * @s1_1:
    1.71 + * @n:
    1.72 + *
    1.73 + * Copies the constant source value @s1_1 to each element in @dest.
    1.74 + */
    1.75 +OIL_DEFINE_CLASS(splat_u16_ns,"uint16_t *dest, uint16_t *s1_1, int n");
    1.76 +/**
    1.77 + * oil_splat_u32_ns:
    1.78 + * @dest:
    1.79 + * @s1_1:
    1.80 + * @n:
    1.81 + *
    1.82 + * Copies the constant source value @s1_1 to each element in @dest.
    1.83 + */
    1.84 +OIL_DEFINE_CLASS(splat_u32_ns,"uint32_t *dest, uint32_t *s1_1, int n");
    1.85 +
    1.86 +
    1.87 +static void splat_u8_ref (uint8_t *dest, int dstr, uint8_t *param, int n)
    1.88 +{
    1.89 +  int i;
    1.90 +  for(i=0;i<n;i++){
    1.91 +    OIL_GET(dest,i*dstr, uint8_t) = *param;
    1.92 +  }
    1.93 +}
    1.94 +OIL_DEFINE_IMPL_REF(splat_u8_ref, splat_u8);
    1.95 +
    1.96 +static void splat_u32_ref (uint32_t *dest, int dstr, uint32_t *param, int n)
    1.97 +{
    1.98 +  int i;
    1.99 +  for(i=0;i<n;i++){
   1.100 +    OIL_GET(dest,i*dstr, uint32_t) = *param;
   1.101 +  }
   1.102 +}
   1.103 +OIL_DEFINE_IMPL_REF(splat_u32_ref, splat_u32);
   1.104 +
   1.105 +
   1.106 +static void splat_u8_ns_ref (uint8_t *dest, uint8_t *param, int n)
   1.107 +{
   1.108 +  int i;
   1.109 +  for(i=0;i<n;i++){
   1.110 +    dest[i] = *param;
   1.111 +  }
   1.112 +}
   1.113 +OIL_DEFINE_IMPL_REF(splat_u8_ns_ref, splat_u8_ns);
   1.114 +
   1.115 +static void splat_u16_ns_ref (uint16_t *dest, uint16_t *param, int n)
   1.116 +{
   1.117 +  int i;
   1.118 +  for(i=0;i<n;i++){
   1.119 +    dest[i] = *param;
   1.120 +  }
   1.121 +}
   1.122 +OIL_DEFINE_IMPL_REF(splat_u16_ns_ref, splat_u16_ns);
   1.123 +
   1.124 +static void splat_u32_ns_ref (uint32_t *dest, uint32_t *param, int n)
   1.125 +{
   1.126 +  int i;
   1.127 +  for(i=0;i<n;i++){
   1.128 +    dest[i] = *param;
   1.129 +  }
   1.130 +}
   1.131 +OIL_DEFINE_IMPL_REF(splat_u32_ns_ref, splat_u32_ns);
   1.132 +
   1.133 +
   1.134 +
   1.135 +
   1.136 +
   1.137 +#ifdef	__SYMBIAN32__
   1.138 + 
   1.139 +OilFunctionClass* __oil_function_class_splat_u8() {
   1.140 +		return &_oil_function_class_splat_u8;
   1.141 +}
   1.142 +#endif
   1.143 +
   1.144 +#ifdef	__SYMBIAN32__
   1.145 + 
   1.146 +OilFunctionClass* __oil_function_class_splat_u32() {
   1.147 +		return &_oil_function_class_splat_u32;
   1.148 +}
   1.149 +#endif
   1.150 +
   1.151 +#ifdef	__SYMBIAN32__
   1.152 + 
   1.153 +OilFunctionClass* __oil_function_class_splat_u8_ns() {
   1.154 +		return &_oil_function_class_splat_u8_ns;
   1.155 +}
   1.156 +#endif
   1.157 +
   1.158 +#ifdef	__SYMBIAN32__
   1.159 + 
   1.160 +OilFunctionClass* __oil_function_class_splat_u16_ns() {
   1.161 +		return &_oil_function_class_splat_u16_ns;
   1.162 +}
   1.163 +#endif
   1.164 +
   1.165 +#ifdef	__SYMBIAN32__
   1.166 + 
   1.167 +OilFunctionClass* __oil_function_class_splat_u32_ns() {
   1.168 +		return &_oil_function_class_splat_u32_ns;
   1.169 +}
   1.170 +#endif
   1.171 +
   1.172 +
   1.173 +
   1.174 +#ifdef	__SYMBIAN32__
   1.175 + 
   1.176 +OilFunctionImpl* __oil_function_impl_splat_u8_ref() {
   1.177 +		return &_oil_function_impl_splat_u8_ref;
   1.178 +}
   1.179 +#endif
   1.180 +
   1.181 +#ifdef	__SYMBIAN32__
   1.182 + 
   1.183 +OilFunctionImpl* __oil_function_impl_splat_u32_ref() {
   1.184 +		return &_oil_function_impl_splat_u32_ref;
   1.185 +}
   1.186 +#endif
   1.187 +
   1.188 +#ifdef	__SYMBIAN32__
   1.189 + 
   1.190 +OilFunctionImpl* __oil_function_impl_splat_u8_ns_ref() {
   1.191 +		return &_oil_function_impl_splat_u8_ns_ref;
   1.192 +}
   1.193 +#endif
   1.194 +
   1.195 +#ifdef	__SYMBIAN32__
   1.196 + 
   1.197 +OilFunctionImpl* __oil_function_impl_splat_u16_ns_ref() {
   1.198 +		return &_oil_function_impl_splat_u16_ns_ref;
   1.199 +}
   1.200 +#endif
   1.201 +
   1.202 +#ifdef	__SYMBIAN32__
   1.203 + 
   1.204 +OilFunctionImpl* __oil_function_impl_splat_u32_ns_ref() {
   1.205 +		return &_oil_function_impl_splat_u32_ns_ref;
   1.206 +}
   1.207 +#endif
   1.208 +
   1.209 +
   1.210 +
   1.211 +#ifdef	__SYMBIAN32__
   1.212 + 
   1.213 +EXPORT_C void** _oil_function_class_ptr_splat_u8 ()	{
   1.214 +	oil_function_class_ptr_splat_u8 = __oil_function_class_splat_u8();
   1.215 +	return &oil_function_class_ptr_splat_u8->func;
   1.216 +	}
   1.217 +#endif
   1.218 +
   1.219 +#ifdef	__SYMBIAN32__
   1.220 + 
   1.221 +EXPORT_C void** _oil_function_class_ptr_splat_u32 ()	{
   1.222 +	oil_function_class_ptr_splat_u32 = __oil_function_class_splat_u32();
   1.223 +	return &oil_function_class_ptr_splat_u32->func;
   1.224 +	}
   1.225 +#endif
   1.226 +
   1.227 +#ifdef	__SYMBIAN32__
   1.228 + 
   1.229 +EXPORT_C void** _oil_function_class_ptr_splat_u8_ns ()	{
   1.230 +	oil_function_class_ptr_splat_u8_ns = __oil_function_class_splat_u8_ns();
   1.231 +	return &oil_function_class_ptr_splat_u8_ns->func;
   1.232 +	}
   1.233 +#endif
   1.234 +
   1.235 +#ifdef	__SYMBIAN32__
   1.236 + 
   1.237 +EXPORT_C void** _oil_function_class_ptr_splat_u16_ns ()	{
   1.238 +	oil_function_class_ptr_splat_u16_ns = __oil_function_class_splat_u16_ns();
   1.239 +	return &oil_function_class_ptr_splat_u16_ns->func;
   1.240 +	}
   1.241 +#endif
   1.242 +
   1.243 +#ifdef	__SYMBIAN32__
   1.244 + 
   1.245 +EXPORT_C void** _oil_function_class_ptr_splat_u32_ns ()	{
   1.246 +	oil_function_class_ptr_splat_u32_ns = __oil_function_class_splat_u32_ns();
   1.247 +	return &oil_function_class_ptr_splat_u32_ns->func;
   1.248 +	}
   1.249 +#endif
   1.250 +