Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
be4c25fa
Commit
be4c25fa
authored
Aug 11, 2009
by
Matthias Braun
Browse files
add rbitsets_have_common function
[r26325]
parent
d20e8214
Changes
1
Hide whitespace changes
Inline
Side-by-side
include/libfirm/adt/raw_bitset.h
View file @
be4c25fa
...
...
@@ -348,6 +348,26 @@ static inline int rbitset_equal(const unsigned *bitset1,
return
memcmp
(
bitset1
,
bitset2
,
BITSET_SIZE_BYTES
(
size
))
==
0
;
}
/**
* Tests wether 2 bitsets wether at least 1 bit is set in both.
*
* @param bitset1 the first bitset
* @param bitset2 the second bitset
* @param size size of both bitsets
*/
static
inline
int
rbitsets_have_common
(
const
unsigned
*
bitset1
,
const
unsigned
*
bitset2
,
size_t
size
)
{
unsigned
i
;
unsigned
n
=
BITSET_SIZE_ELEMS
(
size
);
for
(
i
=
0
;
i
<
n
;
++
i
)
{
if
((
bitset1
[
i
]
&
bitset2
[
i
])
!=
0
)
return
1
;
}
return
0
;
}
/**
* Copy a raw bitset into another.
*
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment