1 /*
2  * Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef _PICO_BIT_OPS_H
8 #define _PICO_BIT_OPS_H
9 
10 #include "pico.h"
11 
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15 
16 /** \file bit_ops.h
17 *  \defgroup pico_bit_ops pico_bit_ops
18 *
19 * \brief Optimized bit manipulation functions
20 *
21 * Additionally provides  replacement implementations of the compiler built-ins __builtin_popcount, __builtin_clz
22 * and __bulitin_ctz
23 */
24 
25 /*! \brief Reverse the bits in a 32 bit word
26  *  \ingroup pico_bit_ops
27  *
28  * \param bits 32 bit input
29  * \return the 32 input bits reversed
30  */
31 uint32_t __rev(uint32_t bits);
32 
33 /*! \brief Reverse the bits in a 64 bit double word
34  *  \ingroup pico_bit_ops
35  *
36  * \param bits 64 bit input
37  * \return the 64 input bits reversed
38  */
39 uint64_t __revll(uint64_t bits);
40 
41 #ifdef __cplusplus
42 }
43 #endif
44 
45 #endif
46