From e90ea5e81fb09663f8589b638998ef3a3cb16953 Mon Sep 17 00:00:00 2001 From: Bruno Cardoso Lopes Date: Sun, 8 Jun 2008 01:39:36 +0000 Subject: [PATCH] Added FP instruction formats. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52086 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/Mips/MipsInstrFormats.td | 59 ++++++++++++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/lib/Target/Mips/MipsInstrFormats.td b/lib/Target/Mips/MipsInstrFormats.td index e84dd268561..f82c3f575fa 100644 --- a/lib/Target/Mips/MipsInstrFormats.td +++ b/lib/Target/Mips/MipsInstrFormats.td @@ -10,7 +10,7 @@ //===----------------------------------------------------------------------===// // Describe MIPS instructions format // -// All the possible Mips fields are: +// CPU INSTRUCTION FORMATS // // opcode - operation code. // rs - src reg. @@ -102,3 +102,60 @@ class FJ op, dag outs, dag ins, string asmstr, list pattern, let Inst{25-0} = addr; } +//===----------------------------------------------------------------------===// +// +// FLOAT POINT INSTRUCTION FORMATS +// +// 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. +// +//===----------------------------------------------------------------------===// + +//===----------------------------------------------------------------------===// +// Format FR instruction class in Mips : <|opcode|fmt|ft|fs|fd|funct|> +//===----------------------------------------------------------------------===// + +class FFR op, bits<6> _funct, bits<5> _fmt, dag outs, dag ins, + string asmstr, list pattern, InstrItinClass itin> : + MipsInst +{ + 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; + let Inst{20-16} = ft; + let Inst{15-11} = fs; + let Inst{10-6} = fd; + let Inst{5-0} = funct; +} + +//===----------------------------------------------------------------------===// +// Format FI instruction class in Mips : <|opcode|fmt|ft|immediate|> +//===----------------------------------------------------------------------===// + +class FFI op, bits<5> _fmt, dag outs, dag ins, string asmstr, + list pattern, InstrItinClass itin>: + MipsInst +{ + bits<5> ft; + bits<5> fmt; + bits<16> imm16; + + let opcode = op; + let fmt = _fmt; + + let Inst{25-21} = fmt; + let Inst{20-16} = ft; + let Inst{15-0} = imm16; +}