2011-05-10 02:16:46 +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
|
|
|
|
|
|
|
// Generic Mips Format
|
2011-03-05 01:51:39 +08:00
|
|
|
class MipsInst<dag outs, dag ins, string asmstr, list<dag> pattern,
|
|
|
|
InstrItinClass itin>: Instruction
|
2007-06-06 15:42:06 +08:00
|
|
|
{
|
|
|
|
field bits<32> Inst;
|
|
|
|
|
|
|
|
let Namespace = "Mips";
|
|
|
|
|
|
|
|
bits<6> opcode;
|
|
|
|
|
|
|
|
// Top 5 bits are the 'opcode' field
|
2011-03-05 01:51:39 +08:00
|
|
|
let Inst{31-26} = opcode;
|
|
|
|
|
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
|
|
|
dag OutOperandList = outs;
|
2007-08-18 10:01:28 +08:00
|
|
|
dag InOperandList = ins;
|
|
|
|
|
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;
|
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-09-27 12:57:54 +08:00
|
|
|
MipsInst<outs, ins, asmstr, pattern, IIPseudo> {
|
|
|
|
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-03-05 01:51:39 +08:00
|
|
|
MipsInst<outs, ins, asmstr, pattern, itin>
|
2007-06-06 15:42:06 +08:00
|
|
|
{
|
|
|
|
bits<5> rd;
|
|
|
|
bits<5> rs;
|
|
|
|
bits<5> rt;
|
|
|
|
bits<5> shamt;
|
|
|
|
bits<6> funct;
|
|
|
|
|
|
|
|
let opcode = op;
|
|
|
|
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-03-05 01:51:39 +08:00
|
|
|
InstrItinClass itin>: MipsInst<outs, ins, asmstr, pattern, itin>
|
2007-06-06 15:42:06 +08:00
|
|
|
{
|
|
|
|
bits<5> rt;
|
|
|
|
bits<5> rs;
|
|
|
|
bits<16> imm16;
|
|
|
|
|
|
|
|
let opcode = op;
|
|
|
|
|
|
|
|
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-10-12 02:49:17 +08:00
|
|
|
class CBranchBase<bits<6> op, dag outs, dag ins, string asmstr,
|
|
|
|
list<dag> pattern, InstrItinClass itin>:
|
|
|
|
MipsInst<outs, ins, asmstr, pattern, itin>
|
|
|
|
{
|
|
|
|
bits<5> rs;
|
|
|
|
bits<5> rt;
|
|
|
|
bits<16> imm16;
|
|
|
|
|
|
|
|
let opcode = op;
|
|
|
|
|
|
|
|
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-03-05 01:51:39 +08:00
|
|
|
InstrItinClass itin>: MipsInst<outs, ins, asmstr, pattern, itin>
|
2007-06-06 15:42:06 +08:00
|
|
|
{
|
|
|
|
bits<26> addr;
|
|
|
|
|
|
|
|
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> :
|
|
|
|
MipsInst<outs, ins, asmstr, pattern, NoItinerary>
|
2008-06-08 09:39:36 +08:00
|
|
|
{
|
|
|
|
bits<5> fd;
|
|
|
|
bits<5> fs;
|
|
|
|
bits<5> ft;
|
|
|
|
bits<5> fmt;
|
|
|
|
bits<6> funct;
|
|
|
|
|
|
|
|
let opcode = op;
|
|
|
|
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>:
|
|
|
|
MipsInst<outs, ins, asmstr, pattern, NoItinerary>
|
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;
|
|
|
|
|
|
|
|
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> :
|
|
|
|
MipsInst<outs, ins, asmstr, pattern, NoItinerary>
|
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;
|
|
|
|
|
|
|
|
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> :
|
|
|
|
MipsInst<outs, ins, asmstr, pattern, NoItinerary>
|
|
|
|
{
|
|
|
|
bits<5> rd;
|
|
|
|
bits<5> rs;
|
|
|
|
bits<3> N;
|
|
|
|
bits<1> tf;
|
|
|
|
|
|
|
|
let opcode = 0;
|
|
|
|
let tf = _tf;
|
|
|
|
|
|
|
|
let Inst{25-21} = rs;
|
|
|
|
let Inst{20-18} = N;
|
|
|
|
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> :
|
|
|
|
MipsInst<outs, ins, asmstr, pattern, NoItinerary>
|
|
|
|
{
|
|
|
|
bits<5> fd;
|
|
|
|
bits<5> fs;
|
|
|
|
bits<3> N;
|
|
|
|
bits<5> fmt;
|
|
|
|
bits<1> tf;
|
|
|
|
|
|
|
|
let opcode = 17;
|
|
|
|
let fmt = _fmt;
|
|
|
|
let tf = _tf;
|
|
|
|
|
|
|
|
let Inst{25-21} = fmt;
|
|
|
|
let Inst{20-18} = N;
|
|
|
|
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))]>;
|