[cfe-commits] (Mips) Clang inline asm code check for clobber registers

Carter, Jack jcarter at mips.com
Thu Mar 22 10:21:20 PDT 2012


Inline asm assembly code sections can declare if any registers  are altered by the sequence of assembler it represents. This is useful if side effects alter some register. We didn't have the correct naming convention to take advantage of clang's mechanism for alternate register names.

In Mips $30 == $fp

Gnu accepts $sp and $fp in the clobber section as well as sp and fp. I added those variants to both the llvm code and test case.

When you compile the test case with gcc you will still get 2 errors because we are clobbering registers that are needed. That is ok because the front end is not checking for that. My test case for the back end will need to be more precise.

Contributer: Jack Carter

Thanks,

Jack
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120322/f64830a9/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clobber_regs.patch
Type: text/x-patch
Size: 5938 bytes
Desc: clobber_regs.patch
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120322/f64830a9/attachment.bin>


More information about the cfe-commits mailing list