llvm-6502/lib/Target/Mips
Daniel Sanders fe6bd52bf2 [mips] BSEL's and BINS[RL] operands are reversed compared to the vselect node used in the pattern.
Summary:
Correct the match patterns and the lowerings that made the CodeGen tests pass despite the mistakes.

The original testcase that discovered the problem was SingleSource/UnitTests/SignlessType/factor.c in test-suite.
During review, we also found that some of the existing CodeGen tests were incorrect and fixed them:
* bitwise.ll: In bsel_v16i8 the IfSet/IfClear were reversed because bsel and bmnz have different operand orders and the test didn't correctly account for this. bmnz goes 'IfClear, IfSet, CondMask', while bsel goes 'CondMask, IfClear, IfSet'.
* vec.ll: In the cases where a bsel is emitted as a bmnz (they are the same operation with a different input tied to the result) the operands were in the wrong order.
* compare.ll and compare_float.ll: The bsel operand order was correct for a greater-than comparison, but a greater-than comparison instruction doesn't exist. Lowering this operation inverts the condition so the IfSet/IfClear need to be swapped to match.

The differences between BSEL, BMNZ, and BMZ and how they map to/from vselect are rather confusing. I've therefore added a note to MSA.txt to explain this in a single place in addition to the comments that explain each case.

Reviewers: matheusalmeida, jacksprat

Reviewed By: matheusalmeida

Differential Revision: http://llvm-reviews.chandlerc.com/D3028

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203657 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-12 11:54:00 +00:00
..
AsmParser [mips] Assembly parser must invoke the target streamer to handle .set reorder macro. 2014-03-10 13:21:10 +00:00
Disassembler Cleaning up a bunch of pre-Visual C++ 2012 build hacks. 2014-03-04 09:23:33 +00:00
InstPrinter [cleanup] Re-sort all the includes with utils/sort_includes.py. 2014-03-04 10:07:28 +00:00
MCTargetDesc [mips] Implement NaCl sandboxing of function calls: 2014-03-11 21:23:40 +00:00
TargetInfo
CMakeLists.txt This patch has two main functions: 2014-02-14 19:16:39 +00:00
LLVMBuild.txt
Makefile
MicroMipsInstrFormats.td Fixed encoding of SYSCALL microMIPS instruction. 2014-02-28 18:17:08 +00:00
MicroMipsInstrFPU.td
MicroMipsInstrInfo.td Fixed operand of SC microMIPS instruction. 2014-02-28 18:22:56 +00:00
Mips16FrameLowering.cpp Replace PROLOG_LABEL with a new CFI_INSTRUCTION. 2014-03-07 06:08:31 +00:00
Mips16FrameLowering.h
Mips16HardFloat.cpp This patch has two main functions: 2014-02-14 19:16:39 +00:00
Mips16HardFloat.h
Mips16HardFloatInfo.cpp [cleanup] Re-sort all the includes with utils/sort_includes.py. 2014-03-04 10:07:28 +00:00
Mips16HardFloatInfo.h This patch has two main functions: 2014-02-14 19:16:39 +00:00
Mips16InstrFormats.td
Mips16InstrInfo.cpp [C++11] Replace llvm::next and llvm::prior with std::next and std::prev. 2014-03-02 12:27:27 +00:00
Mips16InstrInfo.h
Mips16InstrInfo.td
Mips16ISelDAGToDAG.cpp [Modules] Move CFG.h to the IR library as it defines graph traits over 2014-03-04 11:45:46 +00:00
Mips16ISelDAGToDAG.h
Mips16ISelLowering.cpp [cleanup] Re-sort all the includes with utils/sort_includes.py. 2014-03-04 10:07:28 +00:00
Mips16ISelLowering.h
Mips16RegisterInfo.cpp Replace '#include ValueTypes.h' with forward declarations. 2014-03-12 08:00:24 +00:00
Mips16RegisterInfo.h
Mips64InstrInfo.td
Mips.h
Mips.td [mips] Make it impossible to have UnknownABI in CodeGen and Integrated Assembler. 2014-02-20 14:58:19 +00:00
MipsAnalyzeImmediate.cpp
MipsAnalyzeImmediate.h
MipsAsmPrinter.cpp [mips] Implement NaCl sandboxing of indirect jumps: 2014-02-28 10:00:38 +00:00
MipsAsmPrinter.h Switch all uses of LLVM_OVERRIDE to just use 'override' directly. 2014-03-02 09:09:27 +00:00
MipsCallingConv.td
MipsCodeEmitter.cpp
MipsCondMov.td
MipsConstantIslandPass.cpp [Modules] Move InstIterator out of the Support library, where it had no 2014-03-04 10:30:26 +00:00
MipsDelaySlotFiller.cpp [mips] Implement NaCl sandboxing of loads, stores and SP changes: 2014-03-10 20:34:23 +00:00
MipsDSPInstrFormats.td
MipsDSPInstrInfo.td
MipsFrameLowering.cpp
MipsFrameLowering.h
MipsInstrFormats.td
MipsInstrFPU.td
MipsInstrInfo.cpp
MipsInstrInfo.h
MipsInstrInfo.td [mips] Prevent %lo relocation being used on MSA loads and stores. 2014-03-03 14:31:21 +00:00
MipsISelDAGToDAG.cpp [Modules] Move CFG.h to the IR library as it defines graph traits over 2014-03-04 11:45:46 +00:00
MipsISelDAGToDAG.h [mips] Prevent %lo relocation being used on MSA loads and stores. 2014-03-03 14:31:21 +00:00
MipsISelLowering.cpp [C++11] Replace llvm::next and llvm::prior with std::next and std::prev. 2014-03-02 12:27:27 +00:00
MipsISelLowering.h
MipsJITInfo.cpp
MipsJITInfo.h
MipsLongBranch.cpp [C++11] Replace llvm::next and llvm::prior with std::next and std::prev. 2014-03-02 12:27:27 +00:00
MipsMachineFunction.cpp
MipsMachineFunction.h [Modules] Move ValueMap to the IR library. While this class does not 2014-03-04 11:26:31 +00:00
MipsMCInstLower.cpp
MipsMCInstLower.h
MipsModuleISelDAGToDAG.cpp
MipsModuleISelDAGToDAG.h
MipsMSAInstrFormats.td
MipsMSAInstrInfo.td [mips] BSEL's and BINS[RL] operands are reversed compared to the vselect node used in the pattern. 2014-03-12 11:54:00 +00:00
MipsOptimizePICCall.cpp
MipsOs16.cpp
MipsOs16.h
MipsRegisterInfo.cpp Replace '#include ValueTypes.h' with forward declarations. 2014-03-12 08:00:24 +00:00
MipsRegisterInfo.h
MipsRegisterInfo.td
MipsRelocations.h
MipsSchedule.td
MipsSEFrameLowering.cpp Replace PROLOG_LABEL with a new CFI_INSTRUCTION. 2014-03-07 06:08:31 +00:00
MipsSEFrameLowering.h
MipsSEInstrInfo.cpp [mips][fp64] Add an implicit def to MFHC1 claiming that it reads the lower 32-bits of 64-bit FPR 2014-03-10 15:01:57 +00:00
MipsSEInstrInfo.h
MipsSEISelDAGToDAG.cpp [Modules] Move CFG.h to the IR library as it defines graph traits over 2014-03-04 11:45:46 +00:00
MipsSEISelDAGToDAG.h [mips] Prevent %lo relocation being used on MSA loads and stores. 2014-03-03 14:31:21 +00:00
MipsSEISelLowering.cpp [mips] BSEL's and BINS[RL] operands are reversed compared to the vselect node used in the pattern. 2014-03-12 11:54:00 +00:00
MipsSEISelLowering.h Switch all uses of LLVM_OVERRIDE to just use 'override' directly. 2014-03-02 09:09:27 +00:00
MipsSelectionDAGInfo.cpp
MipsSelectionDAGInfo.h
MipsSERegisterInfo.cpp Replace '#include ValueTypes.h' with forward declarations. 2014-03-12 08:00:24 +00:00
MipsSERegisterInfo.h
MipsSubtarget.cpp [mips] Treat -mcpu=generic the same way as an empty CPU string. 2014-02-26 10:20:15 +00:00
MipsSubtarget.h
MipsTargetMachine.cpp Fix regression with -O0 for mips . 2014-03-10 16:31:25 +00:00
MipsTargetMachine.h
MipsTargetObjectFile.cpp
MipsTargetObjectFile.h Switch all uses of LLVM_OVERRIDE to just use 'override' directly. 2014-03-02 09:09:27 +00:00
MipsTargetStreamer.h This patch implements .set dsp directive and sets appropriate feature bits.This directive is a counterpart of -mattr=dsp command line option with the exception that it does not influence elf header flags. The usage example is gives in test file. 2014-03-05 11:05:09 +00:00
MSA.txt [mips] BSEL's and BINS[RL] operands are reversed compared to the vselect node used in the pattern. 2014-03-12 11:54:00 +00:00