better asm detection - there's an --enable-mmx now too if you want to

force or disable the feature by force... it will try autodetect under linux
but only on the build machine...


SVN revision: 2546
This commit is contained in:
Carsten Haitzler 2000-04-27 02:32:28 +00:00
parent ed923261d4
commit cc8e9b0183
7 changed files with 58 additions and 11 deletions

2
README
View File

@ -9,7 +9,7 @@ as well as rendering, manipulation etc. It also does ALL of these FAST and
tries to be highly intelligent about doing it to make writing niaeve programs tries to be highly intelligent about doing it to make writing niaeve programs
that are still very fast. that are still very fast.
This is an early stage of its release and thus is Imlib2 0.0.1 - there are This is an early stage of its release and thus is Imlib2 0.0.4 - there are
bugs that have to be worked out - primarily ones that might deal with network bugs that have to be worked out - primarily ones that might deal with network
rendering, endianess and the lack of loaders. rendering, endianess and the lack of loaders.

View File

@ -13,7 +13,7 @@
/* Define if you have the <freetype/freetype.h> header file. */ /* Define if you have the <freetype/freetype.h> header file. */
#undef HAVE_FREETYPE_FREETYPE_H #undef HAVE_FREETYPE_FREETYPE_H
/* Pentium II/III and up detected - enabling ASM */ /* enabling MMX Assembly */
#undef DO_MMX_ASM #undef DO_MMX_ASM
/* Name of package */ /* Name of package */

View File

@ -3,10 +3,33 @@ dnl Process this file with autoconf to create configure.
AC_INIT(src/Imlib2.h) AC_INIT(src/Imlib2.h)
AM_CONFIG_HEADER(config.h) AM_CONFIG_HEADER(config.h)
AC_CANONICAL_SYSTEM AC_CANONICAL_SYSTEM
if test x$target_cpu = xi686; then mmx=no
AC_DEFINE(DO_MMX_ASM, 1, [Pentium II/III and up detected - enabling ASM]) AC_ARG_ENABLE(mmx, "Enables building of MMX assembly routines",
[
echo "*****************YESYESYESYESYESYES****************"
if test x$enableval = xyes; then
mmx=yes
fi
],
[
echo "*****************NOT****************"
if test x$target_os = xlinux-gnu; then
mmx=`cat /proc/cpuinfo | grep mmx`
if test -n "$mmx"; then
mmx=yes
fi
else
echo "You are not running Linux - This script cannot auto-detect mmx assembly."
echo "You will have to ebnalbe the mmx assembly (which gives anywhere from 10%"
echo "to 300% speedups) by adding --enable-mmx on the configure command-line."
fi fi
AM_INIT_AUTOMAKE(imlib2, 0.0.3) ]
)
if test x$mmx = xyes; then
AC_DEFINE(DO_MMX_ASM, 1, [enabling MMX Assembly])
fi
AM_INIT_AUTOMAKE(imlib2, 0.0.4)
pkglibdir='${libdir}'/loaders pkglibdir='${libdir}'/loaders
AC_SUBST(pkglibdir) AC_SUBST(pkglibdir)

View File

@ -24,7 +24,7 @@ libImlib2_la_SOURCES = rend.c ximage.c scale.c rgba.c image.c color.c grab.c \
libImlib2_la_LIBADD = @DLLDFLAGS@ $(top_builddir)/libltdl/libltdlc.la \ libImlib2_la_LIBADD = @DLLDFLAGS@ $(top_builddir)/libltdl/libltdlc.la \
-lX11 -lXext -lttf $(LDFLAGS) -lX11 -lXext -lttf $(LDFLAGS)
libImlib2_la_DEPENDENCIES = $(top_builddir)/config.h libImlib2_la_DEPENDENCIES = $(top_builddir)/config.h
libImlib2_la_LDFLAGS = -version-info 0:3:0 libImlib2_la_LDFLAGS = -version-info 0:4:0
SYS_LOADERS_PATH = @pkglibdir@ SYS_LOADERS_PATH = @pkglibdir@
image.lo: loaderpath.h image.lo: loaderpath.h

View File

@ -1,5 +1,7 @@
#include <config.h> #include <config.h>
#ifdef DO_MMX_ASM
/*\ /*\
|*| MMX assembly rotation routine for Imlib2 |*| MMX assembly rotation routine for Imlib2
|*| Written by Willem Monsuwe <willem@stack.nl> |*| Written by Willem Monsuwe <willem@stack.nl>
@ -39,8 +41,6 @@
#define m0fff -28(%ebp) #define m0fff -28(%ebp)
#define mulsow -32(%ebp) #define mulsow -32(%ebp)
#ifdef DO_MMX_ASM
__imlib_mmx_RotateAA: __imlib_mmx_RotateAA:
pushl %ebp pushl %ebp
movl %esp, %ebp movl %esp, %ebp

View File

@ -1,5 +1,7 @@
#include <config.h> #include <config.h>
#ifdef DO_MMX_ASM
/*\ /*\
|*| MMX assembly scaling routine for Imlib2 |*| MMX assembly scaling routine for Imlib2
|*| Written by Willem Monsuwe <willem@stack.nl> |*| Written by Willem Monsuwe <willem@stack.nl>
@ -46,8 +48,6 @@
#define yapoints 12(%edx) #define yapoints 12(%edx)
#define xup_yup 16(%edx) #define xup_yup 16(%edx)
#ifdef DO_MMX_ASM
__imlib_Scale_mmx_AARGBA: __imlib_Scale_mmx_AARGBA:
pushl %ebp pushl %ebp
movl %esp, %ebp movl %esp, %ebp

View File

@ -184,6 +184,8 @@ int main (int argc, char **argv)
{ {
if (scaleup) if (scaleup)
XResizeWindow(disp, win, w * 4, h * 4); XResizeWindow(disp, win, w * 4, h * 4);
else if (scaleboth)
XResizeWindow(disp, win, w * 2, h * 2);
else else
XResizeWindow(disp, win, w, h); XResizeWindow(disp, win, w, h);
XMapWindow(disp, win); XMapWindow(disp, win);
@ -352,7 +354,29 @@ int main (int argc, char **argv)
} }
imlib_context_set_image(im); imlib_context_set_image(im);
} }
pixels += (w - i) * (((w - i) * h) / w); pixels += (w + i) * (((w + i) * h) / w);
}
}
else if (scaleboth)
{
for (i = 0; i < w * 2; i+= 1)
{
if (!blendtest)
imlib_render_image_on_drawable_at_size(0, 0,
2 * w - i, (((i) * h) / w));
else
{
Imlib_Image im_tmp;
im_tmp = imlib_create_cropped_scaled_image(0, 0, w, h,
2 * w - i, (((i) * h) / w));
if (im_tmp)
{
imlib_context_set_image(im_tmp);
imlib_free_image();
}
imlib_context_set_image(im);
}
pixels += (2 * w - i) * (((i) * h) / w);
} }
} }
} }