diff options
author | Eli Friedman <efriedma@quicinc.com> | 2019-06-20 21:56:47 +0000 |
---|---|---|
committer | Eli Friedman <efriedma@quicinc.com> | 2019-06-20 21:56:47 +0000 |
commit | 25f08a17c318e8ffbd30ecbab4d3ea5c5105ddbc (patch) | |
tree | 1fd649dc923b9e2316c7f5765c13595d85344777 /llvm/lib/Target/ARM/ARMRegisterBankInfo.cpp | |
parent | 75e23f8523bbb3bb5a1b0fbda99ee90dcdac595f (diff) | |
download | bcm5719-llvm-25f08a17c318e8ffbd30ecbab4d3ea5c5105ddbc.tar.gz bcm5719-llvm-25f08a17c318e8ffbd30ecbab4d3ea5c5105ddbc.zip |
[ARM GlobalISel] Add support for s64 G_ADD and G_SUB.
Teach RegisterBankInfo to use the correct register class, and tell the
legalizer it's legal. Everything else just works.
The one thing that's slightly weird about this compared to SelectionDAG
isel is that legalization can't distinguish between i64 and <1 x i64>,
so we might end up with more NEON instructions than the user expects.
Differential Revision: https://reviews.llvm.org/D63585
llvm-svn: 363989
Diffstat (limited to 'llvm/lib/Target/ARM/ARMRegisterBankInfo.cpp')
-rw-r--r-- | llvm/lib/Target/ARM/ARMRegisterBankInfo.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/llvm/lib/Target/ARM/ARMRegisterBankInfo.cpp b/llvm/lib/Target/ARM/ARMRegisterBankInfo.cpp index f1f08373d0d..b100150175f 100644 --- a/llvm/lib/Target/ARM/ARMRegisterBankInfo.cpp +++ b/llvm/lib/Target/ARM/ARMRegisterBankInfo.cpp @@ -228,7 +228,15 @@ ARMRegisterBankInfo::getInstrMapping(const MachineInstr &MI) const { switch (Opc) { case G_ADD: - case G_SUB: + case G_SUB: { + // Integer operations where the source and destination are in the + // same register class. + LLT Ty = MRI.getType(MI.getOperand(0).getReg()); + OperandsMapping = Ty.getSizeInBits() == 64 + ? &ARM::ValueMappings[ARM::DPR3OpsIdx] + : &ARM::ValueMappings[ARM::GPR3OpsIdx]; + break; + } case G_MUL: case G_AND: case G_OR: |