--- trunk/reactos/subsys/win32k/dib/dib32bpp.c 2005-06-10 22:54:11 UTC (rev 15855)
+++ trunk/reactos/subsys/win32k/dib/dib32bpp.c 2005-06-11 09:53:14 UTC (rev 15856)
@@ -48,10 +48,29 @@
LONG cx = (x2 - x1) ;
PBYTE byteaddr = SurfObj->pvScan0 + y * SurfObj->lDelta;
PDWORD addr = (PDWORD)byteaddr + x1;
- memset4(addr, c, cx);
+
+ __asm__(
+" cld\n"
+" mov %0, %%eax\n"
+" test $0x03, %%edi\n" /* Align to fullword boundary */
+" jnz .L1\n"
+" mov %1,%%ecx\n" /* Setup count of fullwords to fill */
+" rep stosl\n" /* The actual fill */
+" jz .L2\n"
+".L1:\n"
+" mov %%eax, %%ecx\n"
+" stosw\n"
+" sub $0x04,%1\n"
+" mov %1,%%ecx\n" /* Setup count of fullwords to fill */
+" rep stosl\n" /* The actual fill */
+" shr $0x08,%%eax\n"
+" stosw\n"
+".L2:\n"
+ : /* no output */
+ : "r"(c), "r"(cx), "D"(addr)
+ : "%eax", "%ecx");
+
-
-
}
#else
VOID
@@ -693,9 +712,28 @@
pos = (PULONG) (DestSurface->pvScan0 + DestRect->top * delta + (DestRect->left<<2));
for (DestY = DestRect->top; DestY< DestRect->bottom; DestY++)
- {
- memset4( ((PDWORD)(pos)), color, width);
- pos =(PULONG)((ULONG_PTR)pos + delta);
+ {
+ __asm__(
+ " cld\n"
+ " mov %0, %%eax\n"
+ " test $0x03, %%edi\n" /* Align to fullword boundary */
+ " jnz .FL1\n"
+ " mov %1,%%ecx\n" /* Setup count of fullwords to fill */
+ " rep stosl\n" /* The actual fill */
+ " jz .FL2\n"
+ ".FL1:\n"
+ " mov %%eax, %%ecx\n"
+ " stosw\n"
+ " sub $0x04,%1\n"
+ " mov %1,%%ecx\n" /* Setup count of fullwords to fill */
+ " rep stosl\n" /* The actual fill */
+ " shr $0x08,%%eax\n"
+ " stosw\n"
+ ".FL2:\n"
+ : /* no output */
+ : "r"(color), "r"(width), "D"(pos)
+ : "%eax", "%ecx");
+ pos =(PULONG)((ULONG_PTR)pos + delta);
}
#else