We were changing the edi register, but not informing the compiler about this.

For certain optimization combinations, the compiler would assume edi was
unchanged. Fixed by adding %edi to the clobber list.

svn path=/trunk/; revision=15901
This commit is contained in:
Gé van Geldorp 2005-06-13 22:24:28 +00:00
parent f5f855488d
commit 08d5e5e7e5
2 changed files with 11 additions and 8 deletions

View file

@ -17,6 +17,7 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id$ */ /* $Id$ */
#include <w32k.h> #include <w32k.h>
VOID VOID
@ -53,6 +54,7 @@ DIB_16BPP_HLine(SURFOBJ *SurfObj, LONG x1, LONG x2, LONG y, ULONG c)
" shl $16, %%eax\n" " shl $16, %%eax\n"
" andl $0xffff, %0\n" /* If the pixel value is "abcd", put "abcdabcd" in %eax */ " andl $0xffff, %0\n" /* If the pixel value is "abcd", put "abcdabcd" in %eax */
" or %0, %%eax\n" " or %0, %%eax\n"
" mov %2, %%edi\n"
" test $0x03, %%edi\n" /* Align to fullword boundary */ " test $0x03, %%edi\n" /* Align to fullword boundary */
" jz .L1\n" " jz .L1\n"
" stosw\n" " stosw\n"
@ -67,8 +69,8 @@ DIB_16BPP_HLine(SURFOBJ *SurfObj, LONG x1, LONG x2, LONG y, ULONG c)
" stosw\n" " stosw\n"
".L2:\n" ".L2:\n"
: /* no output */ : /* no output */
: "r"(c), "r"(Count), "D"(addr) : "r"(c), "r"(Count), "m"(addr)
: "%eax", "%ecx"); : "%eax", "%ecx", "%edi");
#else /* _M_IX86 */ #else /* _M_IX86 */
LONG cx = x1; LONG cx = x1;
DWORD cc; DWORD cc;
@ -443,8 +445,8 @@ DIB_16BPP_ColorFill(SURFOBJ* DestSurface, RECTL* DestRect, ULONG color)
{ {
__asm__ __volatile__ ( __asm__ __volatile__ (
" cld\n" " cld\n"
" mov %0,%%eax\n"
" mov %1,%%ebx\n" " mov %1,%%ebx\n"
" mov %2,%%edi\n"
" test $0x03, %%edi\n" /* Align to fullword boundary */ " test $0x03, %%edi\n" /* Align to fullword boundary */
" jz .FL1\n" " jz .FL1\n"
" stosw\n" " stosw\n"
@ -459,8 +461,8 @@ DIB_16BPP_ColorFill(SURFOBJ* DestSurface, RECTL* DestRect, ULONG color)
" stosw\n" " stosw\n"
".FL2:\n" ".FL2:\n"
: :
: "r" (color), "r" (width), "D" (pos) : "a" (color), "r" (width), "m" (pos)
: "%eax", "%ecx","%ebx"); : "%ecx", "%ebx", "%edi");
pos =(PULONG)((ULONG_PTR)pos + delta); pos =(PULONG)((ULONG_PTR)pos + delta);
} }

View file

@ -52,6 +52,7 @@ DIB_32BPP_HLine(SURFOBJ *SurfObj, LONG x1, LONG x2, LONG y, ULONG c)
__asm__ __volatile__ ( __asm__ __volatile__ (
" cld\n" " cld\n"
" mov %0, %%eax\n" " mov %0, %%eax\n"
" mov %2, %%edi\n"
" test $0x03, %%edi\n" /* Align to fullword boundary */ " test $0x03, %%edi\n" /* Align to fullword boundary */
" jnz .L1\n" " jnz .L1\n"
" mov %1,%%ecx\n" /* Setup count of fullwords to fill */ " mov %1,%%ecx\n" /* Setup count of fullwords to fill */
@ -67,8 +68,8 @@ DIB_32BPP_HLine(SURFOBJ *SurfObj, LONG x1, LONG x2, LONG y, ULONG c)
" stosw\n" " stosw\n"
".L2:\n" ".L2:\n"
: /* no output */ : /* no output */
: "r"(c), "r"(cx), "D"(addr) : "m"(c), "r"(cx), "m"(addr)
: "%eax", "%ecx"); : "%eax", "%ecx", "%edi");
} }