openexr: make architecture independent
[oi-userland.git] / components / library / liboil / patches / liboil-02-compile.patch
blob597f9b661377c46b98a3768a8e1f5521fe117d92
1 --- liboil-0.3.16/configure.ac-orig 2010-03-31 16:27:48.050482382 -0500
2 +++ liboil-0.3.16/configure.ac 2010-03-31 16:47:06.074555274 -0500
3 @@ -241,6 +241,31 @@ if test "x$HAVE_SSSE3_ASM" = xyes ; then
4 AC_DEFINE(HAVE_SSSE3_ASM, 1, [Defined if compiler/assembler can handle SSSE3 instructions])
5 fi
7 +# Checks for Sun Studio compilers
8 +AC_CHECK_DECL([__SUNPRO_C], [HAVE_SUNCC="yes"], [HAVE_SUNCC="no"])
9 +if test x$HAVE_SUNCC="xyes" ; then
10 + case $host_os in
11 + solaris*)
12 + # When building binaries, apply a mapfile to ensure that the
13 + # binaries are not flagged as only able to run on MMX+SSE capable CPUs
14 + # since they check at runtime before using those instructions.
15 + # Not all linkers grok the mapfile format so we check for that first.
17 + use_hwcap_mapfile=no
18 + AC_MSG_CHECKING(whether to use a hardware capability map file)
19 + hwcap_save_LDFLAGS="$LDFLAGS"
20 + LIBOIL_HWCAP_LDFLAGS='-Wl,-M,$(srcdir)/solaris-hwcap.mapfile'
21 + LDFLAGS="$LDFLAGS -Wl,-M,liboil/solaris-hwcap.mapfile"
22 + AC_LINK_IFELSE([int main() { return 0; }],
23 + use_hwcap_mapfile=yes,
24 + LIBOIL_HWCAP_LDFLAGS="")
25 + LDFLAGS="$hwcap_save_LDFLAGS"
26 + AC_SUBST(LIBOIL_HWCAP_LDFLAGS)
27 + AC_MSG_RESULT($use_hwcap_mapfile)
28 + ;;
29 + esac
30 +fi
32 AC_DEFINE(OIL_EXPORTS, 1, [Defined for compiling internal code])
34 LIBOIL_CFLAGS="$LIBOIL_CFLAGS -D_BSD_SOURCE -D_GNU_SOURCE -I\$(top_srcdir) -DOIL_ENABLE_UNSTABLE_API"
35 --- liboil-0.3.16/liboil/Makefile.am-orig 2010-03-31 16:28:32.687722289 -0500
36 +++ liboil-0.3.16/liboil/Makefile.am 2010-03-31 16:34:50.756904945 -0500
37 @@ -105,13 +105,15 @@ liboilfunctions_la_LIBADD += \
38 deprecated/libdeprecated.la
39 endif
40 liboilfunctions_la_LDFLAGS = \
41 - -no-undefined
42 + -no-undefined \
43 + $(LIBOIL_HWCAP_LDFLAGS)
45 liboiltmp1_la_SOURCES = \
46 liboiltmp.c
47 liboiltmp1_la_LDFLAGS = \
48 -no-undefined \
49 - -export-symbols-regex 'oil_'
50 + -export-symbols-regex 'oil_' \
51 + $(LIBOIL_HWCAP_LDFLAGS)
52 liboiltmp1_la_LIBADD = \
53 liboilfunctions.la \
54 $(LIBM) $(LIBRT)
55 @@ -172,7 +174,8 @@ liboil_@LIBOIL_MAJORMINOR@_la_CFLAGS = $
56 liboil_@LIBOIL_MAJORMINOR@_la_LDFLAGS = \
57 -no-undefined \
58 -version-info $(LIBOIL_LIBVERSION) \
59 - -export-symbols-regex '^oil_'
60 + -export-symbols-regex '^oil_' \
61 + $(LIBOIL_HWCAP_LDFLAGS)
63 # This is required to use 'make -j2'. Automake doesn't seem to notice
64 # that one of the dependencies is in this directory.
65 @@ -252,6 +255,7 @@ liboil_@LIBOIL_OLD_MAJORMINOR@_la_LIBADD
66 liboil_@LIBOIL_OLD_MAJORMINOR@_la_LDFLAGS = \
67 -no-undefined \
68 -version-info $(LIBOIL_LIBVERSION) \
69 - -export-symbols-regex '^oil_'
70 + -export-symbols-regex '^oil_' \
71 + $(LIBOIL_HWCAP_LDFLAGS)
72 endif
74 --- liboil-0.3.16/m4/as-host-defines.m4-orig 2010-04-02 18:00:05.109471540 -0500
75 +++ liboil-0.3.16/m4/as-host-defines.m4 2010-04-02 17:55:02.467785745 -0500
76 @@ -10,22 +10,38 @@ dnl AS_HOST_DEFINES()
78 AC_DEFUN([AS_HOST_DEFINES],
80 - case "x${host_cpu}" in
81 - xi?86 | k?)
82 - HAVE_I386=yes
83 - AC_DEFINE(HAVE_I386, 1, [Defined if host is i386])
84 - ;;
85 - xx86_64|xamd64)
86 - HAVE_AMD64=yes
87 - AC_DEFINE(HAVE_AMD64, 1, [Defined if host is amd64])
88 - ;;
89 - xpowerpc|xppc|xpowerpc64|xppc64)
90 - HAVE_POWERPC=yes
91 - AC_DEFINE(HAVE_POWERPC, 1, [Defined if host is powerpc])
92 - ;;
93 - xarm)
94 - HAVE_ARM=yes
95 - AC_DEFINE(HAVE_ARM, 1, [Defined if host is arm])
96 + case $host_os in
97 + solaris*)
98 + AC_CHECK_DECL([__amd64], [AMD64_ABI="yes"], [AMD64_ABI="no"])
99 + AC_CHECK_DECL([__i386], [I386_ABI="yes"], [I386_ABI="no"])
100 + if test "x$I386_ABI" = "xyes" ; then
101 + HAVE_I386=yes
102 + AC_DEFINE(HAVE_I386, 1, [Defined if host is i386])
103 + fi
104 + if test "x$AMD64_ABI" = "xyes" ; then
105 + HAVE_AMD64=yes
106 + AC_DEFINE(HAVE_AMD64, 1, [Defined if host is amd64])
107 + fi
108 + ;;
109 + *)
110 + case "x${host_cpu}" in
111 + xi?86 | k?)
112 + HAVE_I386=yes
113 + AC_DEFINE(HAVE_I386, 1, [Defined if host is i386])
114 + ;;
115 + xx86_64|xamd64)
116 + HAVE_AMD64=yes
117 + AC_DEFINE(HAVE_AMD64, 1, [Defined if host is amd64])
118 + ;;
119 + xpowerpc|xppc|xpowerpc64|xppc64)
120 + HAVE_POWERPC=yes
121 + AC_DEFINE(HAVE_POWERPC, 1, [Defined if host is powerpc])
122 + ;;
123 + xarm)
124 + HAVE_ARM=yes
125 + AC_DEFINE(HAVE_ARM, 1, [Defined if host is arm])
126 + ;;
127 + esac
129 esac
131 --- liboil-0.3.16/m4/as-gcc-inline-assembly.m4-orig 2010-03-30 15:11:24.758367535 -0500
132 +++ liboil-0.3.16/m4/as-gcc-inline-assembly.m4 2010-03-30 19:09:25.330976472 -0500
133 @@ -16,6 +16,7 @@ AC_DEFUN([AS_GCC_INLINE_ASSEMBLY],
134 AC_MSG_CHECKING([if compiler supports gcc-style inline assembly])
136 AC_TRY_COMPILE([], [
137 +#ifndef __SUNPRO_C
138 #ifndef __GNUC__
139 #error Not GCC
140 #endif
141 @@ -24,6 +25,7 @@ AC_DEFUN([AS_GCC_INLINE_ASSEMBLY],
142 #error GCC before 3.4 has critical bugs compiling inline assembly
143 #endif
144 #endif
145 +#endif
146 __asm__ (""::) ], [flag_ok=yes], [flag_ok=no])
148 if test "X$flag_ok" = Xyes ; then
149 @@ -58,6 +60,7 @@ AC_DEFUN([AS_GCC_INLINE_ASM_INSTRUCTION]
150 AC_MSG_CHECKING([if compiler supports '$1' asm instruction])
152 AC_TRY_COMPILE([], [
153 +#ifndef __SUNPRO_C
154 #ifndef __GNUC__
155 #error Not GCC
156 #endif
157 @@ -66,6 +69,7 @@ AC_DEFUN([AS_GCC_INLINE_ASM_INSTRUCTION]
158 #error GCC before 3.4 has critical bugs compiling inline assembly
159 #endif
160 #endif
161 +#endif
162 __asm__ ("$1"::) ], [flag_ok=yes], [flag_ok=no])
164 if test "X$flag_ok" = Xyes ; then
165 --- liboil-0.3.16/m4/as-intrinsics.m4-orig 2010-03-31 16:28:18.254915354 -0500
166 +++ liboil-0.3.16/m4/as-intrinsics.m4 2010-03-31 16:35:32.424331700 -0500
167 @@ -15,12 +15,35 @@ AC_DEFUN([AS_MMX_INTRINSICS],
169 AC_MSG_CHECKING([if compiler supports MMX intrinsics])
171 - save_CFLAGS="$CFLAGS"
172 - CFLAGS="$CFLAGS -mmmx"
173 - AC_TRY_COMPILE([#include <mmintrin.h>], [_mm_empty()], [flag_ok=yes], [flag_ok=no])
174 - CFLAGS="$save_CFLAGS"
175 + case $host_os in
176 + solaris*)
177 + dnl Note Sun Studio does not have -xarch=mmx, so only support MMX if SSE is
178 + dnl also supported.
180 + AC_CHECK_DECL([__amd64], [AMD64_ABI="yes"], [AMD64_ABI="no"])
181 + AC_CHECK_DECL([__i386], [I386_ABI="yes"], [I386_ABI="no"])
183 + flag_ok=no
184 + if test "x$AMD64_ABI" = "xyes" ; then
185 + $1="-m64"
186 + flag_ok=yes
187 + else
188 + if test "x$I386_ABI" = "xyes" ; then
189 + $1="-mmmx"
190 + flag_ok=yes
191 + fi
192 + fi
193 + ;;
194 + *)
195 + save_CFLAGS="$CFLAGS"
196 + CFLAGS="$CFLAGS -mmmx"
197 + AC_TRY_COMPILE([#include <mmintrin.h>], [_mm_empty()], [flag_ok=yes], [flag_ok=no])
198 + CFLAGS="$save_CFLAGS"
200 + $1="-mmmx"
201 + ;;
202 + esac
204 - $1="-mmmx"
205 if test "X$flag_ok" = Xyes ; then
207 true
208 @@ -41,18 +64,38 @@ AC_DEFUN([AS_SSE_INTRINSICS],
210 AC_MSG_CHECKING([if compiler supports SSE intrinsics])
212 - save_CFLAGS="$CFLAGS"
213 - CFLAGS="$CFLAGS -msse"
214 - AC_TRY_COMPILE([#include <xmmintrin.h>], [
215 + case $host_os in
216 + solaris*)
217 + AC_CHECK_DECL([__amd64], [AMD64_ABI="yes"], [AMD64_ABI="no"])
218 + AC_CHECK_DECL([__i386], [I386_ABI="yes"], [I386_ABI="no"])
220 + flag_ok=no
221 + if test "x$AMD64_ABI" = "xyes" ; then
222 + $1="-m64"
223 + flag_ok=yes
224 + else
225 + if test "x$I386_ABI" = "xyes" ; then
226 + $1="-msse"
227 + flag_ok=yes
228 + fi
229 + fi
230 + ;;
231 + *)
232 + save_CFLAGS="$CFLAGS"
233 + CFLAGS="$CFLAGS -msse"
234 + AC_TRY_COMPILE([#include <xmmintrin.h>], [
235 #ifdef __GNUC_MINOR__
236 #if (__GNUC__ * 1000 + __GNUC_MINOR__) < 4002
237 #error GCC before 4.2 has critical bugs compiling SSE intrinsics
238 #endif
239 #endif
240 __m128 a; a = _mm_or_ps(a,a)], [flag_ok=yes], [flag_ok=no])
241 - CFLAGS="$save_CFLAGS"
242 + CFLAGS="$save_CFLAGS"
244 + $1="-msse"
245 + ;;
246 + esac
248 - $1="-msse"
249 if test "X$flag_ok" = Xyes ; then
251 true
252 @@ -73,18 +116,39 @@ AC_DEFUN([AS_SSE2_INTRINSICS],
254 AC_MSG_CHECKING([if compiler supports SSE2 intrinsics])
256 - save_CFLAGS="$CFLAGS"
257 - CFLAGS="$CFLAGS -msse2"
258 - AC_TRY_COMPILE([#include <emmintrin.h>], [
259 + case $host_os in
260 + solaris*)
261 + AC_CHECK_DECL([__amd64], [AMD64_ABI="yes"], [AMD64_ABI="no"])
262 + AC_CHECK_DECL([__i386], [I386_ABI="yes"], [I386_ABI="no"])
264 + flag_ok=no
265 + if test "x$AMD64_ABI" = "xyes" ; then
266 + $1="-m64"
267 + flag_ok=yes
268 + else
269 + if test "x$I386_ABI" = "xyes" ; then
270 + $1="-msse2"
271 + flag_ok=yes
272 + fi
273 + fi
274 + ;;
276 + *)
277 + save_CFLAGS="$CFLAGS"
278 + CFLAGS="$CFLAGS -msse2"
279 + AC_TRY_COMPILE([#include <emmintrin.h>], [
280 #ifdef __GNUC_MINOR__
281 #if (__GNUC__ * 1000 + __GNUC_MINOR__) < 4002
282 #error GCC before 4.2 has critical bugs compiling SSE2 intrinsics
283 #endif
284 #endif
285 __m128i a; a = _mm_setzero_si128(); a = _mm_srli_epi16(a,8)], [flag_ok=yes], [flag_ok=no])
286 - CFLAGS="$save_CFLAGS"
287 + CFLAGS="$save_CFLAGS"
289 + $1="-msse2"
290 + ;;
291 + esac
293 - $1="-msse2"
294 if test "X$flag_ok" = Xyes ; then
296 true
297 @@ -105,18 +169,38 @@ AC_DEFUN([AS_SSE3_INTRINSICS],
299 AC_MSG_CHECKING([if compiler supports SSE3 intrinsics])
301 - save_CFLAGS="$CFLAGS"
302 - CFLAGS="$CFLAGS -msse3"
303 - AC_TRY_COMPILE([#include <pmmintrin.h>], [
304 + case $host_os in
305 + solaris*)
306 + AC_CHECK_DECL([__amd64], [AMD64_ABI="yes"], [AMD64_ABI="no"])
307 + AC_CHECK_DECL([__i386], [I386_ABI="yes"], [I386_ABI="no"])
309 + flag_ok=no
310 + if test "x$AMD64_ABI" = "xyes" ; then
311 + $1="-m64"
312 + flag_ok=yes
313 + else
314 + if test "x$I386_ABI" = "xyes" ; then
315 + $1="-msse3"
316 + flag_ok=yes
317 + fi
318 + fi
319 + ;;
320 + *)
321 + save_CFLAGS="$CFLAGS"
322 + CFLAGS="$CFLAGS -msse3"
323 + AC_TRY_COMPILE([#include <pmmintrin.h>], [
324 #ifdef __GNUC_MINOR__
325 #if (__GNUC__ * 1000 + __GNUC_MINOR__) < 4002
326 #error GCC before 4.2 has critical bugs compiling SSE2 intrinsics
327 #endif
328 #endif
329 __m128 a; a = _mm_addsub_ps(a,a)], [flag_ok=yes], [flag_ok=no])
330 - CFLAGS="$save_CFLAGS"
331 + CFLAGS="$save_CFLAGS"
333 + $1="-msse3"
334 + ;;
335 + esac
337 - $1="-msse3"
338 if test "X$flag_ok" = Xyes ; then
340 true
341 @@ -137,12 +221,26 @@ AC_DEFUN([AS_3DNOW_INTRINSICS],
343 AC_MSG_CHECKING([if compiler supports 3DNOW intrinsics])
345 - save_CFLAGS="$CFLAGS"
346 - CFLAGS="$CFLAGS -m3dnow"
347 - AC_TRY_COMPILE([#include <mm3dnow.h>], [_m_femms()], [flag_ok=yes], [flag_ok=no])
348 - CFLAGS="$save_CFLAGS"
349 + case $host_os in
350 + solaris*)
351 + AC_CHECK_DECL([__amd64], [AMD64_ABI="yes"], [AMD64_ABI="no"])
352 + AC_CHECK_DECL([__i386], [I386_ABI="yes"], [I386_ABI="no"])
354 + flag_ok=no
355 + if test "x$AMD64_ABI" = "xyes" ; then
356 + $1="-m64"
357 + fi
358 + ;;
359 + *)
360 + save_CFLAGS="$CFLAGS"
361 + CFLAGS="$CFLAGS -m3dnow"
362 + AC_TRY_COMPILE([#include <mm3dnow.h>], [_m_femms()], [flag_ok=yes], [flag_ok=no])
363 + CFLAGS="$save_CFLAGS"
365 + $1="-m3dnow"
366 + ;;
367 + esac
369 - $1="-m3dnow"
370 if test "X$flag_ok" = Xyes ; then
372 true
373 @@ -163,12 +261,26 @@ AC_DEFUN([AS_3DNOWEXT_INTRINSICS],
375 AC_MSG_CHECKING([if compiler supports 3DNOWEXT intrinsics])
377 - save_CFLAGS="$CFLAGS"
378 - CFLAGS="$CFLAGS -m3dnow -march=athlon"
379 - AC_TRY_COMPILE([#include <mm3dnow.h>], [__m64 a;a=_m_pf2iw(a)], [flag_ok=yes], [flag_ok=no])
380 - CFLAGS="$save_CFLAGS"
381 + case $host_os in
382 + solaris*)
383 + AC_CHECK_DECL([__amd64], [AMD64_ABI="yes"], [AMD64_ABI="no"])
384 + AC_CHECK_DECL([__i386], [I386_ABI="yes"], [I386_ABI="no"])
386 + if test "x$AMD64_ABI" = "xyes" ; then
387 + $1="-m64"
388 + flag_ok=yes
389 + fi
390 + ;;
391 + *)
392 + save_CFLAGS="$CFLAGS"
393 + CFLAGS="$CFLAGS -m3dnow -march=athlon"
394 + AC_TRY_COMPILE([#include <mm3dnow.h>], [__m64 a;a=_m_pf2iw(a)], [flag_ok=yes], [flag_ok=no])
395 + CFLAGS="$save_CFLAGS"
397 + $1="-m3dnow -march=athlon"
398 + ;;
399 + esac
401 - $1="-m3dnow -march=athlon"
402 if test "X$flag_ok" = Xyes ; then
404 true
405 @@ -189,12 +301,21 @@ AC_DEFUN([AS_ALTIVEC_INTRINSICS],
407 AC_MSG_CHECKING([if compiler supports ALTIVEC intrinsics])
409 - save_CFLAGS="$CFLAGS"
410 - CFLAGS="$CFLAGS -maltivec"
411 - AC_TRY_COMPILE([#include <altivec.h>], [__vector a; a = vec_or(a,a)], [flag_ok=yes], [flag_ok=no])
412 - CFLAGS="$save_CFLAGS"
413 + case $host_os in
414 + solaris*)
415 + flag_ok=no
416 + $1=""
417 + ;;
418 + *)
419 + save_CFLAGS="$CFLAGS"
420 + CFLAGS="$CFLAGS -maltivec"
421 + AC_TRY_COMPILE([#include <altivec.h>], [__vector a; a = vec_or(a,a)], [flag_ok=yes], [flag_ok=no])
422 + CFLAGS="$save_CFLAGS"
424 + $1="-maltivec"
425 + ;;
426 + esac
428 - $1="-maltivec"
429 if test "X$flag_ok" = Xyes ; then
431 true
432 --- liboil-0.3.16/liboil/i386_amd64/multiply_and_acc.c-orig 2010-03-31 16:40:26.975957343 -0500
433 +++ liboil-0.3.16/liboil/i386_amd64/multiply_and_acc.c 2010-03-31 16:46:04.547795614 -0500
434 @@ -29,7 +29,7 @@ multiply_and_acc_6xn_s16_u8_mmx (int16_t
435 " jnz 1b\n"
436 " emms\n"
437 : "+r" (i1), "+r" (s1), "+r" (s2), "+m" (n)
438 -#ifdef __i386__
439 +#if defined(__i386__) || defined(__i386)
440 : "m" (is1), "m" (ss1), "m" (ss2)
441 #else
442 : "r" ((long)is1), "r" ((long)ss1), "r" ((long)ss2)
443 @@ -65,7 +65,7 @@ multiply_and_acc_8xn_s16_u8_mmx (int16_t
444 " jnz 1b\n"
445 " emms\n"
446 : "+r" (i1), "+r" (s1), "+r" (s2), "+m" (n)
447 -#ifdef __i386__
448 +#if defined(__i386__) || defined(__i386)
449 : "m" (is1), "m" (ss1), "m" (ss2)
450 #else
451 : "r" ((long)is1), "r" ((long)ss1), "r" ((long)ss2)
452 @@ -111,7 +111,7 @@ multiply_and_acc_16xn_s16_u8_mmx (int16_
453 " jnz 1b\n"
454 " emms\n"
455 : "+r" (i1), "+r" (s1), "+r" (s2), "+m" (n)
456 -#ifdef __i386__
457 +#if defined(__i386__) || defined(__i386)
458 : "m" (is1), "m" (ss1), "m" (ss2)
459 #else
460 : "r" ((long)is1), "r" ((long)ss1), "r" ((long)ss2)
461 @@ -167,7 +167,7 @@ multiply_and_acc_24xn_s16_u8_mmx (int16_
462 " jnz 1b\n"
463 " emms\n"
464 : "+r" (i1), "+r" (s1), "+r" (s2), "+m" (n)
465 -#ifdef __i386__
466 +#if defined(__i386__) || defined(__i386)
467 : "m" (is1), "m" (ss1), "m" (ss2)
468 #else
469 : "r" ((long)is1), "r" ((long)ss1), "r" ((long)ss2)
470 --- liboil-0.3.16/liboil/i386_amd64/copy.c-orig 2010-03-31 16:39:11.299623785 -0500
471 +++ liboil-0.3.16/liboil/i386_amd64/copy.c 2010-03-31 16:40:06.764215022 -0500
472 @@ -327,7 +327,7 @@ static void splat_u8_ns_mmx2a (uint8_t *
473 " punpcklbw %%mm0, %%mm0\n"
474 " movq %%mm0, (%0)\n"
475 " movq %%mm0, 8(%0)\n"
476 -#ifdef __i386__
477 +#if defined(__i386__) || defined(__i386)
478 " mov %1, %[tmp]\n"
479 #elif defined(__amd64__)
480 /* ugh this is gross */
481 --- liboil-0.3.16/liboil/fb/fbmmx.c-orig 2010-03-30 14:54:10.754703273 -0500
482 +++ liboil-0.3.16/liboil/fb/fbmmx.c 2010-03-30 14:54:18.144142149 -0500
483 @@ -662,10 +662,15 @@ void fbComposeSetupMMX(void)
485 /* ------------------ MMX code paths called from fbpict.c ----------------------- */
487 +#if defined(__SUNPRO_C)
488 +typedef __m64 m64_ull;
489 +typedef m64_ull mmxdatafield;
490 +#else
491 typedef union {
492 __m64 m64;
493 uint64_t ull;
494 } m64_ull;
495 +#endif
497 typedef struct
499 @@ -688,6 +693,23 @@ typedef struct
501 static const MMXData c =
503 +#if defined(__SUNPRO_C)
504 + .mmx_4x00ff = 0x00ff00ff00ff00ffULL,
505 + .mmx_4x0080 = 0x0080008000800080ULL,
506 + .mmx_565_rgb = 0x000001f0003f001fULL,
507 + .mmx_565_r = 0x000000f800000000ULL,
508 + .mmx_565_g = 0x0000000000fc0000ULL,
509 + .mmx_565_b = 0x00000000000000f8ULL,
510 + .mmx_mask_0 = 0xffffffffffff0000ULL,
511 + .mmx_mask_1 = 0xffffffff0000ffffULL,
512 + .mmx_mask_2 = 0xffff0000ffffffffULL,
513 + .mmx_mask_3 = 0x0000ffffffffffffULL,
514 + .mmx_full_alpha = 0x00ff000000000000ULL,
515 + .mmx_565_unpack_multiplier = 0x0000008404100840ULL,
516 + .mmx_ffff0000ffff0000 = 0xffff0000ffff0000ULL,
517 + .mmx_0000ffff00000000 = 0x0000ffff00000000ULL,
518 + .mmx_000000000000ffff = 0x000000000000ffffULL,
519 +#else
520 .mmx_4x00ff.ull = 0x00ff00ff00ff00ffULL,
521 .mmx_4x0080.ull = 0x0080008000800080ULL,
522 .mmx_565_rgb.ull = 0x000001f0003f001fULL,
523 @@ -703,9 +725,16 @@ static const MMXData c =
524 .mmx_ffff0000ffff0000.ull = 0xffff0000ffff0000ULL,
525 .mmx_0000ffff00000000.ull = 0x0000ffff00000000ULL,
526 .mmx_000000000000ffff.ull = 0x000000000000ffffULL,
527 +#endif
530 +#if defined(__GNUC__)
531 #define MC(x) ((__m64) c.mmx_##x.m64)
532 +#elif defined(__SUNPRO_C)
533 +#define MC(x) c.mmx_##x
534 +#else
535 +#error "Unsupported compiler."
536 +#endif
538 static __inline__ __m64
539 shift (__m64 v, int s)
540 --- liboil-0.3.16/liboil/liboiltest.c-orig 2010-04-05 22:31:02.739988219 -0500
541 +++ liboil-0.3.16/liboil/liboiltest.c 2010-04-05 22:35:47.292816790 -0500
542 @@ -327,6 +327,10 @@ check_guard (uint8_t *data, int n, int g
543 return 1;
546 +#if defined(__SUNPRO_C)
547 +#define LCAST(d) ((unsigned long long *) &d)[0]
548 +#endif
551 * oil_test_check_impl:
552 * @test: the OilTest
553 @@ -396,7 +400,11 @@ oil_test_check_impl (OilTest *test, OilF
557 +#if defined(__SUNPRO_C)
558 + OIL_DEBUG("sum of absolute differences %g for %d values", LCAST(x), n);
559 +#else
560 OIL_DEBUG("sum of absolute differences %g for %d values", x, n);
561 +#endif
562 test->sum_abs_diff = x;
563 test->n_points = n;
565 --- /dev/null 2010-03-31 17:48:49.000000000 -0500
566 +++ liboil-0.3.16/liboil/solaris-hwcap.mapfile 2010-03-31 17:52:00.993460669 -0500
567 @@ -0,0 +1,5 @@
568 +# Override the linker's detection of CMOV/MMX/SSE instructions so this
569 +# library isn't flagged as only usable on CPU's with those ISA's, since it
570 +# checks at runtime for availability before calling them
572 +hwcap_1 = V0x0 FPU OVERRIDE;