diff options
author | Tim Northover <tnorthover@apple.com> | 2013-08-22 06:51:04 +0000 |
---|---|---|
committer | Tim Northover <tnorthover@apple.com> | 2013-08-22 06:51:04 +0000 |
commit | bccc6f89b7a15abda5593a30c101ae85d1dc3b77 (patch) | |
tree | 57ca362527d415549f5e8555ad0e609dde7be9f4 /lib/Target/ARM | |
parent | 021f3280fe791722c668cb96b02f473f2f76f925 (diff) | |
download | external_llvm-bccc6f89b7a15abda5593a30c101ae85d1dc3b77.zip external_llvm-bccc6f89b7a15abda5593a30c101ae85d1dc3b77.tar.gz external_llvm-bccc6f89b7a15abda5593a30c101ae85d1dc3b77.tar.bz2 |
ARM: respect tied 64-bit inlineasm operands when printing
The code for 'Q' and 'R' operand modifiers needs to look through tied
operands to discover the register class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188990 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM')
-rw-r--r-- | lib/Target/ARM/ARMAsmPrinter.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/Target/ARM/ARMAsmPrinter.cpp b/lib/Target/ARM/ARMAsmPrinter.cpp index 13a22b1..485b1c5 100644 --- a/lib/Target/ARM/ARMAsmPrinter.cpp +++ b/lib/Target/ARM/ARMAsmPrinter.cpp @@ -496,6 +496,23 @@ bool ARMAsmPrinter::PrintAsmOperand(const MachineInstr *MI, unsigned OpNum, if (!FlagsOP.isImm()) return true; unsigned Flags = FlagsOP.getImm(); + + // This operand may not be the one that actually provides the register. If + // it's tied to a previous one then we should refer instead to that one + // for registers and their classes. + unsigned TiedIdx; + if (InlineAsm::isUseOperandTiedToDef(Flags, TiedIdx)) { + for (OpNum = InlineAsm::MIOp_FirstOperand; TiedIdx; --TiedIdx) { + unsigned OpFlags = MI->getOperand(OpNum).getImm(); + OpNum += InlineAsm::getNumOperandRegisters(OpFlags) + 1; + } + Flags = MI->getOperand(OpNum).getImm(); + + // Later code expects OpNum to be pointing at the register rather than + // the flags. + OpNum += 1; + } + unsigned NumVals = InlineAsm::getNumOperandRegisters(Flags); unsigned RC; InlineAsm::hasRegClassConstraint(Flags, RC); |