2011-04-15 21:51:11 +00:00
|
|
|
//===- Mips.td - Describe the Mips Target Machine ----------*- tablegen -*-===//
|
2007-06-06 07:42:06 +00:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2007-12-29 20:36:04 +00:00
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
2007-06-06 07:42:06 +00:00
|
|
|
//
|
2011-04-15 21:51:11 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
2007-08-18 02:18:07 +00:00
|
|
|
// This is the top level entry point for the Mips target.
|
2011-04-15 21:51:11 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
2007-06-06 07:42:06 +00:00
|
|
|
|
2011-04-15 21:51:11 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
2007-08-18 02:18:07 +00:00
|
|
|
// Target-independent interfaces
|
2011-04-15 21:51:11 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
2007-06-06 07:42:06 +00:00
|
|
|
|
2008-11-24 07:34:46 +00:00
|
|
|
include "llvm/Target/Target.td"
|
2007-06-06 07:42:06 +00:00
|
|
|
|
2011-04-15 21:51:11 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
Several changes to Mips backend, experimental fp support being the most
important.
- Cleanup in the Subtarget info with addition of new features, not all support
yet, but they allow the future inclusion of features easier. Among new features,
we have : Arch family info (mips1, mips2, ...), ABI info (o32, eabi), 64-bit
integer
and float registers, allegrex vector FPU (VFPU), single float only support.
- TargetMachine now detects allegrex core.
- Added allegrex (Mips32r2) sext_inreg instructions.
- *Added Float Point Instructions*, handling single float only, and
aliased accesses for 32-bit FPUs.
- Some cleanup in FP instruction formats and FP register classes.
- Calling conventions improved to support mips 32-bit EABI.
- Added Asm Printer support for fp cond codes.
- Added support for sret copy to a return register.
- EABI support added into LowerCALL and FORMAL_ARGS.
- MipsFunctionInfo now keeps a virtual register per function to track the
sret on function entry until function ret.
- MipsInstrInfo FP support into methods (isMoveInstr, isLoadFromStackSlot, ...),
FP cond codes mapping and initial FP Branch Analysis.
- Two new Mips SDNode to handle fp branch and compare instructions : FPBrcond,
FPCmp
- MipsTargetLowering : handling different FP classes, Allegrex support, sret
return copy, no homing location within EABI, non 32-bit stack objects
arguments, and asm constraint for float.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53146 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-05 19:05:21 +00:00
|
|
|
// Register File, Calling Conv, Instruction Descriptions
|
2011-04-15 21:51:11 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
2007-06-06 07:42:06 +00:00
|
|
|
|
|
|
|
include "MipsRegisterInfo.td"
|
2007-08-18 02:18:07 +00:00
|
|
|
include "MipsSchedule.td"
|
2007-06-06 07:42:06 +00:00
|
|
|
include "MipsInstrInfo.td"
|
2007-08-18 02:18:07 +00:00
|
|
|
include "MipsCallingConv.td"
|
2007-06-06 07:42:06 +00:00
|
|
|
|
2010-04-05 03:10:20 +00:00
|
|
|
def MipsInstrInfo : InstrInfo;
|
2007-08-18 02:18:07 +00:00
|
|
|
|
2011-04-15 21:51:11 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Mips Subtarget features //
|
|
|
|
//===----------------------------------------------------------------------===//
|
2007-06-06 07:42:06 +00:00
|
|
|
|
2008-07-09 05:32:22 +00:00
|
|
|
def FeatureGP64Bit : SubtargetFeature<"gp64", "IsGP64bit", "true",
|
Several changes to Mips backend, experimental fp support being the most
important.
- Cleanup in the Subtarget info with addition of new features, not all support
yet, but they allow the future inclusion of features easier. Among new features,
we have : Arch family info (mips1, mips2, ...), ABI info (o32, eabi), 64-bit
integer
and float registers, allegrex vector FPU (VFPU), single float only support.
- TargetMachine now detects allegrex core.
- Added allegrex (Mips32r2) sext_inreg instructions.
- *Added Float Point Instructions*, handling single float only, and
aliased accesses for 32-bit FPUs.
- Some cleanup in FP instruction formats and FP register classes.
- Calling conventions improved to support mips 32-bit EABI.
- Added Asm Printer support for fp cond codes.
- Added support for sret copy to a return register.
- EABI support added into LowerCALL and FORMAL_ARGS.
- MipsFunctionInfo now keeps a virtual register per function to track the
sret on function entry until function ret.
- MipsInstrInfo FP support into methods (isMoveInstr, isLoadFromStackSlot, ...),
FP cond codes mapping and initial FP Branch Analysis.
- Two new Mips SDNode to handle fp branch and compare instructions : FPBrcond,
FPCmp
- MipsTargetLowering : handling different FP classes, Allegrex support, sret
return copy, no homing location within EABI, non 32-bit stack objects
arguments, and asm constraint for float.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53146 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-05 19:05:21 +00:00
|
|
|
"General Purpose Registers are 64-bit wide.">;
|
2008-07-09 05:32:22 +00:00
|
|
|
def FeatureFP64Bit : SubtargetFeature<"fp64", "IsFP64bit", "true",
|
Several changes to Mips backend, experimental fp support being the most
important.
- Cleanup in the Subtarget info with addition of new features, not all support
yet, but they allow the future inclusion of features easier. Among new features,
we have : Arch family info (mips1, mips2, ...), ABI info (o32, eabi), 64-bit
integer
and float registers, allegrex vector FPU (VFPU), single float only support.
- TargetMachine now detects allegrex core.
- Added allegrex (Mips32r2) sext_inreg instructions.
- *Added Float Point Instructions*, handling single float only, and
aliased accesses for 32-bit FPUs.
- Some cleanup in FP instruction formats and FP register classes.
- Calling conventions improved to support mips 32-bit EABI.
- Added Asm Printer support for fp cond codes.
- Added support for sret copy to a return register.
- EABI support added into LowerCALL and FORMAL_ARGS.
- MipsFunctionInfo now keeps a virtual register per function to track the
sret on function entry until function ret.
- MipsInstrInfo FP support into methods (isMoveInstr, isLoadFromStackSlot, ...),
FP cond codes mapping and initial FP Branch Analysis.
- Two new Mips SDNode to handle fp branch and compare instructions : FPBrcond,
FPCmp
- MipsTargetLowering : handling different FP classes, Allegrex support, sret
return copy, no homing location within EABI, non 32-bit stack objects
arguments, and asm constraint for float.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53146 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-05 19:05:21 +00:00
|
|
|
"Support 64-bit FP registers.">;
|
2008-07-09 05:32:22 +00:00
|
|
|
def FeatureSingleFloat : SubtargetFeature<"single-float", "IsSingleFloat",
|
2011-04-15 21:51:11 +00:00
|
|
|
"true", "Only supports single precision float">;
|
2008-07-09 05:32:22 +00:00
|
|
|
def FeatureO32 : SubtargetFeature<"o32", "MipsABI", "O32",
|
Several changes to Mips backend, experimental fp support being the most
important.
- Cleanup in the Subtarget info with addition of new features, not all support
yet, but they allow the future inclusion of features easier. Among new features,
we have : Arch family info (mips1, mips2, ...), ABI info (o32, eabi), 64-bit
integer
and float registers, allegrex vector FPU (VFPU), single float only support.
- TargetMachine now detects allegrex core.
- Added allegrex (Mips32r2) sext_inreg instructions.
- *Added Float Point Instructions*, handling single float only, and
aliased accesses for 32-bit FPUs.
- Some cleanup in FP instruction formats and FP register classes.
- Calling conventions improved to support mips 32-bit EABI.
- Added Asm Printer support for fp cond codes.
- Added support for sret copy to a return register.
- EABI support added into LowerCALL and FORMAL_ARGS.
- MipsFunctionInfo now keeps a virtual register per function to track the
sret on function entry until function ret.
- MipsInstrInfo FP support into methods (isMoveInstr, isLoadFromStackSlot, ...),
FP cond codes mapping and initial FP Branch Analysis.
- Two new Mips SDNode to handle fp branch and compare instructions : FPBrcond,
FPCmp
- MipsTargetLowering : handling different FP classes, Allegrex support, sret
return copy, no homing location within EABI, non 32-bit stack objects
arguments, and asm constraint for float.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53146 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-05 19:05:21 +00:00
|
|
|
"Enable o32 ABI">;
|
2008-07-09 05:32:22 +00:00
|
|
|
def FeatureEABI : SubtargetFeature<"eabi", "MipsABI", "EABI",
|
Several changes to Mips backend, experimental fp support being the most
important.
- Cleanup in the Subtarget info with addition of new features, not all support
yet, but they allow the future inclusion of features easier. Among new features,
we have : Arch family info (mips1, mips2, ...), ABI info (o32, eabi), 64-bit
integer
and float registers, allegrex vector FPU (VFPU), single float only support.
- TargetMachine now detects allegrex core.
- Added allegrex (Mips32r2) sext_inreg instructions.
- *Added Float Point Instructions*, handling single float only, and
aliased accesses for 32-bit FPUs.
- Some cleanup in FP instruction formats and FP register classes.
- Calling conventions improved to support mips 32-bit EABI.
- Added Asm Printer support for fp cond codes.
- Added support for sret copy to a return register.
- EABI support added into LowerCALL and FORMAL_ARGS.
- MipsFunctionInfo now keeps a virtual register per function to track the
sret on function entry until function ret.
- MipsInstrInfo FP support into methods (isMoveInstr, isLoadFromStackSlot, ...),
FP cond codes mapping and initial FP Branch Analysis.
- Two new Mips SDNode to handle fp branch and compare instructions : FPBrcond,
FPCmp
- MipsTargetLowering : handling different FP classes, Allegrex support, sret
return copy, no homing location within EABI, non 32-bit stack objects
arguments, and asm constraint for float.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53146 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-05 19:05:21 +00:00
|
|
|
"Enable eabi ABI">;
|
2010-11-08 21:42:32 +00:00
|
|
|
def FeatureVFPU : SubtargetFeature<"vfpu", "HasVFPU",
|
2008-07-09 05:32:22 +00:00
|
|
|
"true", "Enable vector FPU instructions.">;
|
2010-11-08 21:42:32 +00:00
|
|
|
def FeatureSEInReg : SubtargetFeature<"seinreg", "HasSEInReg", "true",
|
2008-07-09 05:32:22 +00:00
|
|
|
"Enable 'signext in register' instructions.">;
|
2010-11-08 21:42:32 +00:00
|
|
|
def FeatureCondMov : SubtargetFeature<"condmov", "HasCondMov", "true",
|
2008-07-30 17:01:06 +00:00
|
|
|
"Enable 'conditional move' instructions.">;
|
|
|
|
def FeatureMulDivAdd : SubtargetFeature<"muldivadd", "HasMulDivAdd", "true",
|
|
|
|
"Enable 'multiply add/sub' instructions.">;
|
|
|
|
def FeatureMinMax : SubtargetFeature<"minmax", "HasMinMax", "true",
|
|
|
|
"Enable 'min/max' instructions.">;
|
|
|
|
def FeatureSwap : SubtargetFeature<"swap", "HasSwap", "true",
|
|
|
|
"Enable 'byte/half swap' instructions.">;
|
|
|
|
def FeatureBitCount : SubtargetFeature<"bitcount", "HasBitCount", "true",
|
|
|
|
"Enable 'count leading bits' instructions.">;
|
2010-11-08 21:42:32 +00:00
|
|
|
def FeatureMips1 : SubtargetFeature<"mips1", "MipsArchVersion", "Mips1",
|
|
|
|
"Mips1 ISA Support">;
|
|
|
|
def FeatureMips2 : SubtargetFeature<"mips2", "MipsArchVersion", "Mips2",
|
|
|
|
"Mips2 ISA Support">;
|
2011-04-15 21:51:11 +00:00
|
|
|
def FeatureMips32 : SubtargetFeature<"mips32", "MipsArchVersion", "Mips32",
|
|
|
|
"Mips32 ISA Support",
|
2010-11-10 02:13:22 +00:00
|
|
|
[FeatureCondMov, FeatureBitCount]>;
|
2010-11-08 21:42:32 +00:00
|
|
|
def FeatureMips32r2 : SubtargetFeature<"mips32r2", "MipsArchVersion",
|
|
|
|
"Mips32r2", "Mips32r2 ISA Support",
|
|
|
|
[FeatureMips32, FeatureSEInReg]>;
|
2007-06-06 07:42:06 +00:00
|
|
|
|
2011-04-15 21:51:11 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
2007-06-06 07:42:06 +00:00
|
|
|
// Mips processors supported.
|
2011-04-15 21:51:11 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
2007-06-06 07:42:06 +00:00
|
|
|
|
Several changes to Mips backend, experimental fp support being the most
important.
- Cleanup in the Subtarget info with addition of new features, not all support
yet, but they allow the future inclusion of features easier. Among new features,
we have : Arch family info (mips1, mips2, ...), ABI info (o32, eabi), 64-bit
integer
and float registers, allegrex vector FPU (VFPU), single float only support.
- TargetMachine now detects allegrex core.
- Added allegrex (Mips32r2) sext_inreg instructions.
- *Added Float Point Instructions*, handling single float only, and
aliased accesses for 32-bit FPUs.
- Some cleanup in FP instruction formats and FP register classes.
- Calling conventions improved to support mips 32-bit EABI.
- Added Asm Printer support for fp cond codes.
- Added support for sret copy to a return register.
- EABI support added into LowerCALL and FORMAL_ARGS.
- MipsFunctionInfo now keeps a virtual register per function to track the
sret on function entry until function ret.
- MipsInstrInfo FP support into methods (isMoveInstr, isLoadFromStackSlot, ...),
FP cond codes mapping and initial FP Branch Analysis.
- Two new Mips SDNode to handle fp branch and compare instructions : FPBrcond,
FPCmp
- MipsTargetLowering : handling different FP classes, Allegrex support, sret
return copy, no homing location within EABI, non 32-bit stack objects
arguments, and asm constraint for float.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53146 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-05 19:05:21 +00:00
|
|
|
class Proc<string Name, list<SubtargetFeature> Features>
|
|
|
|
: Processor<Name, MipsGenericItineraries, Features>;
|
|
|
|
|
2009-05-27 17:23:44 +00:00
|
|
|
def : Proc<"mips1", [FeatureMips1]>;
|
|
|
|
def : Proc<"r2000", [FeatureMips1]>;
|
|
|
|
def : Proc<"r3000", [FeatureMips1]>;
|
Several changes to Mips backend, experimental fp support being the most
important.
- Cleanup in the Subtarget info with addition of new features, not all support
yet, but they allow the future inclusion of features easier. Among new features,
we have : Arch family info (mips1, mips2, ...), ABI info (o32, eabi), 64-bit
integer
and float registers, allegrex vector FPU (VFPU), single float only support.
- TargetMachine now detects allegrex core.
- Added allegrex (Mips32r2) sext_inreg instructions.
- *Added Float Point Instructions*, handling single float only, and
aliased accesses for 32-bit FPUs.
- Some cleanup in FP instruction formats and FP register classes.
- Calling conventions improved to support mips 32-bit EABI.
- Added Asm Printer support for fp cond codes.
- Added support for sret copy to a return register.
- EABI support added into LowerCALL and FORMAL_ARGS.
- MipsFunctionInfo now keeps a virtual register per function to track the
sret on function entry until function ret.
- MipsInstrInfo FP support into methods (isMoveInstr, isLoadFromStackSlot, ...),
FP cond codes mapping and initial FP Branch Analysis.
- Two new Mips SDNode to handle fp branch and compare instructions : FPBrcond,
FPCmp
- MipsTargetLowering : handling different FP classes, Allegrex support, sret
return copy, no homing location within EABI, non 32-bit stack objects
arguments, and asm constraint for float.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53146 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-05 19:05:21 +00:00
|
|
|
|
|
|
|
def : Proc<"mips2", [FeatureMips2]>;
|
|
|
|
def : Proc<"r6000", [FeatureMips2]>;
|
|
|
|
|
2010-11-08 21:42:32 +00:00
|
|
|
def : Proc<"4ke", [FeatureMips32r2]>;
|
|
|
|
|
2011-04-15 05:18:47 +00:00
|
|
|
// Allegrex is a 32bit subset of r4000, both for integer and fp registers,
|
2010-11-08 21:42:32 +00:00
|
|
|
// but much more similar to Mips2 than Mips3. It also contains some of
|
|
|
|
// Mips32/Mips32r2 instructions and a custom vector fpu processor.
|
|
|
|
def : Proc<"allegrex", [FeatureMips2, FeatureSingleFloat, FeatureEABI,
|
2008-07-30 17:01:06 +00:00
|
|
|
FeatureVFPU, FeatureSEInReg, FeatureCondMov, FeatureMulDivAdd,
|
|
|
|
FeatureMinMax, FeatureSwap, FeatureBitCount]>;
|
2007-06-06 07:42:06 +00:00
|
|
|
|
2011-07-07 23:56:50 +00:00
|
|
|
def MipsAsmWriter : AsmWriter {
|
|
|
|
string AsmWriterClassName = "InstPrinter";
|
|
|
|
bit isMCAsmWriter = 1;
|
|
|
|
}
|
|
|
|
|
2007-06-06 07:42:06 +00:00
|
|
|
def Mips : Target {
|
|
|
|
let InstructionSet = MipsInstrInfo;
|
2011-07-07 23:56:50 +00:00
|
|
|
|
|
|
|
let AssemblyWriters = [MipsAsmWriter];
|
2007-06-06 07:42:06 +00:00
|
|
|
}
|
2011-07-07 23:56:50 +00:00
|
|
|
|