Incorrectly reported the inverse of whether not the 3dNow instruction set

* app/composite/gimp-composite-3dnow.c:
  Incorrectly reported the inverse of whether not the 3dNow instruction set is
	supported by the current CPU.

* app/composite/gimp-composite-{mmx,sse}.c:
  Removed linkage of gimp_composite_divide_*.  Something is
  inexplicably broken, and this will get people working again
  while I debug.  This should close bug #125101.
This commit is contained in:
Helvetix Victorinox 2003-10-23 22:35:06 +00:00
parent 393856aa3d
commit a7476d123b
11 changed files with 37 additions and 51 deletions

View File

@ -1,3 +1,13 @@
2003-10-23 Helvetix Victorinox <helvetix@gimp.org>
* app/composite/gimp-composite-3dnow.c:
Incorrectly reported the inverse of whether not the 3dNow
instruction set is supported by the current CPU.
* app/composite/gimp-composite-{mmx,sse}.c:
Removed linkage of gimp_composite_divide_*. Something is
inexplicably broken, and this will get people working again
while I debug. This should close bug #125101.
2003-10-23 Sven Neumann <sven@gimp.org>
* plug-ins/common/sample_colorize.c: made debugging output

View File

@ -47,8 +47,8 @@ gimp_composite_3dnow_init (void)
#if defined(USE_MMX) && defined(ARCH_X86)
if (cpu_accel () & CPU_ACCEL_X86_3DNOW)
{
return (FALSE);
return (TRUE);
}
#endif
return (TRUE);
return (FALSE);
}

View File

@ -1,5 +1,5 @@
/* -*- mode: c tab-width: 2; c-basic-indent: 2; indent-tabs-mode: nil -*-
* The GIMP -- an image manipulation program
* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
@ -588,8 +588,8 @@ gimp_composite_behind_any_any_any_generic (GimpCompositeContext * ctx)
{
ctx->D = ctx->B;
ctx->combine = gimp_composite_pixel_alphap[ctx->pixelformat_A]
? BEHIND_INTEN
: NO_COMBINATION;
? BEHIND_INTEN
: NO_COMBINATION;
}
/**
@ -656,8 +656,8 @@ gimp_composite_multiply_any_any_any_generic (GimpCompositeContext * ctx)
* gimp_composite_divide_any_any_any_generic:
* @ctx: The compositing context.
*
* Perform an RGB[A] divide operation between the pixel sources
* ctx->A and ctx->B.
* Perform an RGB[A] divide operation between the pixel sources ctx->A
* and ctx->B. ctx->A is the numerator, ctx->B the denominator.
*
**/
void
@ -1373,8 +1373,8 @@ gimp_composite_color_erase_any_any_any_generic (GimpCompositeContext *ctx)
{
ctx->D = ctx->B;
ctx->combine = (gimp_composite_pixel_alphap[ctx->pixelformat_A] && gimp_composite_pixel_alphap[ctx->pixelformat_B])
? COLOR_ERASE_INTEN
: 0;
? COLOR_ERASE_INTEN
: 0;
}
@ -1435,5 +1435,5 @@ gimp_composite_generic_init (void)
for (i = 256; i <= 510; i++)
add_lut[i] = 255;
return (TRUE);
return (TRUE);
}

View File

@ -24,7 +24,6 @@ static struct install_table {
{ GIMP_COMPOSITE_SUBTRACT, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, gimp_composite_subtract_rgba8_rgba8_rgba8_mmx },
{ GIMP_COMPOSITE_DARKEN, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, gimp_composite_darken_rgba8_rgba8_rgba8_mmx },
{ GIMP_COMPOSITE_LIGHTEN, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, gimp_composite_lighten_rgba8_rgba8_rgba8_mmx },
{ GIMP_COMPOSITE_DIVIDE, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, gimp_composite_divide_rgba8_rgba8_rgba8_mmx },
{ GIMP_COMPOSITE_DODGE, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, gimp_composite_dodge_rgba8_rgba8_rgba8_mmx },
{ GIMP_COMPOSITE_BURN, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, gimp_composite_burn_rgba8_rgba8_rgba8_mmx },
{ GIMP_COMPOSITE_GRAIN_EXTRACT, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, gimp_composite_grain_extract_rgba8_rgba8_rgba8_mmx },

View File

@ -109,17 +109,6 @@ gimp_composite_mmx_test (int iterations, int n_pixels)
}
gimp_composite_regression_timer_report ("difference", ft0, ft1);
gimp_composite_context_init (&special_ctx, GIMP_COMPOSITE_DIVIDE, 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_DIVIDE, 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_divide_rgba8_rgba8_rgba8_mmx, &special_ctx);
if (gimp_composite_regression_compare_contexts ("divide", &generic_ctx, &special_ctx))
{
printf("divide failed\n");
return (1);
}
gimp_composite_regression_timer_report ("divide", ft0, ft1);
gimp_composite_context_init (&special_ctx, GIMP_COMPOSITE_DODGE, 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_DODGE, 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);

View File

@ -332,11 +332,13 @@ gimp_composite_difference_rgba8_rgba8_rgba8_mmx (GimpCompositeContext *_op)
}
void
gimp_composite_divide_rgba8_rgba8_rgba8_mmx (GimpCompositeContext *_op)
xxxgimp_composite_divide_rgba8_rgba8_rgba8_mmx (GimpCompositeContext *_op)
{
GimpCompositeContext op = *_op;
asm volatile ("movq %0, %%mm0\n"
printf("A=%d B=%d %d ", op.pixelformat_A, op.pixelformat_B, GIMP_PIXELFORMAT_RGBA8); fflush(stdout);
asm volatile (" movq %0, %%mm0\n"
"\tmovq %1, %%mm7\n"
:
: "m" (*rgba8_alpha_mask), "m" (*rgba8_w1)
@ -1216,14 +1218,14 @@ gimp_composite_swap_rgba8_rgba8_rgba8_mmx (GimpCompositeContext *_op)
if (op.n_pixels)
{
asm volatile (" movd %0,%%mm2\n"
"\tmovd %1,%%mm3\n"
"\tmovd %%mm3,%0\n"
"\tmovd %%mm2,%1\n"
: /* empty */
: "m" (*op.A), "m" (*op.B)
: "0", "1", "%mm1", "%mm2", "%mm3", "%mm4");
}
asm volatile (" movd %0,%%mm2\n"
"\tmovd %1,%%mm3\n"
"\tmovd %%mm3,%0\n"
"\tmovd %%mm2,%1\n"
: /* empty */
: "m" (*op.A), "m" (*op.B)
: "0", "1", "%mm1", "%mm2", "%mm3", "%mm4");
}
asm("emms");
}

View File

@ -24,7 +24,6 @@ static struct install_table {
{ GIMP_COMPOSITE_SUBTRACT, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, gimp_composite_subtract_rgba8_rgba8_rgba8_sse },
{ GIMP_COMPOSITE_DARKEN, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, gimp_composite_darken_rgba8_rgba8_rgba8_sse },
{ GIMP_COMPOSITE_LIGHTEN, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, gimp_composite_lighten_rgba8_rgba8_rgba8_sse },
{ GIMP_COMPOSITE_DIVIDE, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, gimp_composite_divide_rgba8_rgba8_rgba8_sse },
{ GIMP_COMPOSITE_DODGE, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, gimp_composite_dodge_rgba8_rgba8_rgba8_sse },
{ GIMP_COMPOSITE_BURN, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, gimp_composite_burn_rgba8_rgba8_rgba8_sse },
{ GIMP_COMPOSITE_GRAIN_EXTRACT, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, gimp_composite_grain_extract_rgba8_rgba8_rgba8_sse },

View File

@ -109,17 +109,6 @@ gimp_composite_sse_test (int iterations, int n_pixels)
}
gimp_composite_regression_timer_report ("difference", ft0, ft1);
gimp_composite_context_init (&special_ctx, GIMP_COMPOSITE_DIVIDE, 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_DIVIDE, 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_divide_rgba8_rgba8_rgba8_sse, &special_ctx);
if (gimp_composite_regression_compare_contexts ("divide", &generic_ctx, &special_ctx))
{
printf("divide failed\n");
return (1);
}
gimp_composite_regression_timer_report ("divide", ft0, ft1);
gimp_composite_context_init (&special_ctx, GIMP_COMPOSITE_DODGE, 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_DODGE, 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);

View File

@ -406,7 +406,7 @@ gimp_composite_difference_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
}
void
gimp_composite_divide_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
xxxgimp_composite_divide_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
{
GimpCompositeContext op = *_op;

View File

@ -372,7 +372,7 @@ gimp_composite_init (void)
* it succeeded in hooking in the functions with the special
* optimisation instructions, or hardware, or whatever.
*/
if (! (gimp_composite_options.bits & GIMP_COMPOSITE_OPTION_INITIALISED))
if (! (gimp_composite_options.bits & GIMP_COMPOSITE_OPTION_NOEXTENSIONS))
{
extern gboolean gimp_composite_mmx_install ();
extern gboolean gimp_composite_sse_install ();
@ -410,8 +410,6 @@ gimp_composite_init (void)
g_printerr (" +vis");
else
g_printerr (" -vis");
gimp_composite_options.bits |= GIMP_COMPOSITE_OPTION_INITIALISED;
}
g_printerr ("\n");

View File

@ -150,9 +150,9 @@ struct GimpCompositeOptions
gulong bits;
};
#define GIMP_COMPOSITE_OPTION_USE 0x1
#define GIMP_COMPOSITE_OPTION_INITIALISED 0x2
#define GIMP_COMPOSITE_OPTION_VERBOSE 0x4
#define GIMP_COMPOSITE_OPTION_USE 0x1
#define GIMP_COMPOSITE_OPTION_NOEXTENSIONS 0x2
#define GIMP_COMPOSITE_OPTION_VERBOSE 0x4
extern struct GimpCompositeOptions gimp_composite_options;