llvm-6502/lib/Target/Mips/MCTargetDesc
Daniel Sanders 7c2ef822f7 [mips][mips64r6] Use JALR for returns instead of JR (which is not available on MIPS32r6/MIPS64r6)
Summary:
RET, and RET_MM have been replaced by a pseudo named PseudoReturn.
In addition a version with a 64-bit GPR named PseudoReturn64 has been
added.

Instruction selection for a return matches RetRA, which is expanded post
register allocation to PseudoReturn/PseudoReturn64. During MipsAsmPrinter,
this PseudoReturn/PseudoReturn64 are emitted as:
- (JALR64 $zero, $rs) on MIPS64r6
- (JALR $zero, $rs) on MIPS32r6
- (JR_MM $rs) on microMIPS
- (JR $rs) otherwise

On MIPS32r6/MIPS64r6, 'jr $rs' is an alias for 'jalr $zero, $rs'. To aid
development and review (specifically, to ensure all cases of jr are
updated), these aliases are temporarily named 'r6.jr' instead of 'jr'.
A follow up patch will change them back to the correct mnemonic.

Added (JALR $zero, $rs) to MipsNaClELFStreamer's definition of an indirect
jump, and removed it from its definition of a call.
Note: I haven't accounted for MIPS64 in MipsNaClELFStreamer since it's
doesn't appear to account for any MIPS64-specifics.

The return instruction created as part of eh_return expansion is now expanded
using expandRetRA() so we use the right return instruction on MIPS32r6/MIPS64r6
('jalr $zero, $rs').

Also, fixed a misuse of isABI_N64() to detect 64-bit wide registers in
expandEhReturn().

Reviewers: jkolek, vmedic, mseaborn, zoran.jovanovic, dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D4268


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212604 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-09 10:16:07 +00:00
..
CMakeLists.txt [mips] Improve encapsulation of the .MIPS.abiflags implementation and limit scope of related enums 2014-07-08 10:11:38 +00:00
LLVMBuild.txt
Makefile
MipsABIFlagsSection.cpp [mips] Improve encapsulation of the .MIPS.abiflags implementation and limit scope of related enums 2014-07-08 10:11:38 +00:00
MipsABIFlagsSection.h [mips] Improve encapsulation of the .MIPS.abiflags implementation and limit scope of related enums 2014-07-08 10:11:38 +00:00
MipsAsmBackend.cpp [mips][mips64r6] Relocation R_MIPS_PC18_S3 2014-06-13 14:26:47 +00:00
MipsAsmBackend.h Convert some assert(0) to llvm_unreachable or fold an 'if' condition into the assert. 2014-06-19 06:10:58 +00:00
MipsBaseInfo.h Completely rewrite ELFObjectWriter::RecordRelocation. 2014-03-29 06:26:49 +00:00
MipsELFObjectWriter.cpp [mips][mips64r6] Relocation R_MIPS_PC18_S3 2014-06-13 14:26:47 +00:00
MipsELFStreamer.cpp [mips] Implement custom MCELFStreamer. 2014-03-27 11:39:03 +00:00
MipsELFStreamer.h [mips] Remove unused private field. 2014-03-27 12:02:48 +00:00
MipsFixupKinds.h [mips][mips64r6] Relocation R_MIPS_PC18_S3 2014-06-13 14:26:47 +00:00
MipsMCAsmInfo.cpp Print a=b as an assignment. 2014-06-24 22:45:16 +00:00
MipsMCAsmInfo.h [C++11] Add 'override' keywords and remove 'virtual'. Additionally add 'final' and leave 'virtual' on some methods that are marked virtual without overriding anything and have no obvious overrides themselves. Mips edition 2014-04-29 07:58:02 +00:00
MipsMCCodeEmitter.cpp [mips][mips64r6] Relocation R_MIPS_PC18_S3 2014-06-13 14:26:47 +00:00
MipsMCCodeEmitter.h [mips][mips64r6] Add LDPC instruction 2014-06-09 09:49:51 +00:00
MipsMCExpr.cpp Move expression visitation logic up to MCStreamer. 2014-06-25 15:45:33 +00:00
MipsMCExpr.h Move expression visitation logic up to MCStreamer. 2014-06-25 15:45:33 +00:00
MipsMCNaCl.h [C++] Use 'nullptr'. 2014-04-28 04:05:08 +00:00
MipsMCTargetDesc.cpp [Mips] Add a target streamer when creating a null streamer. 2014-06-23 19:43:40 +00:00
MipsMCTargetDesc.h [mips] 80-column. 2014-03-19 16:29:06 +00:00
MipsNaClELFStreamer.cpp [mips][mips64r6] Use JALR for returns instead of JR (which is not available on MIPS32r6/MIPS64r6) 2014-07-09 10:16:07 +00:00
MipsTargetStreamer.cpp [mips] Improve encapsulation of the .MIPS.abiflags implementation and limit scope of related enums 2014-07-08 10:11:38 +00:00