diff options
author | Simon Tatham <simon.tatham@arm.com> | 2019-06-25 16:49:32 +0000 |
---|---|---|
committer | Simon Tatham <simon.tatham@arm.com> | 2019-06-25 16:49:32 +0000 |
commit | e8de8ba6a637c60d53db2433c0962c3fdbbdbf5c (patch) | |
tree | b9aa1a7a9ea0881dee88867e12d7271baa5f7f19 /llvm/lib/Target/ARM/ARMISelLowering.cpp | |
parent | 88139c143c5f419aa0ed6ba8bb8e70263ffb37cb (diff) | |
download | bcm5719-llvm-e8de8ba6a637c60d53db2433c0962c3fdbbdbf5c.tar.gz bcm5719-llvm-e8de8ba6a637c60d53db2433c0962c3fdbbdbf5c.zip |
[ARM] Support inline assembler constraints for MVE.
"To" selects an odd-numbered GPR, and "Te" an even one. There are some
8.1-M instructions that have one too few bits in their register fields
and require registers of particular parity, without necessarily using
a consecutive even/odd pair.
Also, the constraint letter "t" should select an MVE q-register, when
MVE is present. This didn't need any source changes, but some extra
tests have been added.
Reviewers: dmgreen, samparker, SjoerdMeijer
Subscribers: javed.absar, eraman, kristof.beyls, hiraditya, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D60709
llvm-svn: 364331
Diffstat (limited to 'llvm/lib/Target/ARM/ARMISelLowering.cpp')
-rw-r--r-- | llvm/lib/Target/ARM/ARMISelLowering.cpp | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/llvm/lib/Target/ARM/ARMISelLowering.cpp b/llvm/lib/Target/ARM/ARMISelLowering.cpp index 8ca947a4969..68a6365f976 100644 --- a/llvm/lib/Target/ARM/ARMISelLowering.cpp +++ b/llvm/lib/Target/ARM/ARMISelLowering.cpp @@ -14002,6 +14002,7 @@ ARMTargetLowering::getConstraintType(StringRef Constraint) const { } else if (Constraint.size() == 2) { switch (Constraint[0]) { default: break; + case 'T': return C_RegisterClass; // All 'U+' constraints are addresses. case 'U': return C_Memory; } @@ -14047,7 +14048,8 @@ using RCPair = std::pair<unsigned, const TargetRegisterClass *>; RCPair ARMTargetLowering::getRegForInlineAsmConstraint( const TargetRegisterInfo *TRI, StringRef Constraint, MVT VT) const { - if (Constraint.size() == 1) { + switch (Constraint.size()) { + case 1: // GCC ARM Constraint Letters switch (Constraint[0]) { case 'l': // Low regs or general regs. @@ -14093,7 +14095,26 @@ RCPair ARMTargetLowering::getRegForInlineAsmConstraint( return RCPair(0U, &ARM::QPR_VFP2RegClass); break; } + + case 2: + switch (Constraint[0]) { + case 'T': + switch (Constraint[1]) { + default: + break; + case 'e': + return RCPair(0U, &ARM::tGPREvenRegClass); + case 'o': + return RCPair(0U, &ARM::tGPROddRegClass); + } + default: + break; + } + + default: + break; } + if (StringRef("{cc}").equals_lower(Constraint)) return std::make_pair(unsigned(ARM::CPSR), &ARM::CCRRegClass); |