[Mesa-dev] [Bug 33388] New: Dubious assembler in xform4.S

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sun Jan 23 12:21:13 PST 2011


           Summary: Dubious assembler in xform4.S
           Product: Mesa
           Version: git
          Platform: x86-64 (AMD64)
        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=42347)
 --> (https://bugs.freedesktop.org/attachment.cgi?id=42347)
Change movzx to movzbl in xform4.S

When building Mesa with the trunk version of clang, using its integrated
assembler, it complains about the ambiguous 'movzx' mnemonics in

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_64_ASM
x86-64/xform4.S -o x86-64/xform4.o
/tmp/cc-A7bOtT.s:36:2: error: invalid operand for instruction
 movzx 20(%rdx), %eax

The mnemonics are ambiguous, because there are no suffixes to specify
whether the source is byte or word-sized.  They are accepted by GNU as,
and it apparently just assumes we want to zero-extend a byte:

  23:   0f b6 42 14             movzbl 0x14(%rdx),%eax

E.g. move 'b' (byte) to 'l' (dword).  The source in question says:

        movzx V4F_STRIDE(%rdx), %eax    /* stride */

where V4F_STRIDE is the offset to the stride member of the GLvector4f
struct, which is a GLuint.

If the original intention was to ignore the upper bytes of the stride
field, and just use the first byte, then I propose to change the 'movzx'
mnemonics to 'movzbl', which explicitly specify the source and
destination type.  See the attached patch.

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