diff options
author | Petar Avramovic <Petar.Avramovic@rt-rk.com> | 2019-06-06 09:16:58 +0000 |
---|---|---|
committer | Petar Avramovic <Petar.Avramovic@rt-rk.com> | 2019-06-06 09:16:58 +0000 |
commit | a7d000644745471a9a7b403f1fdedb773c2b4af0 (patch) | |
tree | 658bd1726e4be5073e5bd5907d3655c74285e89b /llvm/lib | |
parent | faaa2b5d2156271d19603ebedfa80f10c3703d7f (diff) | |
download | bcm5719-llvm-a7d000644745471a9a7b403f1fdedb773c2b4af0.tar.gz bcm5719-llvm-a7d000644745471a9a7b403f1fdedb773c2b4af0.zip |
[MIPS GlobalISel] Select fpext and fptrunc
Select G_FPEXT and G_FPTRUNC for MIPS32.
Differential Revision: https://reviews.llvm.org/D62902
llvm-svn: 362689
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/Mips/MipsLegalizerInfo.cpp | 6 | ||||
-rw-r--r-- | llvm/lib/Target/Mips/MipsRegisterBankInfo.cpp | 8 |
2 files changed, 14 insertions, 0 deletions
diff --git a/llvm/lib/Target/Mips/MipsLegalizerInfo.cpp b/llvm/lib/Target/Mips/MipsLegalizerInfo.cpp index 4fb61ce457d..146ee754183 100644 --- a/llvm/lib/Target/Mips/MipsLegalizerInfo.cpp +++ b/llvm/lib/Target/Mips/MipsLegalizerInfo.cpp @@ -104,6 +104,12 @@ MipsLegalizerInfo::MipsLegalizerInfo(const MipsSubtarget &ST) { getActionDefinitionsBuilder({G_FCEIL, G_FFLOOR}) .libcallFor({s32, s64}); + getActionDefinitionsBuilder(G_FPEXT) + .legalFor({{s64, s32}}); + + getActionDefinitionsBuilder(G_FPTRUNC) + .legalFor({{s32, s64}}); + computeTables(); verify(*ST.getInstrInfo()); } diff --git a/llvm/lib/Target/Mips/MipsRegisterBankInfo.cpp b/llvm/lib/Target/Mips/MipsRegisterBankInfo.cpp index 0f9d1064dda..6a4ffe16a35 100644 --- a/llvm/lib/Target/Mips/MipsRegisterBankInfo.cpp +++ b/llvm/lib/Target/Mips/MipsRegisterBankInfo.cpp @@ -160,6 +160,14 @@ MipsRegisterBankInfo::getInstrMapping(const MachineInstr &MI) const { FPRValueMapping, FPRValueMapping}); break; } + case G_FPEXT: + OperandsMapping = getOperandsMapping({&Mips::ValueMappings[Mips::DPRIdx], + &Mips::ValueMappings[Mips::SPRIdx]}); + break; + case G_FPTRUNC: + OperandsMapping = getOperandsMapping({&Mips::ValueMappings[Mips::SPRIdx], + &Mips::ValueMappings[Mips::DPRIdx]}); + break; case G_CONSTANT: case G_FRAME_INDEX: case G_GLOBAL_VALUE: |