Removed clobbered register declaration in an attempt to get this to

* app/composite/gimp-composite-sse2.c (gimp_composite_swap_rgba8_rgba8_rgba8_sse2):
  Removed clobbered register declaration in an attempt to get this
  to compile with gcc 3.2.3
This commit is contained in:
Helvetix Victorinox 2003-09-14 16:37:31 +00:00
parent 30f23dfc75
commit e0a4244985
2 changed files with 209 additions and 208 deletions

View File

@ -1,3 +1,9 @@
2003-09-14 Helvetix Victorinox <helvetix@gimp.org>
* app/composite/gimp-composite-sse2.c (gimp_composite_swap_rgba8_rgba8_rgba8_sse2):
Removed clobbered register declaration in an attempt to get this
to compile with gcc 3.2.3
2003-09-13 Sven Neumann <sven@gimp.org>
* app/gui/vectors-commands.c (vectors_export_ok_callback): no need

View File

@ -73,7 +73,7 @@ debug_display_sse (void)
{
#define mask32(x) ((x)& (unsigned long long) 0xFFFFFFFF)
#define print128(reg) { \
unsigned long long reg[2]; \
unsigned long long reg[2]; \
asm("movdqu %%" #reg ",%0" : "=m" (reg)); \
printf(#reg"=%08llx %08llx", mask32(reg[0]>>32), mask32(reg[0])); \
printf(" %08llx %08llx", mask32(reg[1]>>32), mask32(reg[1])); \
@ -98,24 +98,24 @@ gimp_composite_addition_rgba8_rgba8_rgba8_sse2 (GimpCompositeContext *_op)
for (; op.n_pixels >= 4; op.n_pixels -= 4)
{
asm (" movdqu %0, %%xmm2\n"
"\tmovdqu %1, %%xmm3\n"
"\tmovdqu %%xmm2, %%xmm4\n"
"\tpaddusb %%xmm3, %%xmm4\n"
asm (" movdqu %0, %%xmm2\n"
"\tmovdqu %1, %%xmm3\n"
"\tmovdqu %%xmm2, %%xmm4\n"
"\tpaddusb %%xmm3, %%xmm4\n"
"\tmovdqu %%xmm0, %%xmm1\n"
"\tpandn %%xmm4, %%xmm1\n"
"\t" pminub(xmm3, xmm2, xmm4) "\n"
"\tpand %%xmm0, %%xmm2\n"
"\tpor %%xmm2, %%xmm1\n"
"\tmovdqu %%xmm1, %2\n"
: /* empty */
: "m" (*op.A), "m" (*op.B), "m" (*op.D)
: "0", "1", "2", "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "%xmm7");
op.A += 16;
op.B += 16;
op.D += 16;
}
"\tmovdqu %%xmm0, %%xmm1\n"
"\tpandn %%xmm4, %%xmm1\n"
"\t" pminub(xmm3, xmm2, xmm4) "\n"
"\tpand %%xmm0, %%xmm2\n"
"\tpor %%xmm2, %%xmm1\n"
"\tmovdqu %%xmm1, %2\n"
: /* empty */
: "m" (*op.A), "m" (*op.B), "m" (*op.D)
: "0", "1", "2", "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "%xmm7");
op.A += 16;
op.B += 16;
op.D += 16;
}
asm volatile ("movq %0,%%mm0"
: /* empty */
@ -123,41 +123,41 @@ gimp_composite_addition_rgba8_rgba8_rgba8_sse2 (GimpCompositeContext *_op)
: "%mm0");
for (; op.n_pixels >= 2; op.n_pixels -= 2)
{
asm (" movq %0, %%mm2\n"
"\tmovq %1, %%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, %2\n"
: /* empty */
: "m" (*op.A), "m" (*op.B), "m" (*op.D)
: "0", "1", "2", "%mm0", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5", "%mm6", "%mm7");
op.A += 8;
op.B += 8;
op.D += 8;
}
{
asm (" movq %0, %%mm2\n"
"\tmovq %1, %%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, %2\n"
: /* empty */
: "m" (*op.A), "m" (*op.B), "m" (*op.D)
: "0", "1", "2", "%mm0", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5", "%mm6", "%mm7");
op.A += 8;
op.B += 8;
op.D += 8;
}
if (op.n_pixels)
{
asm volatile (" movd (%0), %%mm2;\n"
"\tmovd (%1), %%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"
"\tmovd %%mm1, (%2);\n"
: /* empty */
: "r" (op.A), "r" (op.B), "r" (op.D)
: "0", "1", "2", "%mm0", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5", "%mm6", "%mm7");
}
"\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"
"\tmovd %%mm1, (%2);\n"
: /* empty */
: "r" (op.A), "r" (op.B), "r" (op.D)
: "0", "1", "2", "%mm0", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5", "%mm6", "%mm7");
}
asm("emms");
}
@ -181,77 +181,77 @@ gimp_composite_difference_rgba8_rgba8_rgba8_sse2 (GimpCompositeContext *_op)
{
GimpCompositeContext op = *_op;
asm volatile (" movq %0,%%mm0\n"
"\tmovdqu %1,%%xmm0"
:
: "m" (*rgba8_alpha_mask_64), "m" (*rgba8_alpha_mask_128)
: "%mm0");
asm volatile (" movq %0,%%mm0\n"
"\tmovdqu %1,%%xmm0"
:
: "m" (*rgba8_alpha_mask_64), "m" (*rgba8_alpha_mask_128)
: "%mm0");
for (; op.n_pixels >= 4; op.n_pixels -= 4)
{
asm volatile (" movdqu %0,%%xmm2\n"
"\tmovdqu %1,%%xmm3\n"
"\tmovdqu %%xmm2,%%xmm4\n"
"\tmovdqu %%xmm3,%%xmm5\n"
"\tpsubusb %%xmm3,%%xmm4\n"
"\tpsubusb %%xmm2,%%xmm5\n"
"\tpaddb %%xmm5,%%xmm4\n"
"\tmovdqu %%xmm0,%%xmm1\n"
"\tpandn %%xmm4,%%xmm1\n"
"\tpminub %%xmm3,%%xmm2\n"
"\tpand %%xmm0,%%xmm2\n"
"\tpor %%xmm2,%%xmm1\n"
"\tmovdqu %%xmm1,%2\n"
: /* empty */
: "m" (*op.A), "m" (*op.B), "m" (*op.D)
: "0", "1", "2", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5");
op.A += 16;
op.B += 16;
op.D += 16;
}
{
asm volatile (" movdqu %0,%%xmm2\n"
"\tmovdqu %1,%%xmm3\n"
"\tmovdqu %%xmm2,%%xmm4\n"
"\tmovdqu %%xmm3,%%xmm5\n"
"\tpsubusb %%xmm3,%%xmm4\n"
"\tpsubusb %%xmm2,%%xmm5\n"
"\tpaddb %%xmm5,%%xmm4\n"
"\tmovdqu %%xmm0,%%xmm1\n"
"\tpandn %%xmm4,%%xmm1\n"
"\tpminub %%xmm3,%%xmm2\n"
"\tpand %%xmm0,%%xmm2\n"
"\tpor %%xmm2,%%xmm1\n"
"\tmovdqu %%xmm1,%2\n"
: /* empty */
: "m" (*op.A), "m" (*op.B), "m" (*op.D)
: "0", "1", "2", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5");
op.A += 16;
op.B += 16;
op.D += 16;
}
for (; op.n_pixels >= 2; op.n_pixels -= 2)
{
asm volatile (" movq %0, %%mm2\n"
"\tmovq %1, %%mm3\n"
"\tmovq %%mm2, %%mm4\n"
"\tmovq %%mm3, %%mm5\n"
"\tpsubusb %%mm3, %%mm4\n"
"\tpsubusb %%mm2, %%mm5\n"
"\tpaddb %%mm5, %%mm4\n"
"\tmovq %%mm0, %%mm1\n"
"\tpandn %%mm4, %%mm1\n"
"\tpminub %%mm3, %%mm2\n"
"\tpand %%mm0, %%mm2\n"
"\tpor %%mm2, %%mm1\n"
"\tmovq %%mm1, %2\n"
: /* empty */
: "m" (*op.A), "m" (*op.B), "m" (*op.D)
: "0", "1", "2", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5");
op.A += 8;
op.B += 8;
op.D += 8;
}
{
asm volatile (" movq %0, %%mm2\n"
"\tmovq %1, %%mm3\n"
"\tmovq %%mm2, %%mm4\n"
"\tmovq %%mm3, %%mm5\n"
"\tpsubusb %%mm3, %%mm4\n"
"\tpsubusb %%mm2, %%mm5\n"
"\tpaddb %%mm5, %%mm4\n"
"\tmovq %%mm0, %%mm1\n"
"\tpandn %%mm4, %%mm1\n"
"\tpminub %%mm3, %%mm2\n"
"\tpand %%mm0, %%mm2\n"
"\tpor %%mm2, %%mm1\n"
"\tmovq %%mm1, %2\n"
: /* empty */
: "m" (*op.A), "m" (*op.B), "m" (*op.D)
: "0", "1", "2", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5");
op.A += 8;
op.B += 8;
op.D += 8;
}
if (op.n_pixels)
{
asm volatile (" movd %0, %%mm2\n"
"\tmovd %1, %%mm3\n"
"\tmovq %%mm2, %%mm4\n"
"\tmovq %%mm3, %%mm5\n"
"\tpsubusb %%mm3, %%mm4\n"
"\tpsubusb %%mm2, %%mm5\n"
"\tpaddb %%mm5, %%mm4\n"
"\tmovq %%mm0, %%mm1\n"
"\tpandn %%mm4, %%mm1\n"
"\tpminub %%mm3, %%mm2\n"
"\tpand %%mm0, %%mm2\n"
"\tpor %%mm2, %%mm1\n"
"\tmovd %%mm1, %2\n"
: /* empty */
: "m" (*op.A), "m" (*op.B), "m" (*op.D)
: "0", "1", "2", "%mm1", "%mm2", "%mm3", "%mm4");
}
{
asm volatile (" movd %0, %%mm2\n"
"\tmovd %1, %%mm3\n"
"\tmovq %%mm2, %%mm4\n"
"\tmovq %%mm3, %%mm5\n"
"\tpsubusb %%mm3, %%mm4\n"
"\tpsubusb %%mm2, %%mm5\n"
"\tpaddb %%mm5, %%mm4\n"
"\tmovq %%mm0, %%mm1\n"
"\tpandn %%mm4, %%mm1\n"
"\tpminub %%mm3, %%mm2\n"
"\tpand %%mm0, %%mm2\n"
"\tpor %%mm2, %%mm1\n"
"\tmovd %%mm1, %2\n"
: /* empty */
: "m" (*op.A), "m" (*op.B), "m" (*op.D)
: "0", "1", "2", "%mm1", "%mm2", "%mm3", "%mm4");
}
asm("emms");
}
@ -288,11 +288,6 @@ xxxgimp_composite_multiply_rgba8_rgba8_rgba8_sse2 (GimpCompositeContext *_op)
{
}
static void
sse2_op_overlay(void)
{
}
void
xxxgimp_composite_overlay_rgba8_rgba8_rgba8_sse2 (GimpCompositeContext *_op)
{
@ -316,75 +311,75 @@ gimp_composite_subtract_rgba8_rgba8_rgba8_sse2 (GimpCompositeContext *_op)
GimpCompositeContext op = *_op;
asm volatile (" movq %0,%%mm0\n"
"\tmovdqu %1,%%xmm0\n"
: /* empty */
: "m" (*rgba8_alpha_mask_64), "m" (*rgba8_alpha_mask_128)
: "%mm0", "%xmm0");
"\tmovdqu %1,%%xmm0\n"
: /* empty */
: "m" (*rgba8_alpha_mask_64), "m" (*rgba8_alpha_mask_128)
: "%mm0", "%xmm0");
for (; op.n_pixels >= 4; op.n_pixels -= 4)
{
asm volatile (" movdqu %0,%%xmm2\n"
"\tmovdqu %1,%%xmm3\n"
"\tmovdqu %%xmm2,%%xmm4\n"
"\tpsubusb %%xmm3,%%xmm4\n"
{
asm volatile (" movdqu %0,%%xmm2\n"
"\tmovdqu %1,%%xmm3\n"
"\tmovdqu %%xmm2,%%xmm4\n"
"\tpsubusb %%xmm3,%%xmm4\n"
"\tmovdqu %%xmm0,%%xmm1\n"
"\tpandn %%xmm4,%%xmm1\n"
"\t" pminub(xmm3,xmm2,xmm4) "\n"
"\tpand %%xmm0,%%xmm2\n"
"\tpor %%xmm2,%%xmm1\n"
"\tmovdqu %%xmm1,%2\n"
: /* empty */
: "m" (*op.A), "m" (*op.B), "m" (*op.D)
: "0", "1", "2", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5");
op.A += 16;
op.B += 16;
op.D += 16;
}
"\tmovdqu %%xmm0,%%xmm1\n"
"\tpandn %%xmm4,%%xmm1\n"
"\t" pminub(xmm3,xmm2,xmm4) "\n"
"\tpand %%xmm0,%%xmm2\n"
"\tpor %%xmm2,%%xmm1\n"
"\tmovdqu %%xmm1,%2\n"
: /* empty */
: "m" (*op.A), "m" (*op.B), "m" (*op.D)
: "0", "1", "2", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5");
op.A += 16;
op.B += 16;
op.D += 16;
}
for (; op.n_pixels >= 2; op.n_pixels -= 2)
{
asm volatile (" movq %0,%%mm2\n"
"\tmovq %1,%%mm3\n"
{
asm volatile (" movq %0,%%mm2\n"
"\tmovq %1,%%mm3\n"
"\tmovq %%mm2,%%mm4\n"
"\tpsubusb %%mm3,%%mm4\n"
"\tmovq %%mm2,%%mm4\n"
"\tpsubusb %%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,%2\n"
: /* empty */
: "m" (*op.A), "m" (*op.B), "m" (*op.D)
: "0", "1", "2", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5");
op.A += 8;
op.B += 8;
op.D += 8;
"\tmovq %%mm0,%%mm1\n"
"\tpandn %%mm4,%%mm1\n"
"\t" pminub(mm3,mm2,mm4) "\n"
"\tpand %%mm0,%%mm2\n"
"\tpor %%mm2,%%mm1\n"
"\tmovq %%mm1,%2\n"
: /* empty */
: "m" (*op.A), "m" (*op.B), "m" (*op.D)
: "0", "1", "2", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5");
op.A += 8;
op.B += 8;
op.D += 8;
}
if (op.n_pixels)
{
asm volatile (" movd %0,%%mm2\n"
"\tmovd %1,%%mm3\n"
{
asm volatile (" movd %0,%%mm2\n"
"\tmovd %1,%%mm3\n"
"\tmovq %%mm2,%%mm4\n"
"\tpsubusb %%mm3,%%mm4\n"
"\tmovq %%mm2,%%mm4\n"
"\tpsubusb %%mm3,%%mm4\n"
"\tmovq %%mm0,%%mm1\n"
"\tpandn %%mm4,%%mm1\n"
"\tmovq %%mm0,%%mm1\n"
"\tpandn %%mm4,%%mm1\n"
"\t" pminub(mm3,mm2,mm4) "\n"
"\t" pminub(mm3,mm2,mm4) "\n"
"\tpand %%mm0,%%mm2\n"
"\tpor %%mm2,%%mm1\n"
"\tmovd %%mm1,%2\n"
: /* empty */
: "m" (*op.A), "m" (*op.B), "m" (*op.D)
: "0", "1", "2", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5");
"\tpand %%mm0,%%mm2\n"
"\tpor %%mm2,%%mm1\n"
"\tmovd %%mm1,%2\n"
: /* empty */
: "m" (*op.A), "m" (*op.B), "m" (*op.D)
: "0", "1", "2", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5");
}
asm("emms");
@ -395,40 +390,40 @@ gimp_composite_swap_rgba8_rgba8_rgba8_sse2 (GimpCompositeContext *_op)
{
GimpCompositeContext op = *_op;
/*
* Inhale one whole i686 cache line at once. 64 bytes, 16 rgba8 pixels, 4 128 bit xmm registers.
*/
/*
* Inhale one whole i686 cache line at once. 64 bytes, 16 rgba8 pixels, 4 128 bit xmm registers.
*/
for (; op.n_pixels >= 16; op.n_pixels -= 16)
{
asm volatile (" movdqu %0,%%xmm0\n"
"\tmovdqu %1,%%xmm1\n"
"\tmovdqu %2,%%xmm2\n"
"\tmovdqu %3,%%xmm3\n"
"\tmovdqu %4,%%xmm4\n"
"\tmovdqu %5,%%xmm5\n"
"\tmovdqu %6,%%xmm6\n"
"\tmovdqu %7,%%xmm7\n"
{
asm volatile (" movdqu %0,%%xmm0\n"
"\tmovdqu %1,%%xmm1\n"
"\tmovdqu %2,%%xmm2\n"
"\tmovdqu %3,%%xmm3\n"
"\tmovdqu %4,%%xmm4\n"
"\tmovdqu %5,%%xmm5\n"
"\tmovdqu %6,%%xmm6\n"
"\tmovdqu %7,%%xmm7\n"
"\tmovdqu %%xmm0,%1\n"
"\tmovdqu %%xmm1,%0\n"
"\tmovdqu %%xmm2,%3\n"
"\tmovdqu %%xmm3,%2\n"
"\tmovdqu %%xmm4,%5\n"
"\tmovdqu %%xmm5,%4\n"
"\tmovdqu %%xmm6,%7\n"
"\tmovdqu %%xmm7,%6\n"
: /* empty */
: "m" (op.A[0]), "m" (op.B[0]),
"m" (op.A[1]), "m" (op.B[1]),
"m" (op.A[2]), "m" (op.B[2]),
"m" (op.A[3]), "m" (op.B[3])
: "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "%xmm7");
op.A += 64;
op.B += 64;
"\tmovdqu %%xmm0,%1\n"
"\tmovdqu %%xmm1,%0\n"
"\tmovdqu %%xmm2,%3\n"
"\tmovdqu %%xmm3,%2\n"
"\tmovdqu %%xmm4,%5\n"
"\tmovdqu %%xmm5,%4\n"
"\tmovdqu %%xmm6,%7\n"
"\tmovdqu %%xmm7,%6\n"
: /* empty */
: "m" (op.A[0]), "m" (op.B[0]),
"m" (op.A[1]), "m" (op.B[1]),
"m" (op.A[2]), "m" (op.B[2]),
"m" (op.A[3]), "m" (op.B[3])
);
op.A += 64;
op.B += 64;
}
for (; op.n_pixels >= 4; op.n_pixels -= 4)
{
{
asm volatile (" movdqu %0,%%xmm2\n"
"\tmovdqu %1,%%xmm3\n"
"\tmovdqu %%xmm3,%0\n"
@ -436,12 +431,12 @@ gimp_composite_swap_rgba8_rgba8_rgba8_sse2 (GimpCompositeContext *_op)
: /* empty */
: "m" (*op.A), "m" (*op.B)
: "0", "1", "%xmm1", "%xmm2", "%xmm3", "%xmm4");
op.A += 16;
op.B += 16;
op.A += 16;
op.B += 16;
}
for (; op.n_pixels >= 2; op.n_pixels -= 2)
{
{
asm volatile (" movq %0,%%mm2\n"
"\tmovq %1,%%mm3\n"
"\tmovq %%mm3,%0\n"
@ -449,12 +444,12 @@ gimp_composite_swap_rgba8_rgba8_rgba8_sse2 (GimpCompositeContext *_op)
: /* empty */
: "m" (*op.A), "m" (*op.B)
: "0", "1", "%mm1", "%mm2", "%mm3", "%mm4");
op.A += 8;
op.B += 8;
op.A += 8;
op.B += 8;
}
if (op.n_pixels)
{
{
asm volatile (" movd %0,%%mm2\n"
"\tmovd %1,%%mm3\n"
"\tmovd %%mm3,%0\n"