summaryrefslogtreecommitdiff
path: root/hw/xfree86/xaa/xaaBitOrder.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/xfree86/xaa/xaaBitOrder.c')
-rw-r--r--hw/xfree86/xaa/xaaBitOrder.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/hw/xfree86/xaa/xaaBitOrder.c b/hw/xfree86/xaa/xaaBitOrder.c
new file mode 100644
index 000000000..d7f3ba2a3
--- /dev/null
+++ b/hw/xfree86/xaa/xaaBitOrder.c
@@ -0,0 +1,13 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaBitOrder.c,v 1.8 2003/02/17 16:08:29 dawes Exp $ */
+
+#include "Xmd.h"
+CARD32 XAAReverseBitOrder(CARD32 v);
+
+CARD32
+XAAReverseBitOrder(CARD32 v)
+{
+ return (((0x01010101 & v) << 7) | ((0x02020202 & v) << 5) |
+ ((0x04040404 & v) << 3) | ((0x08080808 & v) << 1) |
+ ((0x10101010 & v) >> 1) | ((0x20202020 & v) >> 3) |
+ ((0x40404040 & v) >> 5) | ((0x80808080 & v) >> 7));
+}