2 * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved.
4 * This file is part of libFirm.
6 * This file may be distributed and/or modified under the terms of the
7 * GNU General Public License version 2 as published by the Free Software
8 * Foundation and appearing in the file LICENSE.GPL included in the
9 * packaging of this file.
11 * Licensees holding valid libFirm Professional Edition licenses may use
12 * this file in accordance with the libFirm Commercial License.
13 * Agreement provided with the Software.
15 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * File name: ir/st/bs.h
23 * Purpose: Provides a simple bit set.
24 * Author: Florian Liekweg
28 * Copyright: (c) 2002-2003 Universität Karlsruhe
34 Provides a simple bit set.
44 * the type of a bit set
46 typedef long int bs_t;
48 /** set bit in a bit set */
49 # define bs_set(bs, i) (bs) |= (0x00000001 << i)
51 /** get bit in a bit set */
52 # define bs_get(bs, i) (bs) & (0x00000001 << i)
54 /** logical AND of two bit sets */
55 # define bs_and(bsa, bsb) (bsa) &= (bsb)
57 /** logical OR of two bit sets */
58 # define bs_or(bsa, bsb) (bsa) |= (bsb)
60 /** logical XOR of two bit sets */
61 # define bs_xor(bsa, bsb) (bsa) ^= (bsb)
63 /** returns TRUE if at least one bit is set */
64 # define bs_zro(bs) (0x00000000 != bs)
66 # endif /* ndef _BS_H_ */