diff options
author | Wesley Peck <peckw@wesleypeck.com> | 2010-10-21 03:34:22 +0000 |
---|---|---|
committer | Wesley Peck <peckw@wesleypeck.com> | 2010-10-21 03:34:22 +0000 |
commit | 60e7127e862e359eb1b4694e5161da6dc4c2c397 (patch) | |
tree | 3b7b7f394b741cfd7b592c76909062d7a30623a7 /lib/Target/MBlaze/MBlazeInstrFormats.td | |
parent | d9707e3d852622197133a73dcb788a7fcd364015 (diff) | |
download | external_llvm-60e7127e862e359eb1b4694e5161da6dc4c2c397.zip external_llvm-60e7127e862e359eb1b4694e5161da6dc4c2c397.tar.gz external_llvm-60e7127e862e359eb1b4694e5161da6dc4c2c397.tar.bz2 |
Reverting the commit 116986. It was breaking the build on llvm-x86_64-linux though it
compiles on OS X. I'll ensure that it builds on a linux machine before committing
again.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116991 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/MBlaze/MBlazeInstrFormats.td')
-rw-r--r-- | lib/Target/MBlaze/MBlazeInstrFormats.td | 209 |
1 files changed, 165 insertions, 44 deletions
diff --git a/lib/Target/MBlaze/MBlazeInstrFormats.td b/lib/Target/MBlaze/MBlazeInstrFormats.td index 595ef1d..28e8e44 100644 --- a/lib/Target/MBlaze/MBlazeInstrFormats.td +++ b/lib/Target/MBlaze/MBlazeInstrFormats.td @@ -7,26 +7,6 @@ // //===----------------------------------------------------------------------===// -// 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<6> val> { - bits<6> Value = val; -} - -def FPseudo : Format<0>; -def FRRR : Format<1>; -def FRRI : Format<2>; -def FRIR : Format<3>; -def FFSL : Format<4>; -def FFSLD : Format<5>; -def FFSLT : Format<6>; -def FFSLTD : Format<7>; -def FR : Format<8>; -def FI : Format<9>; -def FRR : Format<10>; -def FRI : Format<11>; - //===----------------------------------------------------------------------===// // Describe MBlaze instructions format // @@ -41,15 +21,14 @@ def FRI : Format<11>; //===----------------------------------------------------------------------===// // Generic MBlaze Format -class MBlazeInst<bits<6> op, Format form, dag outs, dag ins, string asmstr, - list<dag> pattern, InstrItinClass itin> : Instruction +class MBlazeInst<dag outs, dag ins, string asmstr, list<dag> pattern, + InstrItinClass itin> : Instruction { - let Namespace = "MBlaze"; field bits<32> Inst; - bits<6> opcode = op; - Format Form = form; - bits<6> FormBits = Form.Value; + let Namespace = "MBlaze"; + + bits<6> opcode; // Top 6 bits are the 'opcode' field let Inst{0-5} = opcode; @@ -60,16 +39,13 @@ class MBlazeInst<bits<6> op, Format form, dag outs, dag ins, string asmstr, let AsmString = asmstr; let Pattern = pattern; let Itinerary = itin; - - // TSFlags layout should be kept in sync with MBlazeInstrInfo.h. - let TSFlags{5-0} = FormBits; } //===----------------------------------------------------------------------===// // Pseudo instruction class //===----------------------------------------------------------------------===// class MBlazePseudo<dag outs, dag ins, string asmstr, list<dag> pattern>: - MBlazeInst<0x0, FPseudo, outs, ins, asmstr, pattern, IIPseudo>; + MBlazeInst<outs, ins, asmstr, pattern, IIPseudo>; //===----------------------------------------------------------------------===// // Type A instruction class in MBlaze : <|opcode|rd|ra|rb|flags|> @@ -77,49 +53,194 @@ class MBlazePseudo<dag outs, dag ins, string asmstr, list<dag> pattern>: class TA<bits<6> op, bits<11> flags, dag outs, dag ins, string asmstr, list<dag> pattern, InstrItinClass itin> : - MBlazeInst<op,FRRR,outs, ins, asmstr, pattern, itin> + MBlazeInst<outs, ins, asmstr, pattern, itin> { bits<5> rd; bits<5> ra; bits<5> rb; + let opcode = op; + let Inst{6-10} = rd; let Inst{11-15} = ra; let Inst{16-20} = rb; let Inst{21-31} = flags; } +class TAI<bits<6> op, dag outs, dag ins, string asmstr, + list<dag> pattern, InstrItinClass itin> : + MBlazeInst<outs, ins, asmstr, pattern, itin> +{ + bits<5> rd; + bits<5> ra; + bits<16> imm16; + + let opcode = op; + + let Inst{6-10} = rd; + let Inst{11-15} = ra; + let Inst{16-31} = imm16; +} + +class TIMM<bits<6> op, dag outs, dag ins, string asmstr, + list<dag> pattern, InstrItinClass itin> : + MBlazeInst<outs, ins, asmstr, pattern, itin> +{ + bits<5> ra; + bits<16> imm16; + + let opcode = op; + + let Inst{6-15} = 0; + let Inst{16-31} = imm16; +} + +class TADDR<bits<6> op, dag outs, dag ins, string asmstr, + list<dag> pattern, InstrItinClass itin> : + MBlazeInst<outs, ins, asmstr, pattern, itin> +{ + bits<26> addr; + + let opcode = op; + + let Inst{6-31} = addr; +} + //===----------------------------------------------------------------------===// // Type B instruction class in MBlaze : <|opcode|rd|ra|immediate|> //===----------------------------------------------------------------------===// class TB<bits<6> op, dag outs, dag ins, string asmstr, list<dag> pattern, InstrItinClass itin> : - MBlazeInst<op, FRRI, outs, ins, asmstr, pattern, itin> + MBlazeInst<outs, ins, asmstr, pattern, itin> { bits<5> rd; bits<5> ra; bits<16> imm16; + let opcode = op; + let Inst{6-10} = rd; let Inst{11-15} = ra; let Inst{16-31} = imm16; } //===----------------------------------------------------------------------===// -// Type B instruction class in MBlaze but with the operands reversed in -// the LLVM DAG : <|opcode|rd|ra|immediate|> +// Float instruction class in MBlaze : <|opcode|rd|ra|flags|> //===----------------------------------------------------------------------===// -class TBR<bits<6> op, dag outs, dag ins, string asmstr, list<dag> pattern, - InstrItinClass itin> : - TB<op, outs, ins, asmstr, pattern, itin> { - bits<5> rrd; - bits<16> rimm16; - bits<5> rra; - let Form = FRIR; +class TF<bits<6> op, bits<11> flags, dag outs, dag ins, string asmstr, + list<dag> pattern, InstrItinClass itin> : + MBlazeInst<outs, ins, asmstr, pattern, itin> +{ + bits<5> rd; + bits<5> ra; + + let opcode = op; + + let Inst{6-10} = rd; + let Inst{11-15} = ra; + let Inst{16-20} = 0; + let Inst{21-31} = flags; +} + +//===----------------------------------------------------------------------===// +// Branch instruction class in MBlaze : <|opcode|rd|br|ra|flags|> +//===----------------------------------------------------------------------===// + +class TBR<bits<6> op, bits<5> br, bits<11> flags, dag outs, dag ins, + string asmstr, list<dag> pattern, InstrItinClass itin> : + MBlazeInst<outs, ins, asmstr, pattern, itin> +{ + bits<5> ra; + + let opcode = op; - let rd = rrd; - let ra = rra; - let imm16 = rimm16; + let Inst{6-10} = 0; + let Inst{11-15} = br; + let Inst{16-20} = ra; + let Inst{21-31} = flags; +} + +class TBRC<bits<6> op, bits<5> br, bits<11> flags, dag outs, dag ins, + string asmstr, list<dag> pattern, InstrItinClass itin> : + MBlazeInst<outs, ins, asmstr, pattern, itin> +{ + bits<5> ra; + bits<5> rb; + + let opcode = op; + + let Inst{6-10} = br; + let Inst{11-15} = ra; + let Inst{16-20} = rb; + let Inst{21-31} = flags; +} + +class TBRL<bits<6> op, bits<5> br, bits<11> flags, dag outs, dag ins, + string asmstr, list<dag> pattern, InstrItinClass itin> : + MBlazeInst<outs, ins, asmstr, pattern, itin> +{ + bits<5> ra; + + let opcode = op; + + let Inst{6-10} = 0xF; + let Inst{11-15} = br; + let Inst{16-20} = ra; + let Inst{21-31} = flags; +} + +class TBRI<bits<6> op, bits<5> br, dag outs, dag ins, + string asmstr, list<dag> pattern, InstrItinClass itin> : + MBlazeInst<outs, ins, asmstr, pattern, itin> +{ + bits<16> imm16; + + let opcode = op; + + let Inst{6-10} = 0; + let Inst{11-15} = br; + let Inst{16-31} = imm16; +} + +class TBRLI<bits<6> op, bits<5> br, dag outs, dag ins, + string asmstr, list<dag> pattern, InstrItinClass itin> : + MBlazeInst<outs, ins, asmstr, pattern, itin> +{ + bits<16> imm16; + + let opcode = op; + + let Inst{6-10} = 0xF; + let Inst{11-15} = br; + let Inst{16-31} = imm16; +} + +class TBRCI<bits<6> op, bits<5> br, dag outs, dag ins, + string asmstr, list<dag> pattern, InstrItinClass itin> : + MBlazeInst<outs, ins, asmstr, pattern, itin> +{ + bits<5> ra; + bits<16> imm16; + + let opcode = op; + + let Inst{6-10} = br; + let Inst{11-15} = ra; + let Inst{16-31} = imm16; +} + +class TRET<bits<6> op, dag outs, dag ins, + string asmstr, list<dag> pattern, InstrItinClass itin> : + MBlazeInst<outs, ins, asmstr, pattern, itin> +{ + bits<5> ra; + bits<16> imm16; + + let opcode = op; + + let Inst{6-10} = 0x10; + let Inst{11-15} = ra; + let Inst{16-31} = imm16; } |