Open64 (mfef90, whirl2f, and IR tools)  TAG: version-openad; SVN changeset: 916
bitset.c File Reference
#include "defs.h"
#include "mempool.h"
#include "errors.h"
#include "bitset.h"
Include dependency graph for bitset.c:

Go to the source code of this file.

Functions

static BSbs_Malloc (size_t length, MEM_POOL *pool)
static BSbs_Realloc (BS *set, size_t length, MEM_POOL *pool)
BSBS_Create (BS_ELT size, MEM_POOL *pool)
size_t BS_Size_Alloc_Size (BS_ELT size)
size_t BS_Alloc_Size (BS *set)
BSBS_ClearD (BS *set)
BSBS_Create_Empty (BS_ELT size, MEM_POOL *pool)
BSBS_ResizeD (BS *set, BS_ELT new_size, MEM_POOL *pool)
BSBS_RangeD (BS *set, BS_ELT low, BS_ELT high, MEM_POOL *pool)
BSBS_Singleton (BS_ELT element, MEM_POOL *pool)
BSBS_SingletonD (BS *set, BS_ELT element, MEM_POOL *pool)
BSBS_Universe (BS_ELT size, MEM_POOL *pool)
BSBS_UniverseD (BS *set, BS_ELT size, MEM_POOL *pool)
BSBS_Copy (BS *set, MEM_POOL *pool)
BSBS_CopyD (BS *set1, BS *set2, MEM_POOL *pool)
BS_ELT BS_Choose (const BS *set)
BS_ELT BS_Choose_Range (BS *set, BS_ELT low, BS_ELT high)
BS_ELT BS_Choose_Next (const BS *set, BS_ELT bound)
BS_ELT BS_Intersection_Choose (BS *set1, BS *set2)
BS_ELT BS_Intersection_Choose_Next (BS *set1, BS *set2, BS_ELT bound)
BSBS_Difference (BS *set1, BS *set2, MEM_POOL *pool)
BSBS_DifferenceD (BS *set1, BS *set2)
BSBS_Difference1 (BS *set, BS_ELT x, MEM_POOL *pool)
BSBS_Difference1D (BS *set, BS_ELT x)
BSBS_Intersection (BS *set1, BS *set2, MEM_POOL *pool)
BSBS_IntersectionD (BS *set1, BS *set2)
BSBS_IntersectionR (BS *result, const BS *set1, const BS *set2)
BS_ELT BS_Size (BS *set)
BSBS_Union (BS *set1, BS *set2, MEM_POOL *pool)
BSBS_UnionD (BS *set1, BS *set2, MEM_POOL *pool)
BSBS_UnionR (BS *result, BS *set1, BS *set2, MEM_POOL *pool)
BSBS_UnionD_Intersection (BS *set1, BS *set2, BS *set3, MEM_POOL *pool)
BSBS_Union1 (BS *set, BS_ELT x, MEM_POOL *pool)
BSBS_Union1D (BS *set, BS_ELT x, MEM_POOL *pool)
BSBS_2_1_Minus_3_Or_R (BS *result, const BS *set1, const BS *set2, const BS *set3, MEM_POOL *pool)
BSBS_3_2_Minus_1_Or_D (BS *set1, const BS *set2, const BS *set3, MEM_POOL *pool)
BSBS_3_2_Minus_4_Or_1_Or_D (BS *set1, const BS *set2, const BS *set3, const BS *set4, MEM_POOL *pool)
BSBS_3_2_Minus_4_Or_5_Or_1_Or_D (BS *set1, const BS *set2, const BS *set3, const BS *set4, const BS *set5, MEM_POOL *pool)
BSBS_2_1_Minus_3_Or_4_And_5_And_6_And_R (BS *result, const BS *set1, const BS *set2, const BS *set3, const BS *set4, const BS *set5, const BS *set6, MEM_POOL *pool)
BSBS_2_1_Minus_3_Or_4_And_R (BS *result, const BS *set1, const BS *set2, const BS *set3, const BS *set4, MEM_POOL *pool)
BSBS_1_Not_2_Or_3_Minus_4_And_R (BS *result, const BS *set1, const BS *set2, const BS *set3, const BS *set4, MEM_POOL *pool)
BSBS_2_3_Or_1_Or_D (BS *set1, const BS *set2, const BS *set3, MEM_POOL *pool)
BSBS_1_2_Or_3_And_R (BS *result, const BS *set1, const BS *set2, const BS *set3, MEM_POOL *pool)
BSBS_2_3_And_1_Or_D (BS *set1, const BS *set2, const BS *set3, MEM_POOL *pool)
BSBS_3_Not_4_Or_2_And_1_Or_D (BS *set1, const BS *set2, const BS *set3, const BS *set4, MEM_POOL *pool)
BSBS_4_3_Minus_2_Not_Or_1_And_D (BS *set1, const BS *set2, const BS *set3, const BS *set4, MEM_POOL *pool)
BSBS_2_3_Minus_1_Or_D (BS *set1, const BS *set2, const BS *set3, MEM_POOL *pool)
BSBS_2_3_Minus_4_Minus_1_Or_D (BS *set1, const BS *set2, const BS *set3, const BS *set4, MEM_POOL *pool)
BOOL BS_ContainsP (BS *set1, BS *set2)
BOOL BS_EmptyP (BS *set)
BOOL BS_EqualP (BS *set1, BS *set2)
BOOL BS_IntersectsP (BS *set1, BS *set2)
BOOL BS_MemberP (BS *set, BS_ELT x)
BOOL BS_Intersection_MemberP (BS *set1, BS *set2, BS_ELT x)
static void PrintRange (FILE *f, BS_ELT low, BS_ELT high, BOOL *first)
void BS_Print (BS *set, FILE *f)
void BS_Print_dbg (BS *set)
BOOL FBS_MemberP_Validate (BS *set, BS_ELT x)
void FBS_Union1D_Validate (BS *set, BS_ELT x)

Variables

static MEM_POOL bad_pool_struct
static MEM_POOLbad_pool = &bad_pool_struct
static const mUINT8 first_one [256]
static unsigned const char bit_count [256]

Function Documentation

BS* BS_1_2_Or_3_And_R ( BS result,
const BS set1,
const BS set2,
const BS set3,
MEM_POOL pool 
)

Definition at line 2138 of file bitset.c.

References bs_Realloc(), BS_word, BS_word_count, Is_True, and result.

Here is the call graph for this function:

BS* BS_1_Not_2_Or_3_Minus_4_And_R ( BS result,
const BS set1,
const BS set2,
const BS set3,
const BS set4,
MEM_POOL pool 
)

Definition at line 2060 of file bitset.c.

References bs_Realloc(), BS_word, BS_word_count, Is_True, and result.

Here is the call graph for this function:

BS* BS_2_1_Minus_3_Or_4_And_5_And_6_And_R ( BS result,
const BS set1,
const BS set2,
const BS set3,
const BS set4,
const BS set5,
const BS set6,
MEM_POOL pool 
)

Definition at line 1962 of file bitset.c.

References bs_Realloc(), BS_word, BS_word_count, Is_True, and result.

Here is the call graph for this function:

BS* BS_2_1_Minus_3_Or_4_And_R ( BS result,
const BS set1,
const BS set2,
const BS set3,
const BS set4,
MEM_POOL pool 
)

Definition at line 2016 of file bitset.c.

References bs_Realloc(), BS_word, BS_word_count, Is_True, and result.

Here is the call graph for this function:

BS* BS_2_1_Minus_3_Or_R ( BS result,
const BS set1,
const BS set2,
const BS set3,
MEM_POOL pool 
)

Definition at line 1814 of file bitset.c.

References bs_Realloc(), BS_word, BS_word_count, Is_True, and result.

Here is the call graph for this function:

BS* BS_2_3_And_1_Or_D ( BS set1,
const BS set2,
const BS set3,
MEM_POOL pool 
)

Definition at line 2177 of file bitset.c.

References bs_Realloc(), BS_word, BS_word_count, MIN, and size.

Here is the call graph for this function:

BS* BS_2_3_Minus_1_Or_D ( BS set1,
const BS set2,
const BS set3,
MEM_POOL pool 
)

Definition at line 2285 of file bitset.c.

References bs_Realloc(), BS_word, BS_word_count, and Is_True.

Here is the call graph for this function:

BS* BS_2_3_Minus_4_Minus_1_Or_D ( BS set1,
const BS set2,
const BS set3,
const BS set4,
MEM_POOL pool 
)

Definition at line 2320 of file bitset.c.

References bs_Realloc(), BS_word, BS_word_count, and Is_True.

Here is the call graph for this function:

BS* BS_2_3_Or_1_Or_D ( BS set1,
const BS set2,
const BS set3,
MEM_POOL pool 
)

Definition at line 2104 of file bitset.c.

References bs_Realloc(), BS_word, BS_word_count, and Is_True.

Here is the call graph for this function:

BS* BS_3_2_Minus_1_Or_D ( BS set1,
const BS set2,
const BS set3,
MEM_POOL pool 
)

Definition at line 1844 of file bitset.c.

References bs_Realloc(), BS_word, BS_word_count, and Is_True.

Here is the call graph for this function:

BS* BS_3_2_Minus_4_Or_1_Or_D ( BS set1,
const BS set2,
const BS set3,
const BS set4,
MEM_POOL pool 
)

Definition at line 1880 of file bitset.c.

References bs_Realloc(), BS_word, BS_word_count, and Is_True.

Here is the call graph for this function:

BS* BS_3_2_Minus_4_Or_5_Or_1_Or_D ( BS set1,
const BS set2,
const BS set3,
const BS set4,
const BS set5,
MEM_POOL pool 
)

Definition at line 1919 of file bitset.c.

References bs_Realloc(), BS_word, BS_word_count, and Is_True.

Here is the call graph for this function:

BS* BS_3_Not_4_Or_2_And_1_Or_D ( BS set1,
const BS set2,
const BS set3,
const BS set4,
MEM_POOL pool 
)

Definition at line 2207 of file bitset.c.

References bs_Realloc(), BS_word, BS_word_count, and Is_True.

Here is the call graph for this function:

BS* BS_4_3_Minus_2_Not_Or_1_And_D ( BS set1,
const BS set2,
const BS set3,
const BS set4,
MEM_POOL pool 
)

Definition at line 2246 of file bitset.c.

References bs_Realloc(), BS_word, BS_word_count, and Is_True.

Here is the call graph for this function:

size_t BS_Alloc_Size ( BS set)

Definition at line 188 of file bitset.c.

References BS_word_count.

BS* BS_ClearD ( BS set)

Definition at line 205 of file bitset.c.

References BS_word, BS_word_count, and bs_ZEROS.

Referenced by BS_Create_Empty(), BS_RangeD(), and BS_SingletonD().

BOOL BS_ContainsP ( BS set1,
BS set2 
)

Definition at line 2358 of file bitset.c.

References BS_word, BS_word_count, bs_ZEROS, FALSE, and TRUE.

BS* BS_Copy ( BS set,
MEM_POOL pool 
)

Definition at line 462 of file bitset.c.

References bs_Malloc(), BS_word, BS_word_count, and size.

Referenced by BS_Difference1().

Here is the call graph for this function:

BS* BS_CopyD ( BS set1,
BS set2,
MEM_POOL pool 
)

Definition at line 490 of file bitset.c.

References bs_Realloc(), BS_word, BS_word_count, and bs_ZEROS.

Referenced by BS_Union1().

Here is the call graph for this function:

BS* BS_Create ( BS_ELT  size,
MEM_POOL pool 
)

Definition at line 151 of file bitset.c.

References BITS_PER_BS_WORD, bs_Malloc(), bs_QBPW, and Is_True.

Referenced by BS_Create_Empty(), BS_Singleton(), and BS_Universe().

Here is the call graph for this function:

BS* BS_Create_Empty ( BS_ELT  size,
MEM_POOL pool 
)

Definition at line 227 of file bitset.c.

References BS_ClearD(), BS_Create(), and MEM_POOL_Zeroed.

Referenced by BS_Union1(), and TI_RES_RES_Alloc().

Here is the call graph for this function:

BS* BS_Difference ( BS set1,
BS set2,
MEM_POOL pool 
)

Definition at line 1129 of file bitset.c.

References bs_Malloc(), BS_word, BS_word_count, and Min().

Here is the call graph for this function:

BS* BS_Difference1 ( BS set,
BS_ELT  x,
MEM_POOL pool 
)

Definition at line 1190 of file bitset.c.

References BS_Copy(), and BS_Difference1D().

Here is the call graph for this function:

BS* BS_Difference1D ( BS set,
BS_ELT  x 
)

Definition at line 1209 of file bitset.c.

References BS_byte, bs_ONE, bs_QBPB, bs_QBPW, bs_RBPB, BS_word_count, and Is_True.

Referenced by BS_Difference1().

BS* BS_DifferenceD ( BS set1,
BS set2 
)

Definition at line 1166 of file bitset.c.

References BS_word, BS_word_count, and Min().

Here is the call graph for this function:

BOOL BS_EmptyP ( BS set)

Definition at line 2398 of file bitset.c.

References BS_word, BS_word_count, bs_ZEROS, FALSE, and TRUE.

BOOL BS_EqualP ( BS set1,
BS set2 
)

Definition at line 2422 of file bitset.c.

References BS_word, BS_word_count, bs_ZEROS, FALSE, and TRUE.

BS* BS_Intersection ( BS set1,
BS set2,
MEM_POOL pool 
)

Definition at line 1233 of file bitset.c.

References bs_Malloc(), BS_word, BS_word_count, and size.

Here is the call graph for this function:

BOOL BS_Intersection_MemberP ( BS set1,
BS set2,
BS_ELT  x 
)

Definition at line 2514 of file bitset.c.

References BS_byte, bs_ONE, bs_QBPB, bs_QBPW, bs_RBPB, BS_word_count, bs_ZEROS, FALSE, and Is_True.

BS* BS_IntersectionD ( BS set1,
BS set2 
)

Definition at line 1266 of file bitset.c.

References BS_word, BS_word_count, bs_ZEROS, and MIN.

BS* BS_IntersectionR ( BS result,
const BS set1,
const BS set2 
)

Definition at line 1300 of file bitset.c.

References BS_word, BS_word_count, bs_ZEROS, MIN, and result.

BOOL BS_IntersectsP ( BS set1,
BS set2 
)

Definition at line 2460 of file bitset.c.

References BS_word, BS_word_count, bs_ZEROS, FALSE, and TRUE.

static BS* bs_Malloc ( size_t  length,
MEM_POOL pool 
) [static]

Definition at line 80 of file bitset.c.

References BS_word_count, Is_True, and TYPE_MEM_POOL_ALLOC_N.

Referenced by BS_Copy(), BS_Create(), BS_Difference(), BS_Intersection(), and BS_Union().

BOOL BS_MemberP ( BS set,
BS_ELT  x 
)

Definition at line 2490 of file bitset.c.

References BS_byte, bs_ONE, bs_QBPB, bs_QBPW, bs_RBPB, BS_word_count, bs_ZEROS, FALSE, and Is_True.

Referenced by TI_RES_RES_Has_TOP().

void BS_Print ( BS set,
FILE *  f 
)

Definition at line 2578 of file bitset.c.

References BS_Choose(), BS_CHOOSE_FAILURE, BS_Choose_Next(), fprintf(), NULL, PrintRange(), and TRUE.

Referenced by BS_Print_dbg().

Here is the call graph for this function:

void BS_Print_dbg ( BS set)

Definition at line 2625 of file bitset.c.

References BS_Print(), and fprintf().

Here is the call graph for this function:

BS* BS_RangeD ( BS set,
BS_ELT  low,
BS_ELT  high,
MEM_POOL pool 
)

Definition at line 293 of file bitset.c.

References BITS_PER_BS_WORD, BS_byte, BS_ClearD(), bs_ONES, bs_PBytesPW, bs_QBPB, bs_QBPW, bs_RBPB, bs_Realloc(), BS_word, BS_word_count, and Is_True.

Referenced by BS_UniverseD().

Here is the call graph for this function:

BS* BS_ResizeD ( BS set,
BS_ELT  new_size,
MEM_POOL pool 
)

Definition at line 248 of file bitset.c.

References BITS_PER_BS_WORD, bs_QBPW, bs_Realloc(), and BS_word_count.

Here is the call graph for this function:

BS* BS_Singleton ( BS_ELT  element,
MEM_POOL pool 
)

Definition at line 371 of file bitset.c.

References BS_Create(), and BS_SingletonD().

Here is the call graph for this function:

BS* BS_SingletonD ( BS set,
BS_ELT  element,
MEM_POOL pool 
)

Definition at line 391 of file bitset.c.

References BS_byte, BS_ClearD(), bs_ONE, bs_QBPB, bs_QBPW, bs_RBPB, bs_Realloc(), BS_word_count, and Is_True.

Referenced by BS_Singleton().

Here is the call graph for this function:

BS_ELT BS_Size ( BS set)

Definition at line 1596 of file bitset.c.

References BS_byte, BS_word_count, and result.

Definition at line 171 of file bitset.c.

References BITS_PER_BS_WORD, and bs_QBPW.

BS* BS_Union ( BS set1,
BS set2,
MEM_POOL pool 
)

Definition at line 1624 of file bitset.c.

References bs_Malloc(), BS_word, and BS_word_count.

Here is the call graph for this function:

BS* BS_Union1 ( BS set,
BS_ELT  x,
MEM_POOL pool 
)

Definition at line 1757 of file bitset.c.

References BS_CopyD(), BS_Create_Empty(), bs_PBPW, bs_QBPW, BS_Union1D(), and BS_word_count.

Here is the call graph for this function:

BS* BS_Union1D ( BS set,
BS_ELT  x,
MEM_POOL pool 
)

Definition at line 1786 of file bitset.c.

References BS_byte, bs_ONE, bs_QBPB, bs_QBPW, bs_RBPB, bs_Realloc(), BS_word_count, and Is_True.

Referenced by BS_Union1(), and TI_RES_RES_Has_TOP().

Here is the call graph for this function:

BS* BS_UnionD ( BS set1,
BS set2,
MEM_POOL pool 
)

Definition at line 1666 of file bitset.c.

References bs_Realloc(), BS_word, and BS_word_count.

Here is the call graph for this function:

BS* BS_UnionD_Intersection ( BS set1,
BS set2,
BS set3,
MEM_POOL pool 
)

Definition at line 1727 of file bitset.c.

References bs_Realloc(), BS_word, BS_word_count, and MIN.

Here is the call graph for this function:

BS* BS_UnionR ( BS result,
BS set1,
BS set2,
MEM_POOL pool 
)

Definition at line 1695 of file bitset.c.

References bs_Realloc(), BS_word, BS_word_count, MAX, and result.

Here is the call graph for this function:

BS* BS_Universe ( BS_ELT  size,
MEM_POOL pool 
)

Definition at line 425 of file bitset.c.

References BS_Create(), and BS_UniverseD().

Here is the call graph for this function:

BS* BS_UniverseD ( BS set,
BS_ELT  size,
MEM_POOL pool 
)

Definition at line 443 of file bitset.c.

References BS_RangeD().

Referenced by BS_Universe().

Here is the call graph for this function:

BOOL FBS_MemberP_Validate ( BS set,
BS_ELT  x 
)

Definition at line 2642 of file bitset.c.

References BS_byte, bs_ONE, bs_QBPB, bs_QBPW, bs_RBPB, BS_word_count, bs_ZEROS, and Is_True.

void FBS_Union1D_Validate ( BS set,
BS_ELT  x 
)

Definition at line 2663 of file bitset.c.

References BS_byte, bs_ONE, bs_QBPB, bs_QBPW, bs_RBPB, BS_word_count, and Is_True.

static void PrintRange ( FILE *  f,
BS_ELT  low,
BS_ELT  high,
BOOL first 
) [static]

Definition at line 2550 of file bitset.c.

References FALSE, and fprintf().

Referenced by BS_Print().

Here is the call graph for this function:


Variable Documentation

Definition at line 64 of file bitset.c.

Definition at line 63 of file bitset.c.

unsigned const char bit_count[256] [static]

Definition at line 1327 of file bitset.c.

Referenced by _popcnt16(), _popcnt32(), and _popcnt8().

const mUINT8 first_one[256] [static]

Definition at line 522 of file bitset.c.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines