[LLVMbugs] [Bug 21401] New: inline asm

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Oct 27 21:07:48 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=21401

            Bug ID: 21401
           Summary: inline asm
           Product: clang
           Version: 3.4
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: llvmbugzilla at limegreensocks.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 13256
  --> http://llvm.org/bugs/attachment.cgi?id=13256&action=edit
inline asm routines that won't compile with -masm=intel

I have a public header that needs to support both -masm=att and -masm=intel. 
This header works correctly with gcc for both modes, and works correctly with
clang when using -masm=att.  However, some of the assembler instructions are
(incorrectly) being rejected by clang as invalid when compiled with
-masm=intel.

The code is attached, the errors are below.

Compile with:
clang -masm=intel -march=native -mtune=native -m64 -o qall.exe qall3.c

clang -v shows:
clang version 3.5.0 (217039)
Target: i686-pc-windows-gnu
Thread model: posix

results:
qall3.c:6:31: error: unknown use of instruction mnemonic without a size suffix
        bt -20(%rbp),%edx ; setc -13(%rbp)
        ^
qall3.c:16:31: error: unknown use of instruction mnemonic without a size suffix
        lock bts (%rcx),%edx ; setc -13(%rbp)
             ^
qall3.c:26:31: error: unknown use of instruction mnemonic without a size suffix
        lock btr (%rcx),%edx ; setc -13(%rbp)
             ^
qall3.c:36:31: error: unknown use of instruction mnemonic without a size suffix
        lock btc (%rcx),%edx ; setc -13(%rbp)
             ^
qall3.c:45:31: error: invalid instruction mnemonic 'stosd'
        rep stosd
            ^
qall3.c:54:31: error: unknown use of instruction mnemonic without a size suffix
        in %al,%dx
        ^
qall3.c:63:31: error: unknown use of instruction mnemonic without a size suffix
        in %ax,%dx
        ^
qall3.c:72:31: error: unknown use of instruction mnemonic without a size suffix
        in %eax,%dx
        ^
qall3.c:79:31: error: unknown use of instruction mnemonic without a size suffix
        out %dx,%al
        ^
qall3.c:86:31: error: unknown use of instruction mnemonic without a size suffix
        out %dx,%ax
        ^
qall3.c:93:31: error: unknown use of instruction mnemonic without a size suffix
        out %dx,%eax
        ^
qall3.c:100:31: error: invalid instruction mnemonic 'insd'
        cld ; rep insd
                  ^
qall3.c:108:31: error: invalid instruction mnemonic 'outsd'
        cld ; rep outsd
                  ^
qall3.c:116:30: error: invalid operand for instruction
        int 0x2c
            ^~~~
qall3.c:123:18: error: unknown use of instruction mnemonic without a size
suffix
        shrd %r9, %rdx, %cl
        ^
qall3.c:133:18: error: unknown use of instruction mnemonic without a size
suffix
        shld %rdx, %r9, %cl

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20141028/971d539a/attachment.html>


More information about the llvm-bugs mailing list