Lines Matching defs:bitvec
16 static int JimTestBitBigEndian(const unsigned char *bitvec, int b)
19 return bitvec[pos.quot] & (1 << (7 - pos.rem));
28 static int JimTestBitLittleEndian(const unsigned char *bitvec, int b)
31 return bitvec[pos.quot] & (1 << pos.rem);
60 * The pos/width must represent bits inside bitvec,
63 static jim_wide JimBitIntBigEndian(const unsigned char *bitvec, int pos, int width)
71 result = (result << 8) + bitvec[(pos + i) / 8];
78 if (JimTestBitBigEndian(bitvec, pos + width - i - 1)) {
91 static jim_wide JimBitIntLittleEndian(const unsigned char *bitvec, int pos, int width)
99 result += (jim_wide)bitvec[(pos + i) / 8] << i;
106 if (JimTestBitLittleEndian(bitvec, pos + i)) {
120 static void JimSetBitBigEndian(unsigned char *bitvec, int b, int bit)
124 bitvec[pos.quot] |= (1 << (7 - pos.rem));
127 bitvec[pos.quot] &= ~(1 << (7 - pos.rem));
137 static void JimSetBitLittleEndian(unsigned char *bitvec, int b, int bit)
141 bitvec[pos.quot] |= (1 << pos.rem);
144 bitvec[pos.quot] &= ~(1 << pos.rem);
155 * The pos/width must represent bits inside bitvec,
158 static void JimSetBitsIntBigEndian(unsigned char *bitvec, jim_wide value, int pos, int width)
164 bitvec[pos / 8] = value;
170 JimSetBitBigEndian(bitvec, pos + width - i - 1, bit);
177 static void JimSetBitsIntLittleEndian(unsigned char *bitvec, jim_wide value, int pos, int width)
183 bitvec[pos / 8] = value;
189 JimSetBitLittleEndian(bitvec, pos + i, bit);