[PATCH] [mips] Tolerate the use of the %z inline asm operand modifier with non-immediates.

Toma Tabacu toma.tabacu at imgtec.com
Wed Oct 29 04:45:49 PDT 2014


Hi dsanders,

Currently, we give an error if %z is used with non-immediates, instead of continuing as if the %z isn't there.

For example, you use the %z operand modifier along with the "Jr" constraints ("r" makes the operand a register, and "J" makes it an immediate, but only if its value is 0). 
In this case, you want the compiler to print "$0" if the inline asm input operand turns out to be an immediate zero and you want it to print the register containing the operand, if it's not.

We give an error in the latter case, and we shouldn't (GCC also doesn't).

http://reviews.llvm.org/D6023

Files:
  lib/Target/Mips/MipsAsmPrinter.cpp
  test/CodeGen/Mips/inlineasm-operand-code.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D6023.15544.patch
Type: text/x-patch
Size: 2204 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141029/dea9d58e/attachment.bin>


More information about the llvm-commits mailing list