summaryrefslogtreecommitdiffstats
path: root/include/proc_hcd_common.H
blob: 51cc1285fb777e5f10c0d5c36e06e19f55622f09 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#ifndef __PROC_HCD_COMMON_H
#define __PROC_HCD_COMMON_H

/// \file proc_hcd_common.H
/// \brief Standard bit-manipulation macros (C and Assembler) for PORE code

/// \defgroup be64_bits Bit manipulation for 64-bit Big-Endian values
///
/// \note These macros only work in the assembler context because we build our
/// assemblers to do 64-bit arithmetic, which is required for PORE assembly.
///
/// @{

/// Create a multi-bit mask of \a n bits starting at bit \a b
#define BITS(b, n) ((ULL(0xffffffffffffffff) << (64 - (n))) >> (b))

/// Create a single bit mask at bit \a b
#define BIT(b) BITS((b), 1)

#endif  // __PROC_HCD_COMMON_H
OpenPOWER on IntegriCloud