From 0296cf3166e7250191f0e08907b65dad9e665e46 Mon Sep 17 00:00:00 2001 From: imushir Date: Fri, 22 Jan 2016 16:01:46 +0530 Subject: added support of uint8,uint16 for bitwise operators --- 2.3-1/src/c/elementaryFunctions/includes/bitand.h | 39 +++++++++++++++++++++++ 2.3-1/src/c/elementaryFunctions/includes/bitcmp.h | 38 ++++++++++++++++++++++ 2.3-1/src/c/elementaryFunctions/includes/bitget.h | 25 +++++++++++++++ 2.3-1/src/c/elementaryFunctions/includes/bitor.h | 38 ++++++++++++++++++++++ 2.3-1/src/c/elementaryFunctions/includes/bitset.h | 25 +++++++++++++++ 2.3-1/src/c/elementaryFunctions/includes/bitxor.h | 38 ++++++++++++++++++++++ 6 files changed, 203 insertions(+) create mode 100644 2.3-1/src/c/elementaryFunctions/includes/bitand.h create mode 100644 2.3-1/src/c/elementaryFunctions/includes/bitcmp.h create mode 100644 2.3-1/src/c/elementaryFunctions/includes/bitget.h create mode 100644 2.3-1/src/c/elementaryFunctions/includes/bitor.h create mode 100644 2.3-1/src/c/elementaryFunctions/includes/bitset.h create mode 100644 2.3-1/src/c/elementaryFunctions/includes/bitxor.h (limited to '2.3-1/src/c/elementaryFunctions/includes') 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__ */ -- cgit