<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - inline asm"
   href="http://llvm.org/bugs/show_bug.cgi?id=21401">21401</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>inline asm
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>3.4
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>-New Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>llvmbugzilla@limegreensocks.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=13256" name="attach_13256" title="inline asm routines that won't compile with -masm=intel">attachment 13256</a> <a href="attachment.cgi?id=13256&action=edit" title="inline asm routines that won't compile with -masm=intel">[details]</a></span>
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</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>