diff options
author | imushir | 2016-01-22 16:01:46 +0530 |
---|---|---|
committer | imushir | 2016-01-22 16:01:46 +0530 |
commit | 0296cf3166e7250191f0e08907b65dad9e665e46 (patch) | |
tree | adaf5a67239b9db13a469b3a5921c0efb234257e /2.3-1/src | |
parent | 2803a0bccff2ca4f4b5b81d3ef7f7cf3c75e0ec9 (diff) | |
download | Scilab2C-0296cf3166e7250191f0e08907b65dad9e665e46.tar.gz Scilab2C-0296cf3166e7250191f0e08907b65dad9e665e46.tar.bz2 Scilab2C-0296cf3166e7250191f0e08907b65dad9e665e46.zip |
added support of uint8,uint16 for bitwise operators
Diffstat (limited to '2.3-1/src')
60 files changed, 934 insertions, 0 deletions
diff --git a/2.3-1/src/c/elementaryFunctions/bitand/u16bitanda.c b/2.3-1/src/c/elementaryFunctions/bitand/u16bitanda.c new file mode 100644 index 00000000..743161ea --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/bitand/u16bitanda.c @@ -0,0 +1,14 @@ +/* Scilab2C FOSSEE IITB */ +#include "bitand.h" + +void u16bitanda(uint16* x,uint16* y,int size,uint16* out) +{ + int i = 0; + for(i=0;i<size;i++) + { + out[i] = u16bitands(x[i],y[i]); + } + + +} + diff --git a/2.3-1/src/c/elementaryFunctions/bitand/u16bitands.c b/2.3-1/src/c/elementaryFunctions/bitand/u16bitands.c new file mode 100644 index 00000000..7ba73c15 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/bitand/u16bitands.c @@ -0,0 +1,9 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitand.h" + +uint16 u16bitands(uint16 x,uint16 y) +{ + return (x & y); + +} diff --git a/2.3-1/src/c/elementaryFunctions/bitand/u8bitanda.c b/2.3-1/src/c/elementaryFunctions/bitand/u8bitanda.c new file mode 100644 index 00000000..e1260a71 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/bitand/u8bitanda.c @@ -0,0 +1,14 @@ +/* Scilab2C FOSSEE IITB */ +#include "bitand.h" + +void u8bitanda(uint8* x,uint8* y,int size,uint8* out) +{ + int i = 0; + for(i=0;i<size;i++) + { + out[i] = u8bitands(x[i],y[i]); + } + + +} + diff --git a/2.3-1/src/c/elementaryFunctions/bitand/u8bitands.c b/2.3-1/src/c/elementaryFunctions/bitand/u8bitands.c new file mode 100644 index 00000000..eda3ccc6 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/bitand/u8bitands.c @@ -0,0 +1,9 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitand.h" + +uint8 u8bitands(uint8 x,uint8 y) +{ + return (x & y); + +} diff --git a/2.3-1/src/c/elementaryFunctions/bitcmp/u16bitcmpa.c b/2.3-1/src/c/elementaryFunctions/bitcmp/u16bitcmpa.c new file mode 100644 index 00000000..55813712 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/bitcmp/u16bitcmpa.c @@ -0,0 +1,16 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitcmp.h" +void u16bitcmpa(uint16 *x,uint16 y,int size,uint16* out) +{ + int i=0; + for(i=0;i<size;i++) + { + out[i] = u16bitcmps(x[i],y); + + } + + +} + + diff --git a/2.3-1/src/c/elementaryFunctions/bitcmp/u16bitcmps.c b/2.3-1/src/c/elementaryFunctions/bitcmp/u16bitcmps.c new file mode 100644 index 00000000..19816907 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/bitcmp/u16bitcmps.c @@ -0,0 +1,11 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitcmp.h" +uint16 u16bitcmps(uint16 x,uint16 y) +{ + unsigned char temp = x; + return (~x); + +} + + diff --git a/2.3-1/src/c/elementaryFunctions/bitcmp/u8bitcmpa.c b/2.3-1/src/c/elementaryFunctions/bitcmp/u8bitcmpa.c new file mode 100644 index 00000000..67bde285 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/bitcmp/u8bitcmpa.c @@ -0,0 +1,16 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitcmp.h" +void u8bitcmpa(uint8 *x,uint8 y,int size,uint8* out) +{ + int i=0; + for(i=0;i<size;i++) + { + out[i] = u8bitcmps(x[i],y); + + } + + +} + + diff --git a/2.3-1/src/c/elementaryFunctions/bitcmp/u8bitcmps.c b/2.3-1/src/c/elementaryFunctions/bitcmp/u8bitcmps.c new file mode 100644 index 00000000..2a030d92 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/bitcmp/u8bitcmps.c @@ -0,0 +1,11 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitcmp.h" +uint8 u8bitcmps(uint8 x,uint8 y) +{ + unsigned char temp = x; + return (~x); + +} + + diff --git a/2.3-1/src/c/elementaryFunctions/bitget/u16bitgets.c b/2.3-1/src/c/elementaryFunctions/bitget/u16bitgets.c new file mode 100644 index 00000000..20593bff --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/bitget/u16bitgets.c @@ -0,0 +1,24 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitget.h" +#include<stdio.h> + +uint16 u16bitgets(uint16 value,int position) +{ + + value = value >> (position -1); + value = value & 1; + return value; + + /*unsigned char mask = 1<<(position-1); + uint16 bit = value&mask; + if(bit > 0) + { + return 1; + } + else + { + return 0; + }*/ + +} diff --git a/2.3-1/src/c/elementaryFunctions/bitget/u16bitgets.c~ b/2.3-1/src/c/elementaryFunctions/bitget/u16bitgets.c~ new file mode 100644 index 00000000..20593bff --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/bitget/u16bitgets.c~ @@ -0,0 +1,24 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitget.h" +#include<stdio.h> + +uint16 u16bitgets(uint16 value,int position) +{ + + value = value >> (position -1); + value = value & 1; + return value; + + /*unsigned char mask = 1<<(position-1); + uint16 bit = value&mask; + if(bit > 0) + { + return 1; + } + else + { + return 0; + }*/ + +} diff --git a/2.3-1/src/c/elementaryFunctions/bitget/u8bitgets.c b/2.3-1/src/c/elementaryFunctions/bitget/u8bitgets.c new file mode 100644 index 00000000..130bff86 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/bitget/u8bitgets.c @@ -0,0 +1,24 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitget.h" +#include<stdio.h> + +uint8 u8bitgets(uint8 value,int position) +{ + + value = value >> (position -1); + value = value & 1; + return value; + + /*unsigned char mask = 1<<(position-1); + uint8 bit = value&mask; + if(bit > 0) + { + return 1; + } + else + { + return 0; + }*/ + +} diff --git a/2.3-1/src/c/elementaryFunctions/bitget/u8bitgets.c~ b/2.3-1/src/c/elementaryFunctions/bitget/u8bitgets.c~ new file mode 100644 index 00000000..130bff86 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/bitget/u8bitgets.c~ @@ -0,0 +1,24 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitget.h" +#include<stdio.h> + +uint8 u8bitgets(uint8 value,int position) +{ + + value = value >> (position -1); + value = value & 1; + return value; + + /*unsigned char mask = 1<<(position-1); + uint8 bit = value&mask; + if(bit > 0) + { + return 1; + } + else + { + return 0; + }*/ + +} diff --git a/2.3-1/src/c/elementaryFunctions/bitor/dbitanda.c~ b/2.3-1/src/c/elementaryFunctions/bitor/dbitanda.c~ new file mode 100644 index 00000000..d411e6e4 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/bitor/dbitanda.c~ @@ -0,0 +1,14 @@ +/* Scilab2C FOSSEE IITB */ +#include "bitand.h" + +void dbitanda(double* x,double* y,int size,double* out) +{ + int i = 0; + for(i=0;i<size;i++) + { + out[i] = dbitands(x[i],y[i]); + } + + +} + diff --git a/2.3-1/src/c/elementaryFunctions/bitor/dbitands.c~ b/2.3-1/src/c/elementaryFunctions/bitor/dbitands.c~ new file mode 100644 index 00000000..a66e3c13 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/bitor/dbitands.c~ @@ -0,0 +1,9 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitand.h" + +double dbitands(double x,double y) +{ + return ((int)x & (int)y); + +} diff --git a/2.3-1/src/c/elementaryFunctions/bitor/u16bitanda.c~ b/2.3-1/src/c/elementaryFunctions/bitor/u16bitanda.c~ new file mode 100644 index 00000000..743161ea --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/bitor/u16bitanda.c~ @@ -0,0 +1,14 @@ +/* Scilab2C FOSSEE IITB */ +#include "bitand.h" + +void u16bitanda(uint16* x,uint16* y,int size,uint16* out) +{ + int i = 0; + for(i=0;i<size;i++) + { + out[i] = u16bitands(x[i],y[i]); + } + + +} + diff --git a/2.3-1/src/c/elementaryFunctions/bitor/u16bitands.c~ b/2.3-1/src/c/elementaryFunctions/bitor/u16bitands.c~ new file mode 100644 index 00000000..7ba73c15 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/bitor/u16bitands.c~ @@ -0,0 +1,9 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitand.h" + +uint16 u16bitands(uint16 x,uint16 y) +{ + return (x & y); + +} diff --git a/2.3-1/src/c/elementaryFunctions/bitor/u16bitora.c b/2.3-1/src/c/elementaryFunctions/bitor/u16bitora.c new file mode 100644 index 00000000..84722e18 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/bitor/u16bitora.c @@ -0,0 +1,14 @@ +/* Scilab2C FOSSEE IITB */ +#include "bitor.h" + +void u16bitora(uint16* x,uint16* y,int size,uint16* out) +{ + int i = 0; + for(i=0;i<size;i++) + { + out[i] = u16bitors(x[i],y[i]); + } + + +} + diff --git a/2.3-1/src/c/elementaryFunctions/bitor/u16bitora.c~ b/2.3-1/src/c/elementaryFunctions/bitor/u16bitora.c~ new file mode 100644 index 00000000..84722e18 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/bitor/u16bitora.c~ @@ -0,0 +1,14 @@ +/* Scilab2C FOSSEE IITB */ +#include "bitor.h" + +void u16bitora(uint16* x,uint16* y,int size,uint16* out) +{ + int i = 0; + for(i=0;i<size;i++) + { + out[i] = u16bitors(x[i],y[i]); + } + + +} + diff --git a/2.3-1/src/c/elementaryFunctions/bitor/u16bitors.c b/2.3-1/src/c/elementaryFunctions/bitor/u16bitors.c new file mode 100644 index 00000000..e48e3000 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/bitor/u16bitors.c @@ -0,0 +1,9 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitor.h" + +uint16 u16bitors(uint16 x,uint16 y) +{ + return (x | y); + +} diff --git a/2.3-1/src/c/elementaryFunctions/bitor/u16bitors.c~ b/2.3-1/src/c/elementaryFunctions/bitor/u16bitors.c~ new file mode 100644 index 00000000..e48e3000 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/bitor/u16bitors.c~ @@ -0,0 +1,9 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitor.h" + +uint16 u16bitors(uint16 x,uint16 y) +{ + return (x | y); + +} diff --git a/2.3-1/src/c/elementaryFunctions/bitor/u8bitanda.c~ b/2.3-1/src/c/elementaryFunctions/bitor/u8bitanda.c~ new file mode 100644 index 00000000..e1260a71 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/bitor/u8bitanda.c~ @@ -0,0 +1,14 @@ +/* Scilab2C FOSSEE IITB */ +#include "bitand.h" + +void u8bitanda(uint8* x,uint8* y,int size,uint8* out) +{ + int i = 0; + for(i=0;i<size;i++) + { + out[i] = u8bitands(x[i],y[i]); + } + + +} + diff --git a/2.3-1/src/c/elementaryFunctions/bitor/u8bitands.c~ b/2.3-1/src/c/elementaryFunctions/bitor/u8bitands.c~ new file mode 100644 index 00000000..eda3ccc6 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/bitor/u8bitands.c~ @@ -0,0 +1,9 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitand.h" + +uint8 u8bitands(uint8 x,uint8 y) +{ + return (x & y); + +} diff --git a/2.3-1/src/c/elementaryFunctions/bitor/u8bitora.c b/2.3-1/src/c/elementaryFunctions/bitor/u8bitora.c new file mode 100644 index 00000000..edda9bba --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/bitor/u8bitora.c @@ -0,0 +1,14 @@ +/* Scilab2C FOSSEE IITB */ +#include "bitor.h" + +void u8bitora(uint8* x,uint8* y,int size,uint8* out) +{ + int i = 0; + for(i=0;i<size;i++) + { + out[i] = u8bitors(x[i],y[i]); + } + + +} + diff --git a/2.3-1/src/c/elementaryFunctions/bitor/u8bitora.c~ b/2.3-1/src/c/elementaryFunctions/bitor/u8bitora.c~ new file mode 100644 index 00000000..edda9bba --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/bitor/u8bitora.c~ @@ -0,0 +1,14 @@ +/* Scilab2C FOSSEE IITB */ +#include "bitor.h" + +void u8bitora(uint8* x,uint8* y,int size,uint8* out) +{ + int i = 0; + for(i=0;i<size;i++) + { + out[i] = u8bitors(x[i],y[i]); + } + + +} + diff --git a/2.3-1/src/c/elementaryFunctions/bitor/u8bitors.c b/2.3-1/src/c/elementaryFunctions/bitor/u8bitors.c new file mode 100644 index 00000000..56d3540d --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/bitor/u8bitors.c @@ -0,0 +1,9 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitor.h" + +uint8 u8bitors(uint8 x,uint8 y) +{ + return (x | y); + +} diff --git a/2.3-1/src/c/elementaryFunctions/bitor/u8bitors.c~ b/2.3-1/src/c/elementaryFunctions/bitor/u8bitors.c~ new file mode 100644 index 00000000..56d3540d --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/bitor/u8bitors.c~ @@ -0,0 +1,9 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitor.h" + +uint8 u8bitors(uint8 x,uint8 y) +{ + return (x | y); + +} diff --git a/2.3-1/src/c/elementaryFunctions/bitset/u16bitsets.c b/2.3-1/src/c/elementaryFunctions/bitset/u16bitsets.c new file mode 100644 index 00000000..953e46c9 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/bitset/u16bitsets.c @@ -0,0 +1,20 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitset.h" +#include<stdio.h> + +uint16 u16bitsets(uint16 value,int position,int bit_value) +{ + if(bit_value==1) + { + unsigned char mask1 = 1 << (position-1) ; // we could cast to unsigned char, just to be safe + return (mask1 | value); + } + else + { + unsigned char mask2 = ~(1 << (position-1)); // we could cast to unsigned char, just to be safe + return (mask2 & value); + + } + +} diff --git a/2.3-1/src/c/elementaryFunctions/bitset/u16bitsets.c~ b/2.3-1/src/c/elementaryFunctions/bitset/u16bitsets.c~ new file mode 100644 index 00000000..953e46c9 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/bitset/u16bitsets.c~ @@ -0,0 +1,20 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitset.h" +#include<stdio.h> + +uint16 u16bitsets(uint16 value,int position,int bit_value) +{ + if(bit_value==1) + { + unsigned char mask1 = 1 << (position-1) ; // we could cast to unsigned char, just to be safe + return (mask1 | value); + } + else + { + unsigned char mask2 = ~(1 << (position-1)); // we could cast to unsigned char, just to be safe + return (mask2 & value); + + } + +} diff --git a/2.3-1/src/c/elementaryFunctions/bitset/u8bitsets.c b/2.3-1/src/c/elementaryFunctions/bitset/u8bitsets.c new file mode 100644 index 00000000..5f44dcd8 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/bitset/u8bitsets.c @@ -0,0 +1,20 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitset.h" +#include<stdio.h> + +uint8 u8bitsets(uint8 value,int position,int bit_value) +{ + if(bit_value==1) + { + unsigned char mask1 = 1 << (position-1) ; // we could cast to unsigned char, just to be safe + return (mask1 | value); + } + else + { + unsigned char mask2 = ~(1 << (position-1)); // we could cast to unsigned char, just to be safe + return (mask2 & value); + + } + +} diff --git a/2.3-1/src/c/elementaryFunctions/bitset/u8bitsets.c~ b/2.3-1/src/c/elementaryFunctions/bitset/u8bitsets.c~ new file mode 100644 index 00000000..5f44dcd8 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/bitset/u8bitsets.c~ @@ -0,0 +1,20 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitset.h" +#include<stdio.h> + +uint8 u8bitsets(uint8 value,int position,int bit_value) +{ + if(bit_value==1) + { + unsigned char mask1 = 1 << (position-1) ; // we could cast to unsigned char, just to be safe + return (mask1 | value); + } + else + { + unsigned char mask2 = ~(1 << (position-1)); // we could cast to unsigned char, just to be safe + return (mask2 & value); + + } + +} diff --git a/2.3-1/src/c/elementaryFunctions/bitxor/dbitanda.c~ b/2.3-1/src/c/elementaryFunctions/bitxor/dbitanda.c~ new file mode 100644 index 00000000..d411e6e4 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/bitxor/dbitanda.c~ @@ -0,0 +1,14 @@ +/* Scilab2C FOSSEE IITB */ +#include "bitand.h" + +void dbitanda(double* x,double* y,int size,double* out) +{ + int i = 0; + for(i=0;i<size;i++) + { + out[i] = dbitands(x[i],y[i]); + } + + +} + diff --git a/2.3-1/src/c/elementaryFunctions/bitxor/dbitands.c~ b/2.3-1/src/c/elementaryFunctions/bitxor/dbitands.c~ new file mode 100644 index 00000000..a66e3c13 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/bitxor/dbitands.c~ @@ -0,0 +1,9 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitand.h" + +double dbitands(double x,double y) +{ + return ((int)x & (int)y); + +} diff --git a/2.3-1/src/c/elementaryFunctions/bitxor/u16bitanda.c~ b/2.3-1/src/c/elementaryFunctions/bitxor/u16bitanda.c~ new file mode 100644 index 00000000..743161ea --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/bitxor/u16bitanda.c~ @@ -0,0 +1,14 @@ +/* Scilab2C FOSSEE IITB */ +#include "bitand.h" + +void u16bitanda(uint16* x,uint16* y,int size,uint16* out) +{ + int i = 0; + for(i=0;i<size;i++) + { + out[i] = u16bitands(x[i],y[i]); + } + + +} + diff --git a/2.3-1/src/c/elementaryFunctions/bitxor/u16bitands.c~ b/2.3-1/src/c/elementaryFunctions/bitxor/u16bitands.c~ new file mode 100644 index 00000000..7ba73c15 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/bitxor/u16bitands.c~ @@ -0,0 +1,9 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitand.h" + +uint16 u16bitands(uint16 x,uint16 y) +{ + return (x & y); + +} diff --git a/2.3-1/src/c/elementaryFunctions/bitxor/u16bitora.c~ b/2.3-1/src/c/elementaryFunctions/bitxor/u16bitora.c~ new file mode 100644 index 00000000..84722e18 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/bitxor/u16bitora.c~ @@ -0,0 +1,14 @@ +/* Scilab2C FOSSEE IITB */ +#include "bitor.h" + +void u16bitora(uint16* x,uint16* y,int size,uint16* out) +{ + int i = 0; + for(i=0;i<size;i++) + { + out[i] = u16bitors(x[i],y[i]); + } + + +} + diff --git a/2.3-1/src/c/elementaryFunctions/bitxor/u16bitors.c~ b/2.3-1/src/c/elementaryFunctions/bitxor/u16bitors.c~ new file mode 100644 index 00000000..e48e3000 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/bitxor/u16bitors.c~ @@ -0,0 +1,9 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitor.h" + +uint16 u16bitors(uint16 x,uint16 y) +{ + return (x | y); + +} diff --git a/2.3-1/src/c/elementaryFunctions/bitxor/u16bitxora.c b/2.3-1/src/c/elementaryFunctions/bitxor/u16bitxora.c new file mode 100644 index 00000000..6f50f068 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/bitxor/u16bitxora.c @@ -0,0 +1,14 @@ +/* Scilab2C FOSSEE IITB */ +#include "bitxor.h" + +void u16bitxora(uint16* x,uint16* y,int size,uint16* out) +{ + int i = 0; + for(i=0;i<size;i++) + { + out[i] = u16bitxors(x[i],y[i]); + } + + +} + diff --git a/2.3-1/src/c/elementaryFunctions/bitxor/u16bitxora.c~ b/2.3-1/src/c/elementaryFunctions/bitxor/u16bitxora.c~ new file mode 100644 index 00000000..6f50f068 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/bitxor/u16bitxora.c~ @@ -0,0 +1,14 @@ +/* Scilab2C FOSSEE IITB */ +#include "bitxor.h" + +void u16bitxora(uint16* x,uint16* y,int size,uint16* out) +{ + int i = 0; + for(i=0;i<size;i++) + { + out[i] = u16bitxors(x[i],y[i]); + } + + +} + diff --git a/2.3-1/src/c/elementaryFunctions/bitxor/u16bitxors.c b/2.3-1/src/c/elementaryFunctions/bitxor/u16bitxors.c new file mode 100644 index 00000000..03ca8f83 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/bitxor/u16bitxors.c @@ -0,0 +1,9 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitxor.h" + +uint16 u16bitxors(uint16 x,uint16 y) +{ + return (x ^ y); + +} diff --git a/2.3-1/src/c/elementaryFunctions/bitxor/u16bitxors.c~ b/2.3-1/src/c/elementaryFunctions/bitxor/u16bitxors.c~ new file mode 100644 index 00000000..03ca8f83 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/bitxor/u16bitxors.c~ @@ -0,0 +1,9 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitxor.h" + +uint16 u16bitxors(uint16 x,uint16 y) +{ + return (x ^ y); + +} diff --git a/2.3-1/src/c/elementaryFunctions/bitxor/u8bitanda.c~ b/2.3-1/src/c/elementaryFunctions/bitxor/u8bitanda.c~ new file mode 100644 index 00000000..e1260a71 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/bitxor/u8bitanda.c~ @@ -0,0 +1,14 @@ +/* Scilab2C FOSSEE IITB */ +#include "bitand.h" + +void u8bitanda(uint8* x,uint8* y,int size,uint8* out) +{ + int i = 0; + for(i=0;i<size;i++) + { + out[i] = u8bitands(x[i],y[i]); + } + + +} + diff --git a/2.3-1/src/c/elementaryFunctions/bitxor/u8bitands.c~ b/2.3-1/src/c/elementaryFunctions/bitxor/u8bitands.c~ new file mode 100644 index 00000000..eda3ccc6 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/bitxor/u8bitands.c~ @@ -0,0 +1,9 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitand.h" + +uint8 u8bitands(uint8 x,uint8 y) +{ + return (x & y); + +} diff --git a/2.3-1/src/c/elementaryFunctions/bitxor/u8bitora.c~ b/2.3-1/src/c/elementaryFunctions/bitxor/u8bitora.c~ new file mode 100644 index 00000000..edda9bba --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/bitxor/u8bitora.c~ @@ -0,0 +1,14 @@ +/* Scilab2C FOSSEE IITB */ +#include "bitor.h" + +void u8bitora(uint8* x,uint8* y,int size,uint8* out) +{ + int i = 0; + for(i=0;i<size;i++) + { + out[i] = u8bitors(x[i],y[i]); + } + + +} + diff --git a/2.3-1/src/c/elementaryFunctions/bitxor/u8bitors.c~ b/2.3-1/src/c/elementaryFunctions/bitxor/u8bitors.c~ new file mode 100644 index 00000000..56d3540d --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/bitxor/u8bitors.c~ @@ -0,0 +1,9 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitor.h" + +uint8 u8bitors(uint8 x,uint8 y) +{ + return (x | y); + +} diff --git a/2.3-1/src/c/elementaryFunctions/bitxor/u8bitxora.c b/2.3-1/src/c/elementaryFunctions/bitxor/u8bitxora.c new file mode 100644 index 00000000..ad7cc24e --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/bitxor/u8bitxora.c @@ -0,0 +1,14 @@ +/* Scilab2C FOSSEE IITB */ +#include "bitxor.h" + +void u8bitxora(uint8* x,uint8* y,int size,uint8* out) +{ + int i = 0; + for(i=0;i<size;i++) + { + out[i] = u8bitxors(x[i],y[i]); + } + + +} + diff --git a/2.3-1/src/c/elementaryFunctions/bitxor/u8bitxora.c~ b/2.3-1/src/c/elementaryFunctions/bitxor/u8bitxora.c~ new file mode 100644 index 00000000..ad7cc24e --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/bitxor/u8bitxora.c~ @@ -0,0 +1,14 @@ +/* Scilab2C FOSSEE IITB */ +#include "bitxor.h" + +void u8bitxora(uint8* x,uint8* y,int size,uint8* out) +{ + int i = 0; + for(i=0;i<size;i++) + { + out[i] = u8bitxors(x[i],y[i]); + } + + +} + diff --git a/2.3-1/src/c/elementaryFunctions/bitxor/u8bitxors.c b/2.3-1/src/c/elementaryFunctions/bitxor/u8bitxors.c new file mode 100644 index 00000000..9a346eee --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/bitxor/u8bitxors.c @@ -0,0 +1,9 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitxor.h" + +uint8 u8bitxors(uint8 x,uint8 y) +{ + return (x ^ y); + +} diff --git a/2.3-1/src/c/elementaryFunctions/bitxor/u8bitxors.c~ b/2.3-1/src/c/elementaryFunctions/bitxor/u8bitxors.c~ new file mode 100644 index 00000000..9a346eee --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/bitxor/u8bitxors.c~ @@ -0,0 +1,9 @@ +/* Scilab2C FOSSEE IITB */ + +#include "bitxor.h" + +uint8 u8bitxors(uint8 x,uint8 y) +{ + return (x ^ y); + +} diff --git a/2.3-1/src/c/elementaryFunctions/includes/bitand.h b/2.3-1/src/c/elementaryFunctions/includes/bitand.h new file mode 100644 index 00000000..8d98d9be --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/includes/bitand.h @@ -0,0 +1,39 @@ +/* Scilab2C FOSSEE IITB */ + +#ifndef __BITAND_H__ +#define __BITAND_H__ + + + +#include "dynlib_elementaryfunctions.h" +#include "types.h" + +#ifdef __cpluscplus +extern "C" { +#endif +/* bitand returns the logical AND operation + 12 = 00001100 (In Binary) + 25 = 00011001 (In Binary) + +Bit Operation of 12 and 25 + 00001100 +& 00011001 + ________ + 00001000 = 8 (In decimal) +*/ + +EXTERN_ELEMFUNCT uint8 u8bitands(uint8 in1,uint8 in2); + +EXTERN_ELEMFUNCT void u8bitanda(uint8* in1,uint8* in2,int size,uint8* out); + +EXTERN_ELEMFUNCT uint16 u16bitands(uint16 in1,uint16 in2); + +EXTERN_ELEMFUNCT void u16bitanda(uint16* in1,uint16* in2,int size,uint16* out); + + +#ifdef __cplusplus + +} /*extern "C" */ +#endif + +#endif /* !__BITAND_H__ */ diff --git a/2.3-1/src/c/elementaryFunctions/includes/bitcmp.h b/2.3-1/src/c/elementaryFunctions/includes/bitcmp.h new file mode 100644 index 00000000..8176681e --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/includes/bitcmp.h @@ -0,0 +1,38 @@ +/* Scilab2C FOSSEE IITB */ + +#ifndef __BITCMP_H__ +#define __BITCMP_H__ + + + +#include "dynlib_elementaryfunctions.h" +#include "types.h" + +#ifdef __cpluscplus +extern "C" { +#endif +/* bitcmp returns the complement +35=00100011 (In Binary) + +Bitwise complement Operation of 35 +~ 00100011 + ________ + 11011100 = 220 (In decimal) +*/ + +EXTERN_ELEMFUNCT uint8 u8bitcmps(uint8 in1,uint8 in2); + +EXTERN_ELEMFUNCT void u8bitcmpa(uint8* in1,uint8 in2,int size,uint8* out); + +EXTERN_ELEMFUNCT uint16 u16bitcmps(uint16 in1,uint16 in2); + +EXTERN_ELEMFUNCT void u16bitcmpa(uint16* in1,uint16 in2,int size,uint16* out); + + + +#ifdef __cplusplus + +} /*extern "C" */ +#endif + +#endif /* !__BITCMP_H__ */ diff --git a/2.3-1/src/c/elementaryFunctions/includes/bitget.h b/2.3-1/src/c/elementaryFunctions/includes/bitget.h new file mode 100644 index 00000000..0eaf57eb --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/includes/bitget.h @@ -0,0 +1,25 @@ +/* Scilab2C FOSSEE IITB */ + +#ifndef __BITGET_H__ +#define __BITGET_H__ + + + +#include "dynlib_elementaryfunctions.h" +#include "types.h" + +#ifdef __cpluscplus +extern "C" { +#endif + + +EXTERN_ELEMFUNCT uint8 u8bitgets(uint8 value,int position); + +EXTERN_ELEMFUNCT uint16 u16bitgets(uint16 value,int position); + +#ifdef __cplusplus + +} /*extern "C" */ +#endif + +#endif /* !__BITGET_H__ */ diff --git a/2.3-1/src/c/elementaryFunctions/includes/bitor.h b/2.3-1/src/c/elementaryFunctions/includes/bitor.h new file mode 100644 index 00000000..16a6a3d1 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/includes/bitor.h @@ -0,0 +1,38 @@ +/* Scilab2C FOSSEE IITB */ + +#ifndef __BITOR_H__ +#define __BITOR_H__ + + + +#include "dynlib_elementaryfunctions.h" +#include "types.h" + +#ifdef __cpluscplus +extern "C" { +#endif +/* bitor returns the logical OR operation + 12 = 00001100 (In Binary) +25 = 00011001 (In Binary) + +Bitwise OR Operation of 12 and 25 + 00001100 +| 00011001 + ________ + 00011101 = 29 (In decimal) */ + +EXTERN_ELEMFUNCT uint8 u8bitors(uint8 in1,uint8 in2); + +EXTERN_ELEMFUNCT void u8bitora(uint8* in1,uint8* in2,int size,uint8* out); + +EXTERN_ELEMFUNCT uint16 u16bitors(uint16 in1,uint16 in2); + +EXTERN_ELEMFUNCT void u16bitora(uint16* in1,uint16* in2,int size,uint16* out); + + +#ifdef __cplusplus + +} /*extern "C" */ +#endif + +#endif /* !__BITOR_H__ */ diff --git a/2.3-1/src/c/elementaryFunctions/includes/bitset.h b/2.3-1/src/c/elementaryFunctions/includes/bitset.h new file mode 100644 index 00000000..862a4c80 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/includes/bitset.h @@ -0,0 +1,25 @@ +/* Scilab2C FOSSEE IITB */ + +#ifndef __BITSET_H__ +#define __BITSET_H__ + + + +#include "dynlib_elementaryfunctions.h" +#include "types.h" + +#ifdef __cpluscplus +extern "C" { +#endif + + +EXTERN_ELEMFUNCT uint8 u8bitsets(uint8 value,int position,int bit_value); + +EXTERN_ELEMFUNCT uint16 u16bitsets(uint16 value,int position,int bit_value); + +#ifdef __cplusplus + +} /*extern "C" */ +#endif + +#endif /* !__BITSET_H__ */ diff --git a/2.3-1/src/c/elementaryFunctions/includes/bitxor.h b/2.3-1/src/c/elementaryFunctions/includes/bitxor.h new file mode 100644 index 00000000..4e276353 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/includes/bitxor.h @@ -0,0 +1,38 @@ +/* Scilab2C FOSSEE IITB */ + +#ifndef __BITXOR_H__ +#define __BITXOR_H__ + + + +#include "dynlib_elementaryfunctions.h" +#include "types.h" + +#ifdef __cpluscplus +extern "C" { +#endif +/* bitxor returns the logical OR operation + 12 = 00001100 (In Binary) +25 = 00011001 (In Binary) + +Bitwise XOR Operation of 12 and 25 + 00001100 +^ 00011001 + ________ + 00010101 = 21 (In decimal) */ + +EXTERN_ELEMFUNCT uint8 u8bitxors(uint8 in1,uint8 in2); + +EXTERN_ELEMFUNCT void u8bitxora(uint8* in1,uint8* in2,int size,uint8* out); + +EXTERN_ELEMFUNCT uint16 u16bitxors(uint16 in1,uint16 in2); + +EXTERN_ELEMFUNCT void u16bitxora(uint16* in1,uint16* in2,int size,uint16* out); + + +#ifdef __cplusplus + +} /*extern "C" */ +#endif + +#endif /* !__BITXOR_H__ */ diff --git a/2.3-1/src/c/elementaryFunctions/interfaces/int_bitand.h b/2.3-1/src/c/elementaryFunctions/interfaces/int_bitand.h new file mode 100644 index 00000000..26031ad3 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/interfaces/int_bitand.h @@ -0,0 +1,16 @@ +/* Scilab2C FOSSEE IITB */ + +#ifndef __INT_BITAND_H__ +#define __INT_BITAND_H__ + + +#define u80u80bitandu80(in1,in2) u8bitands(in1,in2) + +#define u82u82bitandu82(in1,size1,in2,size2,out) u8bitanda(in1,in2,size1[0]*size1[1],out) + +#define u160u160bitandu160(in1,in2) u16bitands(in1,in2) + +#define u162u162bitandu162(in1,size1,in2,size2,out) u16bitanda(in1,in2,size1[0]*size1[1],out) + + +#endif diff --git a/2.3-1/src/c/elementaryFunctions/interfaces/int_bitcmp.h b/2.3-1/src/c/elementaryFunctions/interfaces/int_bitcmp.h new file mode 100644 index 00000000..d72eb2e7 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/interfaces/int_bitcmp.h @@ -0,0 +1,16 @@ +/* Scilab2C FOSSEE IITB */ + +#ifndef __INT_BITCMP_H__ +#define __INT_BITCMP_H__ + + +#define u80d0bitcmpu80(in1,in2) u8bitcmps(in1,in2) + +#define u82d0bitcmpu82(in1,size1,in2,out) u8bitcmpa(in1,in2,size1[0]*size1[1],out) + +#define u160d0bitcmpu160(in1,in2) u16bitcmps(in1,in2) + +#define u162d0bitcmpu162(in1,size1,in2,out) u16bitcmpa(in1,in2,size1[0]*size1[1],out) + + +#endif diff --git a/2.3-1/src/c/elementaryFunctions/interfaces/int_bitget.h b/2.3-1/src/c/elementaryFunctions/interfaces/int_bitget.h new file mode 100644 index 00000000..7b6b8e9e --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/interfaces/int_bitget.h @@ -0,0 +1,10 @@ +/* Scilab2C FOSSEE IITB */ + +#ifndef __INT_BITGET_H__ +#define __INT_BITGET_H__ + +#define u80d0bitgetu80(in1,in2) u8bitgets(in1,in2) + +#define u160d0bitgetu160(in1,in2) u16bitgets(in1,in2) + +#endif diff --git a/2.3-1/src/c/elementaryFunctions/interfaces/int_bitor.h b/2.3-1/src/c/elementaryFunctions/interfaces/int_bitor.h new file mode 100644 index 00000000..6a65c9f3 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/interfaces/int_bitor.h @@ -0,0 +1,16 @@ +/* Scilab2C FOSSEE IITB */ + +#ifndef __INT_BITOR_H__ +#define __INT_BITOR_H__ + + +#define u80u80bitoru80(in1,in2) u8bitors(in1,in2) + +#define u82u82bitoru82(in1,size1,in2,size2,out) u8bitora(in1,in2,size1[0]*size1[1],out) + +#define u160u160bitoru160(in1,in2) u16bitors(in1,in2) + +#define u162u162bitoru162(in1,size1,in2,size2,out) u16bitora(in1,in2,size1[0]*size1[1],out) + + +#endif diff --git a/2.3-1/src/c/elementaryFunctions/interfaces/int_bitset.h b/2.3-1/src/c/elementaryFunctions/interfaces/int_bitset.h new file mode 100644 index 00000000..e8643252 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/interfaces/int_bitset.h @@ -0,0 +1,13 @@ +/* Scilab2C FOSSEE IITB */ + +#ifndef __INT_BITSET_H__ +#define __INT_BITSET_H__ + +#define u80d0d0bitsetu80(in1,in2,in3) u8bitsets(in1,in2,in3) + +#define u160d0d0bitsetu160(in1,in2,in3) u16bitsets(in1,in2,in3) + + + + +#endif diff --git a/2.3-1/src/c/elementaryFunctions/interfaces/int_bitxor.h b/2.3-1/src/c/elementaryFunctions/interfaces/int_bitxor.h new file mode 100644 index 00000000..30aea6cf --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/interfaces/int_bitxor.h @@ -0,0 +1,16 @@ +/* Scilab2C FOSSEE IITB */ + +#ifndef __INT_BITXOR_H__ +#define __INT_BITXOR_H__ + + +#define u80u80bitxoru80(in1,in2) u8bitxors(in1,in2) + +#define u82u82bitxoru82(in1,size1,in2,size2,out) u8bitxora(in1,in2,size1[0]*size1[1],out) + +#define u160u160bitxoru160(in1,in2) u16bitxors(in1,in2) + +#define u162u162bitxoru162(in1,size1,in2,size2,out) u16bitxora(in1,in2,size1[0]*size1[1],out) + + +#endif |