genericopenlibs/liboil/src/arm/math_vfp.c
changeset 18 47c74d1534e1
equal deleted inserted replaced
0:e4d67989cc36 18:47c74d1534e1
       
     1 /*
       
     2  * Copyright (c) 2007
       
     3  *	Josep Torra.  All rights reserved.
       
     4  *
       
     5  * Redistribution and use in source and binary forms, with or without
       
     6  * modification, are permitted provided that the following conditions
       
     7  * are met:
       
     8  * 1. Redistributions of source code must retain the above copyright
       
     9  *    notice, this list of conditions and the following disclaimer.
       
    10  * 2. Redistributions in binary form must reproduce the above copyright
       
    11  *    notice, this list of conditions and the following disclaimer in the
       
    12  *    documentation and/or other materials provided with the distribution.
       
    13  *
       
    14  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND
       
    15  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
       
    16  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
       
    17  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE
       
    18  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
       
    19  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
       
    20  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
       
    21  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
       
    22  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
       
    23  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
       
    24  * SUCH DAMAGE.
       
    25  */
       
    26 //Portions Copyright (c)  2008-2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. 
       
    27 
       
    28 #ifdef HAVE_CONFIG_H
       
    29 #include "config.h"
       
    30 #endif
       
    31 #include <liboil/liboilclasses.h>
       
    32 #include <liboil/liboilfunction.h>
       
    33 
       
    34 #if __VFP_FP__
       
    35 
       
    36 #if __ARMCC__
       
    37 extern void vfp_add_f32 (float *d, const float *s1, const float *s2, int n);
       
    38 extern void vfp_add_f64 (double *d, const double *s1, const double *s2, int n);
       
    39 extern void vfp_divide_f32 (float *d, const float *s1, const float *s2, int n);
       
    40 extern void vfp_divide_f64 (double *d, const double *s1, const double *s2, int n);
       
    41 extern void vfp_multiply_f32 (float *d, const float *s1, const float *s2, int n);
       
    42 extern void vfp_multiply_f64 (double *d, const double *s1, const double *s2, int n);
       
    43 extern void vfp_subtract_f32 (float *d, const float *s1, const float *s2, int n);
       
    44 extern void vfp_subtract_f64 (double *d, const double *s1, const double *s2, int n);
       
    45 
       
    46 extern void vfp_scalaradd_f32_ns (float *d, const float *s1, const float *s2_1, int n);
       
    47 extern void vfp_scalaradd_f64_ns (double *d, const double *s1, const double *s2_1, int n);
       
    48 extern void vfp_scalarmultiply_f32_ns (float *d, const float *s1, const float *s2_1, int n);
       
    49 extern void vfp_scalarmultiply_f64_ns (double *d, const double *s1, const double *s2_1, int n);
       
    50 
       
    51 extern void vfp_abs_f32_f32_ns(float *d, const float *s, int n);
       
    52 extern void vfp_abs_f64_f64_ns(double *d, const double *s, int n);
       
    53 extern void vfp_negative_f32(float *d, const float *s, int n);
       
    54 extern void vfp_negative_f64(double *d, const double *s, int n);
       
    55 
       
    56 OIL_DEFINE_IMPL_FULL (vfp_add_f32, add_f32, OIL_IMPL_FLAG_VFP);
       
    57 OIL_DEFINE_IMPL_FULL (vfp_add_f64, add_f64, OIL_IMPL_FLAG_VFP);
       
    58 
       
    59 OIL_DEFINE_IMPL_FULL (vfp_divide_f32, divide_f32, OIL_IMPL_FLAG_VFP);
       
    60 OIL_DEFINE_IMPL_FULL (vfp_divide_f64, divide_f64, OIL_IMPL_FLAG_VFP);
       
    61 
       
    62 OIL_DEFINE_IMPL_FULL (vfp_multiply_f32, multiply_f32, OIL_IMPL_FLAG_VFP);
       
    63 OIL_DEFINE_IMPL_FULL (vfp_multiply_f64, multiply_f64, OIL_IMPL_FLAG_VFP);
       
    64 
       
    65 OIL_DEFINE_IMPL_FULL (vfp_subtract_f32, subtract_f32, OIL_IMPL_FLAG_VFP);
       
    66 OIL_DEFINE_IMPL_FULL (vfp_subtract_f64, subtract_f64, OIL_IMPL_FLAG_VFP);
       
    67 
       
    68 OIL_DEFINE_IMPL_FULL (vfp_scalaradd_f32_ns, scalaradd_f32_ns, OIL_IMPL_FLAG_VFP);
       
    69 //OIL_DEFINE_IMPL_FULL (vfp_scalaradd_f64_ns, scalaradd_f64_ns, OIL_IMPL_FLAG_VFP);
       
    70 
       
    71 OIL_DEFINE_IMPL_FULL (vfp_scalarmultiply_f32_ns, scalarmultiply_f32_ns, OIL_IMPL_FLAG_VFP);
       
    72 OIL_DEFINE_IMPL_FULL (vfp_scalarmultiply_f64_ns, scalarmultiply_f64_ns, OIL_IMPL_FLAG_VFP);
       
    73 
       
    74 //OIL_DEFINE_IMPL_FULL (vfp_abs_f32_f32_ns, abs_f32_f32_ns, OIL_IMPL_FLAG_VFP);
       
    75 //OIL_DEFINE_IMPL_FULL (vfp_abs_f64_f64_ns, abs_f64_f64_ns, OIL_IMPL_FLAG_VFP);
       
    76 
       
    77 OIL_DEFINE_IMPL_FULL (vfp_negative_f32, negative_f32, OIL_IMPL_FLAG_VFP);
       
    78 //OIL_DEFINE_IMPL_FULL (vfp_negative_f64, negative_f64, OIL_IMPL_FLAG_VFP);
       
    79 
       
    80 
       
    81 
       
    82 
       
    83 #ifdef	__SYMBIAN32__
       
    84  
       
    85 OilFunctionImpl* __oil_function_impl_vfp_add_f32() {
       
    86 		return &_oil_function_impl_vfp_add_f32;
       
    87 }
       
    88 #endif
       
    89 
       
    90 #ifdef	__SYMBIAN32__
       
    91  
       
    92 OilFunctionImpl* __oil_function_impl_vfp_add_f64() {
       
    93 		return &_oil_function_impl_vfp_add_f64;
       
    94 }
       
    95 #endif
       
    96 
       
    97 #ifdef	__SYMBIAN32__
       
    98  
       
    99 OilFunctionImpl* __oil_function_impl_vfp_divide_f32() {
       
   100 		return &_oil_function_impl_vfp_divide_f32;
       
   101 }
       
   102 #endif
       
   103 
       
   104 #ifdef	__SYMBIAN32__
       
   105  
       
   106 OilFunctionImpl* __oil_function_impl_vfp_divide_f64() {
       
   107 		return &_oil_function_impl_vfp_divide_f64;
       
   108 }
       
   109 #endif
       
   110 
       
   111 #ifdef	__SYMBIAN32__
       
   112  
       
   113 OilFunctionImpl* __oil_function_impl_vfp_multiply_f32() {
       
   114 		return &_oil_function_impl_vfp_multiply_f32;
       
   115 }
       
   116 #endif
       
   117 
       
   118 #ifdef	__SYMBIAN32__
       
   119  
       
   120 OilFunctionImpl* __oil_function_impl_vfp_multiply_f64() {
       
   121 		return &_oil_function_impl_vfp_multiply_f64;
       
   122 }
       
   123 #endif
       
   124 
       
   125 #ifdef	__SYMBIAN32__
       
   126  
       
   127 OilFunctionImpl* __oil_function_impl_vfp_subtract_f32() {
       
   128 		return &_oil_function_impl_vfp_subtract_f32;
       
   129 }
       
   130 #endif
       
   131 
       
   132 #ifdef	__SYMBIAN32__
       
   133  
       
   134 OilFunctionImpl* __oil_function_impl_vfp_subtract_f64() {
       
   135 		return &_oil_function_impl_vfp_subtract_f64;
       
   136 }
       
   137 #endif
       
   138 
       
   139 #ifdef	__SYMBIAN32__
       
   140  
       
   141 OilFunctionImpl* __oil_function_impl_vfp_scalaradd_f32_ns() {
       
   142 		return &_oil_function_impl_vfp_scalaradd_f32_ns;
       
   143 }
       
   144 #endif
       
   145 
       
   146 /*
       
   147 #ifdef	__SYMBIAN32__
       
   148  
       
   149 OilFunctionImpl* __oil_function_impl_vfp_scalaradd_f64_ns() {
       
   150 		return &_oil_function_impl_vfp_scalaradd_f64_ns;
       
   151 }
       
   152 #endif
       
   153 */
       
   154 
       
   155 #ifdef	__SYMBIAN32__
       
   156  
       
   157 OilFunctionImpl* __oil_function_impl_vfp_scalarmultiply_f32_ns() {
       
   158 		return &_oil_function_impl_vfp_scalarmultiply_f32_ns;
       
   159 }
       
   160 #endif
       
   161 
       
   162 #ifdef	__SYMBIAN32__
       
   163  
       
   164 OilFunctionImpl* __oil_function_impl_vfp_scalarmultiply_f64_ns() {
       
   165 		return &_oil_function_impl_vfp_scalarmultiply_f64_ns;
       
   166 }
       
   167 #endif
       
   168 
       
   169 /*
       
   170 #ifdef	__SYMBIAN32__
       
   171  
       
   172 OilFunctionImpl* __oil_function_impl_vfp_abs_f32_f32_ns() {
       
   173 		return &_oil_function_impl_vfp_abs_f32_f32_ns;
       
   174 }
       
   175 #endif
       
   176 
       
   177 #ifdef	__SYMBIAN32__
       
   178  
       
   179 OilFunctionImpl* __oil_function_impl_vfp_abs_f64_f64_ns() {
       
   180 		return &_oil_function_impl_vfp_abs_f64_f64_ns;
       
   181 }
       
   182 #endif
       
   183 */
       
   184 
       
   185 #ifdef	__SYMBIAN32__
       
   186  
       
   187 OilFunctionImpl* __oil_function_impl_vfp_negative_f32() {
       
   188 		return &_oil_function_impl_vfp_negative_f32;
       
   189 }
       
   190 #endif
       
   191 
       
   192 /*
       
   193 #ifdef	__SYMBIAN32__
       
   194  
       
   195 OilFunctionImpl* __oil_function_impl_vfp_negative_f64() {
       
   196 		return &_oil_function_impl_vfp_negative_f64;
       
   197 }
       
   198 #endif
       
   199 */
       
   200 #endif
       
   201 #endif