buildQ (BQB hi lo) = BQ (BQB hi' lo') where
  zeros = countTrailingZeros lo
  lo1 = (lo `shiftRL` 1) .|. (hi `shiftLL` (wordSize - 1))
  hi1 = (hi `shiftRL` 1) .|. (1 `shiftLL` (wordSize - 1))
  lo' = (lo1 `shiftRL` zeros) .|. (hi1 `shiftLL` (wordSize - zeros))
  hi' = hi1 `shiftRL` zeros

-- Test if the queue is empty, which occurs when theres
-- nothing left but a guard bit in the least significant
-- place.
buildQ (BQB hi lo) = BQ (BQB hi' lo') where
  zeros = countTrailingZeros lo
  lo1 = (lo `shiftRL` 1) .|. (hi `shiftLL` (wordSize - 1))
  hi1 = (hi `shiftRL` 1) .|. (1 `shiftLL` (wordSize - 1))
  lo' = (lo1 `shiftRL` zeros) .|. (hi1 `shiftLL` (wordSize - zeros))
  hi' = hi1 `shiftRL` zeros

-- Test if the queue is empty, which occurs when theres
-- nothing left but a guard bit in the least significant
-- place.
buildQ (BQB hi lo) = BQ (BQB hi' lo') where
  zeros = countTrailingZeros lo
  lo1 = (lo `shiftRL` 1) .|. (hi `shiftLL` (wordSize - 1))
  hi1 = (hi `shiftRL` 1) .|. (1 `shiftLL` (wordSize - 1))
  lo' = (lo1 `shiftRL` zeros) .|. (hi1 `shiftLL` (wordSize - zeros))
  hi' = hi1 `shiftRL` zeros

-- Test if the queue is empty, which occurs when theres
-- nothing left but a guard bit in the least significant
-- place.