[Mesa-dev] [Bug 33386] New: Dubious assembler in read_rgba_span_x86.S

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sun Jan 23 11:30:13 PST 2011


https://bugs.freedesktop.org/show_bug.cgi?id=33386

           Summary: Dubious assembler in read_rgba_span_x86.S
           Product: Mesa
           Version: git
          Platform: x86 (IA32)
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: Mesa core
        AssignedTo: mesa-dev at lists.freedesktop.org
        ReportedBy: dimitry at andric.com


Created an attachment (id=42345)
 --> (https://bugs.freedesktop.org/attachment.cgi?id=42345)
Change movzxw to movzwl in read_rgba_span_x86.S

While building Mesa with the trunk version of clang, using its
integrated assembler, it complains about the 'movzxw' mnemonic in
src/mesa/x86/read_rgba_span_x86.S:

clang -c -I../../include -I../../src/mesa -I../../src/mesa/main
-I/usr/local/include -O2 -pipe -fno-strict-aliasing -Wall -Wmissing-prototypes
-std=c99 -ffast-math -fno-strict-aliasing  -fPIC  -DUSE_X86_ASM -DUSE_MMX_ASM
-DUSE_3DNOW_ASM -DUSE_SSE_ASM -DHAVE_POSIX_MEMALIGN -DUSE_XCB -DPTHREADS
-DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER -DHAVE_ALIAS -DGLX_INDIRECT_RENDERING
-DGLX_DIRECT_RENDERING x86/read_rgba_span_x86.S -o x86/read_rgba_span_x86.o
/tmp/cc-iXYqNz.s:528:2: error: invalid instruction mnemonic 'movzxw'
 movzxw (%eax), %ecx
 ^

This mnemonic is accepted by GNU as, but disassembling the relevant part
of a .o file produced by it, gives:

 436:   66 0f b7 08             movzww (%eax),%cx

This is a really weird opcode, apparently moving a word to a word,
without zero extending anything.  An Intel disassembler gives:

  00000466: 66 0F B7 08        movzx       cx,word ptr [eax]

Since the source code in question says:

        /* At this point there can be at most 1 pixel left to process.
         * Process it if needed.
         */

and it is about 16-bit RBG565 pixels, it seems most likely a move from a
word to a dword with zero extension was intended, e.g.:

...
        /* At this point there can be at most 1 pixel left to process.
         * Process it if needed.
         */

        testl   $0x01, %ecx
        je      .L01

        movzwl  (%eax), %ecx    /* opcodes: 0f b7 08 */
        movd    %ecx, %mm4

        pshufw  $0x00, %mm4, %mm0
...

which in Intel syntax would be: "movzx ecx,word ptr [eax]".

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the mesa-dev mailing list