summaryrefslogtreecommitdiff
path: root/liboil
diff options
context:
space:
mode:
authorDavid Schleef <ds@schleef.org>2005-08-03 00:00:27 +0000
committerDavid Schleef <ds@schleef.org>2005-08-03 00:00:27 +0000
commit8e630a5dfd9e57732fa1c09772846a3fcdf0adf5 (patch)
tree73bc6ffd658727d488c3e1388dca03e28b690cc8 /liboil
parent96ef0ef7b1eaef65f147ec423139bd2568b735a2 (diff)
downloadliboil-8e630a5dfd9e57732fa1c09772846a3fcdf0adf5.tar.gz
* liboil/Makefile.am: add libcolorspace.h
* liboil/build_marshal.c: (main): use oil_init_no_optimize() to save us from horrible build problems (like what happened today) * liboil/build_prototypes.c: (main): same * liboil/build_prototypes_doc.c: (main): same * liboil/liboilfunction.h: same * liboil/liboilfunction.c: (oil_init_no_optimize): same * liboil/liboilmarshal.c: (_oil_test_marshal_function): some new marshal cases needed by wim's code. * liboil/null.c: (null_mmx): add mmx impl * liboil/colorspace/argb_paint.c: prototype fixes * liboil/colorspace/ayuv2argb.c: * liboil/colorspace/composite.c: * liboil/colorspace/rgb2bgr.c: * liboil/colorspace/rgb2rgba.c: * liboil/fb/Makefile.am: add headers * liboil/fb/fbmmx.c: hacking * liboil/liboilfuncs.h: update
Diffstat (limited to 'liboil')
-rw-r--r--liboil/Makefile.am1
-rw-r--r--liboil/build_marshal.c2
-rw-r--r--liboil/build_prototypes.c2
-rw-r--r--liboil/build_prototypes_doc.c2
-rw-r--r--liboil/colorspace/argb_paint.c2
-rw-r--r--liboil/colorspace/ayuv2argb.c4
-rw-r--r--liboil/colorspace/composite.c56
-rw-r--r--liboil/colorspace/rgb2bgr.c2
-rw-r--r--liboil/colorspace/rgb2rgba.c2
-rw-r--r--liboil/fb/Makefile.am4
-rw-r--r--liboil/fb/fbmmx.c520
-rw-r--r--liboil/liboilfuncs.h48
-rw-r--r--liboil/liboilfunction.c27
-rw-r--r--liboil/liboilfunction.h1
-rw-r--r--liboil/liboilmarshal.c42
-rw-r--r--liboil/null.c11
16 files changed, 393 insertions, 333 deletions
diff --git a/liboil/Makefile.am b/liboil/Makefile.am
index 17a9de1..e13e153 100644
--- a/liboil/Makefile.am
+++ b/liboil/Makefile.am
@@ -52,6 +52,7 @@ liboil_@LIBOIL_MAJORMINOR@_la_SOURCES = \
liboilfunction.h \
liboilprofile.h \
liboiltypes.h \
+ liboilcolorspace.h \
liboilfunction.c \
liboildebug.c \
liboilcpu.c \
diff --git a/liboil/build_marshal.c b/liboil/build_marshal.c
index 7405b8d..3e425b5 100644
--- a/liboil/build_marshal.c
+++ b/liboil/build_marshal.c
@@ -51,7 +51,7 @@ int main (int argc, char *argv[])
int n;
unsigned int pointer_mask;
- oil_init ();
+ oil_init_no_optimize ();
print_header ();
diff --git a/liboil/build_prototypes.c b/liboil/build_prototypes.c
index 63e5187..d306d98 100644
--- a/liboil/build_prototypes.c
+++ b/liboil/build_prototypes.c
@@ -45,7 +45,7 @@ int main (int argc, char *argv[])
int n;
char *string;
- oil_init ();
+ oil_init_no_optimize ();
print_header ();
diff --git a/liboil/build_prototypes_doc.c b/liboil/build_prototypes_doc.c
index 75c389c..aa38af7 100644
--- a/liboil/build_prototypes_doc.c
+++ b/liboil/build_prototypes_doc.c
@@ -45,7 +45,7 @@ int main (int argc, char *argv[])
int n;
char *string;
- oil_init ();
+ oil_init_no_optimize ();
print_header ();
diff --git a/liboil/colorspace/argb_paint.c b/liboil/colorspace/argb_paint.c
index 8a19f75..8227b11 100644
--- a/liboil/colorspace/argb_paint.c
+++ b/liboil/colorspace/argb_paint.c
@@ -39,7 +39,7 @@ OIL_DEFINE_CLASS (argb_paint_u8, "uint8_t *i_4xn, uint8_t *s1_4, uint8_t *s2_n,
#define blend(x,y,a) div255((x)*(a) + (y)*(255-(a)))
static void
-argb_paint_u8_ref (uint8_t *dest, uint8_t *color, uint8_t *alpha, int n)
+argb_paint_u8_ref (uint8_t *dest, const uint8_t *color, const uint8_t *alpha, int n)
{
int i;
diff --git a/liboil/colorspace/ayuv2argb.c b/liboil/colorspace/ayuv2argb.c
index 6b8b8e8..639b4fd 100644
--- a/liboil/colorspace/ayuv2argb.c
+++ b/liboil/colorspace/ayuv2argb.c
@@ -49,7 +49,7 @@ OIL_DEFINE_CLASS (ayuv2argb_u8, "uint8_t *d_4xn, uint8_t *s_4xn, int n");
static void
-ayuv2argb_u8_ref (uint8_t *argb, uint8_t *ayuv, int n)
+ayuv2argb_u8_ref (uint8_t *argb, const uint8_t *ayuv, int n)
{
int i;
@@ -66,7 +66,7 @@ ayuv2argb_u8_ref (uint8_t *argb, uint8_t *ayuv, int n)
OIL_DEFINE_IMPL_REF (ayuv2argb_u8_ref, ayuv2argb_u8);
static void
-ayuv2argb_u8_int (uint8_t *argb, uint8_t *ayuv, int n)
+ayuv2argb_u8_int (uint8_t *argb, const uint8_t *ayuv, int n)
{
int i;
diff --git a/liboil/colorspace/composite.c b/liboil/colorspace/composite.c
index 5c63c25..6d9f4ea 100644
--- a/liboil/colorspace/composite.c
+++ b/liboil/colorspace/composite.c
@@ -110,9 +110,15 @@ OIL_DEFINE_CLASS_FULL (composite_in_over_argb_const_src,
OIL_DEFINE_CLASS_FULL (composite_in_over_argb_const_mask,
"uint32_t *i_n, uint32_t *s1_n, uint8_t *s2_1, int n",
composite_test);
+OIL_DEFINE_CLASS_FULL (composite_over_u8,
+ "uint8_t *i_n, uint8_t *s1_n, int n",
+ composite_test);
+OIL_DEFINE_CLASS_FULL (composite_add_u8,
+ "uint8_t *i_n, uint8_t *s1_n, int n",
+ composite_test);
static void
-composite_in_argb_ref (uint32_t *dest, uint32_t *src, uint8_t *mask, int n)
+composite_in_argb_ref (uint32_t *dest, const uint32_t *src, const uint8_t *mask, int n)
{
int i;
@@ -127,7 +133,7 @@ composite_in_argb_ref (uint32_t *dest, uint32_t *src, uint8_t *mask, int n)
OIL_DEFINE_IMPL_REF (composite_in_argb_ref, composite_in_argb);
static void
-composite_in_argb_const_src_ref (uint32_t *dest, uint32_t *src, uint8_t *mask, int n)
+composite_in_argb_const_src_ref (uint32_t *dest, const uint32_t *src, const uint8_t *mask, int n)
{
int i;
@@ -142,7 +148,7 @@ composite_in_argb_const_src_ref (uint32_t *dest, uint32_t *src, uint8_t *mask, i
OIL_DEFINE_IMPL_REF (composite_in_argb_const_src_ref, composite_in_argb_const_src);
static void
-composite_in_argb_const_mask_ref (uint32_t *dest, uint32_t *src, uint8_t *mask, int n)
+composite_in_argb_const_mask_ref (uint32_t *dest, const uint32_t *src, const uint8_t *mask, int n)
{
int i;
@@ -157,7 +163,7 @@ composite_in_argb_const_mask_ref (uint32_t *dest, uint32_t *src, uint8_t *mask,
OIL_DEFINE_IMPL_REF (composite_in_argb_const_mask_ref, composite_in_argb_const_mask);
static void
-composite_over_argb_ref (uint32_t *dest, uint32_t *src, int n)
+composite_over_argb_ref (uint32_t *dest, const uint32_t *src, int n)
{
int i;
uint8_t a;
@@ -175,7 +181,7 @@ composite_over_argb_ref (uint32_t *dest, uint32_t *src, int n)
OIL_DEFINE_IMPL_REF (composite_over_argb_ref, composite_over_argb);
static void
-composite_over_argb_const_src_ref (uint32_t *dest, uint32_t *src, int n)
+composite_over_argb_const_src_ref (uint32_t *dest, const uint32_t *src, int n)
{
int i;
uint8_t a;
@@ -193,7 +199,7 @@ composite_over_argb_const_src_ref (uint32_t *dest, uint32_t *src, int n)
OIL_DEFINE_IMPL_REF (composite_over_argb_const_src_ref, composite_over_argb_const_src);
static void
-composite_add_argb_ref (uint32_t *dest, uint32_t *src, int n)
+composite_add_argb_ref (uint32_t *dest, const uint32_t *src, int n)
{
int i;
@@ -209,7 +215,7 @@ composite_add_argb_ref (uint32_t *dest, uint32_t *src, int n)
OIL_DEFINE_IMPL_REF (composite_add_argb_ref, composite_add_argb);
static void
-composite_add_argb_const_src_ref (uint32_t *dest, uint32_t *src, int n)
+composite_add_argb_const_src_ref (uint32_t *dest, const uint32_t *src, int n)
{
int i;
@@ -225,7 +231,7 @@ composite_add_argb_const_src_ref (uint32_t *dest, uint32_t *src, int n)
OIL_DEFINE_IMPL_REF (composite_add_argb_const_src_ref, composite_add_argb_const_src);
static void
-composite_in_over_argb_ref (uint32_t *dest, uint32_t *src, uint8_t *mask, int n)
+composite_in_over_argb_ref (uint32_t *dest, const uint32_t *src, const uint8_t *mask, int n)
{
int i;
uint8_t a;
@@ -249,7 +255,7 @@ composite_in_over_argb_ref (uint32_t *dest, uint32_t *src, uint8_t *mask, int n)
OIL_DEFINE_IMPL_REF (composite_in_over_argb_ref, composite_in_over_argb);
static void
-composite_in_over_argb_const_src_ref (uint32_t *dest, uint32_t *src, uint8_t *mask, int n)
+composite_in_over_argb_const_src_ref (uint32_t *dest, const uint32_t *src, const uint8_t *mask, int n)
{
int i;
uint8_t a;
@@ -273,7 +279,7 @@ composite_in_over_argb_const_src_ref (uint32_t *dest, uint32_t *src, uint8_t *ma
OIL_DEFINE_IMPL_REF (composite_in_over_argb_const_src_ref, composite_in_over_argb_const_src);
static void
-composite_in_over_argb_const_mask_ref (uint32_t *dest, uint32_t *src, uint8_t *mask, int n)
+composite_in_over_argb_const_mask_ref (uint32_t *dest, const uint32_t *src, const uint8_t *mask, int n)
{
int i;
uint8_t a;
@@ -296,10 +302,36 @@ composite_in_over_argb_const_mask_ref (uint32_t *dest, uint32_t *src, uint8_t *m
}
OIL_DEFINE_IMPL_REF (composite_in_over_argb_const_mask_ref, composite_in_over_argb_const_mask);
+static void
+composite_add_u8_ref (uint8_t *dest, const uint8_t *src, int n)
+{
+ int i;
+
+ for(i=0;i<n;i++){
+ dest[i] = COMPOSITE_ADD(dest[i],src[i]);
+ }
+
+}
+OIL_DEFINE_IMPL_REF (composite_add_u8_ref, composite_add_u8);
+
+static void
+composite_over_u8_ref (uint8_t *dest, const uint8_t *src, int n)
+{
+ int i;
+
+ for(i=0;i<n;i++){
+ dest[i] = COMPOSITE_OVER(dest[i],src[i],src[i]);
+ }
+
+}
+OIL_DEFINE_IMPL_REF (composite_over_u8_ref, composite_over_u8);
+
+
+
static void
-composite_over_argb_noclamp (uint32_t *dest, uint32_t *src, int n)
+composite_over_argb_noclamp (uint32_t *dest, const uint32_t *src, int n)
{
int i;
uint8_t a;
@@ -321,7 +353,7 @@ OIL_DEFINE_IMPL (composite_over_argb_noclamp, composite_over_argb);
#define COMPOSITE_OVER_2(d,s,m) ((d) + (s) - oil_muldiv_255((d),(m)))
static void
-composite_over_argb_noclamp_2 (uint32_t *dest, uint32_t *src, int n)
+composite_over_argb_noclamp_2 (uint32_t *dest, const uint32_t *src, int n)
{
int i;
uint8_t a;
diff --git a/liboil/colorspace/rgb2bgr.c b/liboil/colorspace/rgb2bgr.c
index 3035e47..699ad28 100644
--- a/liboil/colorspace/rgb2bgr.c
+++ b/liboil/colorspace/rgb2bgr.c
@@ -37,7 +37,7 @@
OIL_DEFINE_CLASS (rgb2bgr, "uint8_t *d_3xn, uint8_t* s_3xn, int n");
static void
-rgb2bgr_ref (uint8_t *dest, uint8_t* src, int n)
+rgb2bgr_ref (uint8_t *dest, const uint8_t* src, int n)
{
int i;
uint8_t tmp;
diff --git a/liboil/colorspace/rgb2rgba.c b/liboil/colorspace/rgb2rgba.c
index bcd8e98..04a5e44 100644
--- a/liboil/colorspace/rgb2rgba.c
+++ b/liboil/colorspace/rgb2rgba.c
@@ -34,7 +34,7 @@
OIL_DEFINE_CLASS (rgb2rgba, "uint8_t *d_4xn, uint8_t* s_3xn, int n");
static void
-rgb2rgba_ref (uint8_t *dest, uint8_t* src, int n)
+rgb2rgba_ref (uint8_t *dest, const uint8_t* src, int n)
{
int i;
diff --git a/liboil/fb/Makefile.am b/liboil/fb/Makefile.am
index d609417..309ad5d 100644
--- a/liboil/fb/Makefile.am
+++ b/liboil/fb/Makefile.am
@@ -21,6 +21,10 @@ c_sources = \
endif
endif
+noinst_HEADERS = \
+ fbmmx.h \
+ fbpict.h
+
libfb_la_SOURCES = $(c_sources)
libfb_la_CFLAGS = $(MMX_CFLAGS) $(SSE_CFLAGS) $(LIBOIL_CFLAGS)
diff --git a/liboil/fb/fbmmx.c b/liboil/fb/fbmmx.c
index 90f8748..773ffa3 100644
--- a/liboil/fb/fbmmx.c
+++ b/liboil/fb/fbmmx.c
@@ -39,35 +39,60 @@
#include <mmintrin.h>
#include <xmmintrin.h> /* for _mm_shuffle_pi16 and _MM_SHUFFLE */
+typedef uint32_t CARD32;
+typedef uint16_t CARD16;
+typedef int16_t INT16;
+typedef uint8_t CARD8;
+typedef uint64_t ullong;
+typedef CARD32* PicturePtr;
+typedef CARD32* FbBits;
+typedef int FbStride;
+
+
#include "fbmmx.h"
+#include "fbpict.h"
#define CHECKPOINT()
-#if 0
+OIL_DECLARE_CLASS (composite_in_argb);
+OIL_DECLARE_CLASS (composite_in_argb_const_src);
+OIL_DECLARE_CLASS (composite_in_argb_const_mask);
+OIL_DECLARE_CLASS (composite_over_argb);
+OIL_DECLARE_CLASS (composite_over_argb_const_src);
+OIL_DECLARE_CLASS (composite_add_argb);
+OIL_DECLARE_CLASS (composite_add_argb_const_src);
+OIL_DECLARE_CLASS (composite_in_over_argb);
+OIL_DECLARE_CLASS (composite_in_over_argb_const_src);
+OIL_DECLARE_CLASS (composite_in_over_argb_const_mask);
+OIL_DECLARE_CLASS (composite_over_u8);
+OIL_DECLARE_CLASS (composite_add_u8);
+
+
/* --------------- MMX code patch for fbcompose.c --------------------- */
-static FASTCALL void
-mmxCombineMaskU (CARD32 *src, const CARD32 *mask, int width)
+#if 0
+static void
+mmxCombineMaskU (uint32_t *dest, const uint32_t *src, const uint8_t *mask, int width)
{
const __m64 mmx_0 = _mm_setzero_si64();
const __m64 mmx_4x0080 = (__m64) 0x0080008000800080ULL;
- const CARD32 *end = mask + width;
+ const uint32_t *end = mask + width;
while (mask < end) {
__m64 a = MmxTo(*mask);
__m64 s = MmxTo(*src);
a = MmxAlpha(a);
MmxMul(s, a);
- *src = MmxFrom(s);
+ *dest = MmxFrom(s);
++src;
+ ++dest;
++mask;
}
_mm_empty();
}
#endif
-OIL_DECLARE_CLASS(composite_over_argb);
-
+#ifdef ENABLE_BROKEN_IMPLS
static void
mmxCombineOverU (uint32_t *dest, const uint32_t *src, int width)
{
@@ -91,6 +116,7 @@ mmxCombineOverU (uint32_t *dest, const uint32_t *src, int width)
_mm_empty();
}
OIL_DEFINE_IMPL_FULL(mmxCombineOverU, composite_over_argb, OIL_IMPL_FLAG_MMX);
+#endif
#if 0
static FASTCALL void
@@ -115,8 +141,10 @@ mmxCombineOverReverseU (CARD32 *dest, const CARD32 *src, int width)
}
_mm_empty();
}
+#endif
-static FASTCALL void
+#if 0
+static void
mmxCombineInU (CARD32 *dest, const CARD32 *src, int width)
{
const __m64 mmx_0 = _mm_setzero_si64();
@@ -136,7 +164,9 @@ mmxCombineInU (CARD32 *dest, const CARD32 *src, int width)
}
_mm_empty();
}
+#endif
+#if 0
static FASTCALL void
mmxCombineInReverseU (CARD32 *dest, const CARD32 *src, int width)
{
@@ -157,7 +187,9 @@ mmxCombineInReverseU (CARD32 *dest, const CARD32 *src, int width)
}
_mm_empty();
}
+#endif
+#if 0
static FASTCALL void
mmxCombineOutU (CARD32 *dest, const CARD32 *src, int width)
{
@@ -180,7 +212,9 @@ mmxCombineOutU (CARD32 *dest, const CARD32 *src, int width)
}
_mm_empty();
}
+#endif
+#if 0
static FASTCALL void
mmxCombineOutReverseU (CARD32 *dest, const CARD32 *src, int width)
{
@@ -278,13 +312,14 @@ mmxCombineXorU (CARD32 *dest, const CARD32 *src, int width)
}
_mm_empty();
}
+#endif
-static FASTCALL void
-mmxCombineAddU (CARD32 *dest, const CARD32 *src, int width)
+static void
+mmxCombineAddU (uint32_t *dest, const uint32_t *src, int width)
{
const __m64 mmx_0 = _mm_setzero_si64();
- const CARD32 *end = dest + width;
+ const uint32_t *end = dest + width;
while (dest < end) {
__m64 s, d;
s = MmxTo(*src);
@@ -296,7 +331,9 @@ mmxCombineAddU (CARD32 *dest, const CARD32 *src, int width)
}
_mm_empty();
}
+OIL_DEFINE_IMPL_FULL(mmxCombineAddU, composite_add_argb, OIL_IMPL_FLAG_MMX);
+#if 0
static FASTCALL void
mmxCombineSaturateU (CARD32 *dest, const CARD32 *src, int width)
{
@@ -620,10 +657,12 @@ void fbComposeSetupMMX(void)
composeFunctions.combineMaskU = mmxCombineMaskU;
}
}
+#endif
/* ------------------ MMX code paths called from fbpict.c ----------------------- */
+
typedef struct
{
ullong mmx_4x00ff;
@@ -687,7 +726,8 @@ pix_multiply (__m64 a, __m64 b)
__m64 res;
res = _mm_mullo_pi16 (a, b);
- res = _mm_add_pi16 (res, MC(4x0080));
+ res = _mm_adds_pu16 (res, _mm_srli_pi16 (res, 8));
+ res = _mm_adds_pu16 (res, MC(4x0080));
res = _mm_srli_pi16 (res, 8);
return res;
@@ -848,85 +888,53 @@ pack565 (__m64 pixel, __m64 target, int pos)
return _mm_or_si64 (b, p);
}
-void
-fbCompositeSolid_nx8888mmx (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
+static void
+fbCompositeSolid_nx8888mmx (uint32_t *dst, uint32_t *src, int w)
{
- CARD32 src;
- CARD32 *dstLine, *dst;
- CARD16 w;
- FbStride dstStride;
__m64 vsrc, vsrca;
-
- CHECKPOINT();
-
- fbComposeGetSolid(pSrc, src, pDst->format);
-
- if (src >> 24 == 0)
- return;
-
- fbComposeGetStart (pDst, xDst, yDst, CARD32, dstStride, dstLine, 1);
-
- vsrc = load8888 (src);
+
+ vsrc = load8888 (*src);
vsrca = expand_alpha (vsrc);
+
+ while (w && (unsigned long)dst & 7)
+ {
+ *dst = (ullong) pack8888(over(vsrc, vsrca, load8888(*dst)),
+ _mm_setzero_si64());
+
+ w--;
+ dst++;
+ }
- while (height--)
+ while (w >= 2)
{
- dst = dstLine;
- dstLine += dstStride;
- w = width;
-
- CHECKPOINT();
-
- while (w && (unsigned long)dst & 7)
- {
- *dst = (ullong) pack8888(over(vsrc, vsrca, load8888(*dst)),
- _mm_setzero_si64());
-
- w--;
- dst++;
- }
-
- while (w >= 2)
- {
- __m64 vdest;
- __m64 dest0, dest1;
-
- vdest = *(__m64 *)dst;
-
- dest0 = over(vsrc, vsrca, expand8888(vdest, 0));
- dest1 = over(vsrc, vsrca, expand8888(vdest, 1));
-
- *(__m64 *)dst = pack8888(dest0, dest1);
-
- dst += 2;
- w -= 2;
- }
-
- CHECKPOINT();
-
- while (w)
- {
- *dst = (ullong) pack8888(over(vsrc, vsrca, load8888(*dst)), _mm_setzero_si64());
-
- w--;
- dst++;
- }
+ __m64 vdest;
+ __m64 dest0, dest1;
+
+ vdest = *(__m64 *)dst;
+
+ dest0 = over(vsrc, vsrca, expand8888(vdest, 0));
+ dest1 = over(vsrc, vsrca, expand8888(vdest, 1));
+
+ *(__m64 *)dst = pack8888(dest0, dest1);
+
+ dst += 2;
+ w -= 2;
+ }
+
+ while (w)
+ {
+ *dst = (ullong) pack8888(over(vsrc, vsrca, load8888(*dst)), _mm_setzero_si64());
+
+ w--;
+ dst++;
}
_mm_empty();
}
+OIL_DEFINE_IMPL_FULL(fbCompositeSolid_nx8888mmx, composite_over_argb_const_src,
+ OIL_IMPL_FLAG_MMX);
+#if 0
void
fbCompositeSolid_nx0565mmx (CARD8 op,
PicturePtr pSrc,
@@ -1011,20 +1019,11 @@ fbCompositeSolid_nx0565mmx (CARD8 op,
_mm_empty();
}
+#endif
-void
-fbCompositeSolidMask_nx8888x8888Cmmx (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
+#if 0
+static void
+fbCompositeSolidMask_nx8888x8888Cmmx (uint32_t *dst, uint32_t *src, uint8_t *mask, int w)
{
CARD32 src, srca;
CARD32 *dstLine;
@@ -1032,117 +1031,72 @@ fbCompositeSolidMask_nx8888x8888Cmmx (CARD8 op,
FbStride dstStride, maskStride;
__m64 vsrc, vsrca;
- CHECKPOINT();
-
- fbComposeGetSolid(pSrc, src, pDst->format);
-
- srca = src >> 24;
- if (srca == 0)
- return;
- fbComposeGetStart (pDst, xDst, yDst, CARD32, dstStride, dstLine, 1);
- fbComposeGetStart (pMask, xMask, yMask, CARD32, maskStride, maskLine, 1);
+ while (twidth && (unsigned long)q & 7)
+ {
+ CARD32 m = *(CARD32 *)p;
+
+ if (m)
+ {
+ __m64 vdest = load8888(*q);
+ vdest = in_over(vsrc, vsrca, load8888(m), vdest);
+ *q = (ullong)pack8888(vdest, _mm_setzero_si64());
+ }
+
+ twidth--;
+ p++;
+ q++;
+ }
- vsrc = load8888(src);
- vsrca = expand_alpha(vsrc);
+ while (twidth >= 2)
+ {
+ CARD32 m0, m1;
+ m0 = *p;
+ m1 = *(p + 1);
+
+ if (m0 | m1)
+ {
+ __m64 dest0, dest1;
+ __m64 vdest = *(__m64 *)q;
+
+ dest0 = in_over(vsrc, vsrca, load8888(m0),
+ expand8888 (vdest, 0));
+ dest1 = in_over(vsrc, vsrca, load8888(m1),
+ expand8888 (vdest, 1));
+
+ *(__m64 *)q = pack8888(dest0, dest1);
+ }
+
+ p += 2;
+ q += 2;
+ twidth -= 2;
+ }
- while (height--)
+ while (twidth)
{
- int twidth = width;
- CARD32 *p = (CARD32 *)maskLine;
- CARD32 *q = (CARD32 *)dstLine;
-
- while (twidth && (unsigned long)q & 7)
- {
- CARD32 m = *(CARD32 *)p;
-
- if (m)
- {
- __m64 vdest = load8888(*q);
- vdest = in_over(vsrc, vsrca, load8888(m), vdest);
- *q = (ullong)pack8888(vdest, _mm_setzero_si64());
- }
-
- twidth--;
- p++;
- q++;
- }
-
- while (twidth >= 2)
- {
- CARD32 m0, m1;
- m0 = *p;
- m1 = *(p + 1);
-
- if (m0 | m1)
- {
- __m64 dest0, dest1;
- __m64 vdest = *(__m64 *)q;
-
- dest0 = in_over(vsrc, vsrca, load8888(m0),
- expand8888 (vdest, 0));
- dest1 = in_over(vsrc, vsrca, load8888(m1),
- expand8888 (vdest, 1));
-
- *(__m64 *)q = pack8888(dest0, dest1);
- }
-
- p += 2;
- q += 2;
- twidth -= 2;
- }
-
- while (twidth)
- {
- CARD32 m = *(CARD32 *)p;
-
- if (m)
- {
- __m64 vdest = load8888(*q);
- vdest = in_over(vsrc, vsrca, load8888(m), vdest);
- *q = (ullong)pack8888(vdest, _mm_setzero_si64());
- }
-
- twidth--;
- p++;
- q++;
- }
-
- dstLine += dstStride;
- maskLine += maskStride;
+ CARD32 m = *(CARD32 *)p;
+
+ if (m)
+ {
+ __m64 vdest = load8888(*q);
+ vdest = in_over(vsrc, vsrca, load8888(m), vdest);
+ *q = (ullong)pack8888(vdest, _mm_setzero_si64());
+ }
+
+ twidth--;
+ p++;
+ q++;
}
_mm_empty();
}
+#endif
-void
-fbCompositeSrc_8888x8x8888mmx (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
+#if 0
+static void
+fbCompositeSrc_8888x8x8888mmx (uint32_t *dest, uint32_t *src, uint8_t *mask,
+ int width)
{
- CARD32 *dstLine, *dst;
- CARD32 *srcLine, *src;
- CARD8 *maskLine;
- CARD32 mask;
- __m64 vmask;
- FbStride dstStride, srcStride, maskStride;
- CARD16 w;
- __m64 srca;
-
- CHECKPOINT();
-
- fbComposeGetStart (pDst, xDst, yDst, CARD32, dstStride, dstLine, 1);
- fbComposeGetStart (pSrc, xSrc, ySrc, CARD32, srcStride, srcLine, 1);
- fbComposeGetStart (pMask, xMask, yMask, CARD8, maskStride, maskLine, 1);
mask = *maskLine << 24 | *maskLine << 16 | *maskLine << 8 | *maskLine;
vmask = load8888 (mask);
@@ -1895,139 +1849,85 @@ fbCompositeSolidMask_nx8888x0565Cmmx (CARD8 op,
_mm_empty ();
}
+#endif
-void
-fbCompositeSrcAdd_8000x8000mmx (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
+static void
+fbCompositeSrcAdd_8000x8000mmx (uint8_t *dst, uint8_t *src, int w)
{
- CARD8 *dstLine, *dst;
- CARD8 *srcLine, *src;
- FbStride dstStride, srcStride;
- CARD16 w;
- CARD8 s, d;
- CARD16 t;
-
- CHECKPOINT();
-
- fbComposeGetStart (pSrc, xSrc, ySrc, CARD8, srcStride, srcLine, 1);
- fbComposeGetStart (pDst, xDst, yDst, CARD8, dstStride, dstLine, 1);
+ int s;
+ int d;
+ int t;
+
+ while (w && (unsigned long)dst & 7)
+ {
+ s = *src;
+ d = *dst;
+ t = d + s;
+ s = t | (0 - (t >> 8));
+ *dst = s;
+
+ dst++;
+ src++;
+ w--;
+ }
- while (height--)
+ while (w >= 8)
{
- dst = dstLine;
- dstLine += dstStride;
- src = srcLine;
- srcLine += srcStride;
- w = width;
-
- while (w && (unsigned long)dst & 7)
- {
- s = *src;
- d = *dst;
- t = d + s;
- s = t | (0 - (t >> 8));
- *dst = s;
-
- dst++;
- src++;
- w--;
- }
-
- while (w >= 8)
- {
- *(__m64*)dst = _mm_adds_pu8(*(__m64*)src, *(__m64*)dst);
- dst += 8;
- src += 8;
- w -= 8;
- }
-
- while (w)
- {
- s = *src;
- d = *dst;
- t = d + s;
- s = t | (0 - (t >> 8));
- *dst = s;
-
- dst++;
- src++;
- w--;
- }
+ *(__m64*)dst = _mm_adds_pu8(*(__m64*)src, *(__m64*)dst);
+ dst += 8;
+ src += 8;
+ w -= 8;
}
+ while (w)
+ {
+ s = *src;
+ d = *dst;
+ t = d + s;
+ s = t | (0 - (t >> 8));
+ *dst = s;
+
+ dst++;
+ src++;
+ w--;
+ }
+
_mm_empty();
}
+OIL_DEFINE_IMPL_FULL (fbCompositeSrcAdd_8000x8000mmx, composite_add_u8, OIL_IMPL_FLAG_MMX);
-void
-fbCompositeSrcAdd_8888x8888mmx (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
+static void
+fbCompositeSrcAdd_8888x8888mmx (uint32_t *dst, uint32_t *src, int w)
{
- CARD32 *dstLine, *dst;
- CARD32 *srcLine, *src;
- FbStride dstStride, srcStride;
- CARD16 w;
-
- CHECKPOINT();
+ while (w && (unsigned long)dst & 7)
+ {
+ *dst = _mm_cvtsi64_si32(_mm_adds_pu8(_mm_cvtsi32_si64(*src),
+ _mm_cvtsi32_si64(*dst)));
+ dst++;
+ src++;
+ w--;
+ }
- fbComposeGetStart (pSrc, xSrc, ySrc, CARD32, srcStride, srcLine, 1);
- fbComposeGetStart (pDst, xDst, yDst, CARD32, dstStride, dstLine, 1);
+ while (w >= 2)
+ {
+ *(ullong*)dst = (ullong) _mm_adds_pu8(*(__m64*)src, *(__m64*)dst);
+ dst += 2;
+ src += 2;
+ w -= 2;
+ }
- while (height--)
+ if (w)
{
- dst = dstLine;
- dstLine += dstStride;
- src = srcLine;
- srcLine += srcStride;
- w = width;
-
- while (w && (unsigned long)dst & 7)
- {
- *dst = _mm_cvtsi64_si32(_mm_adds_pu8(_mm_cvtsi32_si64(*src),
- _mm_cvtsi32_si64(*dst)));
- dst++;
- src++;
- w--;
- }
-
- while (w >= 2)
- {
- *(ullong*)dst = (ullong) _mm_adds_pu8(*(__m64*)src, *(__m64*)dst);
- dst += 2;
- src += 2;
- w -= 2;
- }
-
- if (w)
- {
- *dst = _mm_cvtsi64_si32(_mm_adds_pu8(_mm_cvtsi32_si64(*src),
- _mm_cvtsi32_si64(*dst)));
-
- }
+ *dst = _mm_cvtsi64_si32(_mm_adds_pu8(_mm_cvtsi32_si64(*src),
+ _mm_cvtsi32_si64(*dst)));
+
}
_mm_empty();
}
+OIL_DEFINE_IMPL_FULL (fbCompositeSrcAdd_8888x8888mmx, composite_add_argb, OIL_IMPL_FLAG_MMX);
+#if 0
#define GetStart(drw,x,y,type,stride,line,bpp) {\
FbBits *__bits__; \
FbStride __stride__; \
diff --git a/liboil/liboilfuncs.h b/liboil/liboilfuncs.h
index 2c55d12..250a524 100644
--- a/liboil/liboilfuncs.h
+++ b/liboil/liboilfuncs.h
@@ -189,12 +189,18 @@ typedef void (*_oil_type_clipconv_u8_u16)(uint8_t * dest, int dstr, const uint16
extern OilFunctionClass *oil_function_class_ptr_clipconv_u8_u32;
typedef void (*_oil_type_clipconv_u8_u32)(uint8_t * dest, int dstr, const uint32_t * src, int sstr, int n);
#define oil_clipconv_u8_u32 ((_oil_type_clipconv_u8_u32)(*(void **)oil_function_class_ptr_clipconv_u8_u32))
+extern OilFunctionClass *oil_function_class_ptr_colsad8x8_u8;
+typedef void (*_oil_type_colsad8x8_u8)(uint32_t * d_1, const uint8_t * s1_8x8, int ss1, const uint8_t * s2_8x8, int ss2);
+#define oil_colsad8x8_u8 ((_oil_type_colsad8x8_u8)(*(void **)oil_function_class_ptr_colsad8x8_u8))
extern OilFunctionClass *oil_function_class_ptr_composite_add_argb;
typedef void (*_oil_type_composite_add_argb)(uint32_t * i_n, const uint32_t * s1_n, int n);
#define oil_composite_add_argb ((_oil_type_composite_add_argb)(*(void **)oil_function_class_ptr_composite_add_argb))
extern OilFunctionClass *oil_function_class_ptr_composite_add_argb_const_src;
typedef void (*_oil_type_composite_add_argb_const_src)(uint32_t * i_n, const uint32_t * s1_1, int n);
#define oil_composite_add_argb_const_src ((_oil_type_composite_add_argb_const_src)(*(void **)oil_function_class_ptr_composite_add_argb_const_src))
+extern OilFunctionClass *oil_function_class_ptr_composite_add_u8;
+typedef void (*_oil_type_composite_add_u8)(uint8_t * i_n, const uint8_t * s1_n, int n);
+#define oil_composite_add_u8 ((_oil_type_composite_add_u8)(*(void **)oil_function_class_ptr_composite_add_u8))
extern OilFunctionClass *oil_function_class_ptr_composite_in_argb;
typedef void (*_oil_type_composite_in_argb)(uint32_t * d_n, const uint32_t * s1_n, const uint8_t * s2_n, int n);
#define oil_composite_in_argb ((_oil_type_composite_in_argb)(*(void **)oil_function_class_ptr_composite_in_argb))
@@ -219,6 +225,9 @@ typedef void (*_oil_type_composite_over_argb)(uint32_t * i_n, const uint32_t * s
extern OilFunctionClass *oil_function_class_ptr_composite_over_argb_const_src;
typedef void (*_oil_type_composite_over_argb_const_src)(uint32_t * i_n, const uint32_t * s1_1, int n);
#define oil_composite_over_argb_const_src ((_oil_type_composite_over_argb_const_src)(*(void **)oil_function_class_ptr_composite_over_argb_const_src))
+extern OilFunctionClass *oil_function_class_ptr_composite_over_u8;
+typedef void (*_oil_type_composite_over_u8)(uint8_t * i_n, const uint8_t * s1_n, int n);
+#define oil_composite_over_u8 ((_oil_type_composite_over_u8)(*(void **)oil_function_class_ptr_composite_over_u8))
extern OilFunctionClass *oil_function_class_ptr_conv8x8_f64_s16;
typedef void (*_oil_type_conv8x8_f64_s16)(double * d_8x8, int dstr, const int16_t * s_8x8, int sstr);
#define oil_conv8x8_f64_s16 ((_oil_type_conv8x8_f64_s16)(*(void **)oil_function_class_ptr_conv8x8_f64_s16))
@@ -393,6 +402,9 @@ typedef void (*_oil_type_conv_u8_u16)(uint8_t * dest, int dstr, const uint16_t *
extern OilFunctionClass *oil_function_class_ptr_conv_u8_u32;
typedef void (*_oil_type_conv_u8_u32)(uint8_t * dest, int dstr, const uint32_t * src, int sstr, int n);
#define oil_conv_u8_u32 ((_oil_type_conv_u8_u32)(*(void **)oil_function_class_ptr_conv_u8_u32))
+extern OilFunctionClass *oil_function_class_ptr_copy8x8_u8;
+typedef void (*_oil_type_copy8x8_u8)(uint8_t * d_8x8, int ds, const uint8_t * s_8x8, int ss);
+#define oil_copy8x8_u8 ((_oil_type_copy8x8_u8)(*(void **)oil_function_class_ptr_copy8x8_u8))
extern OilFunctionClass *oil_function_class_ptr_copy_u8;
typedef void (*_oil_type_copy_u8)(uint8_t * dest, const uint8_t * src, int n);
#define oil_copy_u8 ((_oil_type_copy_u8)(*(void **)oil_function_class_ptr_copy_u8))
@@ -402,12 +414,30 @@ typedef void (*_oil_type_dct36_f32)(float * d_36, int dstr, const float * s_36,
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_diff8x8_average_s16_u8;
+typedef void (*_oil_type_diff8x8_average_s16_u8)(int16_t * d_64, const uint8_t * s1_8x8, int ss1, const uint8_t * s2_8x8, int ss2, const uint8_t * s3_8x8, int ss3);
+#define oil_diff8x8_average_s16_u8 ((_oil_type_diff8x8_average_s16_u8)(*(void **)oil_function_class_ptr_diff8x8_average_s16_u8))
+extern OilFunctionClass *oil_function_class_ptr_diff8x8_const128_s16_u8;
+typedef void (*_oil_type_diff8x8_const128_s16_u8)(int16_t * d_64, const uint8_t * s1_8x8, int ss1);
+#define oil_diff8x8_const128_s16_u8 ((_oil_type_diff8x8_const128_s16_u8)(*(void **)oil_function_class_ptr_diff8x8_const128_s16_u8))
+extern OilFunctionClass *oil_function_class_ptr_diff8x8_s16_u8;
+typedef void (*_oil_type_diff8x8_s16_u8)(int16_t * d_64, const uint8_t * s1_8x8, int ss1, const uint8_t * s2_8x8, int ss2);
+#define oil_diff8x8_s16_u8 ((_oil_type_diff8x8_s16_u8)(*(void **)oil_function_class_ptr_diff8x8_s16_u8))
extern OilFunctionClass *oil_function_class_ptr_diffsquaresum_f64;
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_divide_f32;
typedef void (*_oil_type_divide_f32)(float * d, const float * s1, const float * s2, int n);
#define oil_divide_f32 ((_oil_type_divide_f32)(*(void **)oil_function_class_ptr_divide_f32))
+extern OilFunctionClass *oil_function_class_ptr_err_inter8x8_u8;
+typedef void (*_oil_type_err_inter8x8_u8)(uint32_t * d_1, const uint8_t * s1_8x8, int ss1, const uint8_t * s2_8x8, int ss2);
+#define oil_err_inter8x8_u8 ((_oil_type_err_inter8x8_u8)(*(void **)oil_function_class_ptr_err_inter8x8_u8))
+extern OilFunctionClass *oil_function_class_ptr_err_inter8x8_u8_avg;
+typedef void (*_oil_type_err_inter8x8_u8_avg)(uint32_t * d_1, const uint8_t * s1_8x8, int ss1, const uint8_t * s2_8x8, const uint8_t * s3_8x8, int ss2);
+#define oil_err_inter8x8_u8_avg ((_oil_type_err_inter8x8_u8_avg)(*(void **)oil_function_class_ptr_err_inter8x8_u8_avg))
+extern OilFunctionClass *oil_function_class_ptr_err_intra8x8_u8;
+typedef void (*_oil_type_err_intra8x8_u8)(uint32_t * d_1, const uint8_t * s1_8x8, int ss1);
+#define oil_err_intra8x8_u8 ((_oil_type_err_intra8x8_u8)(*(void **)oil_function_class_ptr_err_intra8x8_u8))
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);
#define oil_fdct8_f64 ((_oil_type_fdct8_f64)(*(void **)oil_function_class_ptr_fdct8_f64))
@@ -417,6 +447,9 @@ typedef void (*_oil_type_fdct8x8_f64)(double * d_8x8, int dstr, const double * s
extern OilFunctionClass *oil_function_class_ptr_fdct8x8s_s16;
typedef void (*_oil_type_fdct8x8s_s16)(int16_t * d_8x8, int ds, const int16_t * s_8x8, int ss);
#define oil_fdct8x8s_s16 ((_oil_type_fdct8x8s_s16)(*(void **)oil_function_class_ptr_fdct8x8s_s16))
+extern OilFunctionClass *oil_function_class_ptr_fdct8x8theora;
+typedef void (*_oil_type_fdct8x8theora)(const int16_t * s_8x8, int16_t * d_8x8);
+#define oil_fdct8x8theora ((_oil_type_fdct8x8theora)(*(void **)oil_function_class_ptr_fdct8x8theora))
extern OilFunctionClass *oil_function_class_ptr_floor_f32;
typedef void (*_oil_type_floor_f32)(float * d, const float * s, int n);
#define oil_floor_f32 ((_oil_type_floor_f32)(*(void **)oil_function_class_ptr_floor_f32))
@@ -516,6 +549,15 @@ typedef void (*_oil_type_permute_u32)(uint32_t * dest, int dstr, const uint32_t
extern OilFunctionClass *oil_function_class_ptr_permute_u8;
typedef void (*_oil_type_permute_u8)(uint8_t * dest, int dstr, const uint8_t * src1, int sstr1, const int32_t * src2, int sstr2, int n);
#define oil_permute_u8 ((_oil_type_permute_u8)(*(void **)oil_function_class_ptr_permute_u8))
+extern OilFunctionClass *oil_function_class_ptr_recon8x8_inter;
+typedef void (*_oil_type_recon8x8_inter)(uint8_t * d_8x8, int ds, const uint8_t * s1_8x8, int ss1, const int16_t * s2_8x8);
+#define oil_recon8x8_inter ((_oil_type_recon8x8_inter)(*(void **)oil_function_class_ptr_recon8x8_inter))
+extern OilFunctionClass *oil_function_class_ptr_recon8x8_inter2;
+typedef void (*_oil_type_recon8x8_inter2)(uint8_t * d_8x8, int ds, const uint8_t * s1_8x8, int ss1, const uint8_t * s2_8x8, int ss2, const int16_t * s3_8x8);
+#define oil_recon8x8_inter2 ((_oil_type_recon8x8_inter2)(*(void **)oil_function_class_ptr_recon8x8_inter2))
+extern OilFunctionClass *oil_function_class_ptr_recon8x8_intra;
+typedef void (*_oil_type_recon8x8_intra)(uint8_t * d_8x8, int ds, const int16_t * s_8x8);
+#define oil_recon8x8_intra ((_oil_type_recon8x8_intra)(*(void **)oil_function_class_ptr_recon8x8_intra))
extern OilFunctionClass *oil_function_class_ptr_resample_linear_argb;
typedef void (*_oil_type_resample_linear_argb)(uint32_t * d_n, const uint32_t * s_2xn, int n, uint32_t * i_2);
#define oil_resample_linear_argb ((_oil_type_resample_linear_argb)(*(void **)oil_function_class_ptr_resample_linear_argb))
@@ -528,6 +570,9 @@ typedef void (*_oil_type_rgb2bgr)(uint8_t * d_3xn, const uint8_t * s_3xn, int n)
extern OilFunctionClass *oil_function_class_ptr_rgb2rgba;
typedef void (*_oil_type_rgb2rgba)(uint8_t * d_4xn, const uint8_t * s_3xn, int n);
#define oil_rgb2rgba ((_oil_type_rgb2rgba)(*(void **)oil_function_class_ptr_rgb2rgba))
+extern OilFunctionClass *oil_function_class_ptr_rowsad8x8_u8;
+typedef void (*_oil_type_rowsad8x8_u8)(uint32_t * d_1, const uint8_t * s1_8x8, const uint8_t * s2_8x8);
+#define oil_rowsad8x8_u8 ((_oil_type_rowsad8x8_u8)(*(void **)oil_function_class_ptr_rowsad8x8_u8))
extern OilFunctionClass *oil_function_class_ptr_sad8x8_f64;
typedef void (*_oil_type_sad8x8_f64)(double * d_8x8, int ds, const double * s1_8x8, int ss1, const double * s2_8x8, int ss2);
#define oil_sad8x8_f64 ((_oil_type_sad8x8_f64)(*(void **)oil_function_class_ptr_sad8x8_f64))
@@ -543,6 +588,9 @@ typedef void (*_oil_type_sad8x8_s16_2)(uint32_t * d_1, const int16_t * s1_8x8, i
extern OilFunctionClass *oil_function_class_ptr_sad8x8_u8;
typedef void (*_oil_type_sad8x8_u8)(uint32_t * d_1, const uint8_t * s1_8x8, int ss1, const uint8_t * s2_8x8, int ss2);
#define oil_sad8x8_u8 ((_oil_type_sad8x8_u8)(*(void **)oil_function_class_ptr_sad8x8_u8))
+extern OilFunctionClass *oil_function_class_ptr_sad8x8_u8_avg;
+typedef void (*_oil_type_sad8x8_u8_avg)(uint32_t * d_1, const uint8_t * s1_8x8, int ss1, const uint8_t * s2_8x8, const uint8_t * s3_8x8, int ss2);
+#define oil_sad8x8_u8_avg ((_oil_type_sad8x8_u8_avg)(*(void **)oil_function_class_ptr_sad8x8_u8_avg))
extern OilFunctionClass *oil_function_class_ptr_scalaradd_f32;
typedef void (*_oil_type_scalaradd_f32)(float * dest, int dstr, const float * src, int sstr, const float * s2_1, int n);
#define oil_scalaradd_f32 ((_oil_type_scalaradd_f32)(*(void **)oil_function_class_ptr_scalaradd_f32))
diff --git a/liboil/liboilfunction.c b/liboil/liboilfunction.c
index 68b0bcb..24359ba 100644
--- a/liboil/liboilfunction.c
+++ b/liboil/liboilfunction.c
@@ -80,6 +80,33 @@ oil_init (void)
}
/**
+ * oil_init_no_optimize:
+ *
+ * Identical to @oil_init(), except that the profiling stage is not
+ * done. This function is mainly useful for internal programs.
+ */
+void
+oil_init_no_optimize (void)
+{
+ static int inited = 0;
+ unsigned long start, stop;
+
+ if (inited) return;
+ inited = 1;
+
+ start = oil_profile_stamp_gtod ();
+
+ _oil_debug_init ();
+ _oil_cpu_init ();
+ oil_init_pointers ();
+ oil_init_structs ();
+
+ stop = oil_profile_stamp_gtod ();
+
+ OIL_INFO ("initialization completed in %ld usec", stop-start);
+}
+
+/**
* oil_optimize_all:
*
* Optimizes all function classes.
diff --git a/liboil/liboilfunction.h b/liboil/liboilfunction.h
index 802f42c..fcfa922 100644
--- a/liboil/liboilfunction.h
+++ b/liboil/liboilfunction.h
@@ -160,6 +160,7 @@ void oil_class_register_impl (OilFunctionClass * klass, OilFunctionImpl *impl);
void oil_class_register_impl_by_name (const char *klass_name,
OilFunctionImpl *impl);
+void oil_init_no_optimize(void);
#endif
diff --git a/liboil/liboilmarshal.c b/liboil/liboilmarshal.c
index 5e1ec4b..ee92f4b 100644
--- a/liboil/liboilmarshal.c
+++ b/liboil/liboilmarshal.c
@@ -76,18 +76,36 @@ _oil_test_marshal_function (void *func, unsigned long *args, int n_args,
((void *)args[0],(int)args[1],(void *)args[2],(int)args[3]);
oil_profile_stop (prof);
break;
+ case 0x003a:
+ oil_profile_start (prof);
+ ((void (*)(void *,void *,int,void *,int))func)
+ ((void *)args[0],(void *)args[1],(int)args[2],(void *)args[3],(int)args[4]);
+ oil_profile_stop (prof);
+ break;
case 0x006a:
oil_profile_start (prof);
((void (*)(void *,int,void *,int,void *,int))func)
((void *)args[0],(int)args[1],(void *)args[2],(int)args[3],(void *)args[4],(int)args[5]);
oil_profile_stop (prof);
break;
+ case 0x00ea:
+ oil_profile_start (prof);
+ ((void (*)(void *,void *,int,void *,int,void *,int))func)
+ ((void *)args[0],(void *)args[1],(int)args[2],(void *)args[3],(int)args[4],(void *)args[5],(int)args[6]);
+ oil_profile_stop (prof);
+ break;
case 0x0074:
oil_profile_start (prof);
((void (*)(void *,void *,int,void *,int,int))func)
((void *)args[0],(void *)args[1],(int)args[2],(void *)args[3],(int)args[4],(int)args[5]);
oil_profile_stop (prof);
break;
+ case 0x0076:
+ oil_profile_start (prof);
+ ((void (*)(void *,void *,int,void *,void *,int))func)
+ ((void *)args[0],(void *)args[1],(int)args[2],(void *)args[3],(void *)args[4],(int)args[5]);
+ oil_profile_stop (prof);
+ break;
case 0x001c:
oil_profile_start (prof);
((void (*)(void *,void *,int,int))func)
@@ -118,16 +136,34 @@ _oil_test_marshal_function (void *func, unsigned long *args, int n_args,
();
oil_profile_stop (prof);
break;
+ case 0x0035:
+ oil_profile_start (prof);
+ ((void (*)(void *,int,void *,int,void *))func)
+ ((void *)args[0],(int)args[1],(void *)args[2],(int)args[3],(void *)args[4]);
+ oil_profile_stop (prof);
+ break;
+ case 0x00d5:
+ oil_profile_start (prof);
+ ((void (*)(void *,int,void *,int,void *,int,void *))func)
+ ((void *)args[0],(int)args[1],(void *)args[2],(int)args[3],(void *)args[4],(int)args[5],(void *)args[6]);
+ oil_profile_stop (prof);
+ break;
+ case 0x000d:
+ oil_profile_start (prof);
+ ((void (*)(void *,int,void *))func)
+ ((void *)args[0],(int)args[1],(void *)args[2]);
+ oil_profile_stop (prof);
+ break;
case 0x001d:
oil_profile_start (prof);
((void (*)(void *,void *,int,void *))func)
((void *)args[0],(void *)args[1],(int)args[2],(void *)args[3]);
oil_profile_stop (prof);
break;
- case 0x003a:
+ case 0x000f:
oil_profile_start (prof);
- ((void (*)(void *,void *,int,void *,int))func)
- ((void *)args[0],(void *)args[1],(int)args[2],(void *)args[3],(int)args[4]);
+ ((void (*)(void *,void *,void *))func)
+ ((void *)args[0],(void *)args[1],(void *)args[2]);
oil_profile_stop (prof);
break;
case 0x003b:
diff --git a/liboil/null.c b/liboil/null.c
index fee092f..8a8fad8 100644
--- a/liboil/null.c
+++ b/liboil/null.c
@@ -39,4 +39,15 @@ null_ref (void)
}
OIL_DEFINE_IMPL_REF (null_ref, null);
+static void
+null_mmx (void)
+{
+ __asm__ __volatile__ ("\n"
+ " pxor %%mm1, %%mm0\n"
+ " emms\n"
+ :::"eax");
+}
+OIL_DEFINE_IMPL_FULL (null_mmx, null, OIL_IMPL_FLAG_MMX);
+
+