2022-11-20 05:07:22 +00:00
|
|
|
#ifndef COMPILER_BITVECTORS_H
|
|
|
|
#define COMPILER_BITVECTORS_H
|
|
|
|
|
|
|
|
#include "compiler/common.h"
|
|
|
|
|
2022-12-14 00:16:59 +00:00
|
|
|
extern void bitvectorcopy(UInt32 *dst, UInt32 *src, int len);
|
|
|
|
extern int bitvectorchanged(UInt32 *dst, UInt32 *src, int len);
|
|
|
|
extern void bitvectorinitialize(UInt32 *vec, int len, UInt32 initval);
|
|
|
|
extern void bitvectorintersect(UInt32 *dst, UInt32 *src, int len);
|
|
|
|
extern void bitvectorunion(UInt32 *dst, UInt32 *src, int len);
|
|
|
|
extern void bitvectordifference(UInt32 *dst, UInt32 *src, int len);
|
|
|
|
extern void bitvectorcomplement(UInt32 *dst, UInt32 *src, int len);
|
|
|
|
extern int bitvectorcount(UInt32 *vec, int len);
|
|
|
|
extern int bitvectorisempty(UInt32 *vec, int len);
|
|
|
|
extern int bitvectorintersectionisempty(UInt32 *a, UInt32 *b, int len);
|
|
|
|
|
|
|
|
#define bitvectorgetbit(_bit, _vec) ((1 << ((_bit) & 31)) & (_vec)[(_bit) >> 5])
|
|
|
|
#define bitvectorsetbit(_bit, _vec) ((_vec)[(_bit) >> 5] |= 1 << ((_bit) & 31))
|
|
|
|
#define bitvectorclearbit(_bit, _vec) ((_vec)[(_bit) >> 5] &= ~(1 << ((_bit) & 31)))
|
|
|
|
|
2022-11-20 05:07:22 +00:00
|
|
|
#endif
|