1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/genericopenlibs/liboil/src/arm/math_vfp.c Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,201 @@
1.4 +/*
1.5 + * Copyright (c) 2007
1.6 + * Josep Torra. All rights reserved.
1.7 + *
1.8 + * Redistribution and use in source and binary forms, with or without
1.9 + * modification, are permitted provided that the following conditions
1.10 + * are met:
1.11 + * 1. Redistributions of source code must retain the above copyright
1.12 + * notice, this list of conditions and the following disclaimer.
1.13 + * 2. Redistributions in binary form must reproduce the above copyright
1.14 + * notice, this list of conditions and the following disclaimer in the
1.15 + * documentation and/or other materials provided with the distribution.
1.16 + *
1.17 + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND
1.18 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1.19 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1.20 + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE
1.21 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1.22 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
1.23 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
1.24 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
1.25 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
1.26 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
1.27 + * SUCH DAMAGE.
1.28 + */
1.29 +//Portions Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
1.30 +
1.31 +#ifdef HAVE_CONFIG_H
1.32 +#include "config.h"
1.33 +#endif
1.34 +#include <liboil/liboilclasses.h>
1.35 +#include <liboil/liboilfunction.h>
1.36 +
1.37 +#if __VFP_FP__
1.38 +
1.39 +#if __ARMCC__
1.40 +extern void vfp_add_f32 (float *d, const float *s1, const float *s2, int n);
1.41 +extern void vfp_add_f64 (double *d, const double *s1, const double *s2, int n);
1.42 +extern void vfp_divide_f32 (float *d, const float *s1, const float *s2, int n);
1.43 +extern void vfp_divide_f64 (double *d, const double *s1, const double *s2, int n);
1.44 +extern void vfp_multiply_f32 (float *d, const float *s1, const float *s2, int n);
1.45 +extern void vfp_multiply_f64 (double *d, const double *s1, const double *s2, int n);
1.46 +extern void vfp_subtract_f32 (float *d, const float *s1, const float *s2, int n);
1.47 +extern void vfp_subtract_f64 (double *d, const double *s1, const double *s2, int n);
1.48 +
1.49 +extern void vfp_scalaradd_f32_ns (float *d, const float *s1, const float *s2_1, int n);
1.50 +extern void vfp_scalaradd_f64_ns (double *d, const double *s1, const double *s2_1, int n);
1.51 +extern void vfp_scalarmultiply_f32_ns (float *d, const float *s1, const float *s2_1, int n);
1.52 +extern void vfp_scalarmultiply_f64_ns (double *d, const double *s1, const double *s2_1, int n);
1.53 +
1.54 +extern void vfp_abs_f32_f32_ns(float *d, const float *s, int n);
1.55 +extern void vfp_abs_f64_f64_ns(double *d, const double *s, int n);
1.56 +extern void vfp_negative_f32(float *d, const float *s, int n);
1.57 +extern void vfp_negative_f64(double *d, const double *s, int n);
1.58 +
1.59 +OIL_DEFINE_IMPL_FULL (vfp_add_f32, add_f32, OIL_IMPL_FLAG_VFP);
1.60 +OIL_DEFINE_IMPL_FULL (vfp_add_f64, add_f64, OIL_IMPL_FLAG_VFP);
1.61 +
1.62 +OIL_DEFINE_IMPL_FULL (vfp_divide_f32, divide_f32, OIL_IMPL_FLAG_VFP);
1.63 +OIL_DEFINE_IMPL_FULL (vfp_divide_f64, divide_f64, OIL_IMPL_FLAG_VFP);
1.64 +
1.65 +OIL_DEFINE_IMPL_FULL (vfp_multiply_f32, multiply_f32, OIL_IMPL_FLAG_VFP);
1.66 +OIL_DEFINE_IMPL_FULL (vfp_multiply_f64, multiply_f64, OIL_IMPL_FLAG_VFP);
1.67 +
1.68 +OIL_DEFINE_IMPL_FULL (vfp_subtract_f32, subtract_f32, OIL_IMPL_FLAG_VFP);
1.69 +OIL_DEFINE_IMPL_FULL (vfp_subtract_f64, subtract_f64, OIL_IMPL_FLAG_VFP);
1.70 +
1.71 +OIL_DEFINE_IMPL_FULL (vfp_scalaradd_f32_ns, scalaradd_f32_ns, OIL_IMPL_FLAG_VFP);
1.72 +//OIL_DEFINE_IMPL_FULL (vfp_scalaradd_f64_ns, scalaradd_f64_ns, OIL_IMPL_FLAG_VFP);
1.73 +
1.74 +OIL_DEFINE_IMPL_FULL (vfp_scalarmultiply_f32_ns, scalarmultiply_f32_ns, OIL_IMPL_FLAG_VFP);
1.75 +OIL_DEFINE_IMPL_FULL (vfp_scalarmultiply_f64_ns, scalarmultiply_f64_ns, OIL_IMPL_FLAG_VFP);
1.76 +
1.77 +//OIL_DEFINE_IMPL_FULL (vfp_abs_f32_f32_ns, abs_f32_f32_ns, OIL_IMPL_FLAG_VFP);
1.78 +//OIL_DEFINE_IMPL_FULL (vfp_abs_f64_f64_ns, abs_f64_f64_ns, OIL_IMPL_FLAG_VFP);
1.79 +
1.80 +OIL_DEFINE_IMPL_FULL (vfp_negative_f32, negative_f32, OIL_IMPL_FLAG_VFP);
1.81 +//OIL_DEFINE_IMPL_FULL (vfp_negative_f64, negative_f64, OIL_IMPL_FLAG_VFP);
1.82 +
1.83 +
1.84 +
1.85 +
1.86 +#ifdef __SYMBIAN32__
1.87 +
1.88 +OilFunctionImpl* __oil_function_impl_vfp_add_f32() {
1.89 + return &_oil_function_impl_vfp_add_f32;
1.90 +}
1.91 +#endif
1.92 +
1.93 +#ifdef __SYMBIAN32__
1.94 +
1.95 +OilFunctionImpl* __oil_function_impl_vfp_add_f64() {
1.96 + return &_oil_function_impl_vfp_add_f64;
1.97 +}
1.98 +#endif
1.99 +
1.100 +#ifdef __SYMBIAN32__
1.101 +
1.102 +OilFunctionImpl* __oil_function_impl_vfp_divide_f32() {
1.103 + return &_oil_function_impl_vfp_divide_f32;
1.104 +}
1.105 +#endif
1.106 +
1.107 +#ifdef __SYMBIAN32__
1.108 +
1.109 +OilFunctionImpl* __oil_function_impl_vfp_divide_f64() {
1.110 + return &_oil_function_impl_vfp_divide_f64;
1.111 +}
1.112 +#endif
1.113 +
1.114 +#ifdef __SYMBIAN32__
1.115 +
1.116 +OilFunctionImpl* __oil_function_impl_vfp_multiply_f32() {
1.117 + return &_oil_function_impl_vfp_multiply_f32;
1.118 +}
1.119 +#endif
1.120 +
1.121 +#ifdef __SYMBIAN32__
1.122 +
1.123 +OilFunctionImpl* __oil_function_impl_vfp_multiply_f64() {
1.124 + return &_oil_function_impl_vfp_multiply_f64;
1.125 +}
1.126 +#endif
1.127 +
1.128 +#ifdef __SYMBIAN32__
1.129 +
1.130 +OilFunctionImpl* __oil_function_impl_vfp_subtract_f32() {
1.131 + return &_oil_function_impl_vfp_subtract_f32;
1.132 +}
1.133 +#endif
1.134 +
1.135 +#ifdef __SYMBIAN32__
1.136 +
1.137 +OilFunctionImpl* __oil_function_impl_vfp_subtract_f64() {
1.138 + return &_oil_function_impl_vfp_subtract_f64;
1.139 +}
1.140 +#endif
1.141 +
1.142 +#ifdef __SYMBIAN32__
1.143 +
1.144 +OilFunctionImpl* __oil_function_impl_vfp_scalaradd_f32_ns() {
1.145 + return &_oil_function_impl_vfp_scalaradd_f32_ns;
1.146 +}
1.147 +#endif
1.148 +
1.149 +/*
1.150 +#ifdef __SYMBIAN32__
1.151 +
1.152 +OilFunctionImpl* __oil_function_impl_vfp_scalaradd_f64_ns() {
1.153 + return &_oil_function_impl_vfp_scalaradd_f64_ns;
1.154 +}
1.155 +#endif
1.156 +*/
1.157 +
1.158 +#ifdef __SYMBIAN32__
1.159 +
1.160 +OilFunctionImpl* __oil_function_impl_vfp_scalarmultiply_f32_ns() {
1.161 + return &_oil_function_impl_vfp_scalarmultiply_f32_ns;
1.162 +}
1.163 +#endif
1.164 +
1.165 +#ifdef __SYMBIAN32__
1.166 +
1.167 +OilFunctionImpl* __oil_function_impl_vfp_scalarmultiply_f64_ns() {
1.168 + return &_oil_function_impl_vfp_scalarmultiply_f64_ns;
1.169 +}
1.170 +#endif
1.171 +
1.172 +/*
1.173 +#ifdef __SYMBIAN32__
1.174 +
1.175 +OilFunctionImpl* __oil_function_impl_vfp_abs_f32_f32_ns() {
1.176 + return &_oil_function_impl_vfp_abs_f32_f32_ns;
1.177 +}
1.178 +#endif
1.179 +
1.180 +#ifdef __SYMBIAN32__
1.181 +
1.182 +OilFunctionImpl* __oil_function_impl_vfp_abs_f64_f64_ns() {
1.183 + return &_oil_function_impl_vfp_abs_f64_f64_ns;
1.184 +}
1.185 +#endif
1.186 +*/
1.187 +
1.188 +#ifdef __SYMBIAN32__
1.189 +
1.190 +OilFunctionImpl* __oil_function_impl_vfp_negative_f32() {
1.191 + return &_oil_function_impl_vfp_negative_f32;
1.192 +}
1.193 +#endif
1.194 +
1.195 +/*
1.196 +#ifdef __SYMBIAN32__
1.197 +
1.198 +OilFunctionImpl* __oil_function_impl_vfp_negative_f64() {
1.199 + return &_oil_function_impl_vfp_negative_f64;
1.200 +}
1.201 +#endif
1.202 +*/
1.203 +#endif
1.204 +#endif