mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-11-16 01:12:15 +03:00
move andn helper function to bitutils.h
This commit is contained in:
committed by
Konstantinos Margaritis
parent
25f0c7823a
commit
b0cf02fdc1
@@ -34,6 +34,7 @@
|
||||
#define BITUTILS_ARCH_COMMON_H
|
||||
|
||||
#include "util/popcount.h"
|
||||
#include "util/unaligned.h"
|
||||
|
||||
static really_inline
|
||||
u32 clz32_impl_c(u32 x) {
|
||||
@@ -350,4 +351,12 @@ u64a pext64_impl_c(u64a x, u64a mask) {
|
||||
return result;
|
||||
}
|
||||
|
||||
/* compilers don't reliably synthesize the 32-bit ANDN instruction here,
|
||||
* so we force its generation.
|
||||
*/
|
||||
static really_inline
|
||||
u64a andn_impl_c(const u32 a, const u8 *b) {
|
||||
return unaligned_load_u32(b) & ~a;
|
||||
}
|
||||
|
||||
#endif // BITUTILS_ARCH_COMMON_H
|
||||
|
||||
Reference in New Issue
Block a user