changeset 891:d3fc77a6d57e libavcodec

Add some rudimentary support for sparc64
author philipjsg
date Tue, 26 Nov 2002 04:29:40 +0000
parents 653d9419ea01
children 550033bc7e2d
files common.h
diffstat 1 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/common.h	Tue Nov 26 00:54:27 2002 +0000
+++ b/common.h	Tue Nov 26 04:29:40 2002 +0000
@@ -248,6 +248,10 @@
     uint8_t run;
 } RL_VLC_ELEM;
 
+#ifdef ARCH_SPARC64
+#define UNALIGNED_STORES_ARE_BAD
+#endif
+
 /* used to avoid missaligned exceptions on some archs (alpha, ...) */
 #ifdef ARCH_X86
 #    define unaligned32(a) (*(UINT32*)(a))
@@ -294,6 +298,14 @@
     } else {
 	bit_buf<<=bit_left;
         bit_buf |= value >> (n - bit_left);
+#ifdef UNALIGNED_STORES_ARE_BAD
+        if (3 & (int) s->buf_ptr) {
+            s->buf_ptr[0] = bit_buf >> 24;
+            s->buf_ptr[1] = bit_buf >> 16;
+            s->buf_ptr[2] = bit_buf >>  8;
+            s->buf_ptr[3] = bit_buf      ;
+        } else
+#endif
         *(UINT32 *)s->buf_ptr = be2me_32(bit_buf);
         //printf("bitbuf = %08x\n", bit_buf);
         s->buf_ptr+=4;