1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 12:12:47 +01:00
llvm-mirror/lib/Target/Mips
Simon Dardis 368eb5857e [mips] Begin reworking instruction predicates for ISAs/encodings (1/N)
The MIPS backend has inconsistent usage of instruction predicates
for assembly and code generation. The issue arises from supporting three
encodings, two (MIPS and microMIPS) of which have a near 1:1 instruction
mapping across ISA revisions and a third encoding with a more restricted
set of instructions (MIPS16e).

To enforce consistent usage, each of the ISA_* adjectives has (or will
have) the relevant encoding attached to it along the relevant ISA revision
where the instruction is defined.

Each instruction, pattern or alias will then have the correct ISA adjective
attached to it, and the base instruction description classes will have any
predicates relating to ISA encoding or revision removed.

Pseudo instructions will also be guarded for the encoding or ABI that they are
supported in.

Finally, the hasStandardEncoding() / inMicroMipsMode() / inMips16Mode() methods
of MipsSubtarget will be changed such that only one can be true at any one time.

The result of this is that code generation and assembly will produce the
correct encoding up front, while code generated from pseudo instructions
and other inserted sequences of instructions will be able to rely on the mapping
tables to produce the correct encoding. This should fix numerous bugs where
the result 'happens' to be correct but has edge cases where microMIPS and MIPS
have subtle differences (e.g. microMIPSR6 using 'j', 'jal' instructions.)

This patch starts the process by changing most of the ISA adjectives to make
use of the EncodingPredicate member of PredicateControl. Follow on patches
will annotate instructions with their correct ISA adjective and eliminate
the usage of "let Predicates = [..]", "let AdditionalPredicates = [..]" and
"isCodeGenOnly = 1" in the cases where it was used to control instruction
availability.

Contributions from Nitesh Jain.

Reviewers: atanasyan

Differential Revision: https://reviews.llvm.org/D41434

llvm-svn: 326322
2018-02-28 13:02:44 +00:00
..
AsmParser [NFC] fix trivial typos in comments 2018-02-22 07:48:29 +00:00
Disassembler [mips] Remove duplicated R6 EVA instructions 2018-01-08 16:50:33 +00:00
InstPrinter
MCTargetDesc [Mips] Handle one byte unsupported relocations 2018-01-11 10:07:47 +00:00
TargetInfo
CMakeLists.txt [MIPS GlobalISel] Adding GlobalISel 2018-02-23 11:06:40 +00:00
LLVMBuild.txt [MIPS GlobalISel] Adding GlobalISel 2018-02-23 11:06:40 +00:00
MicroMips32r6InstrFormats.td [mips] Begin reworking instruction predicates for ISAs/encodings (1/N) 2018-02-28 13:02:44 +00:00
MicroMips32r6InstrInfo.td [mips] Spectre variant two mitigation for MIPSR2 2018-02-21 00:06:53 +00:00
MicroMipsDSPInstrFormats.td
MicroMipsDSPInstrInfo.td
MicroMipsInstrFormats.td [mips] Define certain instructions in microMIPS32r3 2018-02-08 09:25:17 +00:00
MicroMipsInstrFPU.td [mips] Define certain instructions in microMIPS32r3 2018-02-08 09:25:17 +00:00
MicroMipsInstrInfo.td [mips] Spectre variant two mitigation for MIPSR2 2018-02-21 00:06:53 +00:00
MicroMipsSizeReduction.cpp [mips] Removal of microMIPS64R6 2017-12-11 11:21:40 +00:00
Mips16FrameLowering.cpp
Mips16FrameLowering.h
Mips16HardFloat.cpp
Mips16HardFloatInfo.cpp
Mips16HardFloatInfo.h
Mips16InstrFormats.td
Mips16InstrInfo.cpp
Mips16InstrInfo.h
Mips16InstrInfo.td [NFC] fix trivial typos in comments and documents 2018-01-26 08:15:29 +00:00
Mips16ISelDAGToDAG.cpp
Mips16ISelDAGToDAG.h
Mips16ISelLowering.cpp
Mips16ISelLowering.h
Mips16RegisterInfo.cpp
Mips16RegisterInfo.h
Mips32r6InstrFormats.td
Mips32r6InstrInfo.td [mips] Spectre variant two mitigation for MIPSR2 2018-02-21 00:06:53 +00:00
Mips64InstrInfo.td [mips] Spectre variant two mitigation for MIPSR2 2018-02-21 00:06:53 +00:00
Mips64r6InstrInfo.td [mips] Spectre variant two mitigation for MIPSR2 2018-02-21 00:06:53 +00:00
Mips.h [MIPS GlobalISel] Adding GlobalISel 2018-02-23 11:06:40 +00:00
Mips.td [MachineOperand][Target] MachineOperand::isRenamable semantics changes 2018-02-23 18:25:08 +00:00
MipsAnalyzeImmediate.cpp
MipsAnalyzeImmediate.h
MipsAsmPrinter.cpp [mips] Support 'y' operand code to print exact log2 of the operand 2018-02-07 12:36:39 +00:00
MipsAsmPrinter.h
MipsCallingConv.td
MipsCallLowering.cpp [MIPS GlobalISel] Adding GlobalISel 2018-02-23 11:06:40 +00:00
MipsCallLowering.h [MIPS GlobalISel] Adding GlobalISel 2018-02-23 11:06:40 +00:00
MipsCCState.cpp MachineFunction: Return reference from getFunction(); NFC 2017-12-15 22:22:58 +00:00
MipsCCState.h
MipsCondMov.td
MipsConstantIslandPass.cpp MachineFunction: Return reference from getFunction(); NFC 2017-12-15 22:22:58 +00:00
MipsDelaySlotFiller.cpp [NFC] fix trivial typos in comments 2018-01-22 05:54:46 +00:00
MipsDSPInstrFormats.td [mips] Spectre variant two mitigation for MIPSR2 2018-02-21 00:06:53 +00:00
MipsDSPInstrInfo.td [mips] Provide additional DSP bitconvert patterns 2017-12-13 10:13:35 +00:00
MipsEVAInstrFormats.td
MipsEVAInstrInfo.td [mips] Include EVA instructions in Std2MicroMips mapping tables 2018-02-01 12:53:26 +00:00
MipsFastISel.cpp Remove alignment argument from memcpy/memmove/memset in favour of alignment attributes (Step 1) 2018-01-19 17:13:12 +00:00
MipsFrameLowering.cpp
MipsFrameLowering.h
MipsHazardSchedule.cpp
MipsInstrFormats.td [mips] Spectre variant two mitigation for MIPSR2 2018-02-21 00:06:53 +00:00
MipsInstrFPU.td [mips] Correct the definition of cvt.d.w 2018-02-20 15:55:17 +00:00
MipsInstrInfo.cpp [mips] Spectre variant two mitigation for MIPSR2 2018-02-21 00:06:53 +00:00
MipsInstrInfo.h
MipsInstrInfo.td [mips] Begin reworking instruction predicates for ISAs/encodings (1/N) 2018-02-28 13:02:44 +00:00
MipsInstructionSelector.cpp [mips] finish removal of unused fields in MipsInstructionSelector 2018-02-23 15:47:05 +00:00
MipsISelDAGToDAG.cpp [SelectionDAGISel] Add a debug print before call to Select. Adjust where blank lines are printed during isel process to make things more sensibly grouped. 2018-01-26 19:34:20 +00:00
MipsISelDAGToDAG.h
MipsISelLowering.cpp [mips] Generate memory dependencies for byVal arguments 2018-02-22 13:40:42 +00:00
MipsISelLowering.h [MIPS][MSA] Convert vector integer min/max opcodes to use generic implementation 2018-02-17 21:29:45 +00:00
MipsLegalizerInfo.cpp [MIPS GlobalISel] Adding GlobalISel 2018-02-23 11:06:40 +00:00
MipsLegalizerInfo.h [MIPS GlobalISel] Adding GlobalISel 2018-02-23 11:06:40 +00:00
MipsLongBranch.cpp [mips] Spectre variant two mitigation for MIPSR2 2018-02-21 00:06:53 +00:00
MipsMachineFunction.cpp [mips] Removal of microMIPS64R6 2017-12-11 11:21:40 +00:00
MipsMachineFunction.h
MipsMCInstLower.cpp
MipsMCInstLower.h
MipsModuleISelDAGToDAG.cpp
MipsMSAInstrFormats.td
MipsMSAInstrInfo.td [MIPS][MSA] Convert vector integer min/max opcodes to use generic implementation 2018-02-17 21:29:45 +00:00
MipsMTInstrFormats.td
MipsMTInstrInfo.td
MipsOptimizePICCall.cpp
MipsOptionRecord.h
MipsOs16.cpp
MipsRegisterBankInfo.cpp [MIPS GlobalISel] Adding GlobalISel 2018-02-23 11:06:40 +00:00
MipsRegisterBankInfo.h [MIPS GlobalISel] Adding GlobalISel 2018-02-23 11:06:40 +00:00
MipsRegisterInfo.cpp Revert accidental changes that snuck in r324584 2018-02-08 09:31:48 +00:00
MipsRegisterInfo.h [Mips] Return true in enableMultipleCopyHints(). 2018-02-23 08:30:15 +00:00
MipsRegisterInfo.td Trivial commit to force LLVM to run TableGen for Mips target after 2017-12-20 12:45:40 +00:00
MipsSchedule.td
MipsScheduleGeneric.td
MipsScheduleP5600.td [mips] Begin reworking instruction predicates for ISAs/encodings (1/N) 2018-02-28 13:02:44 +00:00
MipsSEFrameLowering.cpp MachineFunction: Return reference from getFunction(); NFC 2017-12-15 22:22:58 +00:00
MipsSEFrameLowering.h
MipsSEInstrInfo.cpp [mips] Define certain instructions in microMIPS32r3 2018-02-08 09:25:17 +00:00
MipsSEInstrInfo.h [mips] Define certain instructions in microMIPS32r3 2018-02-08 09:25:17 +00:00
MipsSEISelDAGToDAG.cpp [NFC] fix trivial typos in comments 2018-01-22 05:54:46 +00:00
MipsSEISelDAGToDAG.h
MipsSEISelLowering.cpp [MIPS][MSA] Convert vector integer min/max opcodes to use generic implementation 2018-02-17 21:29:45 +00:00
MipsSEISelLowering.h
MipsSERegisterInfo.cpp [mips] Remove duplicated R6 EVA instructions 2018-01-08 16:50:33 +00:00
MipsSERegisterInfo.h
MipsSubtarget.cpp [MIPS GlobalISel] Adding GlobalISel 2018-02-23 11:06:40 +00:00
MipsSubtarget.h [MIPS GlobalISel] Adding GlobalISel 2018-02-23 11:06:40 +00:00
MipsTargetMachine.cpp [MIPS GlobalISel] Adding GlobalISel 2018-02-23 11:06:40 +00:00
MipsTargetMachine.h (Re-landing) Expose a TargetMachine::getTargetTransformInfo function 2017-12-22 18:21:59 +00:00
MipsTargetObjectFile.cpp [MIPS] Don't crash on unsized extern types with -mgpopt 2018-01-26 15:56:14 +00:00
MipsTargetObjectFile.h
MipsTargetStreamer.h
MSA.txt
Relocation.txt [mips] Removal of microMIPS64R6 2017-12-11 11:21:40 +00:00