diff options
author | Siddhesh Wani | 2015-08-06 01:10:39 +0530 |
---|---|---|
committer | Siddhesh Wani | 2015-08-06 01:10:39 +0530 |
commit | aba32804a6cbd6fb16e13e86364e643022a2941a (patch) | |
tree | 99584f3d9b76a349eff28579ae42b18f79cbe99f /src | |
parent | 4219784830b655cb0acfd14c5d19d98a33d1de91 (diff) | |
download | Scilab2C_fossee_old-aba32804a6cbd6fb16e13e86364e643022a2941a.tar.gz Scilab2C_fossee_old-aba32804a6cbd6fb16e13e86364e643022a2941a.tar.bz2 Scilab2C_fossee_old-aba32804a6cbd6fb16e13e86364e643022a2941a.zip |
Multiplication tested for new data types
Diffstat (limited to 'src')
25 files changed, 407 insertions, 52 deletions
diff --git a/src/c/elementaryFunctions/interfaces/int_int16.h b/src/c/elementaryFunctions/interfaces/int_int16.h index 759cb97..353890d 100644 --- a/src/c/elementaryFunctions/interfaces/int_int16.h +++ b/src/c/elementaryFunctions/interfaces/int_int16.h @@ -15,12 +15,12 @@ #ifndef __INT_INT16_H__ #define __INT_INT16_H__ -#define s0int16u80(in) sint16s(in) +#define s0int16i160(in) sint16s(in) -#define d0int16u80(in) dint16s(in) +#define d0int16i160(in) dint16s(in) -#define s2int16u82(in,size,out) sint16a(in, size[0]*size[1], out) +#define s2int16i162(in,size,out) sint16a(in, size[0]*size[1], out) -#define d2int16u82(in,size,out) dint16a(in, size[0]*size[1], out) +#define d2int16i162(in,size,out) dint16a(in, size[0]*size[1], out) #endif /* !__INT_INT8_H__ */ diff --git a/src/c/elementaryFunctions/interfaces/int_int8.h b/src/c/elementaryFunctions/interfaces/int_int8.h index 5cf129e..0f6dde2 100644 --- a/src/c/elementaryFunctions/interfaces/int_int8.h +++ b/src/c/elementaryFunctions/interfaces/int_int8.h @@ -15,12 +15,12 @@ #ifndef __INT_INT8_H__ #define __INT_INT8_H__ -#define s0int8u80(in) sint8s(in) +#define s0int8i80(in) sint8s(in) -#define d0int8u80(in) dint8s(in) +#define d0int8i80(in) dint8s(in) -#define s2int8u82(in,size,out) sint8a(in, size[0]*size[1], out) +#define s2int8i82(in,size,out) sint8a(in, size[0]*size[1], out) -#define d2int8u82(in,size,out) dint8a(in, size[0]*size[1], out) +#define d2int8i82(in,size,out) dint8a(in, size[0]*size[1], out) #endif /* !__INT_INT8_H__ */ diff --git a/src/c/elementaryFunctions/interfaces/int_uint16.h b/src/c/elementaryFunctions/interfaces/int_uint16.h index 0d558b3..7d36243 100644 --- a/src/c/elementaryFunctions/interfaces/int_uint16.h +++ b/src/c/elementaryFunctions/interfaces/int_uint16.h @@ -15,12 +15,12 @@ #ifndef __INT_UINT16_H__ #define __INT_UINT16_H__ -#define s0uint16u80(in) suint16s(in) +#define s0uint16u160(in) suint16s(in) -#define d0uint16u80(in) duint16s(in) +#define d0uint16u160(in) duint16s(in) -#define s2uint16u82(in,size,out) suint16a(in, size[0]*size[1], out) +#define s2uint16u162(in,size,out) suint16a(in, size[0]*size[1], out) -#define d2uint16u82(in,size,out) duint16a(in, size[0]*size[1], out) +#define d2uint16u162(in,size,out) duint16a(in, size[0]*size[1], out) #endif /* !__INT_UINT8_H__ */ diff --git a/src/c/operations/division/i16ldivs.c b/src/c/operations/division/i16ldivs.c new file mode 100644 index 0000000..b470b16 --- /dev/null +++ b/src/c/operations/division/i16ldivs.c @@ -0,0 +1,19 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud TORSET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + + +#include "division.h" + + +int16 i16ldivs (int16 in1, int16 in2){ + return in2/in1; +} diff --git a/src/c/operations/division/i16rdivs.c b/src/c/operations/division/i16rdivs.c new file mode 100644 index 0000000..e4d5482 --- /dev/null +++ b/src/c/operations/division/i16rdivs.c @@ -0,0 +1,19 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud TORSET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + + +#include "division.h" + + +int16 i16rdivs (int16 in1, int16 in2){ + return in1/in2; +} diff --git a/src/c/operations/division/i8ldivs.c b/src/c/operations/division/i8ldivs.c new file mode 100644 index 0000000..6bf0d26 --- /dev/null +++ b/src/c/operations/division/i8ldivs.c @@ -0,0 +1,19 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud TORSET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + + +#include "division.h" + + +int8 i8ldivs (int8 in1, int8 in2){ + return in2/in1; +} diff --git a/src/c/operations/division/i8rdivs.c b/src/c/operations/division/i8rdivs.c new file mode 100644 index 0000000..db8062f --- /dev/null +++ b/src/c/operations/division/i8rdivs.c @@ -0,0 +1,19 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud TORSET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + + +#include "division.h" + + +int8 i8rdivs (int8 in1, int8 in2){ + return in1/in2; +} diff --git a/src/c/operations/division/u16ldivs.c b/src/c/operations/division/u16ldivs.c new file mode 100644 index 0000000..5383ebf --- /dev/null +++ b/src/c/operations/division/u16ldivs.c @@ -0,0 +1,19 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud TORSET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + + +#include "division.h" + + +uint16 u16ldivs (uint16 in1, uint16 in2){ + return in2/in1; +} diff --git a/src/c/operations/division/u16rdivs.c b/src/c/operations/division/u16rdivs.c new file mode 100644 index 0000000..68b998f --- /dev/null +++ b/src/c/operations/division/u16rdivs.c @@ -0,0 +1,19 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud TORSET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + + +#include "division.h" + + +uint16 u16rdivs (uint16 in1, uint16 in2){ + return in1/in2; +} diff --git a/src/c/operations/division/u8ldivs.c b/src/c/operations/division/u8ldivs.c new file mode 100644 index 0000000..0694d5f --- /dev/null +++ b/src/c/operations/division/u8ldivs.c @@ -0,0 +1,19 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud TORSET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + + +#include "division.h" + + +uint8 u8ldivs (uint8 in1, uint8 in2){ + return in2/in1; +} diff --git a/src/c/operations/division/u8rdivs.c b/src/c/operations/division/u8rdivs.c new file mode 100644 index 0000000..e6364a8 --- /dev/null +++ b/src/c/operations/division/u8rdivs.c @@ -0,0 +1,19 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud TORSET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + + +#include "division.h" + + +uint8 u8rdivs (uint8 in1, uint8 in2){ + return in1/in2; +} diff --git a/src/c/operations/includes/division.h b/src/c/operations/includes/division.h index df4c5d2..eedf4a3 100644 --- a/src/c/operations/includes/division.h +++ b/src/c/operations/includes/division.h @@ -16,6 +16,7 @@ #include "dynlib_operations.h" #include "floatComplex.h" #include "doubleComplex.h" +#include "types.h" #ifdef __cplusplus extern "C" { @@ -102,6 +103,38 @@ EXTERN_OPERATIONS doubleComplex zrdivs (doubleComplex in1, doubleComplex in2); EXTERN_OPERATIONS void zrdiva(doubleComplex* in1, doubleComplex* in2, int size, doubleComplex* out ); /* +** \brief Compute a right division for uint8. +** \param in1 : input uint8. +** \param in2 : input uint8. +** \return in1 / in2 = in1 ./ in2. +*/ +EXTERN_OPERATIONS uint8 u8rdivs (uint8 in1, uint8 in2); + +/* +** \brief Compute a right division for int8. +** \param in1 : input int8. +** \param in2 : input int8. +** \return in1 / in2 = in1 ./ in2. +*/ +EXTERN_OPERATIONS int8 i8rdivs (int8 in1, int8 in2); + +/* +** \brief Compute a right division for uint16. +** \param in1 : input uint16. +** \param in2 : input uint16. +** \return in1 / in2 = in1 ./ in2. +*/ +EXTERN_OPERATIONS uint16 u16rdivs (uint16 in1, uint16 in2); + +/* +** \brief Compute a right division for int16. +** \param in1 : input int16. +** \param in2 : input int16. +** \return in1 / in2 = in1 ./ in2. +*/ +EXTERN_OPERATIONS int16 i16rdivs (int16 in1, int16 in2); + +/* ** LEFT DIVISION */ @@ -173,6 +206,40 @@ EXTERN_OPERATIONS doubleComplex zldivs (doubleComplex in1, doubleComplex in2); */ EXTERN_OPERATIONS void zldiva(doubleComplex* in1, doubleComplex* in2, int size, doubleComplex* out ); +/* +** \brief Compute a right division for uint8. +** \param in1 : input uint8. +** \param in2 : input uint8. +** \return in1 / in2 = in1 ./ in2. +*/ +EXTERN_OPERATIONS uint8 u8ldivs (uint8 in1, uint8 in2); + +/* +** \brief Compute a right division for int8. +** \param in1 : input int8. +** \param in2 : input int8. +** \return in1 / in2 = in1 ./ in2. +*/ +EXTERN_OPERATIONS int8 i8ldivs (int8 in1, int8 in2); + +/* +** \brief Compute a right division for uint16. +** \param in1 : input uint16. +** \param in2 : input uint16. +** \return in1 / in2 = in1 ./ in2. +*/ +EXTERN_OPERATIONS uint16 u16ldivs (uint16 in1, uint16 in2); + +/* +** \brief Compute a right division for int16. +** \param in1 : input int16. +** \param in2 : input int16. +** \return in1 / in2 = in1 ./ in2. +*/ +EXTERN_OPERATIONS int16 i16ldivs (int16 in1, int16 in2); + + + #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/src/c/operations/includes/multiplication.h b/src/c/operations/includes/multiplication.h index 9931a9a..8b08d6d 100644 --- a/src/c/operations/includes/multiplication.h +++ b/src/c/operations/includes/multiplication.h @@ -16,6 +16,7 @@ #include "dynlib_operations.h" #include "floatComplex.h" #include "doubleComplex.h" +#include "types.h" #ifdef __cplusplus extern "C" { @@ -140,6 +141,75 @@ EXTERN_OPERATIONS doubleComplex zmulzdv(doubleComplex *in1, double *in2, int siz EXTERN_OPERATIONS doubleComplex zmuldzv(double *in1, doubleComplex *in2, int size2); +/* +** \brief Compute a multiplication with uint8. +** \param in1 : input uint8. +** \param in2 : input uint8. +** \return : in1 * in 2 = in1 .* in2. +*/ +EXTERN_OPERATIONS uint8 u8muls(uint8 in1, uint8 in2); + +/* +** \brief Compute a multiplication for uint8 arrays. +** \param in1 : input array. +** \param in2 : input array. +** \param size : size of in2 array. +** \return : scalar that contains the multiplication of the two vectors = in1 .* in2. +*/ +EXTERN_OPERATIONS uint8 u8mulv(uint8 *in1, uint8 *in2, int size2); + +/* +** \brief Compute a multiplication with int8. +** \param in1 : input int8. +** \param in2 : input int8. +** \return : in1 * in 2 = in1 .* in2. +*/ +EXTERN_OPERATIONS int8 i8muls(int8 in1, int8 in2); + +/* +** \brief Compute a multiplication for int8 arrays. +** \param in1 : input array. +** \param in2 : input array. +** \param size : size of in2 array. +** \return : scalar that contains the multiplication of the two vectors = in1 .* in2. +*/ +EXTERN_OPERATIONS int8 i8mulv(int8 *in1, int8 *in2, int size2); + +/* +** \brief Compute a multiplication with uint16. +** \param in1 : input uint16. +** \param in2 : input uint16. +** \return : in1 * in 2 = in1 .* in2. +*/ +EXTERN_OPERATIONS uint16 u16muls(uint16 in1, uint16 in2); + +/* +** \brief Compute a multiplication for uint16 arrays. +** \param in1 : input array. +** \param in2 : input array. +** \param size : size of in2 array. +** \return : scalar that contains the multiplication of the two vectors = in1 .* in2. +*/ +EXTERN_OPERATIONS uint16 u16mulv(uint16 *in1, uint16 *in2, int size2); + +/* +** \brief Compute a multiplication with int16. +** \param in1 : input int16. +** \param in2 : input int16. +** \return : in1 * in 2 = in1 .* in2. +*/ +EXTERN_OPERATIONS int16 i16muls(int16 in1, int16 in2); + +/* +** \brief Compute a multiplication for int16 arrays. +** \param in1 : input array. +** \param in2 : input array. +** \param size : size of in2 array. +** \return : scalar that contains the multiplication of the two vectors = in1 .* in2. +*/ +EXTERN_OPERATIONS int16 i16mulv(int16 *in1, int16 *in2, int size2); + + #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/src/c/operations/interfaces/int_OpMinus.h b/src/c/operations/interfaces/int_OpMinus.h index b96328e..2ea8a52 100644 --- a/src/c/operations/interfaces/int_OpMinus.h +++ b/src/c/operations/interfaces/int_OpMinus.h @@ -56,7 +56,7 @@ } -#define u82OpMinusu82(in, size, out) {int i=0; \ +#define i82OpMinusi82(in, size, out) {int i=0; \ for (i=0;i<size[0]*size[1];i++) out[i] = -in[i]; \ } @@ -65,6 +65,12 @@ for (i=0;i<size[0]*size[1];i++) out[i] = -(int16)in[i]; \ } + +#define i162OpMinui162(in, size, out) {int i=0; \ + for (i=0;i<size[0]*size[1];i++) out[i] = -(int16)in[i]; \ + } + + /* Scalar - Scalar */ #define s0s0OpMinuss0(in1,in2) sdiffs(in1,in2) @@ -237,6 +243,6 @@ #define u162u162OpMinusu162(in1,size1,in2,size2,out) u16diffa(in1, size1[0]*size1[1], in2, size2[0]*size2[1], out) -#define i162i162OpMinusu162(in1,size1,in2,size2,out) i16diffa(in1, size1[0]*size1[1], in2, size2[0]*size2[1], out) +#define i162i162OpMinusi162(in1,size1,in2,size2,out) i16diffa(in1, size1[0]*size1[1], in2, size2[0]*size2[1], out) #endif /* !__INT_OPMINUS_H__ */ diff --git a/src/c/operations/interfaces/int_OpPlus.h b/src/c/operations/interfaces/int_OpPlus.h index 9684d25..a5731d4 100644 --- a/src/c/operations/interfaces/int_OpPlus.h +++ b/src/c/operations/interfaces/int_OpPlus.h @@ -173,7 +173,7 @@ #define u162u162OpPlusu162(in1,size1,in2,size2,out) u16adda(in1, size1[0]*size1[1], in2, size2[0]*size2[1], out) -#define i162i162OpPlusu162(in1,size1,in2,size2,out) i16adda(in1, size1[0]*size1[1], in2, size2[0]*size2[1], out) +#define i162i162OpPlusi162(in1,size1,in2,size2,out) i16adda(in1, size1[0]*size1[1], in2, size2[0]*size2[1], out) /* Strings */ /* RNU: size1[1]-1 -> "-1" because '\0' of the first string must be removed. */ #define g2g2OpPlusg2(in1,size1,in2,size2,out) {int i = 0, j = 0; \ diff --git a/src/c/operations/interfaces/int_OpSlash.h b/src/c/operations/interfaces/int_OpSlash.h index fd8dda2..635fe2b 100644 --- a/src/c/operations/interfaces/int_OpSlash.h +++ b/src/c/operations/interfaces/int_OpSlash.h @@ -33,6 +33,13 @@ #define z0d0OpSlashz0(in1,in2) zrdivs(in1,DoubleComplex(in2,0)) +#define u80u80OpSlashu80(in1,in2) u8rdivs(in1,in2) + +#define i80i80OpSlashi80(in1,in2) i8rdivs(in1,in2) + +#define u160u160OpSlashu160(in1,in2) u16rdivs(in1,in2) + +#define i160i160OpSlashi160(in1,in2) i16rdivs(in1,in2) /* Scalar / Matrix */ @@ -76,6 +83,17 @@ dinverma(in2,temp,size[0]);\ for (i=0;i<size[0]*size[1];i++) out[i]=zmuls(in1,DoubleComplex(temp[i],0));} +#define u80u82OpSlashu82(in1,in2,size,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=in1/in2[i];} + +#define i80i82OpSlashi82(in1,in2,size,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=in1/in2[i];} + +#define u160u162OpSlashu162(in1,in2,size,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=in1/in2[i];} + +#define i160i162OpSlashi162(in1,in2,size,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=in1/in2[i];} /* Matrix / Scalar */ @@ -110,8 +128,17 @@ #define z2d0OpSlashz2(in1,size,in2,out) z2z0OpSlashz2(in1,size,DoubleComplex(in2,0),out) +#define u82u80OpSlashu82(in1,size,in2,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=in1[i]/in2;} +#define i82i80OpSlashi82(in1,size,in2,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=in1[i]/in2;} +#define u162u160OpSlashu162(in1,size,in2,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=in1[i]/in2;} + +#define i162i160OpSlashi162(in1,size,in2,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=in1[i]/in2;} /* Matrix / Matrix */ diff --git a/src/c/operations/interfaces/int_OpStar.h b/src/c/operations/interfaces/int_OpStar.h index 0dbd079..53f39e8 100644 --- a/src/c/operations/interfaces/int_OpStar.h +++ b/src/c/operations/interfaces/int_OpStar.h @@ -33,49 +33,48 @@ #define z0d0OpStarz0(in1,in2) zmuls(in1,DoubleComplex(in2,0)) -#define u80u80OpStaru80(in1,in2) (uint8)(in1 * in2) +#define u80u80OpStaru80(in1,in2) u8muls(in1, in2) -#define u80u80OpStaru160(in1,in2) (uint16)(in1 * in2) +//#define u80u80OpStaru160(in1,in2) (uint16)(in1 * in2) -#define u80i80OpStari80(in1,in2) (int8)(in1 * in2) +//#define u80i80OpStari80(in1,in2) (int8)(in1 * in2) -#define u80u80OpStari160(in1,in2) (int16)(in1 * in2) +//#define u80i80OpStari160(in1,in2) (int16)(in1 * in2) -#define u80u160OpStaru160(in1,in2) (uint16)(in1 * in2) +//#define u80u160OpStaru160(in1,in2) (uint16)(in1 * in2) -#define u80i160OpStari160(in1,in2) (int16)(in1 * in2) +//#define u80i160OpStari160(in1,in2) (int16)(in1 * in2) -#define i80u80OpStari80(in1,in2) (int8)(in1 * in2) +//#define i80u80OpStari80(in1,in2) (int8)(in1 * in2) -#define i80u80OpStari160(in1,in2) (int16)(in1 * in2) +//#define i80u80OpStari160(in1,in2) (int16)(in1 * in2) -#define i80i80OpStari80(in1,in2) (int8)(in1 * in2) +#define i80i80OpStari80(in1,in2) (int8)(in1 , in2) -#define i80i80OpStari160(in1,in2) (int16)(in1 * in2) +//#define i80i80OpStari160(in1,in2) (int16)(in1 * in2) +//#define i80u160OpStari160(in1,in2) (int16)(in1 * in2) -#define i80u160OpStari160(in1,in2) (int16)(in1 * in2) +//#define i80i160OpStari160(in1,in2) (int16)(in1 * in2) -#define i80i160OpStari160(in1,in2) (int16)(in1 * in2) +//#define u160u80OpStaru160(in1,in2) (uint16)(in1 * in2) -#define u160u80OpStaru160(in1,in2) (uint16)(in1 * in2) +//#define u160i80OpStari160(in1,in2) (int16)(in1 * in2) -#define u160i80OpStari160(in1,in2) (int16)(in1 * in2) +#define u160u160OpStaru160(in1,in2) u16muls(in1 , in2) -#define u160u160OpStaru160(in1,in2) (uint16)(in1 * in2) +//#define u160i160OpStari160(in1,in2) (int16)(in1 * in2) -#define u160i160OpStari160(in1,in2) (int16)(in1 * in2) +//#define i160u80OpStari160(in1,in2) (int16)(in1 * in2) -#define i160u80OpStari160(in1,in2) (int16)(in1 * in2) +//#define i160i80OpStari160(in1,in2) (int16)(in1 * in2) -#define i160i80OpStari160(in1,in2) (int16)(in1 * in2) +//#define i160u160OpStari160(in1,in2) (int16)(in1 * in2) -#define i160u160OpStari160(in1,in2) (int16)(in1 * in2) +#define i160i160OpStari160(in1,in2) i16muls(in1 , in2) -#define i160i160OpStari160(in1,in2) (int16)(in1 * in2) /* Scalar * Matrix */ - #define s0s2OpStars2(in1,in2,size,out) {int i=0;\ for (i=0;i<size[0]*size[1];i++) out[i]=in1*in2[i];} @@ -104,6 +103,18 @@ for (i=0;i<size[0]*size[1];i++) out[i]=zmuls(in1,DoubleComplex(in2[i],0));} +#define u80u82OpStaru82(in1,in2,size,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=in1*(uint8)in2[i];} + +#define i80i82OpStari82(in1,in2,size,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=in1*in2[i];} + +#define u160u162OpStaru162(in1,in2,size,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=in1*in2[i];} + +#define i160162OpStari162(in1,in2,size,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=in1*in2[i];} + /* Matrix * Scalar */ @@ -135,6 +146,20 @@ #define z2d0OpStarz2(in1,size,in2,out) z2z0OpStarz2(in1,size,DoubleComplex(in2,0),out) + +#define u82u80OpStaru82(in1,size,in2,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=in1[i]*in2;} + +#define i82i80OpStari82(in1,size,in2,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=in1[i]*in2;} + +#define u162u160OpStaru162(in1,size,in2,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=in1[i]*in2;} + +#define i162160OpStari162(in1,size,in2,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=in1[i]*in2;} + + /* Matrix * Matrix */ #define s2s2OpStars2(in1,size1,in2,size2,out) smulma(in1,size1[0],size1[1],in2,size2[0],size2[1],out) @@ -187,4 +212,12 @@ #define z2z2OpStarz0(in1, size1, in2, size2) zmulv( in1, in2, MAX(MAX(size1[0], size1[1]), MAX(size2[0], size2[1]))) +#define u82u82OpStaru80(in1, size1, in2, size2) u8mulv( in1, in2, MAX(MAX(size1[0], size1[1]), MAX(size2[0], size2[1]))) + +#define i82i82OpStari80(in1, size1, in2, size2) i8mulv( in1, in2, MAX(MAX(size1[0], size1[1]), MAX(size2[0], size2[1]))) + +#define u162u162OpStaru160(in1, size1, in2, size2) u16mulv( in1, in2, MAX(MAX(size1[0], size1[1]), MAX(size2[0], size2[1]))) + +#define i162i162OpStari160(in1, size1, in2, size2) i16mulv( in1, in2, MAX(MAX(size1[0], size1[1]), MAX(size2[0], size2[1]))) + #endif /* !__INT_OPSTAR_H__ */ diff --git a/src/c/operations/multiplication/i16muls.c b/src/c/operations/multiplication/i16muls.c index 1bd002e..687c217 100644 --- a/src/c/operations/multiplication/i16muls.c +++ b/src/c/operations/multiplication/i16muls.c @@ -14,6 +14,6 @@ #include "multiplication.h" #include "types.h" -i16 i16muls(i16 in1, i16 in2){ +int16 i16muls(int16 in1, int16 in2){ return in1*in2; } diff --git a/src/c/operations/multiplication/i16mulv.c b/src/c/operations/multiplication/i16mulv.c index 364d81d..37569d8 100644 --- a/src/c/operations/multiplication/i16mulv.c +++ b/src/c/operations/multiplication/i16mulv.c @@ -13,10 +13,10 @@ #include "multiplication.h" -i16 i16mulv(i16* in1, i16* in2, u16 size) +int16 i16mulv(int16* in1, int16* in2, int size) { - i16 out = 0; - u16 i = 0; + int16 out = 0; + int i = 0; for (i = 0 ; i < size ; ++i) { diff --git a/src/c/operations/multiplication/i8muls.c b/src/c/operations/multiplication/i8muls.c index 6f12425..a19bd7b 100644 --- a/src/c/operations/multiplication/i8muls.c +++ b/src/c/operations/multiplication/i8muls.c @@ -14,6 +14,6 @@ #include "multiplication.h" #include "types.h" -i80 i8muls(i80 in1, i80 in2){ +int8 i8muls(int8 in1, int8 in2){ return in1*in2; } diff --git a/src/c/operations/multiplication/i8mulv.c b/src/c/operations/multiplication/i8mulv.c index f059101..a617ceb 100644 --- a/src/c/operations/multiplication/i8mulv.c +++ b/src/c/operations/multiplication/i8mulv.c @@ -13,10 +13,10 @@ #include "multiplication.h" -i8 i8mulv(i8* in1, i8* in2, i16 size) +int8 i8mulv(int8* in1, int8* in2, int size) { - i8 out = 0; - u16 i = 0; + int8 out = 0; + int i = 0; for (i = 0 ; i < size ; ++i) { diff --git a/src/c/operations/multiplication/u16muls.c b/src/c/operations/multiplication/u16muls.c index c4d8f0e..7b202d5 100644 --- a/src/c/operations/multiplication/u16muls.c +++ b/src/c/operations/multiplication/u16muls.c @@ -14,6 +14,6 @@ #include "multiplication.h" #include "types.h" -u160 u16muls(u160 in1, u160 in2){ +uint16 u16muls(uint16 in1, uint16 in2){ return in1*in2; } diff --git a/src/c/operations/multiplication/u16mulv.c b/src/c/operations/multiplication/u16mulv.c index b7bd9a4..ae7f9fb 100644 --- a/src/c/operations/multiplication/u16mulv.c +++ b/src/c/operations/multiplication/u16mulv.c @@ -13,10 +13,10 @@ #include "multiplication.h" -u16 u16mulv(u16* in1, u16* in2, u16 size) +uint16 u16mulv(uint16* in1, uint16* in2, int size) { - u16 out = 0; - u16 i = 0; + uint16 out = 0; + int i = 0; for (i = 0 ; i < size ; ++i) { diff --git a/src/c/operations/multiplication/u8muls.c b/src/c/operations/multiplication/u8muls.c index 6a4062e..bc7d80a 100644 --- a/src/c/operations/multiplication/u8muls.c +++ b/src/c/operations/multiplication/u8muls.c @@ -14,6 +14,6 @@ #include "multiplication.h" #include "types.h" -u80 u8muls(u80 in1, u80 in2){ +uint8 u8muls(uint8 in1, uint8 in2){ return in1*in2; } diff --git a/src/c/operations/multiplication/u8mulv.c b/src/c/operations/multiplication/u8mulv.c index 4723b53..8681659 100644 --- a/src/c/operations/multiplication/u8mulv.c +++ b/src/c/operations/multiplication/u8mulv.c @@ -12,10 +12,10 @@ #include "multiplication.h" -u8 u8mulv(u8* in1, u8* in2, u16 size) +uint8 u8mulv(uint8* in1, uint8* in2, int size) { - u8 out = 0; - u16 i = 0; + uint8 out = 0; + int i = 0; for (i = 0 ; i < size ; ++i) { |