]> git.pld-linux.org Git - packages/liboil.git/blame - liboil-fixes.patch
- disable some asm on x32
[packages/liboil.git] / liboil-fixes.patch
CommitLineData
8e954045 1--- liboil-0.3.16/liboil/powerpc/resample.c 2007-11-16 03:53:47.000000000 +0100
2+++ liboil-0.3.16.fix/liboil/powerpc/resample.c 2009-05-03 02:05:31.000000000 +0200
3@@ -86,7 +86,8 @@
4 " vpkuhus v0, v0, v0\n"
5 " stvx v0, 0, %0\n"
6 :
7- : "b" (atmp));
8+ : "b" (atmp)
9+ : "r11" );
10
11 dest[i] = atmp[0];
12 if (i+1<n) dest[i+1] = atmp[1];
651f58e5 13--- liboil-0.3.16/liboil/copy/splat_ref.c 2007-11-16 03:53:47.000000000 +0100
14+++ liboil-0.3.16.fix/liboil/copy/splat_ref.c 2009-05-03 03:37:00.000000000 +0200
15@@ -101,18 +101,40 @@
16 #ifdef HAVE_UNALIGNED_ACCESS
17 static void splat_u8_ns_int (uint8_t *dest, const uint8_t *param, int n)
18 {
19- int p;
20- while(n&3) {
21- *dest = *param;
22- dest++;
23- n--;
24+ int i;
25+ uint32_t p, *dest32;
26+ size_t diff;
27+
28+ if(n<4) {
29+ for ( i=0; i<n; i++) {
30+ dest[i] = *param;
31+ }
32+ return;
33 }
34- n >>= 2;
35+
36 p = (*param<<24) | (*param<<16) | (*param<<8) | (*param);
37- while(n>0){
38- *(uint32_t *)dest = p;
39- dest+=4;
40- n--;
41+
42+ dest32 = (void *)dest;
43+ dest32[0] = p; /* may be unaligned */
44+
45+ /* align */
46+ dest32 += 1;
47+ dest32 = (void *)( ((uintptr_t)dest32) & (~3) );
48+ diff = (void *)dest32 - (void *)dest;
49+
50+ n -= diff;
51+ diff = n & 3;
52+ n >>= 2;
53+ /* aligned copy */
54+ for( i=0; i<n; i++) {
55+ dest32[i] = p;
56+ }
57+ dest32 += n;
58+
59+ /* unaligned */
60+ if ( diff ) {
61+ dest32 = (void *) ((uintptr_t)dest32 + diff - 4);
62+ dest32[0] = p;
63 }
64 }
65 OIL_DEFINE_IMPL(splat_u8_ns_int, splat_u8_ns);
This page took 0.127286 seconds and 4 git commands to generate.