equal
deleted
inserted
replaced
1 /* $Id$ */ |
1 /* $Id$ */ |
2 |
2 |
3 #ifndef MACROS_H |
3 #ifndef MACROS_H |
4 #define MACROS_H |
4 #define MACROS_H |
5 |
|
6 #include "map.h" |
|
7 |
5 |
8 /// Fetch n bits starting at bit s from x |
6 /// Fetch n bits starting at bit s from x |
9 #define GB(x, s, n) (((x) >> (s)) & ((1U << (n)) - 1)) |
7 #define GB(x, s, n) (((x) >> (s)) & ((1U << (n)) - 1)) |
10 /// Set n bits starting at bit s in x to d |
8 /// Set n bits starting at bit s in x to d |
11 #define SB(x, s, n, d) ((x) = ((x) & ~(((1U << (n)) - 1) << (s))) | ((d) << (s))) |
9 #define SB(x, s, n, d) ((x) = ((x) & ~(((1U << (n)) - 1) << (s))) | ((d) << (s))) |