From b2f1b36fd92ae0f3420e81fd5597356a3d018131 Mon Sep 17 00:00:00 2001 From: Hartmut Birr Date: Sun, 12 Jun 2005 10:23:04 +0000 Subject: [PATCH] - Fixed the inline assembler in DIB_16BPP_ColorFill. - Calculated the color value outside of the loop in DIB_16BPP_ColorFill. svn path=/trunk/; revision=15869 --- reactos/subsys/win32k/dib/dib16bpp.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/reactos/subsys/win32k/dib/dib16bpp.c b/reactos/subsys/win32k/dib/dib16bpp.c index f2b20161444..1a27109089e 100644 --- a/reactos/subsys/win32k/dib/dib16bpp.c +++ b/reactos/subsys/win32k/dib/dib16bpp.c @@ -454,32 +454,29 @@ DIB_16BPP_ColorFill(SURFOBJ* DestSurface, RECTL* DestRect, ULONG color) ULONG delta = DestSurface->lDelta; ULONG width = (DestRect->right - DestRect->left) ; PULONG pos = (PULONG) (DestSurface->pvScan0 + DestRect->top * delta + (DestRect->left<<1)); + color = (color<<16)|(color&0xffff); /* If the color value is "abcd", put "abcdabcd" into color */ for (DestY = DestRect->top; DestY< DestRect->bottom; DestY++) { + int d0, d1, d2; __asm__ __volatile__ ( " cld\n" - " mov %0, %%eax\n" - " mov %%eax, %%ecx\n" - " shl $16, %%eax\n" - " andl $0xffff, %%ecx\n" /* If the pixel value is "abcd", put "abcdabcd" in %eax */ - " or %%ecx, %%eax\n" " test $0x03, %%edi\n" /* Align to fullword boundary */ " jz .FL1\n" " stosw\n" - " dec %1\n" + " dec %4\n" " jz .FL2\n" ".FL1:\n" - " mov %1,%%ecx\n" /* Setup count of fullwords to fill */ + " mov %4,%%ecx\n" /* Setup count of fullwords to fill */ " shr $1,%%ecx\n" " rep stosl\n" /* The actual fill */ - " test $0x01, %1\n" /* One left to do at the right side? */ + " test $0x01, %4\n" /* One left to do at the right side? */ " jz .FL2\n" " stosw\n" ".FL2:\n" - : /* no output */ - : "r"(color), "r"(width), "D"(pos) - : "%eax", "%ecx"); + : "=&A" (d0), "=&r" (d1), "=&D" (d2) + : "0"(color), "1"(width), "2"(pos) + : "%ecx"); pos =(PULONG)((ULONG_PTR)pos + delta); } #else /* _M_IX86 */