Open64 (mfef90, whirl2f, and IR tools)  TAG: version-openad; SVN changeset: 916
bitset.h File Reference
#include "defs.h"
Include dependency graph for bitset.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define LOG2_BITS_PER_BS_WORD   5
#define BITS_PER_BS_WORD   (sizeof(BS_WORD) * 8)
#define BYTES_PER_BS_WORD   (sizeof(BS_WORD))
#define bs_PBPW(x)   ((BS_ELT) ((x) << LOG2_BITS_PER_BS_WORD))
#define bs_QBPW(x)   ((BS_ELT) ((x) >> LOG2_BITS_PER_BS_WORD))
#define bs_RBPW(x)   ((BS_ELT) ((x) & ((1 << LOG2_BITS_PER_BS_WORD) - 1)))
#define bs_PBPB(x)   ((BS_ELT) ((x) << 3))
#define bs_QBPB(x)   ((BS_ELT) ((x) >> 3))
#define bs_RBPB(x)   ((BS_ELT) ((x) & 0x7))
#define bs_PBytesPW(x)   ((BS_ELT) ((x) * BYTES_PER_BS_WORD))
#define bs_ZEROS   ((BS_WORD) 0)
#define bs_ONES   ((BS_WORD) ~0)
#define bs_ONE   ((BS_WORD) 1)
#define BS_word_count(x)   (*((BS_WORD *) x))
#define BS_word(x, i)   (*(((BS_WORD *) x) + (i) + 1))
#define BS_byte(x, i)   (*(((unsigned char *) x) + (i) + sizeof(BS_WORD)))
#define BS_MIN_ELT   ((BS_ELT) 0)
#define BS_MAX_ELT   ((BS_ELT) UINT32_MAX)
#define BS_CHOOSE_FAILURE   ((BS_ELT) -1)
#define FBS_MemberP(set, x)   FBS_MemberP_Validate(set, x)
#define FBS_Union1D(set, x)   FBS_Union1D_Validate(set, x)

Typedefs

typedef struct bs BS
typedef INT32 BS_ELT
typedef mUINT32 BS_WORD
typedef mUINT8 BS_BYTE

Functions

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_Range (BS_ELT low, BS_ELT high, 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 *bs)
BS_ELT BS_Intersection_Choose (BS *set1, BS *set2)
BS_ELT BS_Choose_Range (BS *set, BS_ELT low, BS_ELT high)
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_Union1 (BS *set, BS_ELT x, MEM_POOL *pool)
BSBS_UnionD_Intersection (BS *set1, BS *set2, BS *set3, 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_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_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_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_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_3_Not_4_Or_2_And_1_Or_D (BS *result, const BS *set1, const BS *set2, const BS *set3, MEM_POOL *pool)
BSBS_4_3_Minus_2_Not_Or_1_And_D (BS *result, const BS *set1, const BS *set2, const BS *set3, MEM_POOL *pool)
BSBS_2_3_Minus_1_Or_D (BS *result, const BS *set1, const BS *set2, MEM_POOL *pool)
BSBS_2_3_Minus_4_Minus_1_Or_D (BS *result, const BS *set1, const BS *set2, const BS *set3, 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)
BS_ELT BS_Choose_Next (const BS *set, BS_ELT elt)
BS_ELT BS_Intersection_Choose_Next (BS *set1, BS *set2, BS_ELT elt)
BOOL FBS_MemberP_Validate (BS *set, BS_ELT x)
void FBS_Union1D_Validate (BS *set, BS_ELT x)
void BS_Print (BS *set, FILE *f)

Define Documentation

#define BITS_PER_BS_WORD   (sizeof(BS_WORD) * 8)

Definition at line 494 of file bitset.h.

Referenced by BS_Choose_Range(), BS_Create(), BS_RangeD(), BS_ResizeD(), and BS_Size_Alloc_Size().

#define BS_MAX_ELT   ((BS_ELT) UINT32_MAX)

Definition at line 562 of file bitset.h.

#define BS_MIN_ELT   ((BS_ELT) 0)

Definition at line 561 of file bitset.h.

#define bs_ONES   ((BS_WORD) ~0)

Definition at line 519 of file bitset.h.

Referenced by BS_Choose_Next(), BS_Choose_Range(), BS_Intersection_Choose_Next(), and BS_RangeD().

#define bs_PBPB (   x)    ((BS_ELT) ((x) << 3))
#define bs_PBPW (   x)    ((BS_ELT) ((x) << LOG2_BITS_PER_BS_WORD))

Definition at line 506 of file bitset.h.

Referenced by BS_Choose_Next(), BS_Choose_Range(), BS_Intersection_Choose_Next(), and BS_Union1().

#define bs_PBytesPW (   x)    ((BS_ELT) ((x) * BYTES_PER_BS_WORD))
#define bs_RBPW (   x)    ((BS_ELT) ((x) & ((1 << LOG2_BITS_PER_BS_WORD) - 1)))

Definition at line 508 of file bitset.h.

#define FBS_MemberP (   set,
 
)    FBS_MemberP_Validate(set, x)

Definition at line 649 of file bitset.h.

#define FBS_Union1D (   set,
 
)    FBS_Union1D_Validate(set, x)

Definition at line 650 of file bitset.h.

#define LOG2_BITS_PER_BS_WORD   5

Definition at line 489 of file bitset.h.


Typedef Documentation

typedef struct bs BS

Definition at line 472 of file bitset.h.

typedef mUINT8 BS_BYTE

Definition at line 492 of file bitset.h.

typedef INT32 BS_ELT

Definition at line 473 of file bitset.h.

typedef mUINT32 BS_WORD

Definition at line 475 of file bitset.h.


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 result,
const BS set1,
const BS set2,
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 result,
const BS set1,
const BS set2,
const BS set3,
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 result,
const BS set1,
const BS set2,
const BS set3,
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 result,
const BS set1,
const BS set2,
const BS set3,
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.

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:

BS* BS_Range ( BS_ELT  low,
BS_ELT  high,
MEM_POOL pool 
)
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.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines