summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Schleef <ds@schleef.org>2005-01-13 09:29:30 +0000
committerDavid Schleef <ds@schleef.org>2005-01-13 09:29:30 +0000
commit7b47b1bc65acd20b15fa7b62114024f2f6e9b652 (patch)
treeb3aaec095a4eb5a61a888662a95c2203d14dae90
parent6233c61a9d737153b32e408e91428c62fa1868e6 (diff)
downloadliboil-7b47b1bc65acd20b15fa7b62114024f2f6e9b652.tar.gz
* Makefile.am: dist autogen.sh
* README: add comments * configure.ac: bump version. Fix ordering. failing->broken * liboil.pc.in: add -lm * liboil/dct/dct36_f32.c: (dct36_f32_ref): still broken. Note to self: only add classes that _have_ a reference implementation. * liboil/dct/fdct8x8_f64.c: (fdct8x8_f64_1d): fix striding * liboil/liboilfuncs.h: parameter name change * liboil/liboilparameter.h: Add guard value. * liboil/liboiltest.c: (oil_test_check_function), (check_guard), (oil_test_check_impl), (init_parameter), (check_holes): check interstitial regions. Use a guard value instead of 0. * liboil/simdpack/abs_i386.c: (abs_u16_s16_mmx2), (abs_u16_s16_sse2): disable broken impls * liboil/simdpack/scalarmult_i386.c: (scalarmult_f32_sse): fix impl
-rw-r--r--ChangeLog19
-rw-r--r--Makefile.am2
-rw-r--r--README6
-rw-r--r--configure.ac16
-rw-r--r--liboil.pc.in2
-rw-r--r--liboil/dct/dct36_f32.c2
-rw-r--r--liboil/dct/fdct8x8_f64.c2
-rw-r--r--liboil/liboilfuncs.h2
-rw-r--r--liboil/liboilparameter.h1
-rw-r--r--liboil/liboiltest.c54
-rw-r--r--liboil/simdpack/abs_i386.c6
-rw-r--r--liboil/simdpack/scalarmult_i386.c6
12 files changed, 91 insertions, 27 deletions
diff --git a/ChangeLog b/ChangeLog
index 23152b5..f19a2c9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+2005-01-13 David Schleef <ds@schleef.org>
+
+ * Makefile.am: dist autogen.sh
+ * README: add comments
+ * configure.ac: bump version. Fix ordering. failing->broken
+ * liboil.pc.in: add -lm
+ * liboil/dct/dct36_f32.c: (dct36_f32_ref): still broken. Note to
+ self: only add classes that _have_ a reference implementation.
+ * liboil/dct/fdct8x8_f64.c: (fdct8x8_f64_1d): fix striding
+ * liboil/liboilfuncs.h: parameter name change
+ * liboil/liboilparameter.h: Add guard value.
+ * liboil/liboiltest.c: (oil_test_check_function), (check_guard),
+ (oil_test_check_impl), (init_parameter), (check_holes): check
+ interstitial regions. Use a guard value instead of 0.
+ * liboil/simdpack/abs_i386.c: (abs_u16_s16_mmx2),
+ (abs_u16_s16_sse2): disable broken impls
+ * liboil/simdpack/scalarmult_i386.c: (scalarmult_f32_sse): fix
+ impl
+
2005-01-11 David Schleef <ds@schleef.org>
* README: additional notes
diff --git a/Makefile.am b/Makefile.am
index 136351a..7c59013 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,7 +1,7 @@
SUBDIRS = liboil testsuite examples
-EXTRA_DIST = COPYING
+EXTRA_DIST = COPYING autogen.sh
pkgconfig_DATA = liboil-$(LIBOIL_MAJORMINOR).pc
diff --git a/README b/README
index eb7445f..ec33f8e 100644
--- a/README
+++ b/README
@@ -72,4 +72,10 @@ Random Ideas
Why is trans8x8_f64 so slow on powerpc (compared to trans8x8_u16)?
+oil_restride_XXX() - copy with stride
+oil_scaleconv_s16_f32() - multiply by constant and convert
+oil_scaleclipconv_s16_f32() - multiply by constant, clip, and convert
+oil_splat_XXX()
+
+
diff --git a/configure.ac b/configure.ac
index ebdfc8a..6b358fd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
AC_PREREQ([2.58])
-AC_INIT(liboil,0.2.2.1)
+AC_INIT(liboil,0.3.0)
nano=$(echo $VERSION | sed 's/[0-9]\.[0-9]\.[0-9]\.*//')
if test x"$nano" = x1 ; then
@@ -8,8 +8,8 @@ else
LIBOIL_CVS="no"
fi
-AM_INIT_AUTOMAKE(1.6)
AC_CANONICAL_TARGET([])
+AM_INIT_AUTOMAKE(1.6)
AM_MAINTAINER_MODE
LIBOIL_MAJORMINOR=0.3
@@ -28,7 +28,7 @@ AM_PROG_LIBTOOL
AC_CONFIG_SRCDIR([liboil/liboil.h])
-ACLOCAL_AMFLAGS="-I m4 $ACLOCAL_FLAGS"
+ACLOCAL_AMFLAGS="-I m4 $ACLOCAL_AMFLAGS"
AC_SUBST(ACLOCAL_AMFLAGS)
PKG_CHECK_MODULES(GLIB, glib-2.0, HAVE_GLIB=yes, HAVE_GLIB=no)
@@ -57,11 +57,11 @@ AM_CONDITIONAL(USE_ALT_OPT, test "x$enable_alt_opt" = xyes)
LIBOIL_OPT_CFLAGS="-O3 -fomit-frame-pointer -funroll-all-loops -Wno-unused-function -D'OIL_OPT_MANGLE(a)=a\#\#_O3' -D'OIL_OPT_SUFFIX=\"_O3\"'"
AC_SUBST(LIBOIL_OPT_CFLAGS)
-AC_ARG_ENABLE(failing-implementations,
- AC_HELP_STRING([--enable-failing-implementations],[compile with failing implementations]),
- enable_failing_implementations=$enableval,enable_failing_implementations=no)
-if test "x$enable_failing_implementations" = xyes ; then
- AC_DEFINE(USE_FAILING_IMPLS, 1, [Define if compiling failing implementations])
+AC_ARG_ENABLE(broken-implementations,
+ AC_HELP_STRING([--enable-broken-implementations],[compile with broken implementations]),
+ enable_broken_implementations=$enableval,enable_broken_implementations=no)
+if test "x$enable_broken_implementations" = xyes ; then
+ AC_DEFINE(ENABLE_BROKEN_IMPLS, 1, [Define if compiling broken implementations])
fi
dnl Set up conditionals for (target) architecture:
diff --git a/liboil.pc.in b/liboil.pc.in
index 1c8e904..ce115eb 100644
--- a/liboil.pc.in
+++ b/liboil.pc.in
@@ -8,7 +8,7 @@ toolsdir=${exec_prefix}/bin
Name: liboil-@LIBOIL_MAJORMINOR@
Description: Libaray of Optimized Inner Loops
Version: @VERSION@
-Libs: -L${libdir} -loil-@LIBOIL_MAJORMINOR@
+Libs: -L${libdir} -loil-@LIBOIL_MAJORMINOR@ -lm
Cflags: -I${includedir}
diff --git a/liboil/dct/dct36_f32.c b/liboil/dct/dct36_f32.c
index c29fb30..f1315c7 100644
--- a/liboil/dct/dct36_f32.c
+++ b/liboil/dct/dct36_f32.c
@@ -37,10 +37,12 @@ OIL_DEFINE_CLASS(dct36_f32, "float *d_36, int dstr, float *s_36, int sstr");
static void
dct36_f32_ref(float *dest, int dstr, float *src, int sstr)
{
+#if 0
int i;
for(i=0;i<36;i++){
dest[i] = src[i];
}
+#endif
}
OIL_DEFINE_IMPL_REF (dct36_f32_ref, dct36_f32);
diff --git a/liboil/dct/fdct8x8_f64.c b/liboil/dct/fdct8x8_f64.c
index 0e7c09f..4e4938d 100644
--- a/liboil/dct/fdct8x8_f64.c
+++ b/liboil/dct/fdct8x8_f64.c
@@ -139,7 +139,7 @@ fdct8x8_f64_1d (double *dest, int dstr, double *src, int sstr)
for(i=0;i<8;i++){
oil_fdct8_f64(dest + i, tmp + i,
- 8*sizeof(double), 8*sizeof(double));
+ dstr, 8*sizeof(double));
}
}
diff --git a/liboil/liboilfuncs.h b/liboil/liboilfuncs.h
index d11cae0..5cd83ca 100644
--- a/liboil/liboilfuncs.h
+++ b/liboil/liboilfuncs.h
@@ -361,7 +361,7 @@ extern OilFunctionClass *oil_function_class_ptr_dequantize8x8_s16;
typedef void (*_oil_type_dequantize8x8_s16)(int16_t * d_8x8, int dstr, const int16_t * s1_8x8, int sstr1, const int16_t * s2_8x8, int sstr2);
#define oil_dequantize8x8_s16 ((_oil_type_dequantize8x8_s16)(*(void **)oil_function_class_ptr_dequantize8x8_s16))
extern OilFunctionClass *oil_function_class_ptr_diffsquaresum_f64;
-typedef void (*_oil_type_diffsquaresum_f64)(double * dest, const double * src1, int sstr1, const double * src2, int sstr2, int n);
+typedef void (*_oil_type_diffsquaresum_f64)(double * d_1, const double * src1, int sstr1, const double * src2, int sstr2, int n);
#define oil_diffsquaresum_f64 ((_oil_type_diffsquaresum_f64)(*(void **)oil_function_class_ptr_diffsquaresum_f64))
extern OilFunctionClass *oil_function_class_ptr_fdct8_f64;
typedef void (*_oil_type_fdct8_f64)(double * d_8, const double * s_8, int dstr, int sstr);
diff --git a/liboil/liboilparameter.h b/liboil/liboilparameter.h
index 8679cd5..f8133a7 100644
--- a/liboil/liboilparameter.h
+++ b/liboil/liboilparameter.h
@@ -104,6 +104,7 @@ struct _OilParameter {
int post_n;
int stride;
int size;
+ int guard;
};
#endif
diff --git a/liboil/liboiltest.c b/liboil/liboiltest.c
index a862d1b..0c9394c 100644
--- a/liboil/liboiltest.c
+++ b/liboil/liboiltest.c
@@ -42,6 +42,8 @@ static void fill_array (void *ptr, OilType type, int pre_n, int stride,
int post_n);
static double check_array (void *data, void *ref, OilType type, int pre_n,
int stride, int post_n);
+static int check_holes (void *data, OilType type, int pre_n,
+ int stride, int post_n, int guard);
OilTest *
oil_test_new (OilFunctionClass *klass)
@@ -156,7 +158,7 @@ oil_test_check_function (OilTest *test)
memcpy (p->test_data, p->src_data, p->size);
args[i] = (unsigned long)p->test_data + OIL_TEST_HEADER;
} else if (p->direction == 'd') {
- memset (p->test_data, 0, p->size);
+ memset (p->test_data, p->guard, p->size);
args[i] = (unsigned long)p->test_data + OIL_TEST_HEADER;
} else {
OIL_ERROR ("not reached");
@@ -204,11 +206,11 @@ oil_test_check_ref (OilTest *test)
}
static int
-check_zero (uint8_t *data, int n)
+check_guard (uint8_t *data, int n, int guard)
{
int i;
for(i=0;i<n;i++) {
- if (data[i] != 0) return 0;
+ if (data[i] != guard) return 0;
}
return 1;
}
@@ -240,20 +242,26 @@ oil_test_check_impl (OilTest *test, OilFunctionImpl *impl)
if (p->is_pointer) {
if (p->direction == 'i' || p->direction == 'd') {
- x += check_array (p->ref_data, p->test_data, p->type, p->pre_n,
+ x += check_array (p->test_data, p->ref_data, p->type, p->pre_n,
p->stride, p->post_n);
n += p->pre_n * p->post_n;
- if (!check_zero (p->test_data, OIL_TEST_HEADER)) {
+ if (!check_guard (p->test_data, OIL_TEST_HEADER, p->guard)) {
fail = 1;
OIL_ERROR("function %s wrote before area for parameter %s",
test->impl->name, p->parameter_name);
}
- if (!check_zero ((uint8_t *)p->test_data + p->size - OIL_TEST_FOOTER,
- OIL_TEST_FOOTER)) {
+ if (!check_guard ((uint8_t *)p->test_data + p->size - OIL_TEST_FOOTER,
+ OIL_TEST_FOOTER, p->guard)) {
fail = 1;
OIL_ERROR("function %s wrote after area for parameter %s",
test->impl->name, p->parameter_name);
}
+ if (!check_holes (p->test_data, p->type, p->pre_n, p->stride,
+ p->post_n, p->guard)) {
+ fail = 1;
+ OIL_ERROR("function %s wrote in interstitial area for parameter %s",
+ test->impl->name, p->parameter_name);
+ }
}
}
}
@@ -347,25 +355,26 @@ init_parameter (OilTest *test, OilParameter *p, OilParameter *ps)
}
p->size = p->stride * p->post_n + OIL_TEST_HEADER + OIL_TEST_FOOTER;
+ p->guard = oil_rand_u8();
if (p->direction == 'i' || p->direction == 's') {
if (p->src_data) free (p->src_data);
OIL_DEBUG("allocating %d bytes for src_data for %s", p->size, p->parameter_name);
p->src_data = malloc (p->size);
- memset (p->src_data, 0, p->size);
+ memset (p->src_data, p->guard, p->size);
fill_array (p->src_data + OIL_TEST_HEADER, p->type, p->pre_n, p->stride, p->post_n);
}
if (p->direction == 'i' || p->direction == 'd') {
if (p->ref_data) free (p->ref_data);
p->ref_data = malloc (p->size);
- memset (p->ref_data, 0, p->size);
+ memset (p->ref_data, p->guard, p->size);
OIL_DEBUG("allocating %d bytes for ref_data and test_data for %s", p->size, p->parameter_name);
if (p->test_data) free (p->test_data);
p->test_data = malloc (p->size);
- memset (p->test_data, 0, p->size);
+ memset (p->test_data, p->guard, p->size);
}
}
@@ -490,3 +499,28 @@ check_array (void *data, void *ref, OilType type, int pre_n, int stride, int pos
}
return x;
}
+
+static int
+check_holes (void *data, OilType type, int pre_n, int stride, int post_n,
+ int guard)
+{
+ int i;
+ int j;
+ int chunk_size;
+ int hole_size;
+
+ chunk_size = pre_n * oil_type_sizeof (type);
+ hole_size = stride - chunk_size;
+ if (hole_size == 0) {
+ return 1;
+ }
+
+ for(i=0;i<post_n;i++){
+ if (!check_guard (data + stride * i + chunk_size, hole_size, guard)) {
+ return 0;
+ }
+ }
+
+ return 1;
+}
+
diff --git a/liboil/simdpack/abs_i386.c b/liboil/simdpack/abs_i386.c
index 824c1ce..ea0a9f2 100644
--- a/liboil/simdpack/abs_i386.c
+++ b/liboil/simdpack/abs_i386.c
@@ -231,6 +231,7 @@ abs_u16_s16_mmxx (uint16_t * dest, int dstr, int16_t * src, int sstr, int n)
OIL_DEFINE_IMPL_FULL (abs_u16_s16_mmxx, abs_u16_s16, OIL_IMPL_FLAG_MMX);
#endif
+#ifdef ENABLE_BROKEN_IMPLS
static void
abs_u16_s16_mmx2 (uint16_t * dest, int dstr, int16_t * src, int sstr, int n)
{
@@ -264,9 +265,10 @@ abs_u16_s16_mmx2 (uint16_t * dest, int dstr, int16_t * src, int sstr, int n)
::"ecx", "edx");
asm volatile ("emms");
}
-
OIL_DEFINE_IMPL_FULL (abs_u16_s16_mmx2, abs_u16_s16, OIL_IMPL_FLAG_MMXEXT);
+#endif
+#ifdef ENABLE_BROKEN_IMPLS
static void
abs_u16_s16_sse2 (uint16_t * dest, int dstr, int16_t * src, int sstr, int n)
{
@@ -294,6 +296,6 @@ abs_u16_s16_sse2 (uint16_t * dest, int dstr, int16_t * src, int sstr, int n)
" popl %%ebp \n":"+D" (src), "+a" (dest), "+S" (n)
::"ecx", "edx");
}
-
OIL_DEFINE_IMPL_FULL (abs_u16_s16_sse2, abs_u16_s16, OIL_IMPL_FLAG_SSE2);
+#endif
diff --git a/liboil/simdpack/scalarmult_i386.c b/liboil/simdpack/scalarmult_i386.c
index 11d8e9a..232dc83 100644
--- a/liboil/simdpack/scalarmult_i386.c
+++ b/liboil/simdpack/scalarmult_i386.c
@@ -60,9 +60,9 @@ scalarmult_f32_sse (float *dest, int dstr, float *src, int sstr,
:
: "r" (t));
OIL_GET(dest,dstr*(i + 0), float) = t[0];
- OIL_GET(dest,dstr*(i + 0), float) = t[1];
- OIL_GET(dest,dstr*(i + 0), float) = t[2];
- OIL_GET(dest,dstr*(i + 0), float) = t[3];
+ OIL_GET(dest,dstr*(i + 1), float) = t[1];
+ OIL_GET(dest,dstr*(i + 2), float) = t[2];
+ OIL_GET(dest,dstr*(i + 3), float) = t[3];
}
}