Lines Matching defs:first
55 * The index of the first bit set needs to be obtained via
86 * The idx member contains the bit index of the first bit described by this
87 * node, while the mask member stores the setting of the first 32-bits.
617 * by first remembering the location of the next
992 /* With num > 0, the first bit must be set. */
1023 /* With num > 0, the first bit must be cleared. */
1084 /* Returns the index of the first set bit. Abort if no bits are set.
1097 /* Returns the index of the first cleared bit. Abort if
1107 /* If no nodes or first node index > 0 then lowest cleared is 0 */
1112 /* Does the mask in the first node contain any cleared bits. */
1117 * All mask bits set in first node. If there isn't a second node
1118 * then the first cleared bit is the first bit after the bits
1119 * described by the first node.
1124 * No second node. First cleared bit is first bit beyond
1125 * bits described by first node.
1134 * If it is not adjacent to the first node, then there is a gap
1135 * of cleared bits between the nodes, and the first cleared bit
1136 * is the first bit within the gap.
1142 * Second node is adjacent to the first node.
1201 * Candidate points to the first node with a starting index
1233 * this, the next bit is the first bit in the next node, if
1274 * by bit after the bits described by the first node.
1282 * If it is not adjacent to the first node, then there is a gap
1284 * is the first bit within the gap.
1290 * Second node is adjacent to the first node.
1300 * and returns the index of the first sequence of num consecutively set
1335 * and returns the index of the first sequence of num consecutively cleared
1383 * Leading - bits before first mask boundary.
1464 /* Leading - bits before first mask boundary */
1894 sparsebit_idx_t first, last;
1907 if (ranges[i].first <= idx && idx <= ranges[i].last)
1913 static void operate(int code, sparsebit_idx_t first, sparsebit_idx_t last)
1918 if (first < last) {
1919 num = last - first + 1;
1921 num = first - last + 1;
1922 first = last;
1923 last = first + num - 1;
1928 sparsebit_set(s, first);
1929 assert(sparsebit_is_set(s, first));
1930 assert(!sparsebit_is_clear(s, first));
1933 if (get_value(first))
1938 { .first = first, .last = first, .set = true };
1941 sparsebit_clear(s, first);
1942 assert(!sparsebit_is_set(s, first));
1943 assert(sparsebit_is_clear(s, first));
1946 if (!get_value(first))
1951 { .first = first, .last = first, .set = false };
1954 assert(sparsebit_is_set(s, first) == get_value(first));
1955 assert(sparsebit_is_clear(s, first) == !get_value(first));
1967 { .first = 0, .last = ~(sparsebit_idx_t)0, .set = true };
1980 next = sparsebit_next_set(s, first);
1981 assert(next == 0 || next > first);
1985 next = sparsebit_next_clear(s, first);
1986 assert(next == 0 || next > first);
1990 next = sparsebit_next_clear(s, first);
1991 if (sparsebit_is_set_num(s, first, num)) {
1993 if (first)
1994 next = sparsebit_next_set(s, first - 1);
1999 assert(next == first);
2001 assert(sparsebit_is_clear(s, first) || next <= last);
2005 next = sparsebit_next_set(s, first);
2006 if (sparsebit_is_clear_num(s, first, num)) {
2008 if (first)
2009 next = sparsebit_next_clear(s, first - 1);
2014 assert(next == first);
2016 assert(sparsebit_is_set(s, first) || next <= last);
2020 sparsebit_set_num(s, first, num);
2021 assert(sparsebit_is_set_num(s, first, num));
2022 assert(!sparsebit_is_clear_num(s, first, num));
2028 { .first = first, .last = last, .set = true };
2031 sparsebit_clear_num(s, first, num);
2032 assert(!sparsebit_is_set_num(s, first, num));
2033 assert(sparsebit_is_clear_num(s, first, num));
2039 { .first = first, .last = last, .set = false };
2078 uint64_t first = get64();
2081 operate(op, first, last);