summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/common/spantmp2.h
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2004-10-18 23:24:51 +0000
committerIan Romanick <[email protected]>2004-10-18 23:24:51 +0000
commitf404ff7b76d70a495d4246851127125a194a1adf (patch)
tree93394d40594b50ab64165e41bcb968ce3b53de1d /src/mesa/drivers/dri/common/spantmp2.h
parentf459b9f9c0ac4f0634028a7edb6275bb1201a055 (diff)
Small optimization for big-endian (e.g., PowerPC) systems.
Diffstat (limited to 'src/mesa/drivers/dri/common/spantmp2.h')
-rw-r--r--src/mesa/drivers/dri/common/spantmp2.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/common/spantmp2.h b/src/mesa/drivers/dri/common/spantmp2.h
index 6bdbe150c3b..5a161b11ddf 100644
--- a/src/mesa/drivers/dri/common/spantmp2.h
+++ b/src/mesa/drivers/dri/common/spantmp2.h
@@ -115,6 +115,16 @@
: "=r" (p) : "r" (p) ); \
((GLuint *)rgba)[0] = p; \
} while (0)
+# elif defined( MESA_BIG_ENDIAN )
+ /* On PowerPC with GCC 3.4.2 the shift madness below becomes a single
+ * rotlwi instruction. It also produces good code on SPARC.
+ */
+# define READ_RGBA( rgba, _x, _y ) \
+ do { \
+ GLuint p = *(volatile GLuint *) GET_SRC_PTR(_x, _y); \
+ GLuint t = p; \
+ *((uint32_t *) rgba) = (t >> 24) | (p << 8); \
+ } while (0)
# else
# define READ_RGBA( rgba, _x, _y ) \
do { \