PageRenderTime 18ms CodeModel.GetById 10ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/media/libvpx/solaris.patch

http://github.com/zpao/v8monkey
Patch | 147 lines | 139 code | 8 blank | 0 comment | 0 complexity | 580b7f024dcb1c5504c0891d43cfa937 MD5 | raw file
  1diff --git a/media/libvpx/vp8/common/loopfilter_filters.c b/media/libvpx/vp8/common/loopfilter_filters.c
  2--- a/media/libvpx/vp8/common/loopfilter_filters.c
  3+++ b/media/libvpx/vp8/common/loopfilter_filters.c
  4@@ -11,10 +11,14 @@
  5 
  6 #include <stdlib.h>
  7 #include "loopfilter.h"
  8 #include "onyxc_int.h"
  9 
 10+#ifdef __SUNPRO_C
 11+#define __inline inline
 12+#endif
 13+
 14 typedef unsigned char uc;
 15 
 16 static __inline signed char vp8_signed_char_clamp(int t)
 17 {
 18     t = (t < -128 ? -128 : t);
 19diff --git a/media/libvpx/vpx_ports/mem.h b/media/libvpx/vpx_ports/mem.h
 20--- a/media/libvpx/vpx_ports/mem.h
 21+++ b/media/libvpx/vpx_ports/mem.h
 22@@ -9,17 +9,17 @@
 23  */
 24 
 25 
 26 #ifndef VPX_PORTS_MEM_H
 27 #define VPX_PORTS_MEM_H
 28 #include "vpx_config.h"
 29 #include "vpx/vpx_integer.h"
 30 
 31-#if defined(__GNUC__) && __GNUC__
 32+#if (defined(__GNUC__) && __GNUC__) || defined(__SUNPRO_C)
 33 #define DECLARE_ALIGNED(n,typ,val)  typ val __attribute__ ((aligned (n)))
 34 #elif defined(_MSC_VER)
 35 #define DECLARE_ALIGNED(n,typ,val)  __declspec(align(n)) typ val
 36 #else
 37 #warning No alignment directives known for this compiler.
 38 #define DECLARE_ALIGNED(n,typ,val)  typ val
 39 #endif
 40 #endif
 41diff --git a/media/libvpx/vpx_ports/x86.h b/media/libvpx/vpx_ports/x86.h
 42--- a/media/libvpx/vpx_ports/x86.h
 43+++ b/media/libvpx/vpx_ports/x86.h
 44@@ -45,16 +45,36 @@
 45 #define cpuid(func,ax,bx,cx,dx)\
 46     __asm__ __volatile__ (\
 47                           "mov %%ebx, %%edi   \n\t" \
 48                           "cpuid              \n\t" \
 49                           "xchg %%edi, %%ebx  \n\t" \
 50                           : "=a" (ax), "=D" (bx), "=c" (cx), "=d" (dx) \
 51                           : "a" (func));
 52 #endif
 53+#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
 54+#if ARCH_X86_64
 55+#define cpuid(func,ax,bx,cx,dx)\
 56+    asm volatile (\
 57+                  "xchg %rsi, %rbx \n\t" \
 58+                  "cpuid           \n\t" \
 59+                  "movl %ebx, %edi \n\t" \
 60+                  "xchg %rsi, %rbx \n\t" \
 61+                  : "=a" (ax), "=D" (bx), "=c" (cx), "=d" (dx) \
 62+                  : "a"  (func));
 63+#else
 64+#define cpuid(func,ax,bx,cx,dx)\
 65+    asm volatile (\
 66+                  "pushl %ebx       \n\t" \
 67+                  "cpuid            \n\t" \
 68+                  "movl %ebx, %edi  \n\t" \
 69+                  "popl %ebx        \n\t" \
 70+                  : "=a" (ax), "=D" (bx), "=c" (cx), "=d" (dx) \
 71+                  : "a" (func));
 72+#endif
 73 #else
 74 #if ARCH_X86_64
 75 void __cpuid(int CPUInfo[4], int info_type);
 76 #pragma intrinsic(__cpuid)
 77 #define cpuid(func,a,b,c,d) do{\
 78         int regs[4];\
 79         __cpuid(regs,func); a=regs[0];  b=regs[1];  c=regs[2];  d=regs[3];\
 80     } while(0)
 81@@ -108,29 +128,36 @@ unsigned __int64 __rdtsc(void);
 82 #endif
 83 static unsigned int
 84 x86_readtsc(void)
 85 {
 86 #if defined(__GNUC__) && __GNUC__
 87     unsigned int tsc;
 88     __asm__ __volatile__("rdtsc\n\t":"=a"(tsc):);
 89     return tsc;
 90+#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
 91+    unsigned int tsc;
 92+    asm volatile("rdtsc\n\t":"=a"(tsc):);
 93+    return tsc;
 94 #else
 95 #if ARCH_X86_64
 96     return __rdtsc();
 97 #else
 98     __asm  rdtsc;
 99 #endif
100 #endif
101 }
102 
103 
104 #if defined(__GNUC__) && __GNUC__
105 #define x86_pause_hint()\
106     __asm__ __volatile__ ("pause \n\t")
107+#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
108+#define x86_pause_hint()\
109+    asm volatile ("pause \n\t")
110 #else
111 #if ARCH_X86_64
112 #define x86_pause_hint()\
113     _mm_pause();
114 #else
115 #define x86_pause_hint()\
116     __asm pause
117 #endif
118@@ -144,16 +171,29 @@ x87_set_control_word(unsigned short mode
119 }
120 static unsigned short
121 x87_get_control_word(void)
122 {
123     unsigned short mode;
124     __asm__ __volatile__("fstcw %0\n\t":"=m"(*&mode):);
125     return mode;
126 }
127+#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
128+static void
129+x87_set_control_word(unsigned short mode)
130+{
131+    asm volatile("fldcw %0" : : "m"(*&mode));
132+}
133+static unsigned short
134+x87_get_control_word(void)
135+{
136+    unsigned short mode;
137+    asm volatile("fstcw %0\n\t":"=m"(*&mode):);
138+    return mode;
139+}
140 #elif ARCH_X86_64
141 /* No fldcw intrinsics on Windows x64, punt to external asm */
142 extern void           vpx_winx64_fldcw(unsigned short mode);
143 extern unsigned short vpx_winx64_fstcw(void);
144 #define x87_set_control_word vpx_winx64_fldcw
145 #define x87_get_control_word vpx_winx64_fstcw
146 #else
147 static void