00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef PBITOPS_H
00016 #define PBITOPS_H
00017
00018 #include "pandabase.h"
00019 #include "numeric_types.h"
00020
00021
00022
00023
00024
00025
00026 INLINE int count_bits_in_word(PN_uint16 x);
00027 INLINE int count_bits_in_word(PN_uint32 x);
00028 INLINE int count_bits_in_word(PN_uint64 x);
00029
00030 INLINE PN_uint16 flood_bits_down(PN_uint16 x);
00031 INLINE PN_uint32 flood_bits_down(PN_uint32 x);
00032 INLINE PN_uint64 flood_bits_down(PN_uint64 x);
00033 INLINE PN_uint16 flood_bits_up(PN_uint16 x);
00034 INLINE PN_uint32 flood_bits_up(PN_uint32 x);
00035 INLINE PN_uint64 flood_bits_up(PN_uint64 x);
00036
00037 INLINE int get_lowest_on_bit(PN_uint16 x);
00038 INLINE int get_lowest_on_bit(PN_uint32 x);
00039 INLINE int get_lowest_on_bit(PN_uint64 x);
00040 INLINE int get_highest_on_bit(PN_uint16 x);
00041 INLINE int get_highest_on_bit(PN_uint32 x);
00042 INLINE int get_highest_on_bit(PN_uint64 x);
00043
00044 INLINE int get_next_higher_bit(PN_uint16 x);
00045 INLINE int get_next_higher_bit(PN_uint32 x);
00046 INLINE int get_next_higher_bit(PN_uint64 x);
00047
00048
00049 extern EXPCL_PANDA_PUTIL unsigned char num_bits_on[65536];
00050
00051 #include "pbitops.I"
00052
00053 #endif