[mips] Tolerate the use of the %z inline asm operand modifier with non-immediates.
authorToma Tabacu <toma.tabacu@imgtec.com>
Thu, 6 Nov 2014 14:25:42 +0000 (14:25 +0000)
committerToma Tabacu <toma.tabacu@imgtec.com>
Thu, 6 Nov 2014 14:25:42 +0000 (14:25 +0000)
commit7f22a203517bf646977bf7117fbfc82078b740f9
tree60ff08d0d822112f66c94d9605b5d866cf2d385d
parent2b8f96996b2c24ecf7c172dcfaf56c2a06761cc2
[mips] Tolerate the use of the %z inline asm operand modifier with non-immediates.

Summary:
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).

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6023

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221453 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/Mips/MipsAsmPrinter.cpp
test/CodeGen/Mips/inlineasm-operand-code.ll