1251607Sdimclass MMArch { 2251607Sdim string Arch = "micromips"; 3251607Sdim list<dag> Pattern = []; 4251607Sdim} 5251607Sdim 6251607Sdimclass ADD_FM_MM<bits<6> op, bits<10> funct> : MMArch { 7251607Sdim bits<5> rt; 8251607Sdim bits<5> rs; 9251607Sdim bits<5> rd; 10251607Sdim 11251607Sdim bits<32> Inst; 12251607Sdim 13251607Sdim let Inst{31-26} = op; 14251607Sdim let Inst{25-21} = rt; 15251607Sdim let Inst{20-16} = rs; 16251607Sdim let Inst{15-11} = rd; 17251607Sdim let Inst{10} = 0; 18251607Sdim let Inst{9-0} = funct; 19251607Sdim} 20251607Sdim 21251607Sdimclass ADDI_FM_MM<bits<6> op> : MMArch { 22251607Sdim bits<5> rs; 23251607Sdim bits<5> rt; 24251607Sdim bits<16> imm16; 25251607Sdim 26251607Sdim bits<32> Inst; 27251607Sdim 28251607Sdim let Inst{31-26} = op; 29251607Sdim let Inst{25-21} = rt; 30251607Sdim let Inst{20-16} = rs; 31251607Sdim let Inst{15-0} = imm16; 32251607Sdim} 33251607Sdim 34251607Sdimclass SLTI_FM_MM<bits<6> op> : MMArch { 35251607Sdim bits<5> rt; 36251607Sdim bits<5> rs; 37251607Sdim bits<16> imm16; 38251607Sdim 39251607Sdim bits<32> Inst; 40251607Sdim 41251607Sdim let Inst{31-26} = op; 42263508Sdim let Inst{25-21} = rt; 43263508Sdim let Inst{20-16} = rs; 44251607Sdim let Inst{15-0} = imm16; 45251607Sdim} 46251607Sdim 47251607Sdimclass LUI_FM_MM : MMArch { 48251607Sdim bits<5> rt; 49251607Sdim bits<16> imm16; 50251607Sdim 51251607Sdim bits<32> Inst; 52251607Sdim 53251607Sdim let Inst{31-26} = 0x10; 54251607Sdim let Inst{25-21} = 0xd; 55251607Sdim let Inst{20-16} = rt; 56251607Sdim let Inst{15-0} = imm16; 57251607Sdim} 58251607Sdim 59251607Sdimclass MULT_FM_MM<bits<10> funct> : MMArch { 60251607Sdim bits<5> rs; 61251607Sdim bits<5> rt; 62251607Sdim 63251607Sdim bits<32> Inst; 64251607Sdim 65251607Sdim let Inst{31-26} = 0x00; 66251607Sdim let Inst{25-21} = rt; 67251607Sdim let Inst{20-16} = rs; 68251607Sdim let Inst{15-6} = funct; 69251607Sdim let Inst{5-0} = 0x3c; 70251607Sdim} 71251607Sdim 72251607Sdimclass SRA_FM_MM<bits<10> funct, bit rotate> : MMArch { 73251607Sdim bits<5> rd; 74251607Sdim bits<5> rt; 75251607Sdim bits<5> shamt; 76251607Sdim 77251607Sdim bits<32> Inst; 78251607Sdim 79251607Sdim let Inst{31-26} = 0; 80251607Sdim let Inst{25-21} = rd; 81251607Sdim let Inst{20-16} = rt; 82251607Sdim let Inst{15-11} = shamt; 83251607Sdim let Inst{10} = rotate; 84251607Sdim let Inst{9-0} = funct; 85251607Sdim} 86251607Sdim 87251607Sdimclass SRLV_FM_MM<bits<10> funct, bit rotate> : MMArch { 88251607Sdim bits<5> rd; 89251607Sdim bits<5> rt; 90251607Sdim bits<5> rs; 91251607Sdim 92251607Sdim bits<32> Inst; 93251607Sdim 94251607Sdim let Inst{31-26} = 0; 95251607Sdim let Inst{25-21} = rt; 96251607Sdim let Inst{20-16} = rs; 97251607Sdim let Inst{15-11} = rd; 98251607Sdim let Inst{10} = rotate; 99251607Sdim let Inst{9-0} = funct; 100251607Sdim} 101251607Sdim 102251607Sdimclass LW_FM_MM<bits<6> op> : MMArch { 103251607Sdim bits<5> rt; 104251607Sdim bits<21> addr; 105251607Sdim 106251607Sdim bits<32> Inst; 107251607Sdim 108251607Sdim let Inst{31-26} = op; 109251607Sdim let Inst{25-21} = rt; 110251607Sdim let Inst{20-16} = addr{20-16}; 111251607Sdim let Inst{15-0} = addr{15-0}; 112251607Sdim} 113263508Sdim 114263508Sdimclass LWL_FM_MM<bits<4> funct> { 115263508Sdim bits<5> rt; 116263508Sdim bits<21> addr; 117263508Sdim 118263508Sdim bits<32> Inst; 119263508Sdim 120263508Sdim let Inst{31-26} = 0x18; 121263508Sdim let Inst{25-21} = rt; 122263508Sdim let Inst{20-16} = addr{20-16}; 123263508Sdim let Inst{15-12} = funct; 124263508Sdim let Inst{11-0} = addr{11-0}; 125263508Sdim} 126263508Sdim 127263508Sdimclass CMov_F_I_FM_MM<bits<7> func> : MMArch { 128263508Sdim bits<5> rd; 129263508Sdim bits<5> rs; 130263508Sdim bits<3> fcc; 131263508Sdim 132263508Sdim bits<32> Inst; 133263508Sdim 134263508Sdim let Inst{31-26} = 0x15; 135263508Sdim let Inst{25-21} = rd; 136263508Sdim let Inst{20-16} = rs; 137263508Sdim let Inst{15-13} = fcc; 138263508Sdim let Inst{12-6} = func; 139263508Sdim let Inst{5-0} = 0x3b; 140263508Sdim} 141263508Sdim 142263508Sdimclass MTLO_FM_MM<bits<10> funct> : MMArch { 143263508Sdim bits<5> rs; 144263508Sdim 145263508Sdim bits<32> Inst; 146263508Sdim 147263508Sdim let Inst{31-26} = 0x00; 148263508Sdim let Inst{25-21} = 0x00; 149263508Sdim let Inst{20-16} = rs; 150263508Sdim let Inst{15-6} = funct; 151263508Sdim let Inst{5-0} = 0x3c; 152263508Sdim} 153263508Sdim 154263508Sdimclass MFLO_FM_MM<bits<10> funct> : MMArch { 155263508Sdim bits<5> rd; 156263508Sdim 157263508Sdim bits<32> Inst; 158263508Sdim 159263508Sdim let Inst{31-26} = 0x00; 160263508Sdim let Inst{25-21} = 0x00; 161263508Sdim let Inst{20-16} = rd; 162263508Sdim let Inst{15-6} = funct; 163263508Sdim let Inst{5-0} = 0x3c; 164263508Sdim} 165263508Sdim 166263508Sdimclass CLO_FM_MM<bits<10> funct> : MMArch { 167263508Sdim bits<5> rd; 168263508Sdim bits<5> rs; 169263508Sdim 170263508Sdim bits<32> Inst; 171263508Sdim 172263508Sdim let Inst{31-26} = 0x00; 173263508Sdim let Inst{25-21} = rd; 174263508Sdim let Inst{20-16} = rs; 175263508Sdim let Inst{15-6} = funct; 176263508Sdim let Inst{5-0} = 0x3c; 177263508Sdim} 178263508Sdim 179263508Sdimclass SEB_FM_MM<bits<10> funct> : MMArch { 180263508Sdim bits<5> rd; 181263508Sdim bits<5> rt; 182263508Sdim 183263508Sdim bits<32> Inst; 184263508Sdim 185263508Sdim let Inst{31-26} = 0x00; 186263508Sdim let Inst{25-21} = rd; 187263508Sdim let Inst{20-16} = rt; 188263508Sdim let Inst{15-6} = funct; 189263508Sdim let Inst{5-0} = 0x3c; 190263508Sdim} 191263508Sdim 192263508Sdimclass EXT_FM_MM<bits<6> funct> : MMArch { 193263508Sdim bits<5> rt; 194263508Sdim bits<5> rs; 195263508Sdim bits<5> pos; 196263508Sdim bits<5> size; 197263508Sdim 198263508Sdim bits<32> Inst; 199263508Sdim 200263508Sdim let Inst{31-26} = 0x00; 201263508Sdim let Inst{25-21} = rt; 202263508Sdim let Inst{20-16} = rs; 203263508Sdim let Inst{15-11} = size; 204263508Sdim let Inst{10-6} = pos; 205263508Sdim let Inst{5-0} = funct; 206263508Sdim} 207263508Sdim 208263508Sdimclass J_FM_MM<bits<6> op> : MMArch { 209263508Sdim bits<26> target; 210263508Sdim 211263508Sdim bits<32> Inst; 212263508Sdim 213263508Sdim let Inst{31-26} = op; 214263508Sdim let Inst{25-0} = target; 215263508Sdim} 216263508Sdim 217263508Sdimclass JR_FM_MM<bits<8> funct> : MMArch { 218263508Sdim bits<5> rs; 219263508Sdim 220263508Sdim bits<32> Inst; 221263508Sdim 222263508Sdim let Inst{31-21} = 0x00; 223263508Sdim let Inst{20-16} = rs; 224263508Sdim let Inst{15-14} = 0x0; 225263508Sdim let Inst{13-6} = funct; 226263508Sdim let Inst{5-0} = 0x3c; 227263508Sdim} 228263508Sdim 229263508Sdimclass JALR_FM_MM<bits<10> funct> : MMArch { 230263508Sdim bits<5> rs; 231263508Sdim bits<5> rd; 232263508Sdim 233263508Sdim bits<32> Inst; 234263508Sdim 235263508Sdim let Inst{31-26} = 0x00; 236263508Sdim let Inst{25-21} = rd; 237263508Sdim let Inst{20-16} = rs; 238263508Sdim let Inst{15-6} = funct; 239263508Sdim let Inst{5-0} = 0x3c; 240263508Sdim} 241263508Sdim 242263508Sdimclass BEQ_FM_MM<bits<6> op> : MMArch { 243263508Sdim bits<5> rs; 244263508Sdim bits<5> rt; 245263508Sdim bits<16> offset; 246263508Sdim 247263508Sdim bits<32> Inst; 248263508Sdim 249263508Sdim let Inst{31-26} = op; 250263508Sdim let Inst{25-21} = rt; 251263508Sdim let Inst{20-16} = rs; 252263508Sdim let Inst{15-0} = offset; 253263508Sdim} 254263508Sdim 255263508Sdimclass BGEZ_FM_MM<bits<5> funct> : MMArch { 256263508Sdim bits<5> rs; 257263508Sdim bits<16> offset; 258263508Sdim 259263508Sdim bits<32> Inst; 260263508Sdim 261263508Sdim let Inst{31-26} = 0x10; 262263508Sdim let Inst{25-21} = funct; 263263508Sdim let Inst{20-16} = rs; 264263508Sdim let Inst{15-0} = offset; 265263508Sdim} 266263508Sdim 267263508Sdimclass BGEZAL_FM_MM<bits<5> funct> : MMArch { 268263508Sdim bits<5> rs; 269263508Sdim bits<16> offset; 270263508Sdim 271263508Sdim bits<32> Inst; 272263508Sdim 273263508Sdim let Inst{31-26} = 0x10; 274263508Sdim let Inst{25-21} = funct; 275263508Sdim let Inst{20-16} = rs; 276263508Sdim let Inst{15-0} = offset; 277263508Sdim} 278263508Sdim 279263508Sdimclass TEQ_FM_MM<bits<6> funct> : MMArch { 280263508Sdim bits<5> rs; 281263508Sdim bits<5> rt; 282263508Sdim bits<4> code_; 283263508Sdim 284263508Sdim bits<32> Inst; 285263508Sdim 286263508Sdim let Inst{31-26} = 0x00; 287263508Sdim let Inst{25-21} = rt; 288263508Sdim let Inst{20-16} = rs; 289263508Sdim let Inst{15-12} = code_; 290263508Sdim let Inst{11-6} = funct; 291263508Sdim let Inst{5-0} = 0x3c; 292263508Sdim} 293263508Sdim 294263508Sdimclass TEQI_FM_MM<bits<5> funct> : MMArch { 295263508Sdim bits<5> rs; 296263508Sdim bits<16> imm16; 297263508Sdim 298263508Sdim bits<32> Inst; 299263508Sdim 300263508Sdim let Inst{31-26} = 0x10; 301263508Sdim let Inst{25-21} = funct; 302263508Sdim let Inst{20-16} = rs; 303263508Sdim let Inst{15-0} = imm16; 304263508Sdim} 305