def _bitvalues(bitnames):
    """ Compute the association between bit names and values.
      Return name->value and value>name mapping.
  """
    n = 1
    values = {}
    names = {}
    for name in bitnames:
        values[name] = n
        names[n] = name
        n <<= 1
    return names, values
