X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FTarget%2FMips%2FMipsInstrFormats.td;h=68872fe8f2ffc2d5b5384d4e244c1f458ae370ed;hb=b9bee10b2158253e222eb8dd5f0ae0452740ace3;hp=ea0737222125d2d1393c4122d518282ab8b9e875;hpb=089741479be03b625f5a8cc52e750b4e532338c6;p=oota-llvm.git diff --git a/lib/Target/Mips/MipsInstrFormats.td b/lib/Target/Mips/MipsInstrFormats.td index ea073722212..68872fe8f2f 100644 --- a/lib/Target/Mips/MipsInstrFormats.td +++ b/lib/Target/Mips/MipsInstrFormats.td @@ -297,17 +297,6 @@ class BGEZ_FM op, bits<5> funct> { let Inst{15-0} = offset; } -class B_FM { - bits<16> offset; - - bits<32> Inst; - - let Inst{31-26} = 4; - let Inst{25-21} = 0; - let Inst{20-16} = 0; - let Inst{15-0} = offset; -} - class SLTI_FM op> : StdArch { bits<5> rt; bits<5> rs; @@ -321,7 +310,7 @@ class SLTI_FM op> : StdArch { let Inst{15-0} = imm16; } -class MFLO_FM funct> { +class MFLO_FM funct> : StdArch { bits<5> rd; bits<32> Inst; @@ -333,7 +322,7 @@ class MFLO_FM funct> { let Inst{5-0} = funct; } -class MTLO_FM funct> { +class MTLO_FM funct> : StdArch { bits<5> rs; bits<32> Inst; @@ -344,7 +333,7 @@ class MTLO_FM funct> { let Inst{5-0} = funct; } -class SEB_FM funct, bits<6> funct2> { +class SEB_FM funct, bits<6> funct2> : StdArch { bits<5> rd; bits<5> rt; @@ -358,7 +347,7 @@ class SEB_FM funct, bits<6> funct2> { let Inst{5-0} = funct2; } -class CLO_FM funct> { +class CLO_FM funct> : StdArch { bits<5> rd; bits<5> rs; bits<5> rt; @@ -374,7 +363,7 @@ class CLO_FM funct> { let rt = rd; } -class LUI_FM { +class LUI_FM : StdArch { bits<5> rt; bits<16> imm16; @@ -400,17 +389,6 @@ class JALR_FM { let Inst{5-0} = 9; } -class BAL_FM { - bits<16> offset; - - bits<32> Inst; - - let Inst{31-26} = 1; - let Inst{25-21} = 0; - let Inst{20-16} = 0x11; - let Inst{15-0} = offset; -} - class BGEZAL_FM funct> { bits<5> rs; bits<16> offset; @@ -446,7 +424,7 @@ class MULT_FM op, bits<6> funct> : StdArch { let Inst{5-0} = funct; } -class EXT_FM funct> { +class EXT_FM funct> : StdArch { bits<5> rt; bits<5> rs; bits<5> pos; @@ -476,6 +454,90 @@ class RDHWR_FM { let Inst{5-0} = 0x3b; } +class TEQ_FM funct> { + bits<5> rs; + bits<5> rt; + bits<10> code_; + + bits<32> Inst; + + let Inst{31-26} = 0; + let Inst{25-21} = rs; + let Inst{20-16} = rt; + let Inst{15-6} = code_; + let Inst{5-0} = funct; +} + +class TEQI_FM funct> { + bits<5> rs; + bits<16> imm16; + + bits<32> Inst; + + let Inst{31-26} = 1; + let Inst{25-21} = rs; + let Inst{20-16} = funct; + let Inst{15-0} = imm16; +} +//===----------------------------------------------------------------------===// +// System calls format +//===----------------------------------------------------------------------===// + +class SYS_FM funct> +{ + bits<20> code_; + bits<32> Inst; + let Inst{31-26} = 0x0; + let Inst{25-6} = code_; + let Inst{5-0} = funct; +} + +//===----------------------------------------------------------------------===// +// Break instruction format +//===----------------------------------------------------------------------===// + +class BRK_FM funct> +{ + bits<10> code_1; + bits<10> code_2; + bits<32> Inst; + let Inst{31-26} = 0x0; + let Inst{25-16} = code_1; + let Inst{15-6} = code_2; + let Inst{5-0} = funct; +} + +//===----------------------------------------------------------------------===// +// Exception return format +//===----------------------------------------------------------------------===// + +class ER_FM funct> +{ + bits<32> Inst; + let Inst{31-26} = 0x10; + let Inst{25} = 1; + let Inst{24-6} = 0; + let Inst{5-0} = funct; +} + + +//===----------------------------------------------------------------------===// +// Enable/disable interrupt instruction format +//===----------------------------------------------------------------------===// + +class EI_FM sc> +{ + bits<32> Inst; + bits<5> rt; + let Inst{31-26} = 0x10; + let Inst{25-21} = 0xb; + let Inst{20-16} = rt; + let Inst{15-11} = 0xc; + let Inst{10-6} = 0; + let Inst{5} = sc; + let Inst{4-0} = 0; +} + //===----------------------------------------------------------------------===// // // FLOATING POINT INSTRUCTION FORMATS @@ -609,13 +671,14 @@ class SWXC1_FM funct> { } class BC1F_FM { + bits<3> fcc; bits<16> offset; bits<32> Inst; let Inst{31-26} = 0x11; let Inst{25-21} = 0x8; - let Inst{20-18} = 0; // cc + let Inst{20-18} = fcc; let Inst{17} = nd; let Inst{16} = tf; let Inst{15-0} = offset; @@ -637,6 +700,10 @@ class CEQS_FM fmt> { let Inst{3-0} = cond; } +class C_COND_FM fmt, bits<4> c> : CEQS_FM { + let cond = c; +} + class CMov_I_F_FM funct, bits<5> fmt> { bits<5> fd; bits<5> fs; @@ -652,15 +719,16 @@ class CMov_I_F_FM funct, bits<5> fmt> { let Inst{5-0} = funct; } -class CMov_F_I_FM { +class CMov_F_I_FM : StdArch { bits<5> rd; bits<5> rs; + bits<3> fcc; bits<32> Inst; let Inst{31-26} = 0; let Inst{25-21} = rs; - let Inst{20-18} = 0; // cc + let Inst{20-18} = fcc; let Inst{17} = 0; let Inst{16} = tf; let Inst{15-11} = rd; @@ -671,12 +739,13 @@ class CMov_F_I_FM { class CMov_F_F_FM fmt, bit tf> { bits<5> fd; bits<5> fs; + bits<3> fcc; bits<32> Inst; let Inst{31-26} = 0x11; let Inst{25-21} = fmt; - let Inst{20-18} = 0; // cc + let Inst{20-18} = fcc; let Inst{17} = 0; let Inst{16} = tf; let Inst{15-11} = fs;