2012-02-28 15:46:26 +08:00
|
|
|
//===-- MipsInstrFormats.td - Mips Instruction Formats -----*- tablegen -*-===//
|
2007-06-06 15:42:06 +08:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2007-12-30 04:36:04 +08:00
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
2007-06-06 15:42:06 +08:00
|
|
|
//
|
2011-04-16 05:51:11 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
2007-06-06 15:42:06 +08:00
|
|
|
|
2011-04-16 05:51:11 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
2007-06-06 15:42:06 +08:00
|
|
|
// Describe MIPS instructions format
|
|
|
|
//
|
2008-06-08 09:39:36 +08:00
|
|
|
// CPU INSTRUCTION FORMATS
|
2007-06-06 15:42:06 +08:00
|
|
|
//
|
|
|
|
// opcode - operation code.
|
|
|
|
// rs - src reg.
|
|
|
|
// rt - dst reg (on a 2 regs instr) or src reg (on a 3 reg instr).
|
|
|
|
// rd - dst reg, only used on 3 regs instr.
|
|
|
|
// shamt - only used on shift instructions, contains the shift amount.
|
|
|
|
// funct - combined with opcode field give us an operation code.
|
|
|
|
//
|
2011-04-16 05:51:11 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
2007-06-06 15:42:06 +08:00
|
|
|
|
2011-10-19 01:50:36 +08:00
|
|
|
// Format specifies the encoding used by the instruction. This is part of the
|
|
|
|
// ad-hoc solution used to emit machine instruction encodings by our machine
|
|
|
|
// code emitter.
|
|
|
|
class Format<bits<4> val> {
|
|
|
|
bits<4> Value = val;
|
|
|
|
}
|
|
|
|
|
|
|
|
def Pseudo : Format<0>;
|
|
|
|
def FrmR : Format<1>;
|
|
|
|
def FrmI : Format<2>;
|
|
|
|
def FrmJ : Format<3>;
|
|
|
|
def FrmFR : Format<4>;
|
|
|
|
def FrmFI : Format<5>;
|
|
|
|
def FrmOther : Format<6>; // Instruction w/ a custom format
|
|
|
|
|
2007-06-06 15:42:06 +08:00
|
|
|
// Generic Mips Format
|
2011-03-05 01:51:39 +08:00
|
|
|
class MipsInst<dag outs, dag ins, string asmstr, list<dag> pattern,
|
2011-10-19 01:50:36 +08:00
|
|
|
InstrItinClass itin, Format f>: Instruction
|
2007-06-06 15:42:06 +08:00
|
|
|
{
|
|
|
|
field bits<32> Inst;
|
2011-10-19 01:50:36 +08:00
|
|
|
Format Form = f;
|
2007-06-06 15:42:06 +08:00
|
|
|
|
|
|
|
let Namespace = "Mips";
|
|
|
|
|
2011-10-19 01:50:36 +08:00
|
|
|
bits<6> Opcode = 0;
|
2007-06-06 15:42:06 +08:00
|
|
|
|
2011-10-19 01:50:36 +08:00
|
|
|
// Top 6 bits are the 'opcode' field
|
|
|
|
let Inst{31-26} = Opcode;
|
2011-03-05 01:51:39 +08:00
|
|
|
|
2011-10-19 01:50:36 +08:00
|
|
|
let OutOperandList = outs;
|
|
|
|
let InOperandList = ins;
|
2007-08-18 10:01:28 +08:00
|
|
|
|
2007-06-06 15:42:06 +08:00
|
|
|
let AsmString = asmstr;
|
|
|
|
let Pattern = pattern;
|
2007-08-22 00:06:45 +08:00
|
|
|
let Itinerary = itin;
|
2011-10-19 01:50:36 +08:00
|
|
|
|
|
|
|
//
|
|
|
|
// Attributes specific to Mips instructions...
|
|
|
|
//
|
|
|
|
bits<4> FormBits = Form.Value;
|
|
|
|
|
|
|
|
// TSFlags layout should be kept in sync with MipsInstrInfo.h.
|
|
|
|
let TSFlags{3-0} = FormBits;
|
2007-06-06 15:42:06 +08:00
|
|
|
}
|
|
|
|
|
2007-10-09 10:55:31 +08:00
|
|
|
// Mips Pseudo Instructions Format
|
2008-06-06 08:58:26 +08:00
|
|
|
class MipsPseudo<dag outs, dag ins, string asmstr, list<dag> pattern>:
|
2011-10-19 01:50:36 +08:00
|
|
|
MipsInst<outs, ins, asmstr, pattern, IIPseudo, Pseudo> {
|
|
|
|
let isCodeGenOnly = 1;
|
2011-09-27 12:57:54 +08:00
|
|
|
let isPseudo = 1;
|
|
|
|
}
|
2007-06-06 15:42:06 +08:00
|
|
|
|
2011-04-16 05:51:11 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
2007-06-06 15:42:06 +08:00
|
|
|
// Format R instruction class in Mips : <|opcode|rs|rt|rd|shamt|funct|>
|
2011-04-16 05:51:11 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
2007-06-06 15:42:06 +08:00
|
|
|
|
Change instruction description to split OperandList into OutOperandList and
InOperandList. This gives one piece of important information: # of results
produced by an instruction.
An example of the change:
def ADD32rr : I<0x01, MRMDestReg, (ops GR32:$dst, GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
=>
def ADD32rr : I<0x01, MRMDestReg, (outs GR32:$dst), (ins GR32:$src1, GR32:$src2),
"add{l} {$src2, $dst|$dst, $src2}",
[(set GR32:$dst, (add GR32:$src1, GR32:$src2))]>;
llvm-svn: 40033
2007-07-19 09:14:50 +08:00
|
|
|
class FR<bits<6> op, bits<6> _funct, dag outs, dag ins, string asmstr,
|
2007-08-18 10:01:28 +08:00
|
|
|
list<dag> pattern, InstrItinClass itin>:
|
2011-10-19 01:50:36 +08:00
|
|
|
MipsInst<outs, ins, asmstr, pattern, itin, FrmR>
|
2007-06-06 15:42:06 +08:00
|
|
|
{
|
|
|
|
bits<5> rd;
|
|
|
|
bits<5> rs;
|
|
|
|
bits<5> rt;
|
|
|
|
bits<5> shamt;
|
|
|
|
bits<6> funct;
|
|
|
|
|
2011-10-19 01:50:36 +08:00
|
|
|
let Opcode = op;
|
2007-06-06 15:42:06 +08:00
|
|
|
let funct = _funct;
|
|
|
|
|
|
|
|
let Inst{25-21} = rs;
|
2011-03-05 01:51:39 +08:00
|
|
|
let Inst{20-16} = rt;
|
2007-06-06 15:42:06 +08:00
|
|
|
let Inst{15-11} = rd;
|
|
|
|
let Inst{10-6} = shamt;
|
|
|
|
let Inst{5-0} = funct;
|
|
|
|
}
|
|
|
|
|
2011-04-16 05:51:11 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
2007-06-06 15:42:06 +08:00
|
|
|
// Format I instruction class in Mips : <|opcode|rs|rt|immediate|>
|
2011-04-16 05:51:11 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
2007-06-06 15:42:06 +08:00
|
|
|
|
2007-08-18 10:01:28 +08:00
|
|
|
class FI<bits<6> op, dag outs, dag ins, string asmstr, list<dag> pattern,
|
2011-10-19 01:50:36 +08:00
|
|
|
InstrItinClass itin>: MipsInst<outs, ins, asmstr, pattern, itin, FrmI>
|
2007-06-06 15:42:06 +08:00
|
|
|
{
|
|
|
|
bits<5> rt;
|
|
|
|
bits<5> rs;
|
|
|
|
bits<16> imm16;
|
|
|
|
|
2011-10-19 01:50:36 +08:00
|
|
|
let Opcode = op;
|
2007-06-06 15:42:06 +08:00
|
|
|
|
|
|
|
let Inst{25-21} = rs;
|
2011-03-05 01:51:39 +08:00
|
|
|
let Inst{20-16} = rt;
|
2007-06-06 15:42:06 +08:00
|
|
|
let Inst{15-0} = imm16;
|
|
|
|
}
|
|
|
|
|
2011-12-06 11:34:48 +08:00
|
|
|
class BranchBase<bits<6> op, dag outs, dag ins, string asmstr,
|
2011-10-12 02:49:17 +08:00
|
|
|
list<dag> pattern, InstrItinClass itin>:
|
2011-10-19 01:50:36 +08:00
|
|
|
MipsInst<outs, ins, asmstr, pattern, itin, FrmI>
|
2011-10-12 02:49:17 +08:00
|
|
|
{
|
|
|
|
bits<5> rs;
|
|
|
|
bits<5> rt;
|
|
|
|
bits<16> imm16;
|
|
|
|
|
2011-10-19 01:50:36 +08:00
|
|
|
let Opcode = op;
|
2011-10-12 02:49:17 +08:00
|
|
|
|
|
|
|
let Inst{25-21} = rs;
|
|
|
|
let Inst{20-16} = rt;
|
|
|
|
let Inst{15-0} = imm16;
|
|
|
|
}
|
|
|
|
|
2011-04-16 05:51:11 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
2007-06-06 15:42:06 +08:00
|
|
|
// Format J instruction class in Mips : <|opcode|address|>
|
2011-04-16 05:51:11 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
2007-06-06 15:42:06 +08:00
|
|
|
|
2007-08-18 10:01:28 +08:00
|
|
|
class FJ<bits<6> op, dag outs, dag ins, string asmstr, list<dag> pattern,
|
2011-10-19 01:50:36 +08:00
|
|
|
InstrItinClass itin>: MipsInst<outs, ins, asmstr, pattern, itin, FrmJ>
|
2007-06-06 15:42:06 +08:00
|
|
|
{
|
|
|
|
bits<26> addr;
|
|
|
|
|
2011-10-19 01:50:36 +08:00
|
|
|
let Opcode = op;
|
2011-03-05 01:51:39 +08:00
|
|
|
|
2007-06-06 15:42:06 +08:00
|
|
|
let Inst{25-0} = addr;
|
|
|
|
}
|
2007-10-09 10:55:31 +08:00
|
|
|
|
2011-04-16 05:51:11 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
2008-06-08 09:39:36 +08:00
|
|
|
//
|
2008-07-09 12:45:36 +08:00
|
|
|
// FLOATING POINT INSTRUCTION FORMATS
|
2008-06-08 09:39:36 +08:00
|
|
|
//
|
|
|
|
// opcode - operation code.
|
|
|
|
// fs - src reg.
|
|
|
|
// ft - dst reg (on a 2 regs instr) or src reg (on a 3 reg instr).
|
|
|
|
// fd - dst reg, only used on 3 regs instr.
|
|
|
|
// fmt - double or single precision.
|
|
|
|
// funct - combined with opcode field give us an operation code.
|
|
|
|
//
|
2011-04-16 05:51:11 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
2008-06-08 09:39:36 +08:00
|
|
|
|
2011-04-16 05:51:11 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
2008-06-08 09:39:36 +08:00
|
|
|
// Format FR instruction class in Mips : <|opcode|fmt|ft|fs|fd|funct|>
|
2011-04-16 05:51:11 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
2008-06-08 09:39:36 +08:00
|
|
|
|
2011-03-05 01:51:39 +08:00
|
|
|
class FFR<bits<6> op, bits<6> _funct, bits<5> _fmt, dag outs, dag ins,
|
|
|
|
string asmstr, list<dag> pattern> :
|
2011-10-19 01:50:36 +08:00
|
|
|
MipsInst<outs, ins, asmstr, pattern, NoItinerary, FrmFR>
|
2008-06-08 09:39:36 +08:00
|
|
|
{
|
|
|
|
bits<5> fd;
|
|
|
|
bits<5> fs;
|
|
|
|
bits<5> ft;
|
|
|
|
bits<5> fmt;
|
|
|
|
bits<6> funct;
|
|
|
|
|
2011-10-19 01:50:36 +08:00
|
|
|
let Opcode = op;
|
2008-06-08 09:39:36 +08:00
|
|
|
let funct = _funct;
|
|
|
|
let fmt = _fmt;
|
|
|
|
|
|
|
|
let Inst{25-21} = fmt;
|
2011-03-05 01:51:39 +08:00
|
|
|
let Inst{20-16} = ft;
|
2008-06-08 09:39:36 +08:00
|
|
|
let Inst{15-11} = fs;
|
|
|
|
let Inst{10-6} = fd;
|
|
|
|
let Inst{5-0} = funct;
|
|
|
|
}
|
|
|
|
|
2011-04-16 05:51:11 +08: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.
llvm-svn: 53146
2008-07-06 03:05:21 +08:00
|
|
|
// Format FI instruction class in Mips : <|opcode|base|ft|immediate|>
|
2011-04-16 05:51:11 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
2008-06-08 09:39:36 +08:00
|
|
|
|
2011-03-05 01:51:39 +08:00
|
|
|
class FFI<bits<6> op, dag outs, dag ins, string asmstr, list<dag> pattern>:
|
2011-10-19 01:50:36 +08:00
|
|
|
MipsInst<outs, ins, asmstr, pattern, NoItinerary, FrmFI>
|
2008-06-08 09:39:36 +08:00
|
|
|
{
|
|
|
|
bits<5> ft;
|
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.
llvm-svn: 53146
2008-07-06 03:05:21 +08:00
|
|
|
bits<5> base;
|
2008-06-08 09:39:36 +08:00
|
|
|
bits<16> imm16;
|
|
|
|
|
2011-10-19 01:50:36 +08:00
|
|
|
let Opcode = op;
|
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.
llvm-svn: 53146
2008-07-06 03:05:21 +08:00
|
|
|
|
|
|
|
let Inst{25-21} = base;
|
2011-03-05 01:51:39 +08:00
|
|
|
let Inst{20-16} = ft;
|
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.
llvm-svn: 53146
2008-07-06 03:05:21 +08:00
|
|
|
let Inst{15-0} = imm16;
|
|
|
|
}
|
|
|
|
|
2011-04-16 05:51:11 +08: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.
llvm-svn: 53146
2008-07-06 03:05:21 +08:00
|
|
|
// Compare instruction class in Mips : <|010001|fmt|ft|fs|0000011|condcode|>
|
2011-04-16 05:51:11 +08: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.
llvm-svn: 53146
2008-07-06 03:05:21 +08:00
|
|
|
|
2011-03-05 01:51:39 +08:00
|
|
|
class FCC<bits<5> _fmt, dag outs, dag ins, string asmstr, list<dag> pattern> :
|
2011-10-19 01:50:36 +08:00
|
|
|
MipsInst<outs, ins, asmstr, pattern, NoItinerary, FrmOther>
|
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.
llvm-svn: 53146
2008-07-06 03:05:21 +08:00
|
|
|
{
|
|
|
|
bits<5> fs;
|
|
|
|
bits<5> ft;
|
|
|
|
bits<4> cc;
|
|
|
|
bits<5> fmt;
|
|
|
|
|
2011-10-19 01:50:36 +08:00
|
|
|
let Opcode = 0x11;
|
2008-06-08 09:39:36 +08:00
|
|
|
let fmt = _fmt;
|
|
|
|
|
|
|
|
let Inst{25-21} = fmt;
|
2011-03-05 01:51:39 +08:00
|
|
|
let Inst{20-16} = ft;
|
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.
llvm-svn: 53146
2008-07-06 03:05:21 +08:00
|
|
|
let Inst{15-11} = fs;
|
|
|
|
let Inst{10-6} = 0;
|
|
|
|
let Inst{5-4} = 0b11;
|
|
|
|
let Inst{3-0} = cc;
|
2008-06-08 09:39:36 +08:00
|
|
|
}
|
2011-04-01 02:26:17 +08:00
|
|
|
|
|
|
|
|
|
|
|
class FCMOV<bits<1> _tf, dag outs, dag ins, string asmstr,
|
|
|
|
list<dag> pattern> :
|
2011-10-19 01:50:36 +08:00
|
|
|
MipsInst<outs, ins, asmstr, pattern, NoItinerary, FrmOther>
|
2011-04-01 02:26:17 +08:00
|
|
|
{
|
|
|
|
bits<5> rd;
|
|
|
|
bits<5> rs;
|
2011-10-18 02:43:19 +08:00
|
|
|
bits<3> cc;
|
2011-04-01 02:26:17 +08:00
|
|
|
bits<1> tf;
|
|
|
|
|
2011-10-19 01:50:36 +08:00
|
|
|
let Opcode = 0;
|
2011-04-01 02:26:17 +08:00
|
|
|
let tf = _tf;
|
|
|
|
|
|
|
|
let Inst{25-21} = rs;
|
2011-10-18 02:43:19 +08:00
|
|
|
let Inst{20-18} = cc;
|
2011-04-01 02:26:17 +08:00
|
|
|
let Inst{17} = 0;
|
|
|
|
let Inst{16} = tf;
|
|
|
|
let Inst{15-11} = rd;
|
|
|
|
let Inst{10-6} = 0;
|
|
|
|
let Inst{5-0} = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
class FFCMOV<bits<5> _fmt, bits<1> _tf, dag outs, dag ins, string asmstr,
|
|
|
|
list<dag> pattern> :
|
2011-10-19 01:50:36 +08:00
|
|
|
MipsInst<outs, ins, asmstr, pattern, NoItinerary, FrmOther>
|
2011-04-01 02:26:17 +08:00
|
|
|
{
|
|
|
|
bits<5> fd;
|
|
|
|
bits<5> fs;
|
2011-10-18 02:43:19 +08:00
|
|
|
bits<3> cc;
|
2011-04-01 02:26:17 +08:00
|
|
|
bits<5> fmt;
|
|
|
|
bits<1> tf;
|
|
|
|
|
2011-10-19 01:50:36 +08:00
|
|
|
let Opcode = 17;
|
2011-04-01 02:26:17 +08:00
|
|
|
let fmt = _fmt;
|
|
|
|
let tf = _tf;
|
|
|
|
|
|
|
|
let Inst{25-21} = fmt;
|
2011-10-18 02:43:19 +08:00
|
|
|
let Inst{20-18} = cc;
|
2011-04-01 02:26:17 +08:00
|
|
|
let Inst{17} = 0;
|
|
|
|
let Inst{16} = tf;
|
|
|
|
let Inst{15-11} = fs;
|
|
|
|
let Inst{10-6} = fd;
|
|
|
|
let Inst{5-0} = 17;
|
2011-10-08 11:19:38 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// FP unary instructions without patterns.
|
|
|
|
class FFR1<bits<6> funct, bits<5> fmt, string opstr, string fmtstr,
|
|
|
|
RegisterClass DstRC, RegisterClass SrcRC> :
|
|
|
|
FFR<0x11, funct, fmt, (outs DstRC:$fd), (ins SrcRC:$fs),
|
|
|
|
!strconcat(opstr, ".", fmtstr, "\t$fd, $fs"), []> {
|
|
|
|
let ft = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// FP unary instructions with patterns.
|
|
|
|
class FFR1P<bits<6> funct, bits<5> fmt, string opstr, string fmtstr,
|
|
|
|
RegisterClass DstRC, RegisterClass SrcRC, SDNode OpNode> :
|
|
|
|
FFR<0x11, funct, fmt, (outs DstRC:$fd), (ins SrcRC:$fs),
|
|
|
|
!strconcat(opstr, ".", fmtstr, "\t$fd, $fs"),
|
|
|
|
[(set DstRC:$fd, (OpNode SrcRC:$fs))]> {
|
|
|
|
let ft = 0;
|
|
|
|
}
|
|
|
|
|
2011-10-08 11:38:41 +08:00
|
|
|
class FFR2P<bits<6> funct, bits<5> fmt, string opstr,
|
|
|
|
string fmtstr, RegisterClass RC, SDNode OpNode> :
|
|
|
|
FFR<0x11, funct, fmt, (outs RC:$fd), (ins RC:$fs, RC:$ft),
|
|
|
|
!strconcat(opstr, ".", fmtstr, "\t$fd, $fs, $ft"),
|
|
|
|
[(set RC:$fd, (OpNode RC:$fs, RC:$ft))]>;
|
2012-02-25 08:21:52 +08:00
|
|
|
|
|
|
|
// Floating point madd/msub/nmadd/nmsub.
|
|
|
|
class FFMADDSUB<bits<3> funct, bits<3> fmt, dag outs, dag ins, string asmstr,
|
|
|
|
list<dag> pattern>
|
|
|
|
: MipsInst<outs, ins, asmstr, pattern, NoItinerary, FrmOther> {
|
|
|
|
bits<5> fd;
|
|
|
|
bits<5> fr;
|
|
|
|
bits<5> fs;
|
|
|
|
bits<5> ft;
|
|
|
|
|
|
|
|
let Opcode = 0x13;
|
|
|
|
let Inst{25-21} = fr;
|
|
|
|
let Inst{20-16} = ft;
|
|
|
|
let Inst{15-11} = fs;
|
|
|
|
let Inst{10-6} = fd;
|
|
|
|
let Inst{5-3} = funct;
|
|
|
|
let Inst{2-0} = fmt;
|
|
|
|
}
|
2012-02-28 10:55:02 +08:00
|
|
|
|
|
|
|
// FP indexed load/store instructions.
|
2012-03-02 06:12:30 +08:00
|
|
|
class FFMemIdx<bits<6> funct, dag outs, dag ins, string asmstr,
|
2012-02-28 10:55:02 +08:00
|
|
|
list<dag> pattern> :
|
|
|
|
MipsInst<outs, ins, asmstr, pattern, NoItinerary, FrmOther>
|
|
|
|
{
|
|
|
|
bits<5> base;
|
|
|
|
bits<5> index;
|
|
|
|
bits<5> fs;
|
|
|
|
bits<5> fd;
|
|
|
|
|
|
|
|
let Opcode = 0x13;
|
|
|
|
|
|
|
|
let Inst{25-21} = base;
|
|
|
|
let Inst{20-16} = index;
|
|
|
|
let Inst{15-11} = fs;
|
|
|
|
let Inst{10-6} = fd;
|
|
|
|
let Inst{5-0} = funct;
|
|
|
|
}
|