Re: [AD] Build issue with CVS TOT

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Here's a patch to work around the issue. Compeltely untested (especially in 24-bpp).

Someone should double-check that I'm not accidentally clobbering any registers that are live.

There is no measurable performance change from this patch.





Evert Glebbeek wrote:
On Thursday 09 June 2005 06:38, Eric Botcazou wrote:

gcc -Wall -I. -I./include -x assembler-with-cpp -o
obj/msvc/alleg/iblit16.obj -c
 src/i386/iblit16.s
src/i386/iblit16.s: Assembler messages:
src/i386/iblit16.s:46: Error: suffix or operands invalid for `mov'

Recent GNU Binutils reject constructs they used to accept.


This is really, really, really annoying. And evil. Is there anything we can do to work around the problem?
Yet another good reason for scrapping the asm code in the 4.3 branch.

Evert


-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.  How far can you shotput
a projector? How fast can you ride your desk chair down the office luge track?
If you want to score the big prize, get to know the little guy. Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20

? obj/msvc/cpp-tested
? obj/msvc/cpp-yes
? obj/msvc/dibsound.res
? obj/msvc/dxwindow.res
? obj/msvc/scrsave.res
? tests/8-norm.log
? tests/8-sse.log
? tests/8-sse2.log
? tests/8-sse3.log
? tests/8-sse4.log
? tests/8-sse5.log
? tests/8-sse6.log
? tests/8-sse7.log
? tests/8-sse8.log
? tests/8-sse9.log
? tests/8sse4.log
? tests/win/dibgrab.ilk
? tests/win/dibhello.ilk
? tests/win/dibsound.ilk
? tests/win/dxwindow.ilk
Index: src/i386/blit.inc
===================================================================
RCS file: /cvsroot/alleg/allegro/src/i386/blit.inc,v
retrieving revision 1.3
diff -u -r1.3 blit.inc
--- src/i386/blit.inc	16 Jul 2003 19:43:28 -0000	1.3
+++ src/i386/blit.inc	19 Jun 2005 03:15:12 -0000
@@ -52,7 +52,8 @@
    leal (%eax, %esi, bpp), %esi                                            ; \
 									   ; \
    movl B_WIDTH, %ecx            /* x loop counter */                      ; \
-   movl BMP_SEG(%edx), %ds       /* load data segment */                   ; \
+   movl BMP_SEG(%edx), %eax      /* load data segment */                   ; \
+   movl %eax, %ds                                                          ; \
    code                          /* do the transfer */                     ; \
 									   ; \
    movl %ebx, %ds                /* restore data segment */                ; \
Index: src/i386/iblit16.s
===================================================================
RCS file: /cvsroot/alleg/allegro/src/i386/iblit16.s,v
retrieving revision 1.13
diff -u -r1.13 iblit16.s
--- src/i386/iblit16.s	16 Jul 2003 19:43:28 -0000	1.13
+++ src/i386/iblit16.s	19 Jun 2005 03:18:03 -0000
@@ -43,7 +43,8 @@
    movl ARG1, %edx               /* edx = bmp */
    movl BMP_CT(%edx), %ebx       /* line to start at */
 
-   movl BMP_SEG(%edx), %es       /* select segment */
+   movl BMP_SEG(%edx), %eax      /* select segment */
+   movl %eax, %es
 
    movl BMP_CR(%edx), %esi       /* width to clear */
    subl BMP_CL(%edx), %esi
@@ -311,7 +312,8 @@
 
    movl B_DEST, %edx
    movl %ds, %ebx                /* save data segment selector */
-   movl BMP_SEG(%edx), %es       /* load destination segment */
+   movl BMP_SEG(%edx), %eax      /* load destination segment */
+   movl %eax, %es
 
 #ifdef ALLEGRO_MMX               /* only use MMX if the compiler supports it */
 
@@ -484,7 +486,8 @@
 
    movl B_DEST, %edx
    movl %ds, %ebx                /* save data segment selector */
-   movl BMP_SEG(%edx), %es       /* load destination segment */
+   movl BMP_SEG(%edx), %eax      /* load destination segment */
+   movl %eax, %es
 
    _align_
 blit_backwards_loop:
@@ -501,7 +504,8 @@
    leal (%eax, %esi, 2), %esi
 
    movl B_WIDTH, %ecx            /* x loop counter */
-   movl BMP_SEG(%edx), %ds       /* load data segment */
+   movl BMP_SEG(%edx), %edx      /* load data segment */
+   movl %edx, %ds
    std                           /* backwards */
    rep ; movsw                   /* copy the line */
 
@@ -551,7 +555,8 @@
 
    movl B_DEST, %edx
    movl %ds, %ebx 
-   movl BMP_SEG(%edx), %es 
+   movl BMP_SEG(%edx), %edx
+   movl %edx, %es
    cld 
 
    movl B_SOURCE, %edx
Index: src/i386/iblit24.s
===================================================================
RCS file: /cvsroot/alleg/allegro/src/i386/iblit24.s,v
retrieving revision 1.4
diff -u -r1.4 iblit24.s
--- src/i386/iblit24.s	12 Jul 2002 22:51:15 -0000	1.4
+++ src/i386/iblit24.s	19 Jun 2005 03:22:40 -0000
@@ -39,7 +39,8 @@
    movl ARG1, %edx               /* edx = bmp */
    movl BMP_CT(%edx), %ebx       /* line to start at */
 
-   movl BMP_SEG(%edx), %es       /* select segment */
+   movl BMP_SEG(%edx), %eax      /* select segment */
+   movl %eax, %es
 
    cld
 
@@ -123,7 +124,9 @@
    pushl %es
 
    movl B_DEST, %edx
-   movl BMP_SEG(%edx), %es       /* load destination segment */
+   movl BMP_SEG(%edx), %eax      /* load destination segment */
+   movl %eax, %es
+
    movl B_DEST_X, %edi
    leal (%edi, %edi, 2), %edi
    movl %edi, B_DEST_X
@@ -148,8 +151,11 @@
    movl B_SOURCE_X, %esi         /* x offset */
    READ_BANK()                   /* select bank */
    addl %eax, %esi               /* esi = eax+3*esi */
+
    movl B_WIDTH, %ecx            /* x loop counter */
-   movl BMP_SEG(%edx), %ds       /* load data segment */
+   movl BMP_SEG(%edx), %eax      /* load data segment */
+   movl %eax, %ds
+
    shrl $1, %ecx
    jnc notcarry1
    movsb
@@ -218,7 +224,8 @@
 
    movl B_DEST, %edx
    movl %ds, %ebx                /* save data segment selector */
-   movl BMP_SEG(%edx), %es       /* load destination segment */
+   movl BMP_SEG(%edx), %eax      /* load destination segment */
+   movl %eax, %es
 
    _align_
 blit_backwards_loop:
@@ -233,7 +240,8 @@
    READ_BANK()                   /* select bank */
    addl %eax, %esi               /* esi = eax+3*esi */
    movl B_WIDTH, %ecx            /* x loop counter */
-   movl BMP_SEG(%edx), %ds       /* load data segment */
+   movl BMP_SEG(%edx), %eax      /* load data segment */
+   movl %eax, %ds
    std                           /* backwards */
    shrl $1, %ecx
    jnc  not_carry1
@@ -289,7 +297,8 @@
 
    movl B_DEST, %edx
    movl %ds, %ebx 
-   movl BMP_SEG(%edx), %es 
+   movl BMP_SEG(%edx), %eax
+   movl %eax, %es
    cld 
 
    movl B_DEST_X, %eax
@@ -307,7 +316,8 @@
    WRITE_BANK()                  /* select bank */
    addl %eax, %edi
    movl B_SOURCE,%edx
-   movl BMP_SEG(%edx), %ds       /* load data segment */
+   movl BMP_SEG(%edx), %eax      /* load data segment */
+   movl %eax, %ds
    movl B_SOURCE_Y, %eax         /* line number */
    movl B_SOURCE_X, %esi         /* x offset */
    READ_BANK()                   /* select bank */
Index: src/i386/iblit32.s
===================================================================
RCS file: /cvsroot/alleg/allegro/src/i386/iblit32.s,v
retrieving revision 1.11
diff -u -r1.11 iblit32.s
--- src/i386/iblit32.s	16 Jul 2003 19:43:28 -0000	1.11
+++ src/i386/iblit32.s	19 Jun 2005 03:27:00 -0000
@@ -39,7 +39,8 @@
    movl ARG1, %edx               /* edx = bmp */
    movl BMP_CT(%edx), %ebx       /* line to start at */
 
-   movl BMP_SEG(%edx), %es       /* select segment */
+   movl BMP_SEG(%edx), %eax      /* select segment */
+   movl %eax, %es
 
    movl BMP_CR(%edx), %esi       /* width to clear */
    subl BMP_CL(%edx), %esi
@@ -88,7 +89,8 @@
 
    movl B_DEST, %edx
    movl %ds, %ebx                /* save data segment selector */
-   movl BMP_SEG(%edx), %es       /* load destination segment */
+   movl BMP_SEG(%edx), %eax      /* load destination segment */
+   movl %eax, %es
    cld                           /* for forward copy */
 
    _align_
@@ -138,7 +140,8 @@
 
    movl B_DEST, %edx
    movl %ds, %ebx                /* save data segment selector */
-   movl BMP_SEG(%edx), %es       /* load destination segment */
+   movl BMP_SEG(%edx), %edx      /* load destination segment */
+   movl %edx, %es
 
    _align_
 blit_backwards_loop:
@@ -155,7 +158,8 @@
    leal (%eax, %esi, 4), %esi
 
    movl B_WIDTH, %ecx            /* x loop counter */
-   movl BMP_SEG(%edx), %ds       /* load data segment */
+   movl BMP_SEG(%edx), %eax      /* load data segment */
+   movl %eax, %ds
    std                           /* backwards */
    rep ; movsl                   /* copy the line */
 
@@ -202,7 +206,8 @@
 
    movl B_DEST, %edx
    movl %ds, %ebx 
-   movl BMP_SEG(%edx), %es 
+   movl BMP_SEG(%edx), %eax
+   movl %eax, %es
    cld 
 
 #ifdef ALLEGRO_SSE  /* Use SSE if the compiler supports it */
Index: src/i386/iblit8.s
===================================================================
RCS file: /cvsroot/alleg/allegro/src/i386/iblit8.s,v
retrieving revision 1.13
diff -u -r1.13 iblit8.s
--- src/i386/iblit8.s	16 Jul 2003 19:43:28 -0000	1.13
+++ src/i386/iblit8.s	19 Jun 2005 03:30:36 -0000
@@ -41,7 +41,8 @@
    movl ARG1, %edx               /* edx = bmp */
    pushl %es 
 
-   movl BMP_SEG(%edx), %es       /* select segment */
+   movl BMP_SEG(%edx), %eax      /* select segment */
+   movl %eax, %es
 
    movl BMP_CT(%edx), %ebx       /* line to start at */
 
@@ -315,7 +316,8 @@
 
    movl B_DEST, %edx
    movl %ds, %ebx                /* save data segment selector */
-   movl BMP_SEG(%edx), %es       /* load destination segment */
+   movl BMP_SEG(%edx), %eax      /* load destination segment */
+   movl %eax, %es
    cld                           /* for forward copy */
 
    shrl $1, B_WIDTH              /* halve counter for word copies */
@@ -406,7 +408,8 @@
 
    movl B_DEST, %edx
    movl %ds, %ebx                /* save data segment selector */
-   movl BMP_SEG(%edx), %es       /* load destination segment */
+   movl BMP_SEG(%edx), %eax      /* load destination segment */
+   movl %eax, %es
 
    movl B_SOURCE_Y, %eax         /* if different line -> fast dword blit */
    cmpl B_DEST_Y, %eax
@@ -433,7 +436,8 @@
 
    std                           /* backwards */
    movl B_WIDTH, %ecx            /* x loop counter */
-   movl BMP_SEG(%edx), %ds       /* load data segment */
+   movl BMP_SEG(%edx), %eax      /* load data segment */
+   movl %eax, %ds
    rep ; movsb                   /* copy the line */
 
    movl %ebx, %ds                /* restore data segment */
@@ -460,7 +464,8 @@
 
    std                           /* backwards */
    movl B_WIDTH, %eax            /* x loop counter */
-   movl BMP_SEG(%edx), %ds       /* load data segment */
+   movl BMP_SEG(%edx), %edx      /* load data segment */
+   movl %edx, %ds
 
    movl %eax, %ecx
    andl $3, %ecx                 /* copy bytes */
@@ -517,7 +522,8 @@
 
    movl B_DEST, %edx
    movl %ds, %ebx 
-   movl BMP_SEG(%edx), %es 
+   movl BMP_SEG(%edx), %eax
+   movl %eax, %es
    cld 
 
 #ifdef ALLEGRO_SSE  /* Use SSE if the compiler supports it */
Index: tests/test.c
===================================================================
RCS file: /cvsroot/alleg/allegro/tests/test.c,v
retrieving revision 1.37
diff -u -r1.37 test.c
--- tests/test.c	16 May 2005 13:07:58 -0000	1.37
+++ tests/test.c	10 Jun 2005 02:59:06 -0000
@@ -3078,7 +3078,7 @@
    global_compiled_sprite = get_compiled_sprite(global_sprite, is_planar_bitmap(screen));
    check_tables();
    profile = TRUE;
-
+#if 0
    for (mode=0; mode<6; mode++) {
 
       do_it("profiling putpixel", FALSE, putpix_demo);
@@ -3155,7 +3155,8 @@
       goto abort;
    else
       textout_time = ct;
-
+#endif
+   
    if (!old_screen) {
       blit_from_screen = TRUE;
       do_it("profiling blit screen->screen", FALSE, blit_demo);


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/