#ifndef MAD_BIT_AVX2_TC #define MAD_BIT_AVX2_TC /* o-----------------------------------------------------------------------------o | | AVX2 optimization for bit manipulation | | Methodical Accelerator Design - Copyright (c) 2016+ | Support: http://cern.ch/mad - mad at cern.ch | Authors: L. Deniau, laurent.deniau at cern.ch | Contrib: - | o-----------------------------------------------------------------------------o | You can redistribute this file and/or modify it under the terms of the GNU | General Public License GPLv3 (or later), as published by the Free Software | Foundation. This file is distributed in the hope that it will be useful, but | WITHOUT ANY WARRANTY OF ANY KIND. See http://gnu.org/licenses for details. o-----------------------------------------------------------------------------o */ #include static inline int __attribute__((const)) mad_bit_lowest32 (uint32_t b) { return _tzcnt_u32(b); } static inline int __attribute__((const)) mad_bit_lowest64 (uint64_t b) { return _tzcnt_u64(b); } static inline int __attribute__((const)) mad_bit_highest32 (uint32_t b) { return 31 - _lzcnt_u32(b); } static inline int __attribute__((const)) mad_bit_highest64 (uint64_t b) { return 63 - _lzcnt_u64(b); } // --- end --------------------------------------------------------------------o #endif // MAD_MONO_AVX2_TC