Commit 54630be2 authored by Helvetix Victorinox's avatar Helvetix Victorinox

Print the list of active instruction sets if the --verbose command line

* app/composite/gimp-composite.c (gimp_composite_init): Print the
list of active instruction sets if the --verbose command line
switch is ON (via be_verbose)

* app/composite/gimp-composite-x86.h: Factored code from the mmx,
and sse implementations.

* app/composite/make-installer.py: Raised the number of test
iterations from 1 to 10.

* app/composite/gimp-composite-3dnow.[ch]
* app/composite/gimp-composite-3dnow-test.c
* app/composite/gimp-composite-3dnow-installer.c
* app/composite/gimp-composite-altivec.[ch]
* app/composite/gimp-composite-altivec-test.c
* app/composite/gimp-composite-altivec-installer.c
* app/composite/gimp-composite-mmx.[ch]
* app/composite/gimp-composite-altivec-test.c
* app/composite/gimp-composite-altivec-installer.c
* app/composite/gimp-composite-sse.[ch]
* app/composite/gimp-composite-sse-test.c
* app/composite/gimp-composite-sse-installer.c
* app/composite/gimp-composite-sse2.[ch]
* app/composite/gimp-composite-sse2-test.c
* app/composite/gimp-composite-sse2-installer.c
* app/composite/gimp-composite-vis.[ch]
* app/composite/gimp-composite-vis-test.c:
Regenerated sources via make-installer.py
parent 03b3f8c9
2004-07-20 Helvetix Victorinox <helvetix@gimp.org>
* app/composite/gimp-composite.c (gimp_composite_init): Print the
list of active instruction sets if the --verbose command line
switch is ON (via be_verbose)
* app/composite/gimp-composite-x86.h: Factored code from the mmx,
and sse implementations.
* app/composite/make-installer.py: Raised the number of test
iterations from 1 to 10.
* app/composite/gimp-composite-3dnow.[ch]
* app/composite/gimp-composite-3dnow-test.c
* app/composite/gimp-composite-3dnow-installer.c
* app/composite/gimp-composite-altivec.[ch]
* app/composite/gimp-composite-altivec-test.c
* app/composite/gimp-composite-altivec-installer.c
* app/composite/gimp-composite-mmx.[ch]
* app/composite/gimp-composite-altivec-test.c
* app/composite/gimp-composite-altivec-installer.c
* app/composite/gimp-composite-sse.[ch]
* app/composite/gimp-composite-sse-test.c
* app/composite/gimp-composite-sse-installer.c
* app/composite/gimp-composite-sse2.[ch]
* app/composite/gimp-composite-sse2-test.c
* app/composite/gimp-composite-sse2-installer.c
* app/composite/gimp-composite-vis.[ch]
* app/composite/gimp-composite-vis-test.c:
Regenerated sources via make-installer.py
2004-07-20 Sven Neumann <sven@gimp.org>
* app/app_procs.c
......
......@@ -19,7 +19,7 @@
int
gimp_composite_3dnow_test (int iterations, int n_pixels)
{
#if (__GNUC__ >= 3) && defined(USE_3DNOW) && defined(ARCH_X86) && (defined(ARCH_X86_64) || !defined(PIC))
#if defined(COMPILE_3DNOW_IS_OKAY)
GimpCompositeContext generic_ctx;
GimpCompositeContext special_ctx;
double ft0;
......@@ -78,7 +78,7 @@ main (int argc, char *argv[])
putenv ("GIMP_COMPOSITE=0x1");
iterations = 1;
iterations = 10;
n_pixels = 1048593;
argv++, argc--;
......
......@@ -31,22 +31,17 @@
#include "base/cpu-accel.h"
#include "gimp-composite.h"
#include "gimp-composite-3dnow.h"
#if defined(USE_MMX)
#if defined(ARCH_X86)
#if __GNUC__ >= 3
#if defined(ARCH_X86_64) || !defined(PIC)
#ifdef COMPILE_3DNOW_IS_OKAY
#endif /* ARCH_X86_64 || !PIC */
#endif /* __GNUC__ > 3 */
#endif /* ARCH_X86 */
#endif /* USE_MMX */
#endif
gboolean
gimp_composite_3dnow_init (void)
{
#if defined(USE_MMX) && defined(ARCH_X86) && (defined(ARCH_X86_64) || !defined(PIC))
#ifdef COMPILE_3DNOW_IS_OKAY
if (cpu_accel () & CPU_ACCEL_X86_3DNOW)
{
return (TRUE);
......
......@@ -9,4 +9,16 @@ extern gboolean gimp_composite_3dnow_init (void);
*/
extern gboolean gimp_composite_3dnow_install (void);
#if !defined(__INTEL_COMPILER)
#if defined(USE_MMX)
#if defined(ARCH_X86)
#if __GNUC__ >= 3
#if defined(ARCH_X86_64) || !defined(PIC)
#define COMPILE_3DNOW_IS_OKAY (1)
#endif /* ARCH_X86_64 || !PIC */
#endif /* __GNUC__ > 3 */
#endif /* ARCH_X86 */
#endif /* USE_MMX */
#endif /* !defined(__INTEL_COMPILER) */
#endif
......@@ -19,7 +19,7 @@
int
gimp_composite_altivec_test (int iterations, int n_pixels)
{
#if (__GNUC__ >= 3) && defined(USE_ALTIVEC) && defined(ARCH_PPC)
#if defined(COMPILE_ALTIVEC_IS_OKAY)
GimpCompositeContext generic_ctx;
GimpCompositeContext special_ctx;
double ft0;
......@@ -78,7 +78,7 @@ main (int argc, char *argv[])
putenv ("GIMP_COMPOSITE=0x1");
iterations = 1;
iterations = 10;
n_pixels = 1048593;
argv++, argc--;
......
......@@ -30,16 +30,14 @@
#include "gimp-composite.h"
#include "gimp-composite-altivec.h"
#ifdef ARCH_PPC
#if __GNUC__ >= 3
#ifdef COMPILE_ALTIVEC_IS_OKAY
#endif /* __GNUC__ > 3 */
#endif /* ARCH_PPC */
#endif
gboolean
gimp_composite_altivec_init (void)
{
#ifdef ARCH_PPC
#ifdef COMPILE_ALTIVEC_IS_OKAY
if (cpu_accel () & CPU_ACCEL_PPC_ALTIVEC)
{
return (TRUE);
......
......@@ -9,4 +9,10 @@ extern gboolean gimp_composite_altivec_init (void);
*/
extern gboolean gimp_composite_altivec_install (void);
#ifdef ARCH_PPC
#if __GNUC__ >= 3
#define COMPILE_ALTIVEC_IS_OKAY (1)
#endif /* __GNUC__ > 3 */
#endif /* ARCH_PPC */
#endif
......@@ -16,7 +16,7 @@ static struct install_table {
GimpPixelFormat D;
void (*function)(GimpCompositeContext *);
} _gimp_composite_mmx[] = {
#if (__GNUC__ >= 3) && defined(USE_MMX) && defined(ARCH_X86) && (defined(ARCH_X86_64) || !defined(PIC))
#if defined(COMPILE_MMX_IS_OKAY)
{ GIMP_COMPOSITE_MULTIPLY, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, gimp_composite_multiply_rgba8_rgba8_rgba8_mmx },
{ GIMP_COMPOSITE_SCREEN, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, gimp_composite_screen_rgba8_rgba8_rgba8_mmx },
{ GIMP_COMPOSITE_DIFFERENCE, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, gimp_composite_difference_rgba8_rgba8_rgba8_mmx },
......
......@@ -19,7 +19,7 @@
int
gimp_composite_mmx_test (int iterations, int n_pixels)
{
#if (__GNUC__ >= 3) && defined(USE_MMX) && defined(ARCH_X86) && (defined(ARCH_X86_64) || !defined(PIC))
#if defined(COMPILE_MMX_IS_OKAY)
GimpCompositeContext generic_ctx;
GimpCompositeContext special_ctx;
double ft0;
......@@ -210,7 +210,7 @@ main (int argc, char *argv[])
putenv ("GIMP_COMPOSITE=0x1");
iterations = 1;
iterations = 10;
n_pixels = 1048593;
argv++, argc--;
......
This diff is collapsed.
......@@ -16,7 +16,7 @@ static struct install_table {
GimpPixelFormat D;
void (*function)(GimpCompositeContext *);
} _gimp_composite_sse[] = {
#if (__GNUC__ >= 3) && defined(USE_SSE) && defined(ARCH_X86) && (defined(ARCH_X86_64) || !defined(PIC))
#if defined(COMPILE_SSE_IS_OKAY)
{ GIMP_COMPOSITE_MULTIPLY, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, gimp_composite_multiply_rgba8_rgba8_rgba8_sse },
{ GIMP_COMPOSITE_SCREEN, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, gimp_composite_screen_rgba8_rgba8_rgba8_sse },
{ GIMP_COMPOSITE_DIFFERENCE, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, gimp_composite_difference_rgba8_rgba8_rgba8_sse },
......
......@@ -19,7 +19,7 @@
int
gimp_composite_sse_test (int iterations, int n_pixels)
{
#if (__GNUC__ >= 3) && defined(USE_SSE) && defined(ARCH_X86) && (defined(ARCH_X86_64) || !defined(PIC))
#if defined(COMPILE_SSE_IS_OKAY)
GimpCompositeContext generic_ctx;
GimpCompositeContext special_ctx;
double ft0;
......@@ -210,7 +210,7 @@ main (int argc, char *argv[])
putenv ("GIMP_COMPOSITE=0x1");
iterations = 1;
iterations = 10;
n_pixels = 1048593;
argv++, argc--;
......
......@@ -48,6 +48,7 @@
#define pminub(src,dst,tmp) "pminub " "%%" #src ", %%" #dst
#define pmaxub(src,dst,tmp) "pmaxub " "%%" #src ", %%" #dst
#if 0
/*
* Double-word divide. Adjusted for subsequent unsigned packing
* (high-order bit of each word is cleared)
......@@ -65,7 +66,8 @@
"roll $16, %%eax; " \
"btr $15, %%eax; " \
"movd %%eax,%%" #quotient ";"
#endif
#if 0
/*
* Quadword divide. No adjustment for subsequent unsigned packing
* (high-order bit of each word is left alone)
......@@ -107,7 +109,8 @@
"movd %%eax,%%" #divisor ";" \
"psllq $32,%%" #divisor ";" \
"por %%" #divisor ",%%" #quotient ";"
#endif
#if 0
/* equivalent to the INT_MULT() macro in gimp-composite-generic.c */
/*
* opr2 = INT_MULT(opr1, opr2, t)
......@@ -126,7 +129,8 @@
"\tpsrlw $8, %%"#opr2"; " \
"\tpaddw %%"#opr1", %%"#opr2"; " \
"\tpsrlw $8, %%"#opr2"\n"
#endif
#if 0
/* a = INT_MULT(a,b) */
#define mmx_int_mult(a,b,w128) \
"\tpmullw %%"#b", %%"#a"; " \
......@@ -135,7 +139,9 @@
"\tpsrlw $8, %%"#b"; " \
"\tpaddw %%"#a", %%"#b"; " \
"\tpsrlw $8, %%"#b"\n"
#endif
#if 0
static const guint32 rgba8_alpha_mask_64[2] = { 0xFF000000, 0xFF000000 };
static const guint32 rgba8_b1_64[2] = { 0x01010101, 0x01010101 };
static const guint32 rgba8_b255_64[2] = { 0xFFFFFFFF, 0xFFFFFFFF };
......@@ -149,6 +155,7 @@ static const guint32 va8_alpha_mask[2] = { 0xFF00FF00, 0xFF00FF00 };
static const guint32 va8_b255[2] = { 0xFFFFFFFF, 0xFFFFFFFF };
static const guint32 va8_w1[2] = { 0x00010001, 0x00010001 };
static const guint32 va8_w255[2] = { 0x00FF00FF, 0x00FF00FF };
#endif
/*
*
......@@ -156,48 +163,51 @@ static const guint32 va8_w255[2] = { 0x00FF00FF, 0x00FF00FF };
void
gimp_composite_addition_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
{
GimpCompositeContext op = *_op;
uint64 *d = (uint64 *) _op->D;
uint64 *a = (uint64 *) _op->A;
uint64 *b = (uint64 *) _op->B;
gulong n_pixels = _op->n_pixels;
asm volatile ("movq %0,%%mm0"
: /* empty */
: "m" (*rgba8_alpha_mask_64)
: "%mm0");
for (; op.n_pixels >= 2; op.n_pixels -= 2)
for (; n_pixels >= 2; n_pixels -= 2)
{
asm (" movq %1, %%mm2\n"
"\tmovq %2, %%mm3\n"
"\tmovq %%mm2, %%mm4\n"
"\tpaddusb %%mm3, %%mm4\n"
"\tmovq %%mm0, %%mm1\n"
"\tpandn %%mm4, %%mm1\n"
"\tpminub %%mm3, %%mm2\n"
"\tpand %%mm0, %%mm2\n"
"\tpor %%mm2, %%mm1\n"
"\tmovq %%mm1, %0\n"
: "=m" (*op.D)
: "m" (*op.A), "m" (*op.B)
: "%mm0", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5", "%mm6", "%mm7");
op.A += 8;
op.B += 8;
op.D += 8;
asm volatile (" movq %1, %%mm2\n"
"\tmovq %2, %%mm3\n"
"\tmovq %%mm2, %%mm4\n"
"\tpaddusb %%mm3, %%mm4\n"
"\tmovq %%mm0, %%mm1\n"
"\tpandn %%mm4, %%mm1\n"
"\t" pminub(mm3, mm2, mm4) "\n"
"\tpand %%mm0, %%mm2\n"
"\tpor %%mm2, %%mm1\n"
"\tmovq %%mm1, %0\n"
: "=m" (*d)
: "m" (*a), "m" (*b)
: "%mm0", "%mm1", "%mm2", "%mm3", "%mm4");
a++;
b++;
d++;
}
if (op.n_pixels)
if (n_pixels > 0)
{
asm volatile (" movd %1, %%mm2\n"
"\tmovd %2, %%mm3\n"
asm volatile (" movd %1, %%mm2\n"
"\tmovd %2, %%mm3\n"
"\tmovq %%mm2, %%mm4\n"
"\tpaddusb %%mm3, %%mm4\n"
"\tmovq %%mm0, %%mm1\n"
"\tpandn %%mm4, %%mm1\n"
"\tpminub %%mm3, %%mm2\n"
"\t" pminub(mm3, mm2, mm4) "\n"
"\tpand %%mm0, %%mm2\n"
"\tpor %%mm2, %%mm1\n"
"\tmovd %%mm1, %0\n"
: "=m" (*op.D)
: "m" (*op.A), "m" (*op.B)
: "%mm0", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5", "%mm6", "%mm7");
: "=m" (*d)
: "m" (*a), "m" (*b)
: "%mm0", "%mm1", "%mm2", "%mm3", "%mm4");
}
asm("emms");
......@@ -207,63 +217,66 @@ gimp_composite_addition_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
void
gimp_composite_burn_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
{
GimpCompositeContext op = *_op;
uint64 *d = (uint64 *) _op->D;
uint64 *a = (uint64 *) _op->A;
uint64 *b = (uint64 *) _op->B;
gulong n_pixels = _op->n_pixels;
for (; op.n_pixels >= 2; op.n_pixels -= 2)
for (; n_pixels >= 2; n_pixels -= 2)
{
asm (" movq %1,%%mm0\n"
"\tmovq %2,%%mm1\n"
"\tmovq %3,%%mm2\n"
"\tpsubb %%mm0,%%mm2\n" /* mm2 = 255 - A */
"\tpxor %%mm4,%%mm4\n"
"\tpunpcklbw %%mm2,%%mm4\n" /* mm4 = (255- A) * 256 */
asm volatile (" movq %1,%%mm0\n"
"\tmovq %2,%%mm1\n"
"\tmovq %%mm1,%%mm3\n"
"\tpxor %%mm5,%%mm5\n"
"\tpunpcklbw %%mm5,%%mm3\n"
"\tmovq %4,%%mm5\n"
"\tpaddusw %%mm3,%%mm5\n" /* mm5 = B + 1 */
"\tmovq %3,%%mm2\n"
"\tpsubb %%mm0,%%mm2\n" /* mm2 = 255 - A */
"\tpxor %%mm4,%%mm4\n"
"\tpunpcklbw %%mm2,%%mm4\n" /* mm4 = (255- A) * 256 */
"\t" pdivwqX(mm4,mm5,mm7) "\n"
"\tmovq %%mm1,%%mm3\n"
"\tpxor %%mm5,%%mm5\n"
"\tpunpcklbw %%mm5,%%mm3\n"
"\tmovq %4,%%mm5\n"
"\tpaddusw %%mm3,%%mm5\n" /* mm5 = B + 1 */
"\tmovq %3,%%mm2\n"
"\tpsubb %%mm0,%%mm2\n" /* mm2 = 255 - A */
"\tpxor %%mm4,%%mm4\n"
"\tpunpckhbw %%mm2,%%mm4\n" /* mm4 = (255- A) * 256 */
"\t" pdivwqX(mm4,mm5,mm7) "\n"
"\tmovq %%mm1,%%mm3\n"
"\tpxor %%mm5,%%mm5\n"
"\tpunpckhbw %%mm5,%%mm3\n"
"\tmovq %4,%%mm5\n"
"\tpaddusw %%mm3,%%mm5\n" /* mm5 = B + 1 */
"\t" pdivwqX(mm4,mm5,mm6) "\n"
"\tmovq %3,%%mm2\n"
"\tpsubb %%mm0,%%mm2\n" /* mm2 = 255 - A */
"\tpxor %%mm4,%%mm4\n"
"\tpunpckhbw %%mm2,%%mm4\n" /* mm4 = (255- A) * 256 */
"\tmovq %5,%%mm4\n"
"\tmovq %%mm4,%%mm5\n"
"\tpsubusw %%mm6,%%mm4\n"
"\tpsubusw %%mm7,%%mm5\n"
"\tmovq %%mm1,%%mm3\n"
"\tpxor %%mm5,%%mm5\n"
"\tpunpckhbw %%mm5,%%mm3\n"
"\tmovq %4,%%mm5\n"
"\tpaddusw %%mm3,%%mm5\n" /* mm5 = B + 1 */
"\t" pdivwqX(mm4,mm5,mm6) "\n"
"\tpackuswb %%mm4,%%mm5\n"
"\tmovq %5,%%mm4\n"
"\tmovq %%mm4,%%mm5\n"
"\tpsubusw %%mm6,%%mm4\n"
"\tpsubusw %%mm7,%%mm5\n"
"\tpminub %%mm0,%%mm1\n" /* mm1 = min(mm0,mm1) clobber mm3 */
"\tpackuswb %%mm4,%%mm5\n"
"\tmovq %6,%%mm7\n"
"\tpand %%mm7,%%mm1\n" /* mm1 = mm7 & alpha_mask */
"\t" pminub(mm0,mm1,mm3) "\n" /* mm1 = min(mm0,mm1) clobber mm3 */
"\tpandn %%mm5,%%mm7\n" /* mm7 = ~mm7 & mm5 */
"\tpor %%mm1,%%mm7\n" /* mm7 = mm7 | mm1 */
"\tmovq %6,%%mm7\n" /* mm6 = rgba8_alpha_mask_64 */
"\tpand %%mm7,%%mm1\n" /* mm1 = mm7 & alpha_mask */
"\tmovq %%mm7,%0\n"
: "=m" (*op.D)
: "m" (*op.A), "m" (*op.B), "m" (*rgba8_b255_64), "m" (*rgba8_w1_64), "m" (*rgba8_w255_64), "m" (*rgba8_alpha_mask_64)
: "0", "1", "2", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5", "%mm6", "%mm7");
op.A += 8;
op.B += 8;
op.D += 8;
"\tpandn %%mm5,%%mm7\n" /* mm7 = ~mm7 & mm5 */
"\tpor %%mm1,%%mm7\n" /* mm7 = mm7 | mm1 */
"\tmovq %%mm7,%0\n"
: "=m" (*d)
: "m" (*a), "m" (*b), "m" (*rgba8_b255_64), "m" (*rgba8_w1_64), "m" (*rgba8_w255_64), "m" (*rgba8_alpha_mask_64)
: pdivwqX_clobber, "%mm0", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5", "%mm6", "%mm7");
d++;
b++;
a++;
}
if (op.n_pixels)
if (n_pixels > 0)
{
asm volatile (" movd %1,%%mm0\n"
"\tmovd %2,%%mm1\n"
......@@ -300,7 +313,7 @@ gimp_composite_burn_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
"\tpackuswb %%mm4,%%mm5\n"
"\tpminub %%mm0,%%mm1\n" /* mm1 = min(mm0,mm1) clobber mm3 */
"\t" pminub(mm0,mm1,mm3) "\n" /* mm1 = min(mm0,mm1) clobber mm3 */
"\tmovq %6,%%mm7\n"
"\tpand %%mm7,%%mm1\n" /* mm1 = mm7 & alpha_mask */
......@@ -309,9 +322,9 @@ gimp_composite_burn_rgba8_rgba8_rgba8_sse (GimpCompositeContext *_op)
"\tpor %%mm1,%%mm7\n" /* mm7 = mm7 | mm1 */
"\tmovd %%mm7,%0\n"
: "=m" (*op.D)
: "m" (*op.A), "m" (*op.B), "m" (*rgba8_b255_64), "m" (*rgba8_w1_64), "m" (*rgba8_w255_64), "m" (*rgba8_alpha_mask_64)
: "0", "1", "2", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5", "%mm6", "%mm7");
: "=m" (*d)
: "m" (*a), "m" (*b), "m" (*rgba8_b255_64), "m" (*rgba8_w1_64), "m" (*rgba8_w255_64), "m" (*rgba8_alpha_mask_64)
: pdivwqX_clobber, "%mm0", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5", "%mm6", "%mm7");
}
asm("emms");
......
......@@ -16,7 +16,7 @@ static struct install_table {
GimpPixelFormat D;
void (*function)(GimpCompositeContext *);
} _gimp_composite_sse2[] = {
#if (__GNUC__ >= 3) && defined(USE_SSE) && defined(ARCH_X86) && (defined(ARCH_X86_64) || !defined(PIC))
#if defined(COMPILE_SSE2_IS_OKAY)
{ GIMP_COMPOSITE_DIFFERENCE, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, gimp_composite_difference_rgba8_rgba8_rgba8_sse2 },
{ GIMP_COMPOSITE_ADDITION, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, gimp_composite_addition_rgba8_rgba8_rgba8_sse2 },
{ GIMP_COMPOSITE_SUBTRACT, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, GIMP_PIXELFORMAT_RGBA8, gimp_composite_subtract_rgba8_rgba8_rgba8_sse2 },
......
......@@ -19,7 +19,7 @@
int
gimp_composite_sse2_test (int iterations, int n_pixels)
{
#if (__GNUC__ >= 3) && defined(USE_SSE) && defined(ARCH_X86) && (defined(ARCH_X86_64) || !defined(PIC))
#if defined(COMPILE_SSE2_IS_OKAY)
GimpCompositeContext generic_ctx;
GimpCompositeContext special_ctx;
double ft0;
......@@ -155,7 +155,7 @@ main (int argc, char *argv[])
putenv ("GIMP_COMPOSITE=0x1");
iterations = 1;
iterations = 10;
n_pixels = 1048593;
argv++, argc--;
......
......@@ -19,7 +19,7 @@
int
gimp_composite_vis_test (int iterations, int n_pixels)
{
#if (__GNUC__ >= 3) && defined(USE_VIS) && defined(ARCH_SPARC)
#if defined(COMPILE_VIS_IS_OKAY)
GimpCompositeContext generic_ctx;
GimpCompositeContext special_ctx;
double ft0;
......@@ -78,7 +78,7 @@ main (int argc, char *argv[])
putenv ("GIMP_COMPOSITE=0x1");
iterations = 1;
iterations = 10;
n_pixels = 1048593;
argv++, argc--;
......
......@@ -32,18 +32,14 @@
#include "gimp-composite.h"
#include "gimp-composite-vis.h"
#if defined(USE_VIS)
#if defined(ARCH_SPARC)
#if __GNUC__ >= 3
#ifdef COMPILE_VIS_IS_OKAY
#endif /* __GNUC__ > 3 */
#endif /* defined(ARCH_SPARC) */
#endif /* defined(USE_VIS) */
#endif
gboolean
gimp_composite_vis_init (void)
{
#ifdef ARCH_SPARC
#ifdef COMPILE_VIS_IS_OKAY
return (TRUE);
#else
return (FALSE);
......
......@@ -9,4 +9,12 @@ extern gboolean gimp_composite_vis_init (void);
*/
extern gboolean gimp_composite_vis_install (void);
#if defined(USE_VIS)
#if defined(ARCH_SPARC)
#if __GNUC__ >= 3
#define COMPILE_VIS_IS_OKAY (1)
#endif /* __GNUC__ > 3 */
#endif /* defined(ARCH_SPARC) */
#endif /* defined(USE_VIS) */
#endif
......@@ -21,10 +21,16 @@
#if __GNUC__ >= 3
/*
* Convert the low 8bit byte of the src to 16bit words in dst.
*/
#define mmx_low_bytes_to_words(src,dst,zero) \
"\tmovq %%"#src", %%"#dst"; " \
"\tpunpcklbw %%"#zero", %%"#dst"\n"
/*
* Convert the high 8bit byte of the src to 16bit words in dst.
*/
#define mmx_high_bytes_to_words(src,dst,zero) \
"\tmovq %%"#src", %%"#dst"; " \
"\tpunpckhbw %%"#zero", %%"#dst"\n"
......@@ -230,5 +236,18 @@
"\tpsrlw $8, %%"#opr2"\n"
typedef unsigned long long uint64;
extern const guint32 rgba8_alpha_mask_64[2];
extern const guint32 rgba8_b1_64[2];
extern const guint32 rgba8_b255_64[2];
extern const guint32 rgba8_w1_64[2];
extern const guint32 rgba8_w2_64[2];
extern const guint32 rgba8_w128_64[2];
extern const guint32 rgba8_w256_64[2];
extern const guint32 rgba8_w255_64[2];
extern const guint32 va8_alpha_mask[2];
extern const guint32 va8_b255[2];
extern const guint32 va8_w1[2];
extern const guint32 va8_w255[2];
#endif /* __GNUC__ >= 3 */
......@@ -366,9 +366,12 @@ gimp_composite_init (gboolean be_verbose,
gimp_composite_options.bits |= GIMP_COMPOSITE_OPTION_NOEXTENSIONS;
#ifdef GIMP_UNSTABLE
g_printerr ("gimp_composite: use=%s, verbose=%s\n",
(gimp_composite_options.bits & GIMP_COMPOSITE_OPTION_USE) ? "yes" : "no",
(gimp_composite_options.bits & GIMP_COMPOSITE_OPTION_VERBOSE) ? "yes" : "no");
if (be_verbose)
{
g_printerr ("gimp_composite: use=%s, verbose=%s\n",
(gimp_composite_options.bits & GIMP_COMPOSITE_OPTION_USE) ? "yes" : "no",
(gimp_composite_options.bits & GIMP_COMPOSITE_OPTION_VERBOSE) ? "yes" : "no");
}
#endif
gimp_composite_generic_install ();
......@@ -400,14 +403,17 @@ gimp_composite_init (gboolean be_verbose,
gboolean can_use_vis = gimp_composite_vis_install ();
#ifdef GIMP_UNSTABLE
g_printerr ("supported by gimp_composite: "
"%cmmx %csse %csse2 %c3dnow %caltivec %cvis\n",
can_use_mmx ? '+' : '-',
can_use_sse ? '+' : '-',
can_use_sse2 ? '+' : '-',
can_use_3dnow ? '+' : '-',
can_use_altivec ? '+' : '-',
can_use_vis ? '+' : '-');
if (be_verbose)
{
g_printerr ("Processor instruction sets: "
"%cmmx %csse %csse2 %c3dnow %caltivec %cvis\n",
can_use_mmx ? '+' : '-',
can_use_sse ? '+' : '-',
can_use_sse2 ? '+' : '-',
can_use_3dnow ? '+' : '-',
can_use_altivec ? '+' : '-',
can_use_vis ? '+' : '-');
}
#endif
}
}
......@@ -471,7 +471,7 @@ op.add_option('-f', '--file', action='store', type='string', dest='file',
help='the input object file')
op.add_option('-t', '--test', action='store_true', dest='test', default=False,
help='generate regression testing code')
op.add_option('-i', '--iterations', action='store', type='int', dest='iterations', default=1,
op.add_option('-i', '--iterations', action='store', type='int', dest='iterations', default=10,
help='number of iterations in regression tests')
op.add_option('-n', '--n-pixels', action='store', type="int", dest='n_pixels', default=128*8192+16+1,
help='number of pixels in each regression test iteration')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment