summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Schleef <ds@schleef.org>2005-01-09 08:01:33 +0000
committerDavid Schleef <ds@schleef.org>2005-01-09 08:01:33 +0000
commit6b1e627cc201af35777c721a857c8dcfe44919bb (patch)
treeaa47e358da71d710c11637b0eb313c2f634b8143
parent4d44fde5765f6ad78053a29a1f514b2077cfd60a (diff)
downloadliboil-6b1e627cc201af35777c721a857c8dcfe44919bb.tar.gz
* examples/md5/md5sum.c: Don't use MAP_POPULATE if it's not
defined. * liboil/dct/fdct8x8_f64.c: Fix pointer offsets * liboil/dct/fdct8x8s_s16.c: (fdct8x8s_s16_ref): same * liboil/simdpack/clip_s32.c: (clip_s32_fast): same * liboil/simdpack/sad8x8.c: (sad8x8_f64_ref), (sad8x8_s16_ref): same * testsuite/introspect.c: (xstrndup), (parse_string): add xstrndup() * liboil/liboiltest.c: (check_array): Solaris chokes on INFINITY.
-rw-r--r--ChangeLog11
-rw-r--r--examples/md5/md5sum.c4
-rw-r--r--liboil/dct/fdct8x8_f64.c1
-rw-r--r--liboil/dct/fdct8x8s_s16.c2
-rw-r--r--liboil/liboiltest.c2
-rw-r--r--liboil/simdpack/clip_s32.c4
-rw-r--r--liboil/simdpack/sad8x8.c8
-rw-r--r--testsuite/introspect.c17
8 files changed, 39 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index af63a24..c253b27 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2005-01-08 David Schleef <ds@schleef.org>
+
+ * examples/md5/md5sum.c: Don't use MAP_POPULATE if it's not
+ defined.
+ * liboil/dct/fdct8x8_f64.c: Fix pointer offsets
+ * liboil/dct/fdct8x8s_s16.c: (fdct8x8s_s16_ref): same
+ * liboil/simdpack/clip_s32.c: (clip_s32_fast): same
+ * liboil/simdpack/sad8x8.c: (sad8x8_f64_ref), (sad8x8_s16_ref): same
+ * testsuite/introspect.c: (xstrndup), (parse_string): add xstrndup()
+ * liboil/liboiltest.c: (check_array): Solaris chokes on INFINITY.
+
2005-01-07 David Schleef <ds@schleef.org>
* README: add some stuff to read
diff --git a/examples/md5/md5sum.c b/examples/md5/md5sum.c
index c290001..db37330 100644
--- a/examples/md5/md5sum.c
+++ b/examples/md5/md5sum.c
@@ -45,6 +45,10 @@
#include <fcntl.h>
#include <unistd.h>
+#ifndef MAP_POPULATE
+#define MAP_POPULATE 0
+#endif
+
#ifdef WORDS_BIGENDIAN
#define uint32_from_host(a) \
((((a)&0xff)<<24)|(((a)&0xff00)<<8)|(((a)&0xff0000)>>8)|(((a)>>24)&0xff))
diff --git a/liboil/dct/fdct8x8_f64.c b/liboil/dct/fdct8x8_f64.c
index 2a9d233..0e7c09f 100644
--- a/liboil/dct/fdct8x8_f64.c
+++ b/liboil/dct/fdct8x8_f64.c
@@ -126,7 +126,6 @@ fdct8x8_f64_ref2(double *dest, int dstr, double *src, int sstr)
OIL_DEFINE_IMPL (fdct8x8_f64_ref2, fdct8x8_f64);
-
static void
fdct8x8_f64_1d (double *dest, int dstr, double *src, int sstr)
{
diff --git a/liboil/dct/fdct8x8s_s16.c b/liboil/dct/fdct8x8s_s16.c
index 327292b..cc6bb54 100644
--- a/liboil/dct/fdct8x8s_s16.c
+++ b/liboil/dct/fdct8x8s_s16.c
@@ -69,7 +69,7 @@ fdct8x8s_s16_ref (int16_t *dest, int dstr, int16_t *src, int sstr)
for(i=0;i<8;i++){
for(j=0;j<8;j++){
- s[8*i+j] = OIL_GET (src,sstr*i+j, int16_t);
+ s[8*i+j] = OIL_GET (src,sstr*i+j*sizeof(int16_t), int16_t);
}
}
diff --git a/liboil/liboiltest.c b/liboil/liboiltest.c
index 2c987b0..c77f743 100644
--- a/liboil/liboiltest.c
+++ b/liboil/liboiltest.c
@@ -496,7 +496,7 @@ check_array (void *data, void *ref, OilType type, int pre_n, int stride, int pos
break;
default:
OIL_ERROR ("should not be reached (type == %d)", type);
- return INFINITY;
+ return 1e9;
break;
}
return x;
diff --git a/liboil/simdpack/clip_s32.c b/liboil/simdpack/clip_s32.c
index 464111c..1c7b784 100644
--- a/liboil/simdpack/clip_s32.c
+++ b/liboil/simdpack/clip_s32.c
@@ -47,8 +47,8 @@ clip_s32_fast (int32_t *dest, int dstr, int32_t *src, int sstr, int n,
for(i=0;i<n;i++){
x = OIL_GET(src,i*sstr,int32_t);
- OIL_GET(dest,i*dstr,int32_t) = x - (((x-*low)>>31)&(x-*low))
- + (((*hi-x)>>31)&(*hi-x));
+ OIL_GET(dest,i*dstr,int32_t) = x - (((x-*low)>>63)&(x-*low))
+ + (((*hi-x)>>63)&(*hi-x));
}
}
diff --git a/liboil/simdpack/sad8x8.c b/liboil/simdpack/sad8x8.c
index 51d51c7..b0b8a94 100644
--- a/liboil/simdpack/sad8x8.c
+++ b/liboil/simdpack/sad8x8.c
@@ -49,8 +49,8 @@ sad8x8_f64_ref(double *dest, int dstr, double *src1, int sstr1, double *src2,
sum = 0;
for(i=0;i<8;i++){
for(j=0;j<8;j++){
- sum += fabs(OIL_GET(src1,sstr1*i+j, double) -
- OIL_GET(src2,sstr2*i+j, double));
+ sum += fabs(OIL_GET(src1,sstr1*i+j*sizeof(double), double) -
+ OIL_GET(src2,sstr2*i+j*sizeof(double), double));
}
}
*dest = sum;
@@ -69,8 +69,8 @@ sad8x8_s16_ref(uint32_t *dest, int dstr, int16_t *src1, int sstr1, int16_t *src2
sum = 0;
for(i=0;i<8;i++){
for(j=0;j<8;j++){
- d = ((int)OIL_GET(src1,sstr1*i+j, int16_t)) -
- ((int)OIL_GET(src2,sstr2*i+j, int16_t));
+ d = ((int)OIL_GET(src1,sstr1*i+j*sizeof(int16_t), int16_t)) -
+ ((int)OIL_GET(src2,sstr2*i+j*sizeof(int16_t), int16_t));
sum += (d<0) ? -d : d;
}
}
diff --git a/testsuite/introspect.c b/testsuite/introspect.c
index 5ea904c..1232217 100644
--- a/testsuite/introspect.c
+++ b/testsuite/introspect.c
@@ -136,6 +136,21 @@ static int parse_size (const char *s, char **endptr)
}
#endif
+char *
+xstrndup (const char *s, int n)
+{
+ char *r;
+
+ if (strlen(s) < n) {
+ n = strlen(s);
+ }
+ r = malloc(n+1);
+ memcpy(r,s,n);
+ r[n] = 0;
+
+ return r;
+}
+
static char * parse_string (const char *s, const char **endptr)
{
const char *s0;
@@ -146,7 +161,7 @@ static char * parse_string (const char *s, const char **endptr)
}
*endptr = s;
- return strndup(s0, s - s0);
+ return xstrndup(s0, s - s0);
}
void parse_prototype (const char *s)