diff options
Diffstat (limited to 'include/proc_hcd_common.H')
-rw-r--r-- | include/proc_hcd_common.H | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/proc_hcd_common.H b/include/proc_hcd_common.H new file mode 100644 index 00000000..51cc1285 --- /dev/null +++ b/include/proc_hcd_common.H @@ -0,0 +1,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 |