#include <inttypes.h>#include <stdio.h>


Go to the source code of this file.
Data Types | |
| type | _BV64_T |
| type | _BV128_T |
| type | _BV_T |
Defines | |
| #define | i2bv32(i) ( 1 << (i) ) |
| #define | ZERO_bv32(bv) ((bv) = 0) |
| #define | ONE_bv32(bv) ((bv)=0xFFFFFFFF) |
| #define | bv32ZEROS() ( 0 ) |
| #define | bv32ONES(len) ( ((len) == 0) ? 0 : ( ( (len) < 32 ) ? ( 1 << (len) ) - 1 : 0xFFFFFFFF ) ) |
| #define | bv32ONES_MASK(len, pos) ( bv32ONES(len) << ( pos ) ) |
| #define | bv32SHL(bv32Src, len) ( ((len)>=32) ? 0 : ( (bv32Src) << (len) ) ) |
| #define | bv32SHRL(bv32Src, len) ( ( (len)>=32) ? 0 : ( ( (uint32_t) (bv32Src) ) >> (len) ) ) |
| #define | bv32EXTRACTU(bv32Src, len, pos) ( bv32SHRL( (bv32Src), (pos) ) & bv32ONES(len) ) |
| #define | isbv32ZERO(bv) ( (bv) == 0 ) |
| #define | isbv32BITSET(bv, pos) ( ( (bv) & ( 1 << ((pos)) ) ) ) |
| #define | bv32AND(bv1, bv2) ( (bv1) & (bv2) ) |
| #define | bv32OR(bv1, bv2) ( (bv1) | (bv2) ) |
| #define | bv32XOR(bv1, bv2) ( (bv1) ^ (bv2) ) |
| #define | bv32NOT(bvRes, bv) { (bvRes) = ~(bv); } |
| #define | UNSETBIT_bv32(bv, pos) |
| #define | SETBIT_bv32(bv, pos) |
| #define | COPY_bv32(bvTar, bvSrc) |
| #define | isbv64ZERO(bv) ( (bv.i1) == 0 && (bv.i2) == 0 ) |
| #define | isbv64BITSET(bv, pos) |
| #define | ZERO_bv64(bv) { (bv.i1) = 0; (bv.i2) = 0; } |
| #define | SETBIT_bv64(bv, pos) |
| #define | COPY_bv64(bvTar, bvSrc) |
| #define | ONES_bv64(bv64Tar, len) |
| #define | OR_SELF_bv64(bvRes, bv1) |
| #define | AND_SELF_bv64(bvRes, bv1) |
| #define | OR_2_bv64(bvRes, bv1, bv2) |
| #define | AND_2_bv64(bvRes, bv1, bv2) |
| #define | OR_3SELF_bv64(bvRes, bv1, bv2, bv3) |
| #define | AND_3SELF_bv64(bvRes, bv1, bv2, bv3) |
| #define | NOT_bv64(bvRes, bv) |
| #define | SHL_bv64(bv64Tar, bv64Src, len) |
| #define | SHRL_bv64(bv64Tar, bv64Src, len) |
| #define | EXTRACTU_bv64(bv64Tar, bv64Src, len, pos) |
| #define | OR_SELF_bv128(bvRes, bv1) |
| #define | AND_SELF_bv128(bvRes, bv1) |
| #define | OR_2_bv128(bvRes, bv1, bv2) |
| #define | AND_2_bv128(bvRes, bv1, bv2) |
| #define | OR_3SELF_bv128(bvRes, bv1, bv2, bv3) |
| #define | AND_3SELF_bv128(bvRes, bv1, bv2, bv3) |
| #define | NOT_bv128(bvRes, bv) |
| #define | ZERO_bv128(bv) |
| #define | ONE_bv128(bv) |
| #define | isbv128ZERO(bv) |
| #define | isbv128BITSET(bv, pos) |
| #define | SETBIT_bv128(bv, pos) |
| #define | COPY_bv128(bvTar, bvSrc) |
| #define | BYTE_LENGTHbv(pbv) ( 4 * (pbv)->n32Chunks ) |
| #define | BIT_LENGTHbv(pbv) ( 32 * (pbv)->n32Chunks ) |
| #define | isbvBITSET(pbv, pos) ( (pbv)->n32Chunks == 0 ? 0 : ((pbv)->pint32Data[ (pos) >> 5 ] & ( 1 << ((pos) & 0x1F )) ) ) |
| #define | SETBIT_bv(pbv, pos) { (pbv)->pint32Data[ (pos) >> 5 ] |= ( 1 << ((pos) & 0x1F) ); } |
| #define | UNSETBIT_bv(pbv, pos) { (pbv)->pint32Data[ (pos) >> 5 ] &= ~( 1 << ((pos) & 0x1F) ); } |
| #define | ONE_bv(pbv) |
| #define | ZERO_bv(pbv) |
| #define | u32ALLOCATED(length) ( ( ((length-1) / 32) + 1 )) |
Typedefs | |
| typedef uint32_t | bv32_t |
| typedef struct _BV64_T | bv64_t |
| typedef struct _BV128_T | bv128_t |
| typedef struct _BV_T | bv_t |
Functions/Subroutines | |
| char * | bv322pch (bv32_t bv32, char *pch) |
| char * | bv642pch (bv64_t bv64, char *pch) |
| char * | bv1282pch (bv128_t bv128, char *pch) |
| bv_t * | pbvMake (int iLength, int fOn) |
| bv_t * | pbvDup (bv_t *pbv) |
| void | bvInit (bv_t *pbv, int iLength, int fOn) |
| void | bvResize (bv_t *pbv, int iNewLength, int fOn) |
| int | fEqual_bv (bv_t *pbv1, bv_t *pbv2) |
| bv_t * | pbvOr (bv_t *pbvTarget, bv_t *pbvSrc1, bv_t *pbvSrc2) |
| bv_t * | pbvAnd (bv_t *pbvTarget, bv_t *pbvSrc1, bv_t *pbvSrc2) |
| bv_t * | pbvXor (bv_t *pbvTarget, bv_t *pbvSrc1, bv_t *pbvSrc2) |
| void | Printbv (FILE *fp, bv_t *pbv) |
| void | Free_pbv (bv_t *pbv) |
| #define AND_2_bv128 | ( | bvRes, | |||
| bv1, | |||||
| bv2 | ) |
| #define AND_2_bv64 | ( | bvRes, | |||
| bv1, | |||||
| bv2 | ) |
| #define AND_3SELF_bv128 | ( | bvRes, | |||
| bv1, | |||||
| bv2, | |||||
| bv3 | ) |
| #define AND_3SELF_bv64 | ( | bvRes, | |||
| bv1, | |||||
| bv2, | |||||
| bv3 | ) |
| #define AND_SELF_bv128 | ( | bvRes, | |||
| bv1 | ) |
| #define AND_SELF_bv64 | ( | bvRes, | |||
| bv1 | ) |
| #define bv32AND | ( | bv1, | |||
| bv2 | ) | ( (bv1) & (bv2) ) |
Definition at line 85 of file kapi_bv.h.
Referenced by kmapi_AllocateForItanium(), and KMAPI_SetResourceMap().
| #define bv32NOT | ( | bvRes, | |||
| bv | ) | { (bvRes) = ~(bv); } |
| #define bv32OR | ( | bv1, | |||
| bv2 | ) | ( (bv1) | (bv2) ) |
| #define BYTE_LENGTHbv | ( | pbv | ) | ( 4 * (pbv)->n32Chunks ) |
Definition at line 323 of file kapi_bv.h.
Referenced by KAPI3X_update_cluster0Cutports(), and pbvDup().
| #define COPY_bv128 | ( | bvTar, | |||
| bvSrc | ) |
Value:
{ bvTar.i1 = bvSrc.i1; \
bvTar.i2 = bvSrc.i2; \
bvTar.i3 = bvSrc.i3; \
bvTar.i4 = bvSrc.i4; }
Definition at line 305 of file kapi_bv.h.
Referenced by kmapi_AllocateException().
| #define COPY_bv32 | ( | bvTar, | |||
| bvSrc | ) |
Value:
{ \
(bvTar) = (bvSrc); }
Definition at line 104 of file kapi_bv.h.
Referenced by fulist_AddNewNode(), and kmapi_AllocateForItanium().
| #define COPY_bv64 | ( | bvTar, | |||
| bvSrc | ) |
| #define EXTRACTU_bv64 | ( | bv64Tar, | |||
| bv64Src, | |||||
| len, | |||||
| pos | ) |
| #define isbv128BITSET | ( | bv, | |||
| pos | ) |
Value:
( ( (pos) < 32 ) ? ( \ ( bv.i1 & ( 1 << ((pos)) ) ) ) : ( \ ( (pos) < 64 ) ? ( \ ( bv.i2 & ( 1 << ((pos)-32) ) ) ) : ( \ ( (pos) < 96 ) ? ( \ ( bv.i3 & ( 1 << ((pos)-64) ) ) ) : \ ( bv.i4 & ( 1 << ((pos)-96) ) ) ) ) )
Definition at line 285 of file kapi_bv.h.
Referenced by kmapi_AllocateException(), and KMAPI_ImplicitBreakType().
| #define isbv128ZERO | ( | bv | ) |
| #define isbv32BITSET | ( | bv, | |||
| pos | ) | ( ( (bv) & ( 1 << ((pos)) ) ) ) |
Definition at line 81 of file kapi_bv.h.
Referenced by KAPI_fuGetLatencyType(), KMAPI_AllocationOptions4fu(), KMAPI_GetFirstAllocatedMapResource(), KMAPI_GetNextAllocatedMapResource(), kmapi_getunset_resource(), and KMAPI_ResourceStatus().
| #define isbv32ZERO | ( | bv | ) | ( (bv) == 0 ) |
Definition at line 78 of file kapi_bv.h.
Referenced by kmapi_AllocateForItanium(), and KMAPI_IsResourceMapClear().
| #define isbv64BITSET | ( | bv, | |||
| pos | ) |
| #define isbvBITSET | ( | pbv, | |||
| pos | ) | ( (pbv)->n32Chunks == 0 ? 0 : ((pbv)->pint32Data[ (pos) >> 5 ] & ( 1 << ((pos) & 0x1F )) ) ) |
Definition at line 329 of file kapi_bv.h.
Referenced by EKAPI_EunMask4op(), EKAPI_OppMask4op(), KAPI_cportCount4fu(), KAPI_cportMask4fu(), KDebug_DumpFUTable(), KMAPI_AllocationOptions4fu(), and Printbv().
| #define NOT_bv128 | ( | bvRes, | |||
| bv | ) |
| #define NOT_bv64 | ( | bvRes, | |||
| bv | ) |
| #define ONE_bv | ( | pbv | ) |
Value:
{ \
memset( (pbv)->pint32Data, 0xFFFFFFFF, BYTE_LENGTHbv(pbv) ); \
}
| #define ONE_bv128 | ( | bv | ) |
Value:
{ (bv.i1) = 0xFFFFFFFF; (bv.i2) = 0xFFFFFFFF; \
(bv.i3) = 0xFFFFFFFF; (bv.i4) = 0xFFFFFFFF; }
Definition at line 276 of file kapi_bv.h.
Referenced by kmapi_parse_exception().
| #define ONE_bv32 | ( | bv | ) | ((bv)=0xFFFFFFFF) |
| #define ONES_bv64 | ( | bv64Tar, | |||
| len | ) |
| #define OR_2_bv128 | ( | bvRes, | |||
| bv1, | |||||
| bv2 | ) |
| #define OR_2_bv64 | ( | bvRes, | |||
| bv1, | |||||
| bv2 | ) |
| #define OR_3SELF_bv128 | ( | bvRes, | |||
| bv1, | |||||
| bv2, | |||||
| bv3 | ) |
| #define OR_3SELF_bv64 | ( | bvRes, | |||
| bv1, | |||||
| bv2, | |||||
| bv3 | ) |
| #define OR_SELF_bv128 | ( | bvRes, | |||
| bv1 | ) |
| #define OR_SELF_bv64 | ( | bvRes, | |||
| bv1 | ) |
| #define SETBIT_bv | ( | pbv, | |||
| pos | ) | { (pbv)->pint32Data[ (pos) >> 5 ] |= ( 1 << ((pos) & 0x1F) ); } |
| #define SETBIT_bv128 | ( | bv, | |||
| pos | ) |
Value:
{ if ( (pos) < 32 ) { \
bv.i1 |= ( 1 << (pos) ); \
} else if ( (pos) < 64 ) { \
bv.i2 |= ( 1 << ((pos)-32) ); \
} else if ( (pos) < 96 ) { \
bv.i3 |= ( 1 << ((pos)-64) ); \
} else { \
bv.i4 |= ( 1 << ((pos)-96) ); \
} }
Definition at line 294 of file kapi_bv.h.
Referenced by kmapi_parse_exception(), and kmapi_parse_split().
| #define SETBIT_bv32 | ( | bv, | |||
| pos | ) |
Value:
{ \
(bv) |= ( 1 << (pos) ); }
Definition at line 101 of file kapi_bv.h.
Referenced by kmapi_AllocateForItanium(), KMAPI_AllocationOptions4fu(), and KMAPI_SetResource().
| #define SETBIT_bv64 | ( | bv, | |||
| pos | ) |
| #define SHL_bv64 | ( | bv64Tar, | |||
| bv64Src, | |||||
| len | ) |
Value:
{ \
\
bv64Tar.i1 = bv32SHL( bv64Src.i1, (len) ); \
bv64Tar.i2 = bv32SHL( bv64Src.i2, (len) ); \
\
/* compute high order len bits of i1 */ \
if ( (len) > 32 ) { \
bv64Tar.i2 |= bv32SHL( bv64Src.i1, (len)-32 ); \
} else { \
bv64Tar.i2 |= bv32EXTRACTU( bv64Src.i1, (len), 32-(len) ); \
} \
}
Definition at line 184 of file kapi_bv.h.
Referenced by Test_bv64Rtns().
| #define SHRL_bv64 | ( | bv64Tar, | |||
| bv64Src, | |||||
| len | ) |
Value:
{ \
bv64Tar.i1 = bv32SHRL( bv64Src.i1, (len) ); \
bv64Tar.i2 = bv32SHRL( bv64Src.i2, (len) ); \
\
/* extract low order bits of i2 */ \
if ( (len) > 32 ) { \
bv64Tar.i1 |= bv32SHRL( bv64Src.i2, (len)-32 ); \
} else { \
bv64Tar.i1 |= bv32SHL( bv32EXTRACTU( bv64Src.i2, (len), 0 ), 32-(len) ); \
} \
}
Definition at line 199 of file kapi_bv.h.
Referenced by Test_bv64Rtns().
| #define UNSETBIT_bv | ( | pbv, | |||
| pos | ) | { (pbv)->pint32Data[ (pos) >> 5 ] &= ~( 1 << ((pos) & 0x1F) ); } |
| #define UNSETBIT_bv32 | ( | bv, | |||
| pos | ) |
Value:
{ \
(bv) &= ~( 1 << (pos) ); }
Definition at line 98 of file kapi_bv.h.
Referenced by KMAPI_AllocationOptions4fu(), kmapi_getunset_resource(), and KMAPI_SetResource().
| #define ZERO_bv | ( | pbv | ) |
Value:
{ \
memset( (pbv)->pint32Data, 0, BYTE_LENGTHbv(pbv) ); \
}
Definition at line 343 of file kapi_bv.h.
Referenced by KAPI3X_update_cluster0Cutports().
| #define ZERO_bv128 | ( | bv | ) |
Value:
{ (bv.i1) = 0; (bv.i2) = 0; \
(bv.i3) = 0; (bv.i4) = 0; }
Definition at line 272 of file kapi_bv.h.
Referenced by bundle_fus_AddNode(), and kmapi_MakeException().
| #define ZERO_bv32 | ( | bv | ) | ((bv) = 0) |
Definition at line 54 of file kapi_bv.h.
Referenced by kmapi_AllocateForItanium(), and KMAPI_SetAllResources().
| char* bv322pch | ( | bv32_t | bv32, | |
| char * | pch | |||
| ) |
| char* bv642pch | ( | bv64_t | bv64, | |
| char * | pch | |||
| ) |
Definition at line 307 of file kapi_bv.c.
References b, i, _BV64_T::i1, _BV64_T::i2, and pos().
Referenced by Test_bv64Rtns().
Definition at line 131 of file kapi_bv.c.
References assert, i, len, malloc, _BV_T::n32Chunks, _BV_T::pint32Data, and u32ALLOCATED.
Definition at line 35 of file kapi_bv.c.
References i, _BV_T::n32Chunks, _BV_T::pint32Data, realloc, u32ALLOCATED, and val.
Referenced by KAPI3X_update_cluster0Cutports().
Definition at line 87 of file kapi_bv.c.
References i, _BV_T::n32Chunks, and _BV_T::pint32Data.
Referenced by fEqual_val().
Definition at line 226 of file kapi_bv.c.
References i, len, _BV_T::n32Chunks, and _BV_T::pint32Data.
Definition at line 112 of file kapi_bv.c.
References assert, BYTE_LENGTHbv, i, len, malloc, memcpy, _BV_T::n32Chunks, and _BV_T::pint32Data.
| bv_t* pbvMake | ( | int | iLength, | |
| int | fOn | |||
| ) |
Definition at line 172 of file kapi_bv.c.
References assert, i, len, malloc, _BV_T::n32Chunks, _BV_T::pint32Data, and u32ALLOCATED.
Referenced by KDumpBin_LoadBitVector(), and pbvBuild4valhdr().
Definition at line 204 of file kapi_bv.c.
References i, len, _BV_T::n32Chunks, and _BV_T::pint32Data.
Definition at line 247 of file kapi_bv.c.
References i, len, _BV_T::n32Chunks, and _BV_T::pint32Data.
Definition at line 269 of file kapi_bv.c.
References b, fprintf(), free(), i, isbvBITSET, malloc, and _BV_T::n32Chunks.
1.5.6