-static inline uint32_t
-ao_left(uint32_t bits, int16_t shift) {
- return bits >> shift;
-}
-
-static inline uint32_t
-ao_right(uint32_t bits, int16_t shift) {
- return bits << shift;
-}
-
-static inline uint32_t
-ao_right_mask(int16_t x) {
- if ((AO_UNIT - x) & AO_MASK)
- return ao_left(AO_ALLONES,(AO_UNIT - x) & AO_MASK);
- else
- return 0;
-}
-
-static inline uint32_t
-ao_left_mask(int16_t x) {
- if (x & AO_MASK)
- return ao_right(AO_ALLONES, x & AO_MASK);
- else
- return 0;
-}
-
-static inline uint32_t
-ao_bits_mask(int16_t x, int16_t w) {
- return ao_right(AO_ALLONES, x & AO_MASK) &
- ao_left(AO_ALLONES,(AO_UNIT - (x + w)) & AO_MASK);
-}
-
-#define ao_mask_bits(x,w,l,n,r) { \
- n = (w); \
- r = ao_right_mask((x)+n); \
- l = ao_left_mask(x); \
- if (l) { \
- n -= AO_UNIT - ((x) & AO_MASK); \
- if (n < 0) { \
- n = 0; \
- l &= r; \
- r = 0; \
- } \
- } \
- n >>= AO_SHIFT; \
-}
-
-static inline uint32_t
-ao_do_mask_rrop(uint32_t dst, uint32_t and, uint32_t xor, uint32_t mask) {
- return (dst & (and | ~mask)) ^ (xor & mask);
-}
-
-static inline uint32_t
-ao_do_rrop(uint32_t dst, uint32_t and, uint32_t xor) {
- return (dst & and) ^ xor;
-}