gimp/app/composite/gimp-composite-mmx-test.c

240 lines
14 KiB
C
Raw Normal View History

composite/ modularisation of the automatic compositing function "wiring" * composite/ modularisation of the automatic compositing function "wiring" to construct the table of compositing functions at run-time instead of compile time. The environment variable GIMP_COMPOSITE is a hexadecimal number representing a bit-field used to set/reset options in the gimp-composite code. * gimp-composite-altivec.[ch]: added * gimp-composite-altivec-installer.[ch]: added * gimp-composite-vis.[ch]: added * gimp-composite-vis-installer.[ch]: added * gimp-composite-mmx-installer.[ch]: added * gimp-composite-sse-installer.[ch]: added * gimp-composite-altivec-test.[ch]: added * gimp-composite-vis-test.[ch]: added * gimp-composite-mmx-test.[ch]: added * gimp-composite-sse-test.[ch]: added * make-installer.py: Added meta programme for generating code to 1) construct a table of compositing functions indexed by operation, and the pixel formats of the sources and destination, and 2) generating code for regression testing of these compositing functions against the same functions in gimp-composite-generic.c * gimp-composite-mmx.c (xxxgimp_composite_overlay_rgba8_rgba8_rgba8_mmx): removing from the current set of optimisations because it appears to be broken. * Makefile.am: modified regression testing targets to now build gimp-composite-*-test where * is any of generic, mmx, sse, altivec, and vis. * gimp-composite.c: moved in initialisation code gimp_composite_init() from gimp-composite-dispatch.c * gimp-composite.c: removed gimp_composite_unsupported(). * gimp-composite.c: use cpu_accel() to determine at run-time which set of optimisations are to be used. * gimp-composite.c: conditionally compile code for ARCH_X86. * make-gimp-composite-dispatch.c: retired. See make-installer.py * gimp-composite-mmx.c (op_overlay): namespace cleanup, op_overlay() and all of the constant values are now static * gimp-composite-mmx.c, gimp-composite-sse.c: fixed bug with the alpha mask being the address of the alpha mask, not the mask itself. * app/paint-funcs/paint-funcs.c: Check gimp_composite_options.use to see if we should use the new code or the old code.
2003-08-14 15:43:34 +08:00
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
#include <glib-object.h>
#include "base/base-types.h"
#include "gimp-composite.h"
#include "gimp-composite-regression.h"
#include "gimp-composite-util.h"
#include "gimp-composite-generic.h"
#include "gimp-composite-mmx.h"
int
gimp_composite_mmx_test (int iterations, int n_pixels)
composite/ modularisation of the automatic compositing function "wiring" * composite/ modularisation of the automatic compositing function "wiring" to construct the table of compositing functions at run-time instead of compile time. The environment variable GIMP_COMPOSITE is a hexadecimal number representing a bit-field used to set/reset options in the gimp-composite code. * gimp-composite-altivec.[ch]: added * gimp-composite-altivec-installer.[ch]: added * gimp-composite-vis.[ch]: added * gimp-composite-vis-installer.[ch]: added * gimp-composite-mmx-installer.[ch]: added * gimp-composite-sse-installer.[ch]: added * gimp-composite-altivec-test.[ch]: added * gimp-composite-vis-test.[ch]: added * gimp-composite-mmx-test.[ch]: added * gimp-composite-sse-test.[ch]: added * make-installer.py: Added meta programme for generating code to 1) construct a table of compositing functions indexed by operation, and the pixel formats of the sources and destination, and 2) generating code for regression testing of these compositing functions against the same functions in gimp-composite-generic.c * gimp-composite-mmx.c (xxxgimp_composite_overlay_rgba8_rgba8_rgba8_mmx): removing from the current set of optimisations because it appears to be broken. * Makefile.am: modified regression testing targets to now build gimp-composite-*-test where * is any of generic, mmx, sse, altivec, and vis. * gimp-composite.c: moved in initialisation code gimp_composite_init() from gimp-composite-dispatch.c * gimp-composite.c: removed gimp_composite_unsupported(). * gimp-composite.c: use cpu_accel() to determine at run-time which set of optimisations are to be used. * gimp-composite.c: conditionally compile code for ARCH_X86. * make-gimp-composite-dispatch.c: retired. See make-installer.py * gimp-composite-mmx.c (op_overlay): namespace cleanup, op_overlay() and all of the constant values are now static * gimp-composite-mmx.c, gimp-composite-sse.c: fixed bug with the alpha mask being the address of the alpha mask, not the mask itself. * app/paint-funcs/paint-funcs.c: Check gimp_composite_options.use to see if we should use the new code or the old code.
2003-08-14 15:43:34 +08:00
{
#if (__GNUC__ >= 3) && defined(USE_MMX) && defined(ARCH_X86)
composite/ modularisation of the automatic compositing function "wiring" * composite/ modularisation of the automatic compositing function "wiring" to construct the table of compositing functions at run-time instead of compile time. The environment variable GIMP_COMPOSITE is a hexadecimal number representing a bit-field used to set/reset options in the gimp-composite code. * gimp-composite-altivec.[ch]: added * gimp-composite-altivec-installer.[ch]: added * gimp-composite-vis.[ch]: added * gimp-composite-vis-installer.[ch]: added * gimp-composite-mmx-installer.[ch]: added * gimp-composite-sse-installer.[ch]: added * gimp-composite-altivec-test.[ch]: added * gimp-composite-vis-test.[ch]: added * gimp-composite-mmx-test.[ch]: added * gimp-composite-sse-test.[ch]: added * make-installer.py: Added meta programme for generating code to 1) construct a table of compositing functions indexed by operation, and the pixel formats of the sources and destination, and 2) generating code for regression testing of these compositing functions against the same functions in gimp-composite-generic.c * gimp-composite-mmx.c (xxxgimp_composite_overlay_rgba8_rgba8_rgba8_mmx): removing from the current set of optimisations because it appears to be broken. * Makefile.am: modified regression testing targets to now build gimp-composite-*-test where * is any of generic, mmx, sse, altivec, and vis. * gimp-composite.c: moved in initialisation code gimp_composite_init() from gimp-composite-dispatch.c * gimp-composite.c: removed gimp_composite_unsupported(). * gimp-composite.c: use cpu_accel() to determine at run-time which set of optimisations are to be used. * gimp-composite.c: conditionally compile code for ARCH_X86. * make-gimp-composite-dispatch.c: retired. See make-installer.py * gimp-composite-mmx.c (op_overlay): namespace cleanup, op_overlay() and all of the constant values are now static * gimp-composite-mmx.c, gimp-composite-sse.c: fixed bug with the alpha mask being the address of the alpha mask, not the mask itself. * app/paint-funcs/paint-funcs.c: Check gimp_composite_options.use to see if we should use the new code or the old code.
2003-08-14 15:43:34 +08:00
GimpCompositeContext generic_ctx;
GimpCompositeContext special_ctx;
double ft0;
double ft1;
gimp_rgba8_t *rgba8D1;
gimp_rgba8_t *rgba8D2;
gimp_rgba8_t *rgba8A;
gimp_rgba8_t *rgba8B;
gimp_rgba8_t *rgba8M;
gimp_va8_t *va8A;
gimp_va8_t *va8B;
gimp_va8_t *va8M;
gimp_va8_t *va8D1;
gimp_va8_t *va8D2;
int i;
printf("\nRunning gimp_composite_mmx tests...\n");
if (gimp_composite_mmx_init () == 0)
{
printf("gimp_composite_mmx: Instruction set is not available.\n");
return (0);
}
rgba8A = gimp_composite_regression_random_rgba8(n_pixels+1);
rgba8B = gimp_composite_regression_random_rgba8(n_pixels+1);
rgba8M = gimp_composite_regression_random_rgba8(n_pixels+1);
composite/ modularisation of the automatic compositing function "wiring" * composite/ modularisation of the automatic compositing function "wiring" to construct the table of compositing functions at run-time instead of compile time. The environment variable GIMP_COMPOSITE is a hexadecimal number representing a bit-field used to set/reset options in the gimp-composite code. * gimp-composite-altivec.[ch]: added * gimp-composite-altivec-installer.[ch]: added * gimp-composite-vis.[ch]: added * gimp-composite-vis-installer.[ch]: added * gimp-composite-mmx-installer.[ch]: added * gimp-composite-sse-installer.[ch]: added * gimp-composite-altivec-test.[ch]: added * gimp-composite-vis-test.[ch]: added * gimp-composite-mmx-test.[ch]: added * gimp-composite-sse-test.[ch]: added * make-installer.py: Added meta programme for generating code to 1) construct a table of compositing functions indexed by operation, and the pixel formats of the sources and destination, and 2) generating code for regression testing of these compositing functions against the same functions in gimp-composite-generic.c * gimp-composite-mmx.c (xxxgimp_composite_overlay_rgba8_rgba8_rgba8_mmx): removing from the current set of optimisations because it appears to be broken. * Makefile.am: modified regression testing targets to now build gimp-composite-*-test where * is any of generic, mmx, sse, altivec, and vis. * gimp-composite.c: moved in initialisation code gimp_composite_init() from gimp-composite-dispatch.c * gimp-composite.c: removed gimp_composite_unsupported(). * gimp-composite.c: use cpu_accel() to determine at run-time which set of optimisations are to be used. * gimp-composite.c: conditionally compile code for ARCH_X86. * make-gimp-composite-dispatch.c: retired. See make-installer.py * gimp-composite-mmx.c (op_overlay): namespace cleanup, op_overlay() and all of the constant values are now static * gimp-composite-mmx.c, gimp-composite-sse.c: fixed bug with the alpha mask being the address of the alpha mask, not the mask itself. * app/paint-funcs/paint-funcs.c: Check gimp_composite_options.use to see if we should use the new code or the old code.
2003-08-14 15:43:34 +08:00
rgba8D1 = (gimp_rgba8_t *) calloc(sizeof(gimp_rgba8_t), n_pixels+1);
rgba8D2 = (gimp_rgba8_t *) calloc(sizeof(gimp_rgba8_t), n_pixels+1);
va8A = (gimp_va8_t *) calloc(sizeof(gimp_va8_t), n_pixels+1);
va8B = (gimp_va8_t *) calloc(sizeof(gimp_va8_t), n_pixels+1);
va8M = (gimp_va8_t *) calloc(sizeof(gimp_va8_t), n_pixels+1);
va8D1 = (gimp_va8_t *) calloc(sizeof(gimp_va8_t), n_pixels+1);
va8D2 = (gimp_va8_t *) calloc(sizeof(gimp_va8_t), n_pixels+1);
for (i = 0; i < n_pixels; i++)
{
va8A[i].v = i;
va8A[i].a = 255-i;
va8B[i].v = i;
va8B[i].a = i;
va8M[i].v = i;
va8M[i].a = i;
}
composite/ modularisation of the automatic compositing function "wiring" * composite/ modularisation of the automatic compositing function "wiring" to construct the table of compositing functions at run-time instead of compile time. The environment variable GIMP_COMPOSITE is a hexadecimal number representing a bit-field used to set/reset options in the gimp-composite code. * gimp-composite-altivec.[ch]: added * gimp-composite-altivec-installer.[ch]: added * gimp-composite-vis.[ch]: added * gimp-composite-vis-installer.[ch]: added * gimp-composite-mmx-installer.[ch]: added * gimp-composite-sse-installer.[ch]: added * gimp-composite-altivec-test.[ch]: added * gimp-composite-vis-test.[ch]: added * gimp-composite-mmx-test.[ch]: added * gimp-composite-sse-test.[ch]: added * make-installer.py: Added meta programme for generating code to 1) construct a table of compositing functions indexed by operation, and the pixel formats of the sources and destination, and 2) generating code for regression testing of these compositing functions against the same functions in gimp-composite-generic.c * gimp-composite-mmx.c (xxxgimp_composite_overlay_rgba8_rgba8_rgba8_mmx): removing from the current set of optimisations because it appears to be broken. * Makefile.am: modified regression testing targets to now build gimp-composite-*-test where * is any of generic, mmx, sse, altivec, and vis. * gimp-composite.c: moved in initialisation code gimp_composite_init() from gimp-composite-dispatch.c * gimp-composite.c: removed gimp_composite_unsupported(). * gimp-composite.c: use cpu_accel() to determine at run-time which set of optimisations are to be used. * gimp-composite.c: conditionally compile code for ARCH_X86. * make-gimp-composite-dispatch.c: retired. See make-installer.py * gimp-composite-mmx.c (op_overlay): namespace cleanup, op_overlay() and all of the constant values are now static * gimp-composite-mmx.c, gimp-composite-sse.c: fixed bug with the alpha mask being the address of the alpha mask, not the mask itself. * app/paint-funcs/paint-funcs.c: Check gimp_composite_options.use to see if we should use the new code or the old code.
2003-08-14 15:43:34 +08:00
gimp_composite_context_init (&special_ctx, GIMP_COMPOSITE_ADDITION, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D2);
gimp_composite_context_init (&generic_ctx, GIMP_COMPOSITE_ADDITION, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D1);
ft0 = gimp_composite_regression_time_function (iterations, gimp_composite_dispatch, &generic_ctx);
ft1 = gimp_composite_regression_time_function (iterations, gimp_composite_addition_rgba8_rgba8_rgba8_mmx, &special_ctx);
if (gimp_composite_regression_compare_contexts ("addition", &generic_ctx, &special_ctx))
{
printf("addition failed\n");
return (1);
}
gimp_composite_regression_timer_report ("addition", ft0, ft1);
composite/ modularisation of the automatic compositing function "wiring" * composite/ modularisation of the automatic compositing function "wiring" to construct the table of compositing functions at run-time instead of compile time. The environment variable GIMP_COMPOSITE is a hexadecimal number representing a bit-field used to set/reset options in the gimp-composite code. * gimp-composite-altivec.[ch]: added * gimp-composite-altivec-installer.[ch]: added * gimp-composite-vis.[ch]: added * gimp-composite-vis-installer.[ch]: added * gimp-composite-mmx-installer.[ch]: added * gimp-composite-sse-installer.[ch]: added * gimp-composite-altivec-test.[ch]: added * gimp-composite-vis-test.[ch]: added * gimp-composite-mmx-test.[ch]: added * gimp-composite-sse-test.[ch]: added * make-installer.py: Added meta programme for generating code to 1) construct a table of compositing functions indexed by operation, and the pixel formats of the sources and destination, and 2) generating code for regression testing of these compositing functions against the same functions in gimp-composite-generic.c * gimp-composite-mmx.c (xxxgimp_composite_overlay_rgba8_rgba8_rgba8_mmx): removing from the current set of optimisations because it appears to be broken. * Makefile.am: modified regression testing targets to now build gimp-composite-*-test where * is any of generic, mmx, sse, altivec, and vis. * gimp-composite.c: moved in initialisation code gimp_composite_init() from gimp-composite-dispatch.c * gimp-composite.c: removed gimp_composite_unsupported(). * gimp-composite.c: use cpu_accel() to determine at run-time which set of optimisations are to be used. * gimp-composite.c: conditionally compile code for ARCH_X86. * make-gimp-composite-dispatch.c: retired. See make-installer.py * gimp-composite-mmx.c (op_overlay): namespace cleanup, op_overlay() and all of the constant values are now static * gimp-composite-mmx.c, gimp-composite-sse.c: fixed bug with the alpha mask being the address of the alpha mask, not the mask itself. * app/paint-funcs/paint-funcs.c: Check gimp_composite_options.use to see if we should use the new code or the old code.
2003-08-14 15:43:34 +08:00
gimp_composite_context_init (&special_ctx, GIMP_COMPOSITE_BURN, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D2);
gimp_composite_context_init (&generic_ctx, GIMP_COMPOSITE_BURN, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D1);
ft0 = gimp_composite_regression_time_function (iterations, gimp_composite_dispatch, &generic_ctx);
ft1 = gimp_composite_regression_time_function (iterations, gimp_composite_burn_rgba8_rgba8_rgba8_mmx, &special_ctx);
if (gimp_composite_regression_compare_contexts ("burn", &generic_ctx, &special_ctx))
{
printf("burn failed\n");
return (1);
}
gimp_composite_regression_timer_report ("burn", ft0, ft1);
composite/ modularisation of the automatic compositing function "wiring" * composite/ modularisation of the automatic compositing function "wiring" to construct the table of compositing functions at run-time instead of compile time. The environment variable GIMP_COMPOSITE is a hexadecimal number representing a bit-field used to set/reset options in the gimp-composite code. * gimp-composite-altivec.[ch]: added * gimp-composite-altivec-installer.[ch]: added * gimp-composite-vis.[ch]: added * gimp-composite-vis-installer.[ch]: added * gimp-composite-mmx-installer.[ch]: added * gimp-composite-sse-installer.[ch]: added * gimp-composite-altivec-test.[ch]: added * gimp-composite-vis-test.[ch]: added * gimp-composite-mmx-test.[ch]: added * gimp-composite-sse-test.[ch]: added * make-installer.py: Added meta programme for generating code to 1) construct a table of compositing functions indexed by operation, and the pixel formats of the sources and destination, and 2) generating code for regression testing of these compositing functions against the same functions in gimp-composite-generic.c * gimp-composite-mmx.c (xxxgimp_composite_overlay_rgba8_rgba8_rgba8_mmx): removing from the current set of optimisations because it appears to be broken. * Makefile.am: modified regression testing targets to now build gimp-composite-*-test where * is any of generic, mmx, sse, altivec, and vis. * gimp-composite.c: moved in initialisation code gimp_composite_init() from gimp-composite-dispatch.c * gimp-composite.c: removed gimp_composite_unsupported(). * gimp-composite.c: use cpu_accel() to determine at run-time which set of optimisations are to be used. * gimp-composite.c: conditionally compile code for ARCH_X86. * make-gimp-composite-dispatch.c: retired. See make-installer.py * gimp-composite-mmx.c (op_overlay): namespace cleanup, op_overlay() and all of the constant values are now static * gimp-composite-mmx.c, gimp-composite-sse.c: fixed bug with the alpha mask being the address of the alpha mask, not the mask itself. * app/paint-funcs/paint-funcs.c: Check gimp_composite_options.use to see if we should use the new code or the old code.
2003-08-14 15:43:34 +08:00
gimp_composite_context_init (&special_ctx, GIMP_COMPOSITE_DARKEN, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D2);
gimp_composite_context_init (&generic_ctx, GIMP_COMPOSITE_DARKEN, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D1);
ft0 = gimp_composite_regression_time_function (iterations, gimp_composite_dispatch, &generic_ctx);
ft1 = gimp_composite_regression_time_function (iterations, gimp_composite_darken_rgba8_rgba8_rgba8_mmx, &special_ctx);
if (gimp_composite_regression_compare_contexts ("darken", &generic_ctx, &special_ctx))
{
printf("darken failed\n");
return (1);
}
gimp_composite_regression_timer_report ("darken", ft0, ft1);
composite/ modularisation of the automatic compositing function "wiring" * composite/ modularisation of the automatic compositing function "wiring" to construct the table of compositing functions at run-time instead of compile time. The environment variable GIMP_COMPOSITE is a hexadecimal number representing a bit-field used to set/reset options in the gimp-composite code. * gimp-composite-altivec.[ch]: added * gimp-composite-altivec-installer.[ch]: added * gimp-composite-vis.[ch]: added * gimp-composite-vis-installer.[ch]: added * gimp-composite-mmx-installer.[ch]: added * gimp-composite-sse-installer.[ch]: added * gimp-composite-altivec-test.[ch]: added * gimp-composite-vis-test.[ch]: added * gimp-composite-mmx-test.[ch]: added * gimp-composite-sse-test.[ch]: added * make-installer.py: Added meta programme for generating code to 1) construct a table of compositing functions indexed by operation, and the pixel formats of the sources and destination, and 2) generating code for regression testing of these compositing functions against the same functions in gimp-composite-generic.c * gimp-composite-mmx.c (xxxgimp_composite_overlay_rgba8_rgba8_rgba8_mmx): removing from the current set of optimisations because it appears to be broken. * Makefile.am: modified regression testing targets to now build gimp-composite-*-test where * is any of generic, mmx, sse, altivec, and vis. * gimp-composite.c: moved in initialisation code gimp_composite_init() from gimp-composite-dispatch.c * gimp-composite.c: removed gimp_composite_unsupported(). * gimp-composite.c: use cpu_accel() to determine at run-time which set of optimisations are to be used. * gimp-composite.c: conditionally compile code for ARCH_X86. * make-gimp-composite-dispatch.c: retired. See make-installer.py * gimp-composite-mmx.c (op_overlay): namespace cleanup, op_overlay() and all of the constant values are now static * gimp-composite-mmx.c, gimp-composite-sse.c: fixed bug with the alpha mask being the address of the alpha mask, not the mask itself. * app/paint-funcs/paint-funcs.c: Check gimp_composite_options.use to see if we should use the new code or the old code.
2003-08-14 15:43:34 +08:00
gimp_composite_context_init (&special_ctx, GIMP_COMPOSITE_DIFFERENCE, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D2);
gimp_composite_context_init (&generic_ctx, GIMP_COMPOSITE_DIFFERENCE, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D1);
ft0 = gimp_composite_regression_time_function (iterations, gimp_composite_dispatch, &generic_ctx);
ft1 = gimp_composite_regression_time_function (iterations, gimp_composite_difference_rgba8_rgba8_rgba8_mmx, &special_ctx);
if (gimp_composite_regression_compare_contexts ("difference", &generic_ctx, &special_ctx))
{
printf("difference failed\n");
return (1);
}
gimp_composite_regression_timer_report ("difference", ft0, ft1);
composite/ modularisation of the automatic compositing function "wiring" * composite/ modularisation of the automatic compositing function "wiring" to construct the table of compositing functions at run-time instead of compile time. The environment variable GIMP_COMPOSITE is a hexadecimal number representing a bit-field used to set/reset options in the gimp-composite code. * gimp-composite-altivec.[ch]: added * gimp-composite-altivec-installer.[ch]: added * gimp-composite-vis.[ch]: added * gimp-composite-vis-installer.[ch]: added * gimp-composite-mmx-installer.[ch]: added * gimp-composite-sse-installer.[ch]: added * gimp-composite-altivec-test.[ch]: added * gimp-composite-vis-test.[ch]: added * gimp-composite-mmx-test.[ch]: added * gimp-composite-sse-test.[ch]: added * make-installer.py: Added meta programme for generating code to 1) construct a table of compositing functions indexed by operation, and the pixel formats of the sources and destination, and 2) generating code for regression testing of these compositing functions against the same functions in gimp-composite-generic.c * gimp-composite-mmx.c (xxxgimp_composite_overlay_rgba8_rgba8_rgba8_mmx): removing from the current set of optimisations because it appears to be broken. * Makefile.am: modified regression testing targets to now build gimp-composite-*-test where * is any of generic, mmx, sse, altivec, and vis. * gimp-composite.c: moved in initialisation code gimp_composite_init() from gimp-composite-dispatch.c * gimp-composite.c: removed gimp_composite_unsupported(). * gimp-composite.c: use cpu_accel() to determine at run-time which set of optimisations are to be used. * gimp-composite.c: conditionally compile code for ARCH_X86. * make-gimp-composite-dispatch.c: retired. See make-installer.py * gimp-composite-mmx.c (op_overlay): namespace cleanup, op_overlay() and all of the constant values are now static * gimp-composite-mmx.c, gimp-composite-sse.c: fixed bug with the alpha mask being the address of the alpha mask, not the mask itself. * app/paint-funcs/paint-funcs.c: Check gimp_composite_options.use to see if we should use the new code or the old code.
2003-08-14 15:43:34 +08:00
gimp_composite_context_init (&special_ctx, GIMP_COMPOSITE_GRAIN_EXTRACT, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D2);
gimp_composite_context_init (&generic_ctx, GIMP_COMPOSITE_GRAIN_EXTRACT, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D1);
ft0 = gimp_composite_regression_time_function (iterations, gimp_composite_dispatch, &generic_ctx);
ft1 = gimp_composite_regression_time_function (iterations, gimp_composite_grain_extract_rgba8_rgba8_rgba8_mmx, &special_ctx);
if (gimp_composite_regression_compare_contexts ("grain_extract", &generic_ctx, &special_ctx))
{
printf("grain_extract failed\n");
return (1);
}
gimp_composite_regression_timer_report ("grain_extract", ft0, ft1);
gimp_composite_context_init (&special_ctx, GIMP_COMPOSITE_GRAIN_MERGE, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D2);
gimp_composite_context_init (&generic_ctx, GIMP_COMPOSITE_GRAIN_MERGE, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D1);
ft0 = gimp_composite_regression_time_function (iterations, gimp_composite_dispatch, &generic_ctx);
ft1 = gimp_composite_regression_time_function (iterations, gimp_composite_grain_merge_rgba8_rgba8_rgba8_mmx, &special_ctx);
if (gimp_composite_regression_compare_contexts ("grain_merge", &generic_ctx, &special_ctx))
{
printf("grain_merge failed\n");
return (1);
}
gimp_composite_regression_timer_report ("grain_merge", ft0, ft1);
gimp_composite_context_init (&special_ctx, GIMP_COMPOSITE_LIGHTEN, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D2);
gimp_composite_context_init (&generic_ctx, GIMP_COMPOSITE_LIGHTEN, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D1);
ft0 = gimp_composite_regression_time_function (iterations, gimp_composite_dispatch, &generic_ctx);
ft1 = gimp_composite_regression_time_function (iterations, gimp_composite_lighten_rgba8_rgba8_rgba8_mmx, &special_ctx);
if (gimp_composite_regression_compare_contexts ("lighten", &generic_ctx, &special_ctx))
{
printf("lighten failed\n");
return (1);
}
gimp_composite_regression_timer_report ("lighten", ft0, ft1);
gimp_composite_context_init (&special_ctx, GIMP_COMPOSITE_MULTIPLY, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D2);
gimp_composite_context_init (&generic_ctx, GIMP_COMPOSITE_MULTIPLY, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D1);
ft0 = gimp_composite_regression_time_function (iterations, gimp_composite_dispatch, &generic_ctx);
ft1 = gimp_composite_regression_time_function (iterations, gimp_composite_multiply_rgba8_rgba8_rgba8_mmx, &special_ctx);
if (gimp_composite_regression_compare_contexts ("multiply", &generic_ctx, &special_ctx))
{
printf("multiply failed\n");
return (1);
}
gimp_composite_regression_timer_report ("multiply", ft0, ft1);
composite/ modularisation of the automatic compositing function "wiring" * composite/ modularisation of the automatic compositing function "wiring" to construct the table of compositing functions at run-time instead of compile time. The environment variable GIMP_COMPOSITE is a hexadecimal number representing a bit-field used to set/reset options in the gimp-composite code. * gimp-composite-altivec.[ch]: added * gimp-composite-altivec-installer.[ch]: added * gimp-composite-vis.[ch]: added * gimp-composite-vis-installer.[ch]: added * gimp-composite-mmx-installer.[ch]: added * gimp-composite-sse-installer.[ch]: added * gimp-composite-altivec-test.[ch]: added * gimp-composite-vis-test.[ch]: added * gimp-composite-mmx-test.[ch]: added * gimp-composite-sse-test.[ch]: added * make-installer.py: Added meta programme for generating code to 1) construct a table of compositing functions indexed by operation, and the pixel formats of the sources and destination, and 2) generating code for regression testing of these compositing functions against the same functions in gimp-composite-generic.c * gimp-composite-mmx.c (xxxgimp_composite_overlay_rgba8_rgba8_rgba8_mmx): removing from the current set of optimisations because it appears to be broken. * Makefile.am: modified regression testing targets to now build gimp-composite-*-test where * is any of generic, mmx, sse, altivec, and vis. * gimp-composite.c: moved in initialisation code gimp_composite_init() from gimp-composite-dispatch.c * gimp-composite.c: removed gimp_composite_unsupported(). * gimp-composite.c: use cpu_accel() to determine at run-time which set of optimisations are to be used. * gimp-composite.c: conditionally compile code for ARCH_X86. * make-gimp-composite-dispatch.c: retired. See make-installer.py * gimp-composite-mmx.c (op_overlay): namespace cleanup, op_overlay() and all of the constant values are now static * gimp-composite-mmx.c, gimp-composite-sse.c: fixed bug with the alpha mask being the address of the alpha mask, not the mask itself. * app/paint-funcs/paint-funcs.c: Check gimp_composite_options.use to see if we should use the new code or the old code.
2003-08-14 15:43:34 +08:00
gimp_composite_context_init (&special_ctx, GIMP_COMPOSITE_SCALE, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D2);
gimp_composite_context_init (&generic_ctx, GIMP_COMPOSITE_SCALE, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D1);
ft0 = gimp_composite_regression_time_function (iterations, gimp_composite_dispatch, &generic_ctx);
ft1 = gimp_composite_regression_time_function (iterations, gimp_composite_scale_rgba8_rgba8_rgba8_mmx, &special_ctx);
if (gimp_composite_regression_compare_contexts ("scale", &generic_ctx, &special_ctx))
{
printf("scale failed\n");
return (1);
}
gimp_composite_regression_timer_report ("scale", ft0, ft1);
gimp_composite_context_init (&special_ctx, GIMP_COMPOSITE_SCREEN, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D2);
gimp_composite_context_init (&generic_ctx, GIMP_COMPOSITE_SCREEN, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D1);
ft0 = gimp_composite_regression_time_function (iterations, gimp_composite_dispatch, &generic_ctx);
ft1 = gimp_composite_regression_time_function (iterations, gimp_composite_screen_rgba8_rgba8_rgba8_mmx, &special_ctx);
if (gimp_composite_regression_compare_contexts ("screen", &generic_ctx, &special_ctx))
{
printf("screen failed\n");
return (1);
}
gimp_composite_regression_timer_report ("screen", ft0, ft1);
gimp_composite_context_init (&special_ctx, GIMP_COMPOSITE_SUBTRACT, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D2);
gimp_composite_context_init (&generic_ctx, GIMP_COMPOSITE_SUBTRACT, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D1);
ft0 = gimp_composite_regression_time_function (iterations, gimp_composite_dispatch, &generic_ctx);
ft1 = gimp_composite_regression_time_function (iterations, gimp_composite_subtract_rgba8_rgba8_rgba8_mmx, &special_ctx);
if (gimp_composite_regression_compare_contexts ("subtract", &generic_ctx, &special_ctx))
{
printf("subtract failed\n");
return (1);
}
gimp_composite_regression_timer_report ("subtract", ft0, ft1);
gimp_composite_context_init (&special_ctx, GIMP_COMPOSITE_SWAP, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D2);
gimp_composite_context_init (&generic_ctx, GIMP_COMPOSITE_SWAP, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, n_pixels, (unsigned char *) rgba8A, (unsigned char *) rgba8B, (unsigned char *) rgba8B, (unsigned char *) rgba8D1);
ft0 = gimp_composite_regression_time_function (iterations, gimp_composite_dispatch, &generic_ctx);
ft1 = gimp_composite_regression_time_function (iterations, gimp_composite_swap_rgba8_rgba8_rgba8_mmx, &special_ctx);
if (gimp_composite_regression_compare_contexts ("swap", &generic_ctx, &special_ctx))
{
printf("swap failed\n");
return (1);
}
gimp_composite_regression_timer_report ("swap", ft0, ft1);
#endif
composite/ modularisation of the automatic compositing function "wiring" * composite/ modularisation of the automatic compositing function "wiring" to construct the table of compositing functions at run-time instead of compile time. The environment variable GIMP_COMPOSITE is a hexadecimal number representing a bit-field used to set/reset options in the gimp-composite code. * gimp-composite-altivec.[ch]: added * gimp-composite-altivec-installer.[ch]: added * gimp-composite-vis.[ch]: added * gimp-composite-vis-installer.[ch]: added * gimp-composite-mmx-installer.[ch]: added * gimp-composite-sse-installer.[ch]: added * gimp-composite-altivec-test.[ch]: added * gimp-composite-vis-test.[ch]: added * gimp-composite-mmx-test.[ch]: added * gimp-composite-sse-test.[ch]: added * make-installer.py: Added meta programme for generating code to 1) construct a table of compositing functions indexed by operation, and the pixel formats of the sources and destination, and 2) generating code for regression testing of these compositing functions against the same functions in gimp-composite-generic.c * gimp-composite-mmx.c (xxxgimp_composite_overlay_rgba8_rgba8_rgba8_mmx): removing from the current set of optimisations because it appears to be broken. * Makefile.am: modified regression testing targets to now build gimp-composite-*-test where * is any of generic, mmx, sse, altivec, and vis. * gimp-composite.c: moved in initialisation code gimp_composite_init() from gimp-composite-dispatch.c * gimp-composite.c: removed gimp_composite_unsupported(). * gimp-composite.c: use cpu_accel() to determine at run-time which set of optimisations are to be used. * gimp-composite.c: conditionally compile code for ARCH_X86. * make-gimp-composite-dispatch.c: retired. See make-installer.py * gimp-composite-mmx.c (op_overlay): namespace cleanup, op_overlay() and all of the constant values are now static * gimp-composite-mmx.c, gimp-composite-sse.c: fixed bug with the alpha mask being the address of the alpha mask, not the mask itself. * app/paint-funcs/paint-funcs.c: Check gimp_composite_options.use to see if we should use the new code or the old code.
2003-08-14 15:43:34 +08:00
return (0);
}
int
main (int argc, char *argv[])
composite/ modularisation of the automatic compositing function "wiring" * composite/ modularisation of the automatic compositing function "wiring" to construct the table of compositing functions at run-time instead of compile time. The environment variable GIMP_COMPOSITE is a hexadecimal number representing a bit-field used to set/reset options in the gimp-composite code. * gimp-composite-altivec.[ch]: added * gimp-composite-altivec-installer.[ch]: added * gimp-composite-vis.[ch]: added * gimp-composite-vis-installer.[ch]: added * gimp-composite-mmx-installer.[ch]: added * gimp-composite-sse-installer.[ch]: added * gimp-composite-altivec-test.[ch]: added * gimp-composite-vis-test.[ch]: added * gimp-composite-mmx-test.[ch]: added * gimp-composite-sse-test.[ch]: added * make-installer.py: Added meta programme for generating code to 1) construct a table of compositing functions indexed by operation, and the pixel formats of the sources and destination, and 2) generating code for regression testing of these compositing functions against the same functions in gimp-composite-generic.c * gimp-composite-mmx.c (xxxgimp_composite_overlay_rgba8_rgba8_rgba8_mmx): removing from the current set of optimisations because it appears to be broken. * Makefile.am: modified regression testing targets to now build gimp-composite-*-test where * is any of generic, mmx, sse, altivec, and vis. * gimp-composite.c: moved in initialisation code gimp_composite_init() from gimp-composite-dispatch.c * gimp-composite.c: removed gimp_composite_unsupported(). * gimp-composite.c: use cpu_accel() to determine at run-time which set of optimisations are to be used. * gimp-composite.c: conditionally compile code for ARCH_X86. * make-gimp-composite-dispatch.c: retired. See make-installer.py * gimp-composite-mmx.c (op_overlay): namespace cleanup, op_overlay() and all of the constant values are now static * gimp-composite-mmx.c, gimp-composite-sse.c: fixed bug with the alpha mask being the address of the alpha mask, not the mask itself. * app/paint-funcs/paint-funcs.c: Check gimp_composite_options.use to see if we should use the new code or the old code.
2003-08-14 15:43:34 +08:00
{
int iterations;
int n_pixels;
srand (314159);
composite/ modularisation of the automatic compositing function "wiring" * composite/ modularisation of the automatic compositing function "wiring" to construct the table of compositing functions at run-time instead of compile time. The environment variable GIMP_COMPOSITE is a hexadecimal number representing a bit-field used to set/reset options in the gimp-composite code. * gimp-composite-altivec.[ch]: added * gimp-composite-altivec-installer.[ch]: added * gimp-composite-vis.[ch]: added * gimp-composite-vis-installer.[ch]: added * gimp-composite-mmx-installer.[ch]: added * gimp-composite-sse-installer.[ch]: added * gimp-composite-altivec-test.[ch]: added * gimp-composite-vis-test.[ch]: added * gimp-composite-mmx-test.[ch]: added * gimp-composite-sse-test.[ch]: added * make-installer.py: Added meta programme for generating code to 1) construct a table of compositing functions indexed by operation, and the pixel formats of the sources and destination, and 2) generating code for regression testing of these compositing functions against the same functions in gimp-composite-generic.c * gimp-composite-mmx.c (xxxgimp_composite_overlay_rgba8_rgba8_rgba8_mmx): removing from the current set of optimisations because it appears to be broken. * Makefile.am: modified regression testing targets to now build gimp-composite-*-test where * is any of generic, mmx, sse, altivec, and vis. * gimp-composite.c: moved in initialisation code gimp_composite_init() from gimp-composite-dispatch.c * gimp-composite.c: removed gimp_composite_unsupported(). * gimp-composite.c: use cpu_accel() to determine at run-time which set of optimisations are to be used. * gimp-composite.c: conditionally compile code for ARCH_X86. * make-gimp-composite-dispatch.c: retired. See make-installer.py * gimp-composite-mmx.c (op_overlay): namespace cleanup, op_overlay() and all of the constant values are now static * gimp-composite-mmx.c, gimp-composite-sse.c: fixed bug with the alpha mask being the address of the alpha mask, not the mask itself. * app/paint-funcs/paint-funcs.c: Check gimp_composite_options.use to see if we should use the new code or the old code.
2003-08-14 15:43:34 +08:00
putenv ("GIMP_COMPOSITE=0x1");
composite/ modularisation of the automatic compositing function "wiring" * composite/ modularisation of the automatic compositing function "wiring" to construct the table of compositing functions at run-time instead of compile time. The environment variable GIMP_COMPOSITE is a hexadecimal number representing a bit-field used to set/reset options in the gimp-composite code. * gimp-composite-altivec.[ch]: added * gimp-composite-altivec-installer.[ch]: added * gimp-composite-vis.[ch]: added * gimp-composite-vis-installer.[ch]: added * gimp-composite-mmx-installer.[ch]: added * gimp-composite-sse-installer.[ch]: added * gimp-composite-altivec-test.[ch]: added * gimp-composite-vis-test.[ch]: added * gimp-composite-mmx-test.[ch]: added * gimp-composite-sse-test.[ch]: added * make-installer.py: Added meta programme for generating code to 1) construct a table of compositing functions indexed by operation, and the pixel formats of the sources and destination, and 2) generating code for regression testing of these compositing functions against the same functions in gimp-composite-generic.c * gimp-composite-mmx.c (xxxgimp_composite_overlay_rgba8_rgba8_rgba8_mmx): removing from the current set of optimisations because it appears to be broken. * Makefile.am: modified regression testing targets to now build gimp-composite-*-test where * is any of generic, mmx, sse, altivec, and vis. * gimp-composite.c: moved in initialisation code gimp_composite_init() from gimp-composite-dispatch.c * gimp-composite.c: removed gimp_composite_unsupported(). * gimp-composite.c: use cpu_accel() to determine at run-time which set of optimisations are to be used. * gimp-composite.c: conditionally compile code for ARCH_X86. * make-gimp-composite-dispatch.c: retired. See make-installer.py * gimp-composite-mmx.c (op_overlay): namespace cleanup, op_overlay() and all of the constant values are now static * gimp-composite-mmx.c, gimp-composite-sse.c: fixed bug with the alpha mask being the address of the alpha mask, not the mask itself. * app/paint-funcs/paint-funcs.c: Check gimp_composite_options.use to see if we should use the new code or the old code.
2003-08-14 15:43:34 +08:00
iterations = 1;
n_pixels = 1048593;
composite/ modularisation of the automatic compositing function "wiring" * composite/ modularisation of the automatic compositing function "wiring" to construct the table of compositing functions at run-time instead of compile time. The environment variable GIMP_COMPOSITE is a hexadecimal number representing a bit-field used to set/reset options in the gimp-composite code. * gimp-composite-altivec.[ch]: added * gimp-composite-altivec-installer.[ch]: added * gimp-composite-vis.[ch]: added * gimp-composite-vis-installer.[ch]: added * gimp-composite-mmx-installer.[ch]: added * gimp-composite-sse-installer.[ch]: added * gimp-composite-altivec-test.[ch]: added * gimp-composite-vis-test.[ch]: added * gimp-composite-mmx-test.[ch]: added * gimp-composite-sse-test.[ch]: added * make-installer.py: Added meta programme for generating code to 1) construct a table of compositing functions indexed by operation, and the pixel formats of the sources and destination, and 2) generating code for regression testing of these compositing functions against the same functions in gimp-composite-generic.c * gimp-composite-mmx.c (xxxgimp_composite_overlay_rgba8_rgba8_rgba8_mmx): removing from the current set of optimisations because it appears to be broken. * Makefile.am: modified regression testing targets to now build gimp-composite-*-test where * is any of generic, mmx, sse, altivec, and vis. * gimp-composite.c: moved in initialisation code gimp_composite_init() from gimp-composite-dispatch.c * gimp-composite.c: removed gimp_composite_unsupported(). * gimp-composite.c: use cpu_accel() to determine at run-time which set of optimisations are to be used. * gimp-composite.c: conditionally compile code for ARCH_X86. * make-gimp-composite-dispatch.c: retired. See make-installer.py * gimp-composite-mmx.c (op_overlay): namespace cleanup, op_overlay() and all of the constant values are now static * gimp-composite-mmx.c, gimp-composite-sse.c: fixed bug with the alpha mask being the address of the alpha mask, not the mask itself. * app/paint-funcs/paint-funcs.c: Check gimp_composite_options.use to see if we should use the new code or the old code.
2003-08-14 15:43:34 +08:00
argv++, argc--;
while (argc >= 2)
{
if (argc > 1 && (strcmp (argv[0], "--iterations") == 0 || strcmp (argv[0], "-i") == 0))
{
iterations = atoi(argv[1]);
argc -= 2, argv++; argv++;
}
else if (argc > 1 && (strcmp (argv[0], "--n-pixels") == 0 || strcmp (argv[0], "-n") == 0))
{
n_pixels = atoi (argv[1]);
argc -= 2, argv++; argv++;
}
else
{
printf("Usage: gimp-composites-*-test [-i|--iterations n] [-n|--n-pixels n]");
exit(1);
}
}
gimp_composite_generic_install ();
composite/ modularisation of the automatic compositing function "wiring" * composite/ modularisation of the automatic compositing function "wiring" to construct the table of compositing functions at run-time instead of compile time. The environment variable GIMP_COMPOSITE is a hexadecimal number representing a bit-field used to set/reset options in the gimp-composite code. * gimp-composite-altivec.[ch]: added * gimp-composite-altivec-installer.[ch]: added * gimp-composite-vis.[ch]: added * gimp-composite-vis-installer.[ch]: added * gimp-composite-mmx-installer.[ch]: added * gimp-composite-sse-installer.[ch]: added * gimp-composite-altivec-test.[ch]: added * gimp-composite-vis-test.[ch]: added * gimp-composite-mmx-test.[ch]: added * gimp-composite-sse-test.[ch]: added * make-installer.py: Added meta programme for generating code to 1) construct a table of compositing functions indexed by operation, and the pixel formats of the sources and destination, and 2) generating code for regression testing of these compositing functions against the same functions in gimp-composite-generic.c * gimp-composite-mmx.c (xxxgimp_composite_overlay_rgba8_rgba8_rgba8_mmx): removing from the current set of optimisations because it appears to be broken. * Makefile.am: modified regression testing targets to now build gimp-composite-*-test where * is any of generic, mmx, sse, altivec, and vis. * gimp-composite.c: moved in initialisation code gimp_composite_init() from gimp-composite-dispatch.c * gimp-composite.c: removed gimp_composite_unsupported(). * gimp-composite.c: use cpu_accel() to determine at run-time which set of optimisations are to be used. * gimp-composite.c: conditionally compile code for ARCH_X86. * make-gimp-composite-dispatch.c: retired. See make-installer.py * gimp-composite-mmx.c (op_overlay): namespace cleanup, op_overlay() and all of the constant values are now static * gimp-composite-mmx.c, gimp-composite-sse.c: fixed bug with the alpha mask being the address of the alpha mask, not the mask itself. * app/paint-funcs/paint-funcs.c: Check gimp_composite_options.use to see if we should use the new code or the old code.
2003-08-14 15:43:34 +08:00
return (gimp_composite_mmx_test (iterations, n_pixels));
composite/ modularisation of the automatic compositing function "wiring" * composite/ modularisation of the automatic compositing function "wiring" to construct the table of compositing functions at run-time instead of compile time. The environment variable GIMP_COMPOSITE is a hexadecimal number representing a bit-field used to set/reset options in the gimp-composite code. * gimp-composite-altivec.[ch]: added * gimp-composite-altivec-installer.[ch]: added * gimp-composite-vis.[ch]: added * gimp-composite-vis-installer.[ch]: added * gimp-composite-mmx-installer.[ch]: added * gimp-composite-sse-installer.[ch]: added * gimp-composite-altivec-test.[ch]: added * gimp-composite-vis-test.[ch]: added * gimp-composite-mmx-test.[ch]: added * gimp-composite-sse-test.[ch]: added * make-installer.py: Added meta programme for generating code to 1) construct a table of compositing functions indexed by operation, and the pixel formats of the sources and destination, and 2) generating code for regression testing of these compositing functions against the same functions in gimp-composite-generic.c * gimp-composite-mmx.c (xxxgimp_composite_overlay_rgba8_rgba8_rgba8_mmx): removing from the current set of optimisations because it appears to be broken. * Makefile.am: modified regression testing targets to now build gimp-composite-*-test where * is any of generic, mmx, sse, altivec, and vis. * gimp-composite.c: moved in initialisation code gimp_composite_init() from gimp-composite-dispatch.c * gimp-composite.c: removed gimp_composite_unsupported(). * gimp-composite.c: use cpu_accel() to determine at run-time which set of optimisations are to be used. * gimp-composite.c: conditionally compile code for ARCH_X86. * make-gimp-composite-dispatch.c: retired. See make-installer.py * gimp-composite-mmx.c (op_overlay): namespace cleanup, op_overlay() and all of the constant values are now static * gimp-composite-mmx.c, gimp-composite-sse.c: fixed bug with the alpha mask being the address of the alpha mask, not the mask itself. * app/paint-funcs/paint-funcs.c: Check gimp_composite_options.use to see if we should use the new code or the old code.
2003-08-14 15:43:34 +08:00
}