X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fst%2Fbs.h;h=bfe6f48ec99ee0519abdaf5d858d364de9b422eb;hb=395c1f470c010aaef09345d08204e8780df6ee0b;hp=beea7f87708abc9a29b0c0dc2fb8e0f3a4408d92;hpb=df83e37827032795585d3b25776c465870672901;p=libfirm diff --git a/ir/st/bs.h b/ir/st/bs.h index beea7f877..bfe6f48ec 100644 --- a/ir/st/bs.h +++ b/ir/st/bs.h @@ -1,30 +1,48 @@ -/* Copyright (c) 2002 by Universität Karlsruhe (TH). All Rights Reserved */ +/* + * Project: libFIRM + * File name: ir/st/bs.h + * Purpose: Provides a simple bit set. + * Author: Florian Liekweg + * Modified by: + * Created: 4.3.2002 + * CVS-ID: $Id$ + * Copyright: (c) 2002-2003 Universität Karlsruhe + * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE. + */ /** - NAME - bs - PURPOSE - provide bs_t - S - not quite complete - HISTORY - liekweg - Feb 27, 2002: Created. - CVS: - $Id$ -***/ + @file bs.h + + Provides a simple bit set. + + Not quite complete +*/ + # ifndef _BS_H_ # define _BS_H_ +/** + * the type of a bit set + */ typedef long int bs_t; +/** set bit in a bit set */ # define bs_set(bs, i) (bs) |= (0x00000001 << i) + +/** get bit in a bit set */ # define bs_get(bs, i) (bs) & (0x00000001 << i) +/** logical AND of two bit sets */ # define bs_and(bsa, bsb) (bsa) &= (bsb) + +/** logical OR of two bit sets */ # define bs_or(bsa, bsb) (bsa) |= (bsb) + +/** logical XOR of two bit sets */ # define bs_xor(bsa, bsb) (bsa) ^= (bsb) +/** returns TRUE if at least one bit is set */ # define bs_zro(bs) (0x00000000 != bs) # endif /* ndef _BS_H_ */