[LLVMbugs] [Bug 21105] New: inline asm doesn't support %z0

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Sep 30 17:12:39 PDT 2014


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

            Bug ID: 21105
           Summary: inline asm doesn't support %z0
           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

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

Compiling this code with "clang z2.cpp":

int main(int argc, char *argv[])
{
  int a = 3;

   asm volatile ("add%z0 $4, %0": "=m" (a));
}

Gives these errors:
z2.cpp:5:18: error: invalid operand in inline asm: 'add${0:z} $$4, $0'
   asm volatile ("add%z0 $4, %0": "=m" (a));
                 ^
z2.cpp:5:18: error: ambiguous instructions require an explicit suffix (could be
'addb', 'addw', 'addl', or 'addq')
<inline asm>:1:2: note: instantiated into assembly here
        add $4, -12(%ebp)
        ^
2 errors generated.

Note that this code compiles correctly with gcc.  See also the gcc docs at
https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html#i386Operandmodifiers

-- 
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/20141001/cb34a170/attachment.html>


More information about the llvm-bugs mailing list