10b57cec5SDimitry Andric//=- MicroMips32r6InstrFormats.td - Mips32r6 Instruction Formats -*- tablegen -*-==// 20b57cec5SDimitry Andric// 30b57cec5SDimitry Andric// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 40b57cec5SDimitry Andric// See https://llvm.org/LICENSE.txt for license information. 50b57cec5SDimitry Andric// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 60b57cec5SDimitry Andric// 70b57cec5SDimitry Andric//===----------------------------------------------------------------------===// 80b57cec5SDimitry Andric// 90b57cec5SDimitry Andric// This file describes microMIPS32r6 instruction formats. 100b57cec5SDimitry Andric// 110b57cec5SDimitry Andric//===----------------------------------------------------------------------===// 120b57cec5SDimitry Andric 130b57cec5SDimitry Andricclass MMR6Arch<string opstr> { 140b57cec5SDimitry Andric string Arch = "micromipsr6"; 150b57cec5SDimitry Andric string BaseOpcode = opstr; 160b57cec5SDimitry Andric string DecoderNamespace = "MicroMipsR6"; 170b57cec5SDimitry Andric} 180b57cec5SDimitry Andric 190b57cec5SDimitry Andric//===----------------------------------------------------------------------===// 200b57cec5SDimitry Andric// 210b57cec5SDimitry Andric// Disambiguators 220b57cec5SDimitry Andric// 230b57cec5SDimitry Andric//===----------------------------------------------------------------------===// 240b57cec5SDimitry Andric// 250b57cec5SDimitry Andric// Some encodings are ambiguous except by comparing field values. 260b57cec5SDimitry Andric 270b57cec5SDimitry Andricclass MMDecodeDisambiguatedBy<string Name> : DecodeDisambiguates<Name> { 280b57cec5SDimitry Andric string DecoderNamespace = "MicroMipsR6_Ambiguous"; 290b57cec5SDimitry Andric} 300b57cec5SDimitry Andric 310b57cec5SDimitry Andric//===----------------------------------------------------------------------===// 320b57cec5SDimitry Andric// 330b57cec5SDimitry Andric// Encoding Formats 340b57cec5SDimitry Andric// 350b57cec5SDimitry Andric//===----------------------------------------------------------------------===// 360b57cec5SDimitry Andric 370b57cec5SDimitry Andricclass BC16_FM_MM16R6 { 380b57cec5SDimitry Andric bits<10> offset; 390b57cec5SDimitry Andric 400b57cec5SDimitry Andric bits<16> Inst; 410b57cec5SDimitry Andric 420b57cec5SDimitry Andric let Inst{15-10} = 0x33; 430b57cec5SDimitry Andric let Inst{9-0} = offset; 440b57cec5SDimitry Andric} 450b57cec5SDimitry Andric 460b57cec5SDimitry Andricclass BEQZC_BNEZC_FM_MM16R6<bits<6> op> { 470b57cec5SDimitry Andric bits<3> rs; 480b57cec5SDimitry Andric bits<7> offset; 490b57cec5SDimitry Andric 500b57cec5SDimitry Andric bits<16> Inst; 510b57cec5SDimitry Andric 520b57cec5SDimitry Andric let Inst{15-10} = op; 530b57cec5SDimitry Andric let Inst{9-7} = rs; 540b57cec5SDimitry Andric let Inst{6-0} = offset; 550b57cec5SDimitry Andric} 560b57cec5SDimitry Andric 570b57cec5SDimitry Andricclass POOL16C_JALRC_FM_MM16R6<bits<5> op> { 580b57cec5SDimitry Andric bits<5> rs; 590b57cec5SDimitry Andric 600b57cec5SDimitry Andric bits<16> Inst; 610b57cec5SDimitry Andric 620b57cec5SDimitry Andric let Inst{15-10} = 0x11; 630b57cec5SDimitry Andric let Inst{9-5} = rs; 640b57cec5SDimitry Andric let Inst{4-0} = op; 650b57cec5SDimitry Andric} 660b57cec5SDimitry Andric 670b57cec5SDimitry Andricclass POP35_BOVC_FM_MMR6<string instr_asm> : MipsR6Inst, MMR6Arch<instr_asm> { 680b57cec5SDimitry Andric bits<5> rt; 690b57cec5SDimitry Andric bits<5> rs; 700b57cec5SDimitry Andric bits<16> offset; 710b57cec5SDimitry Andric 720b57cec5SDimitry Andric bits<32> Inst; 730b57cec5SDimitry Andric 740b57cec5SDimitry Andric let Inst{31-26} = 0b011101; 750b57cec5SDimitry Andric let Inst{25-21} = rt; 760b57cec5SDimitry Andric let Inst{20-16} = rs; 770b57cec5SDimitry Andric let Inst{15-0} = offset; 780b57cec5SDimitry Andric} 790b57cec5SDimitry Andric 800b57cec5SDimitry Andricclass POP37_BNVC_FM_MMR6<string instr_asm> : MipsR6Inst, MMR6Arch<instr_asm> { 810b57cec5SDimitry Andric bits<5> rt; 820b57cec5SDimitry Andric bits<5> rs; 830b57cec5SDimitry Andric bits<16> offset; 840b57cec5SDimitry Andric 850b57cec5SDimitry Andric bits<32> Inst; 860b57cec5SDimitry Andric 870b57cec5SDimitry Andric let Inst{31-26} = 0b011111; 880b57cec5SDimitry Andric let Inst{25-21} = rt; 890b57cec5SDimitry Andric let Inst{20-16} = rs; 900b57cec5SDimitry Andric let Inst{15-0} = offset; 910b57cec5SDimitry Andric} 920b57cec5SDimitry Andric 930b57cec5SDimitry Andricclass POOL16C_JRCADDIUSP_FM_MM16R6<bits<5> op> { 940b57cec5SDimitry Andric bits<5> imm; 950b57cec5SDimitry Andric 960b57cec5SDimitry Andric bits<16> Inst; 970b57cec5SDimitry Andric 980b57cec5SDimitry Andric let Inst{15-10} = 0x11; 990b57cec5SDimitry Andric let Inst{9-5} = imm; 1000b57cec5SDimitry Andric let Inst{4-0} = op; 1010b57cec5SDimitry Andric} 1020b57cec5SDimitry Andric 1030b57cec5SDimitry Andricclass POOL16C_LWM_SWM_FM_MM16R6<bits<4> funct> { 1040b57cec5SDimitry Andric bits<2> rt; 1050b57cec5SDimitry Andric bits<4> addr; 1060b57cec5SDimitry Andric 1070b57cec5SDimitry Andric bits<16> Inst; 1080b57cec5SDimitry Andric 1090b57cec5SDimitry Andric let Inst{15-10} = 0x11; 1100b57cec5SDimitry Andric let Inst{9-8} = rt; 1110b57cec5SDimitry Andric let Inst{7-4} = addr; 1120b57cec5SDimitry Andric let Inst{3-0} = funct; 1130b57cec5SDimitry Andric} 1140b57cec5SDimitry Andric 1150b57cec5SDimitry Andricclass POOL32A_BITSWAP_FM_MMR6<bits<6> funct> : MipsR6Inst { 1160b57cec5SDimitry Andric bits<5> rd; 1170b57cec5SDimitry Andric bits<5> rt; 1180b57cec5SDimitry Andric 1190b57cec5SDimitry Andric bits<32> Inst; 1200b57cec5SDimitry Andric 1210b57cec5SDimitry Andric let Inst{31-26} = 0b000000; 1220b57cec5SDimitry Andric let Inst{25-21} = rt; 1230b57cec5SDimitry Andric let Inst{20-16} = rd; 1240b57cec5SDimitry Andric let Inst{15-12} = 0b0000; 1250b57cec5SDimitry Andric let Inst{11-6} = funct; 1260b57cec5SDimitry Andric let Inst{5-0} = 0b111100; 1270b57cec5SDimitry Andric} 1280b57cec5SDimitry Andric 1290b57cec5SDimitry Andricclass CACHE_PREF_FM_MMR6<bits<6> opgroup, bits<4> funct> : MipsR6Inst { 1300b57cec5SDimitry Andric bits<21> addr; 1310b57cec5SDimitry Andric bits<5> hint; 1320b57cec5SDimitry Andric 1330b57cec5SDimitry Andric bits<32> Inst; 1340b57cec5SDimitry Andric 1350b57cec5SDimitry Andric let Inst{31-26} = opgroup; 1360b57cec5SDimitry Andric let Inst{25-21} = hint; 1370b57cec5SDimitry Andric let Inst{20-16} = addr{20-16}; 1380b57cec5SDimitry Andric let Inst{15-12} = funct; 1390b57cec5SDimitry Andric let Inst{11-0} = addr{11-0}; 1400b57cec5SDimitry Andric} 1410b57cec5SDimitry Andric 1420b57cec5SDimitry Andricclass ARITH_FM_MMR6<string instr_asm, bits<10> funct> : MMR6Arch<instr_asm> { 1430b57cec5SDimitry Andric bits<5> rd; 1440b57cec5SDimitry Andric bits<5> rt; 1450b57cec5SDimitry Andric bits<5> rs; 1460b57cec5SDimitry Andric 1470b57cec5SDimitry Andric bits<32> Inst; 1480b57cec5SDimitry Andric 1490b57cec5SDimitry Andric let Inst{31-26} = 0; 1500b57cec5SDimitry Andric let Inst{25-21} = rt; 1510b57cec5SDimitry Andric let Inst{20-16} = rs; 1520b57cec5SDimitry Andric let Inst{15-11} = rd; 1530b57cec5SDimitry Andric let Inst{10} = 0; 1540b57cec5SDimitry Andric let Inst{9-0} = funct; 1550b57cec5SDimitry Andric} 1560b57cec5SDimitry Andric 1570b57cec5SDimitry Andricclass ADDI_FM_MMR6<string instr_asm, bits<6> op> : MMR6Arch<instr_asm> { 1580b57cec5SDimitry Andric bits<5> rt; 1590b57cec5SDimitry Andric bits<5> rs; 1600b57cec5SDimitry Andric bits<16> imm16; 1610b57cec5SDimitry Andric 1620b57cec5SDimitry Andric bits<32> Inst; 1630b57cec5SDimitry Andric 1640b57cec5SDimitry Andric let Inst{31-26} = op; 1650b57cec5SDimitry Andric let Inst{25-21} = rt; 1660b57cec5SDimitry Andric let Inst{20-16} = rs; 1670b57cec5SDimitry Andric let Inst{15-0} = imm16; 1680b57cec5SDimitry Andric} 1690b57cec5SDimitry Andric 1700b57cec5SDimitry Andricclass LB32_FM_MMR6 : MipsR6Inst { 1710b57cec5SDimitry Andric bits<21> addr; 1720b57cec5SDimitry Andric bits<5> rt; 1730b57cec5SDimitry Andric bits<5> base = addr{20-16}; 1740b57cec5SDimitry Andric bits<16> offset = addr{15-0}; 1750b57cec5SDimitry Andric 1760b57cec5SDimitry Andric bits<32> Inst; 1770b57cec5SDimitry Andric 1780b57cec5SDimitry Andric let Inst{31-26} = 0b000111; 1790b57cec5SDimitry Andric let Inst{25-21} = rt; 1800b57cec5SDimitry Andric let Inst{20-16} = base; 1810b57cec5SDimitry Andric let Inst{15-0} = offset; 1820b57cec5SDimitry Andric} 1830b57cec5SDimitry Andric 1840b57cec5SDimitry Andricclass LBU32_FM_MMR6 : MipsR6Inst { 1850b57cec5SDimitry Andric bits<21> addr; 1860b57cec5SDimitry Andric bits<5> rt; 1870b57cec5SDimitry Andric bits<5> base = addr{20-16}; 1880b57cec5SDimitry Andric bits<16> offset = addr{15-0}; 1890b57cec5SDimitry Andric 1900b57cec5SDimitry Andric bits<32> Inst; 1910b57cec5SDimitry Andric 1920b57cec5SDimitry Andric let Inst{31-26} = 0b000101; 1930b57cec5SDimitry Andric let Inst{25-21} = rt; 1940b57cec5SDimitry Andric let Inst{20-16} = base; 1950b57cec5SDimitry Andric let Inst{15-0} = offset; 1960b57cec5SDimitry Andric} 1970b57cec5SDimitry Andric 1980b57cec5SDimitry Andricclass PCREL19_FM_MMR6<bits<2> funct> : MipsR6Inst { 1990b57cec5SDimitry Andric bits<5> rt; 2000b57cec5SDimitry Andric bits<19> imm; 2010b57cec5SDimitry Andric 2020b57cec5SDimitry Andric bits<32> Inst; 2030b57cec5SDimitry Andric 2040b57cec5SDimitry Andric let Inst{31-26} = 0b011110; 2050b57cec5SDimitry Andric let Inst{25-21} = rt; 2060b57cec5SDimitry Andric let Inst{20-19} = funct; 2070b57cec5SDimitry Andric let Inst{18-0} = imm; 2080b57cec5SDimitry Andric} 2090b57cec5SDimitry Andric 2100b57cec5SDimitry Andricclass PCREL16_FM_MMR6<bits<5> funct> : MipsR6Inst { 2110b57cec5SDimitry Andric bits<5> rt; 2120b57cec5SDimitry Andric bits<16> imm; 2130b57cec5SDimitry Andric 2140b57cec5SDimitry Andric bits<32> Inst; 2150b57cec5SDimitry Andric 2160b57cec5SDimitry Andric let Inst{31-26} = 0b011110; 2170b57cec5SDimitry Andric let Inst{25-21} = rt; 2180b57cec5SDimitry Andric let Inst{20-16} = funct; 2190b57cec5SDimitry Andric let Inst{15-0} = imm; 2200b57cec5SDimitry Andric} 2210b57cec5SDimitry Andric 2220b57cec5SDimitry Andricclass POOL32A_FM_MMR6<bits<10> funct> : MipsR6Inst { 2230b57cec5SDimitry Andric bits<5> rd; 2240b57cec5SDimitry Andric bits<5> rs; 2250b57cec5SDimitry Andric bits<5> rt; 2260b57cec5SDimitry Andric 2270b57cec5SDimitry Andric bits<32> Inst; 2280b57cec5SDimitry Andric 2290b57cec5SDimitry Andric let Inst{31-26} = 0b000000; 2300b57cec5SDimitry Andric let Inst{25-21} = rt; 2310b57cec5SDimitry Andric let Inst{20-16} = rs; 2320b57cec5SDimitry Andric let Inst{15-11} = rd; 2330b57cec5SDimitry Andric let Inst{10} = 0; 2340b57cec5SDimitry Andric let Inst{9-0} = funct; 2350b57cec5SDimitry Andric} 2360b57cec5SDimitry Andric 237480093f4SDimitry Andricclass POOL32A_PAUSE_FM_MMR6<string instr_asm, bits<5> op> 238480093f4SDimitry Andric : MMR6Arch<instr_asm> { 2390b57cec5SDimitry Andric bits<32> Inst; 2400b57cec5SDimitry Andric 2410b57cec5SDimitry Andric let Inst{31-26} = 0; 2420b57cec5SDimitry Andric let Inst{25-21} = 0; 2430b57cec5SDimitry Andric let Inst{20-16} = 0; 2440b57cec5SDimitry Andric let Inst{15-11} = op; 2450b57cec5SDimitry Andric let Inst{10-6} = 0; 2460b57cec5SDimitry Andric let Inst{5-0} = 0; 2470b57cec5SDimitry Andric} 2480b57cec5SDimitry Andric 2490b57cec5SDimitry Andricclass POOL32A_RDPGPR_FM_MMR6<bits<10> funct> { 2500b57cec5SDimitry Andric bits<5> rt; 2510b57cec5SDimitry Andric bits<5> rd; 2520b57cec5SDimitry Andric bits<32> Inst; 2530b57cec5SDimitry Andric 2540b57cec5SDimitry Andric let Inst{31-26} = 0; 2550b57cec5SDimitry Andric let Inst{25-21} = rt; 2560b57cec5SDimitry Andric let Inst{20-16} = rd; 2570b57cec5SDimitry Andric let Inst{15-6} = funct; 2580b57cec5SDimitry Andric let Inst{5-0} = 0b111100; 2590b57cec5SDimitry Andric} 2600b57cec5SDimitry Andric 2610b57cec5SDimitry Andricclass POOL32A_RDHWR_FM_MMR6 { 2620b57cec5SDimitry Andric bits<5> rt; 2630b57cec5SDimitry Andric bits<5> rs; 2640b57cec5SDimitry Andric bits<3> sel; 2650b57cec5SDimitry Andric bits<32> Inst; 2660b57cec5SDimitry Andric 2670b57cec5SDimitry Andric let Inst{31-26} = 0; 2680b57cec5SDimitry Andric let Inst{25-21} = rt; 2690b57cec5SDimitry Andric let Inst{20-16} = rs; 2700b57cec5SDimitry Andric let Inst{15-14} = 0; 2710b57cec5SDimitry Andric let Inst{13-11} = sel; 2720b57cec5SDimitry Andric let Inst{10} = 0; 2730b57cec5SDimitry Andric let Inst{9-0} = 0b0111000000; 2740b57cec5SDimitry Andric} 2750b57cec5SDimitry Andric 2760b57cec5SDimitry Andricclass POOL32A_SYNC_FM_MMR6 { 2770b57cec5SDimitry Andric bits<5> stype; 2780b57cec5SDimitry Andric 2790b57cec5SDimitry Andric bits<32> Inst; 2800b57cec5SDimitry Andric 2810b57cec5SDimitry Andric let Inst{31-26} = 0; 2820b57cec5SDimitry Andric let Inst{25-21} = 0; 2830b57cec5SDimitry Andric let Inst{20-16} = stype; 2840b57cec5SDimitry Andric let Inst{15-6} = 0b0110101101; 2850b57cec5SDimitry Andric let Inst{5-0} = 0b111100; 2860b57cec5SDimitry Andric} 2870b57cec5SDimitry Andric 2880b57cec5SDimitry Andricclass POOL32I_SYNCI_FM_MMR6 { 2890b57cec5SDimitry Andric bits<21> addr; 2900b57cec5SDimitry Andric bits<5> base = addr{20-16}; 2910b57cec5SDimitry Andric bits<16> immediate = addr{15-0}; 2920b57cec5SDimitry Andric 2930b57cec5SDimitry Andric bits<32> Inst; 2940b57cec5SDimitry Andric 2950b57cec5SDimitry Andric let Inst{31-26} = 0b010000; 2960b57cec5SDimitry Andric let Inst{25-21} = 0b01100; 2970b57cec5SDimitry Andric let Inst{20-16} = base; 2980b57cec5SDimitry Andric let Inst{15-0} = immediate; 2990b57cec5SDimitry Andric} 3000b57cec5SDimitry Andric 3010b57cec5SDimitry Andricclass POOL32A_2R_FM_MMR6<bits<10> funct> : MipsR6Inst { 3020b57cec5SDimitry Andric bits<5> rs; 3030b57cec5SDimitry Andric bits<5> rt; 3040b57cec5SDimitry Andric 3050b57cec5SDimitry Andric bits<32> Inst; 3060b57cec5SDimitry Andric 3070b57cec5SDimitry Andric let Inst{31-26} = 0b000000; 3080b57cec5SDimitry Andric let Inst{25-21} = rt; 3090b57cec5SDimitry Andric let Inst{20-16} = rs; 3100b57cec5SDimitry Andric let Inst{15-6} = funct; 3110b57cec5SDimitry Andric let Inst{5-0} = 0b111100; 3120b57cec5SDimitry Andric} 3130b57cec5SDimitry Andric 3140b57cec5SDimitry Andricclass SPECIAL_2R_FM_MMR6<bits<6> funct> : MipsR6Inst { 3150b57cec5SDimitry Andric bits<5> rs; 3160b57cec5SDimitry Andric bits<5> rt; 3170b57cec5SDimitry Andric 3180b57cec5SDimitry Andric bits<32> Inst; 3190b57cec5SDimitry Andric 3200b57cec5SDimitry Andric let Inst{31-26} = 0b000000; 3210b57cec5SDimitry Andric let Inst{25-21} = rs; 3220b57cec5SDimitry Andric let Inst{20-16} = 0b00000; 3230b57cec5SDimitry Andric let Inst{15-11} = rt; 3240b57cec5SDimitry Andric let Inst{10-6} = 0b00001; 3250b57cec5SDimitry Andric let Inst{5-0} = funct; 3260b57cec5SDimitry Andric} 3270b57cec5SDimitry Andric 3280b57cec5SDimitry Andricclass POOL32A_ALIGN_FM_MMR6<bits<6> funct> : MipsR6Inst { 3290b57cec5SDimitry Andric bits<5> rd; 3300b57cec5SDimitry Andric bits<5> rs; 3310b57cec5SDimitry Andric bits<5> rt; 3320b57cec5SDimitry Andric bits<2> bp; 3330b57cec5SDimitry Andric 3340b57cec5SDimitry Andric bits<32> Inst; 3350b57cec5SDimitry Andric 3360b57cec5SDimitry Andric let Inst{31-26} = 0b000000; 3370b57cec5SDimitry Andric let Inst{25-21} = rs; 3380b57cec5SDimitry Andric let Inst{20-16} = rt; 3390b57cec5SDimitry Andric let Inst{15-11} = rd; 3400b57cec5SDimitry Andric let Inst{10-9} = bp; 3410b57cec5SDimitry Andric let Inst{8-6} = 0b000; 3420b57cec5SDimitry Andric let Inst{5-0} = funct; 3430b57cec5SDimitry Andric} 3440b57cec5SDimitry Andric 3450b57cec5SDimitry Andricclass AUI_FM_MMR6 : MipsR6Inst { 3460b57cec5SDimitry Andric bits<5> rs; 3470b57cec5SDimitry Andric bits<5> rt; 3480b57cec5SDimitry Andric bits<16> imm; 3490b57cec5SDimitry Andric 3500b57cec5SDimitry Andric bits<32> Inst; 3510b57cec5SDimitry Andric 3520b57cec5SDimitry Andric let Inst{31-26} = 0b000100; 3530b57cec5SDimitry Andric let Inst{25-21} = rt; 3540b57cec5SDimitry Andric let Inst{20-16} = rs; 3550b57cec5SDimitry Andric let Inst{15-0} = imm; 3560b57cec5SDimitry Andric} 3570b57cec5SDimitry Andric 3580b57cec5SDimitry Andricclass POOL32A_LSA_FM<bits<6> funct> : MipsR6Inst { 3590b57cec5SDimitry Andric bits<5> rd; 3600b57cec5SDimitry Andric bits<5> rs; 3610b57cec5SDimitry Andric bits<5> rt; 3620b57cec5SDimitry Andric bits<2> imm2; 3630b57cec5SDimitry Andric 3640b57cec5SDimitry Andric bits<32> Inst; 3650b57cec5SDimitry Andric 3660b57cec5SDimitry Andric let Inst{31-26} = 0b000000; 3670b57cec5SDimitry Andric let Inst{25-21} = rt; 3680b57cec5SDimitry Andric let Inst{20-16} = rs; 3690b57cec5SDimitry Andric let Inst{15-11} = rd; 3700b57cec5SDimitry Andric let Inst{10-9} = imm2; 3710b57cec5SDimitry Andric let Inst{8-6} = 0b000; 3720b57cec5SDimitry Andric let Inst{5-0} = funct; 3730b57cec5SDimitry Andric} 3740b57cec5SDimitry Andric 3750b57cec5SDimitry Andricclass SB32_SH32_STORE_FM_MMR6<bits<6> op> { 3760b57cec5SDimitry Andric bits<5> rt; 3770b57cec5SDimitry Andric bits<21> addr; 3780b57cec5SDimitry Andric bits<5> base = addr{20-16}; 3790b57cec5SDimitry Andric bits<16> offset = addr{15-0}; 3800b57cec5SDimitry Andric 3810b57cec5SDimitry Andric bits<32> Inst; 3820b57cec5SDimitry Andric 3830b57cec5SDimitry Andric let Inst{31-26} = op; 3840b57cec5SDimitry Andric let Inst{25-21} = rt; 3850b57cec5SDimitry Andric let Inst{20-16} = base; 3860b57cec5SDimitry Andric let Inst{15-0} = offset; 3870b57cec5SDimitry Andric} 3880b57cec5SDimitry Andric 3890b57cec5SDimitry Andricclass LOAD_WORD_FM_MMR6 { 3900b57cec5SDimitry Andric bits<5> rt; 3910b57cec5SDimitry Andric bits<21> addr; 3920b57cec5SDimitry Andric bits<5> base = addr{20-16}; 3930b57cec5SDimitry Andric bits<16> offset = addr{15-0}; 3940b57cec5SDimitry Andric 3950b57cec5SDimitry Andric bits<32> Inst; 3960b57cec5SDimitry Andric 3970b57cec5SDimitry Andric let Inst{31-26} = 0b111111; 3980b57cec5SDimitry Andric let Inst{25-21} = rt; 3990b57cec5SDimitry Andric let Inst{20-16} = base; 4000b57cec5SDimitry Andric let Inst{15-0} = offset; 4010b57cec5SDimitry Andric} 4020b57cec5SDimitry Andric 4030b57cec5SDimitry Andricclass LOAD_UPPER_IMM_FM_MMR6 { 4040b57cec5SDimitry Andric bits<5> rt; 4050b57cec5SDimitry Andric bits<16> imm16; 4060b57cec5SDimitry Andric 4070b57cec5SDimitry Andric bits<32> Inst; 4080b57cec5SDimitry Andric 4090b57cec5SDimitry Andric let Inst{31-26} = 0b000100; 4100b57cec5SDimitry Andric let Inst{25-21} = rt; 4110b57cec5SDimitry Andric let Inst{20-16} = 0; 4120b57cec5SDimitry Andric let Inst{15-0} = imm16; 4130b57cec5SDimitry Andric} 4140b57cec5SDimitry Andric 4150b57cec5SDimitry Andricclass CMP_BRANCH_1R_RT_OFF16_FM_MMR6<string instr_asm, bits<6> funct> 4160b57cec5SDimitry Andric : MMR6Arch<instr_asm>, MipsR6Inst { 4170b57cec5SDimitry Andric bits<5> rt; 4180b57cec5SDimitry Andric bits<16> offset; 4190b57cec5SDimitry Andric 4200b57cec5SDimitry Andric bits<32> Inst; 4210b57cec5SDimitry Andric 4220b57cec5SDimitry Andric let Inst{31-26} = funct; 4230b57cec5SDimitry Andric let Inst{25-21} = rt; 4240b57cec5SDimitry Andric let Inst{20-16} = 0b00000; 4250b57cec5SDimitry Andric let Inst{15-0} = offset; 4260b57cec5SDimitry Andric} 4270b57cec5SDimitry Andric 4280b57cec5SDimitry Andricclass CMP_BRANCH_1R_BOTH_OFF16_FM_MMR6<string instr_asm, bits<6> funct> 4290b57cec5SDimitry Andric : MMR6Arch<instr_asm>, MipsR6Inst { 4300b57cec5SDimitry Andric bits<5> rt; 4310b57cec5SDimitry Andric bits<16> offset; 4320b57cec5SDimitry Andric 4330b57cec5SDimitry Andric bits<32> Inst; 4340b57cec5SDimitry Andric 4350b57cec5SDimitry Andric let Inst{31-26} = funct; 4360b57cec5SDimitry Andric let Inst{25-21} = rt; 4370b57cec5SDimitry Andric let Inst{20-16} = rt; 4380b57cec5SDimitry Andric let Inst{15-0} = offset; 4390b57cec5SDimitry Andric} 4400b57cec5SDimitry Andric 4410b57cec5SDimitry Andricclass POOL32A_JALRC_FM_MMR6<string instr_asm, bits<10> funct> 4420b57cec5SDimitry Andric : MipsR6Inst, MMR6Arch<instr_asm> { 4430b57cec5SDimitry Andric bits<5> rt; 4440b57cec5SDimitry Andric bits<5> rs; 4450b57cec5SDimitry Andric 4460b57cec5SDimitry Andric bits<32> Inst; 4470b57cec5SDimitry Andric 4480b57cec5SDimitry Andric let Inst{31-26} = 0; 4490b57cec5SDimitry Andric let Inst{25-21} = rt; 4500b57cec5SDimitry Andric let Inst{20-16} = rs; 4510b57cec5SDimitry Andric let Inst{15-6} = funct; 4520b57cec5SDimitry Andric let Inst{5-0} = 0b111100; 4530b57cec5SDimitry Andric} 4540b57cec5SDimitry Andric 4550b57cec5SDimitry Andricclass POOL32A_EXT_INS_FM_MMR6<string instr_asm, bits<6> funct> 4560b57cec5SDimitry Andric : MMR6Arch<instr_asm>, MipsR6Inst { 4570b57cec5SDimitry Andric bits<5> rt; 4580b57cec5SDimitry Andric bits<5> rs; 4590b57cec5SDimitry Andric bits<5> size; 4600b57cec5SDimitry Andric bits<5> pos; 4610b57cec5SDimitry Andric 4620b57cec5SDimitry Andric bits<32> Inst; 4630b57cec5SDimitry Andric 4640b57cec5SDimitry Andric let Inst{31-26} = 0; 4650b57cec5SDimitry Andric let Inst{25-21} = rt; 4660b57cec5SDimitry Andric let Inst{20-16} = rs; 4670b57cec5SDimitry Andric let Inst{15-11} = size; 4680b57cec5SDimitry Andric let Inst{10-6} = pos; 4690b57cec5SDimitry Andric let Inst{5-0} = funct; 4700b57cec5SDimitry Andric} 4710b57cec5SDimitry Andric 4720b57cec5SDimitry Andricclass POOL32A_ERET_FM_MMR6<string instr_asm, bits<10> funct> 4730b57cec5SDimitry Andric : MMR6Arch<instr_asm> { 4740b57cec5SDimitry Andric bits<32> Inst; 4750b57cec5SDimitry Andric 4760b57cec5SDimitry Andric let Inst{31-26} = 0x00; 4770b57cec5SDimitry Andric let Inst{25-16} = 0x00; 4780b57cec5SDimitry Andric let Inst{15-6} = funct; 4790b57cec5SDimitry Andric let Inst{5-0} = 0x3c; 4800b57cec5SDimitry Andric} 4810b57cec5SDimitry Andric 4820b57cec5SDimitry Andricclass ERETNC_FM_MMR6<string instr_asm> : MMR6Arch<instr_asm> { 4830b57cec5SDimitry Andric bits<32> Inst; 4840b57cec5SDimitry Andric 4850b57cec5SDimitry Andric let Inst{31-26} = 0x00; 4860b57cec5SDimitry Andric let Inst{25-17} = 0x00; 4870b57cec5SDimitry Andric let Inst{16-16} = 0x01; 4880b57cec5SDimitry Andric let Inst{15-6} = 0x3cd; 4890b57cec5SDimitry Andric let Inst{5-0} = 0x3c; 4900b57cec5SDimitry Andric} 4910b57cec5SDimitry Andric 4920b57cec5SDimitry Andricclass BREAK_MMR6_ENC<string instr_asm> : MMR6Arch<instr_asm> { 4930b57cec5SDimitry Andric bits<10> code_1; 4940b57cec5SDimitry Andric bits<10> code_2; 4950b57cec5SDimitry Andric bits<32> Inst; 4960b57cec5SDimitry Andric let Inst{31-26} = 0x0; 4970b57cec5SDimitry Andric let Inst{25-16} = code_1; 4980b57cec5SDimitry Andric let Inst{15-6} = code_2; 4990b57cec5SDimitry Andric let Inst{5-0} = 0x07; 5000b57cec5SDimitry Andric} 5010b57cec5SDimitry Andric 5020b57cec5SDimitry Andricclass BARRIER_MMR6_ENC<string instr_asm, bits<5> op> : MMR6Arch<instr_asm> { 5030b57cec5SDimitry Andric bits<32> Inst; 5040b57cec5SDimitry Andric 5050b57cec5SDimitry Andric let Inst{31-26} = 0x0; 5060b57cec5SDimitry Andric let Inst{25-21} = 0x0; 5070b57cec5SDimitry Andric let Inst{20-16} = 0x0; 5080b57cec5SDimitry Andric let Inst{15-11} = op; 5090b57cec5SDimitry Andric let Inst{10-6} = 0x0; 5100b57cec5SDimitry Andric let Inst{5-0} = 0x0; 5110b57cec5SDimitry Andric} 5120b57cec5SDimitry Andric 5130b57cec5SDimitry Andricclass POOL32A_EIDI_MMR6_ENC<string instr_asm, bits<10> funct> 5140b57cec5SDimitry Andric : MMR6Arch<instr_asm> { 5150b57cec5SDimitry Andric bits<32> Inst; 516480093f4SDimitry Andric bits<5> rt; // Actually rs but we're sharing code with the standard encodings 517480093f4SDimitry Andric // which call it rt 5180b57cec5SDimitry Andric 5190b57cec5SDimitry Andric let Inst{31-26} = 0x00; 5200b57cec5SDimitry Andric let Inst{25-21} = 0x00; 5210b57cec5SDimitry Andric let Inst{20-16} = rt; 5220b57cec5SDimitry Andric let Inst{15-6} = funct; 5230b57cec5SDimitry Andric let Inst{5-0} = 0x3c; 5240b57cec5SDimitry Andric} 5250b57cec5SDimitry Andric 526480093f4SDimitry Andricclass SHIFT_MMR6_ENC<string instr_asm, bits<10> funct, bit rotate> 527480093f4SDimitry Andric : MMR6Arch<instr_asm> { 5280b57cec5SDimitry Andric bits<5> rd; 5290b57cec5SDimitry Andric bits<5> rt; 5300b57cec5SDimitry Andric bits<5> shamt; 5310b57cec5SDimitry Andric 5320b57cec5SDimitry Andric bits<32> Inst; 5330b57cec5SDimitry Andric 5340b57cec5SDimitry Andric let Inst{31-26} = 0; 5350b57cec5SDimitry Andric let Inst{25-21} = rd; 5360b57cec5SDimitry Andric let Inst{20-16} = rt; 5370b57cec5SDimitry Andric let Inst{15-11} = shamt; 5380b57cec5SDimitry Andric let Inst{10} = rotate; 5390b57cec5SDimitry Andric let Inst{9-0} = funct; 5400b57cec5SDimitry Andric} 5410b57cec5SDimitry Andric 5420b57cec5SDimitry Andricclass SW32_FM_MMR6<string instr_asm, bits<6> op> : MMR6Arch<instr_asm> { 5430b57cec5SDimitry Andric bits<5> rt; 5440b57cec5SDimitry Andric bits<21> addr; 5450b57cec5SDimitry Andric 5460b57cec5SDimitry Andric bits<32> Inst; 5470b57cec5SDimitry Andric 5480b57cec5SDimitry Andric let Inst{31-26} = op; 5490b57cec5SDimitry Andric let Inst{25-21} = rt; 5500b57cec5SDimitry Andric let Inst{20-16} = addr{20-16}; 5510b57cec5SDimitry Andric let Inst{15-0} = addr{15-0}; 5520b57cec5SDimitry Andric} 5530b57cec5SDimitry Andric 5540b57cec5SDimitry Andricclass POOL32F_ARITH_FM_MMR6<string instr_asm, bits<2> fmt, bits<8> funct> 5550b57cec5SDimitry Andric : MMR6Arch<instr_asm>, MipsR6Inst { 5560b57cec5SDimitry Andric bits<5> ft; 5570b57cec5SDimitry Andric bits<5> fs; 5580b57cec5SDimitry Andric bits<5> fd; 5590b57cec5SDimitry Andric 5600b57cec5SDimitry Andric bits<32> Inst; 5610b57cec5SDimitry Andric 5620b57cec5SDimitry Andric let Inst{31-26} = 0b010101; 5630b57cec5SDimitry Andric let Inst{25-21} = ft; 5640b57cec5SDimitry Andric let Inst{20-16} = fs; 5650b57cec5SDimitry Andric let Inst{15-11} = fd; 5660b57cec5SDimitry Andric let Inst{10} = 0; 5670b57cec5SDimitry Andric let Inst{9-8} = fmt; 5680b57cec5SDimitry Andric let Inst{7-0} = funct; 5690b57cec5SDimitry Andric} 5700b57cec5SDimitry Andric 5710b57cec5SDimitry Andricclass POOL32F_ARITHF_FM_MMR6<string instr_asm, bits<2> fmt, bits<9> funct> 5720b57cec5SDimitry Andric : MMR6Arch<instr_asm>, MipsR6Inst { 5730b57cec5SDimitry Andric bits<5> ft; 5740b57cec5SDimitry Andric bits<5> fs; 5750b57cec5SDimitry Andric bits<5> fd; 5760b57cec5SDimitry Andric 5770b57cec5SDimitry Andric bits<32> Inst; 5780b57cec5SDimitry Andric 5790b57cec5SDimitry Andric let Inst{31-26} = 0b010101; 5800b57cec5SDimitry Andric let Inst{25-21} = ft; 5810b57cec5SDimitry Andric let Inst{20-16} = fs; 5820b57cec5SDimitry Andric let Inst{15-11} = fd; 5830b57cec5SDimitry Andric let Inst{10-9} = fmt; 5840b57cec5SDimitry Andric let Inst{8-0} = funct; 5850b57cec5SDimitry Andric} 5860b57cec5SDimitry Andric 5870b57cec5SDimitry Andricclass POOL32F_MOV_NEG_FM_MMR6<string instr_asm, bits<2> fmt, bits<7> funct> 5880b57cec5SDimitry Andric : MMR6Arch<instr_asm>, MipsR6Inst { 5890b57cec5SDimitry Andric bits<5> ft; 5900b57cec5SDimitry Andric bits<5> fs; 5910b57cec5SDimitry Andric 5920b57cec5SDimitry Andric bits<32> Inst; 5930b57cec5SDimitry Andric 5940b57cec5SDimitry Andric let Inst{31-26} = 0b010101; 5950b57cec5SDimitry Andric let Inst{25-21} = ft; 5960b57cec5SDimitry Andric let Inst{20-16} = fs; 5970b57cec5SDimitry Andric let Inst{15} = 0; 5980b57cec5SDimitry Andric let Inst{14-13} = fmt; 5990b57cec5SDimitry Andric let Inst{12-6} = funct; 6000b57cec5SDimitry Andric let Inst{5-0} = 0b111011; 6010b57cec5SDimitry Andric} 6020b57cec5SDimitry Andric 6030b57cec5SDimitry Andricclass POOL32F_MINMAX_FM<string instr_asm, bits<2> fmt, bits<9> funct> 6040b57cec5SDimitry Andric : MMR6Arch<instr_asm>, MipsR6Inst { 6050b57cec5SDimitry Andric bits<5> ft; 6060b57cec5SDimitry Andric bits<5> fs; 6070b57cec5SDimitry Andric bits<5> fd; 6080b57cec5SDimitry Andric 6090b57cec5SDimitry Andric bits<32> Inst; 6100b57cec5SDimitry Andric 6110b57cec5SDimitry Andric let Inst{31-26} = 0b010101; 6120b57cec5SDimitry Andric let Inst{25-21} = ft; 6130b57cec5SDimitry Andric let Inst{20-16} = fs; 6140b57cec5SDimitry Andric let Inst{15-11} = fd; 6150b57cec5SDimitry Andric let Inst{10-9} = fmt; 6160b57cec5SDimitry Andric let Inst{8-0} = funct; 6170b57cec5SDimitry Andric} 6180b57cec5SDimitry Andric 6190b57cec5SDimitry Andricclass POOL32F_CMP_FM<string instr_asm, bits<6> format, FIELD_CMP_COND Cond> 6200b57cec5SDimitry Andric : MMR6Arch<instr_asm>, MipsR6Inst { 6210b57cec5SDimitry Andric bits<5> ft; 6220b57cec5SDimitry Andric bits<5> fs; 6230b57cec5SDimitry Andric bits<5> fd; 6240b57cec5SDimitry Andric 6250b57cec5SDimitry Andric bits<32> Inst; 6260b57cec5SDimitry Andric 6270b57cec5SDimitry Andric let Inst{31-26} = 0b010101; 6280b57cec5SDimitry Andric let Inst{25-21} = ft; 6290b57cec5SDimitry Andric let Inst{20-16} = fs; 6300b57cec5SDimitry Andric let Inst{15-11} = fd; 6310b57cec5SDimitry Andric let Inst{10-6} = Cond.Value; 6320b57cec5SDimitry Andric let Inst{5-0} = format; 6330b57cec5SDimitry Andric} 6340b57cec5SDimitry Andric 6350b57cec5SDimitry Andricclass POOL32F_CVT_LW_FM<string instr_asm, bit fmt, bits<8> funct> 6360b57cec5SDimitry Andric : MMR6Arch<instr_asm>, MipsR6Inst { 6370b57cec5SDimitry Andric bits<5> ft; 6380b57cec5SDimitry Andric bits<5> fs; 6390b57cec5SDimitry Andric 6400b57cec5SDimitry Andric bits<32> Inst; 6410b57cec5SDimitry Andric let Inst{31-26} = 0b010101; 6420b57cec5SDimitry Andric let Inst{25-21} = ft; 6430b57cec5SDimitry Andric let Inst{20-16} = fs; 6440b57cec5SDimitry Andric let Inst{15} = 0; 6450b57cec5SDimitry Andric let Inst{14} = fmt; 6460b57cec5SDimitry Andric let Inst{13-6} = funct; 6470b57cec5SDimitry Andric let Inst{5-0} = 0b111011; 6480b57cec5SDimitry Andric} 6490b57cec5SDimitry Andric 6500b57cec5SDimitry Andricclass POOL32F_CVT_DS_FM<string instr_asm, bits<2> fmt, bits<7> funct> 6510b57cec5SDimitry Andric : MMR6Arch<instr_asm>, MipsR6Inst { 6520b57cec5SDimitry Andric bits<5> ft; 6530b57cec5SDimitry Andric bits<5> fs; 6540b57cec5SDimitry Andric 6550b57cec5SDimitry Andric bits<32> Inst; 6560b57cec5SDimitry Andric let Inst{31-26} = 0b010101; 6570b57cec5SDimitry Andric let Inst{25-21} = ft; 6580b57cec5SDimitry Andric let Inst{20-16} = fs; 6590b57cec5SDimitry Andric let Inst{15} = 0; 6600b57cec5SDimitry Andric let Inst{14-13} = fmt; 6610b57cec5SDimitry Andric let Inst{12-6} = funct; 6620b57cec5SDimitry Andric let Inst{5-0} = 0b111011; 6630b57cec5SDimitry Andric} 6640b57cec5SDimitry Andric 6650b57cec5SDimitry Andricclass POOL32F_ABS_FM_MMR6<string instr_asm, bits<2> fmt, bits<7> funct> 6660b57cec5SDimitry Andric : MMR6Arch<instr_asm>, MipsR6Inst { 6670b57cec5SDimitry Andric bits<5> ft; 6680b57cec5SDimitry Andric bits<5> fs; 6690b57cec5SDimitry Andric 6700b57cec5SDimitry Andric bits<32> Inst; 6710b57cec5SDimitry Andric 6720b57cec5SDimitry Andric let Inst{31-26} = 0b010101; 6730b57cec5SDimitry Andric let Inst{25-21} = ft; 6740b57cec5SDimitry Andric let Inst{20-16} = fs; 6750b57cec5SDimitry Andric let Inst{15} = 0; 6760b57cec5SDimitry Andric let Inst{14-13} = fmt; 6770b57cec5SDimitry Andric let Inst{12-6} = funct; 6780b57cec5SDimitry Andric let Inst{5-0} = 0b111011; 6790b57cec5SDimitry Andric} 6800b57cec5SDimitry Andric 6810b57cec5SDimitry Andricclass POOL32F_MATH_FM_MMR6<string instr_asm, bits<1> fmt, bits<8> funct> 6820b57cec5SDimitry Andric : MMR6Arch<instr_asm>, MipsR6Inst { 6830b57cec5SDimitry Andric bits<5> ft; 6840b57cec5SDimitry Andric bits<5> fs; 6850b57cec5SDimitry Andric 6860b57cec5SDimitry Andric bits<32> Inst; 6870b57cec5SDimitry Andric 6880b57cec5SDimitry Andric let Inst{31-26} = 0b010101; 6890b57cec5SDimitry Andric let Inst{25-21} = ft; 6900b57cec5SDimitry Andric let Inst{20-16} = fs; 6910b57cec5SDimitry Andric let Inst{15} = 0; 6920b57cec5SDimitry Andric let Inst{14} = fmt; 6930b57cec5SDimitry Andric let Inst{13-6} = funct; 6940b57cec5SDimitry Andric let Inst{5-0} = 0b111011; 6950b57cec5SDimitry Andric} 6960b57cec5SDimitry Andric 6970b57cec5SDimitry Andricclass POOL16A_ADDU16_FM_MMR6 { 6980b57cec5SDimitry Andric bits<3> rs; 6990b57cec5SDimitry Andric bits<3> rt; 7000b57cec5SDimitry Andric bits<3> rd; 7010b57cec5SDimitry Andric 7020b57cec5SDimitry Andric bits<16> Inst; 7030b57cec5SDimitry Andric 7040b57cec5SDimitry Andric let Inst{15-10} = 0b000001; 7050b57cec5SDimitry Andric let Inst{9-7} = rs; 7060b57cec5SDimitry Andric let Inst{6-4} = rt; 7070b57cec5SDimitry Andric let Inst{3-1} = rd; 7080b57cec5SDimitry Andric let Inst{0} = 0; 7090b57cec5SDimitry Andric} 7100b57cec5SDimitry Andric 7110b57cec5SDimitry Andricclass POOL16C_AND16_FM_MMR6 { 7120b57cec5SDimitry Andric bits<3> rt; 7130b57cec5SDimitry Andric bits<3> rs; 7140b57cec5SDimitry Andric 7150b57cec5SDimitry Andric bits<16> Inst; 7160b57cec5SDimitry Andric 7170b57cec5SDimitry Andric let Inst{15-10} = 0b010001; 7180b57cec5SDimitry Andric let Inst{9-7} = rt; 7190b57cec5SDimitry Andric let Inst{6-4} = rs; 7200b57cec5SDimitry Andric let Inst{3-0} = 0b0001; 7210b57cec5SDimitry Andric} 7220b57cec5SDimitry Andric 7230b57cec5SDimitry Andricclass POOL16C_NOT16_FM_MMR6 { 7240b57cec5SDimitry Andric bits<3> rt; 7250b57cec5SDimitry Andric bits<3> rs; 7260b57cec5SDimitry Andric 7270b57cec5SDimitry Andric bits<16> Inst; 7280b57cec5SDimitry Andric 7290b57cec5SDimitry Andric let Inst{15-10} = 0x11; 7300b57cec5SDimitry Andric let Inst{9-7} = rt; 7310b57cec5SDimitry Andric let Inst{6-4} = rs; 7320b57cec5SDimitry Andric let Inst{3-0} = 0b0000; 7330b57cec5SDimitry Andric} 7340b57cec5SDimitry Andric 7350b57cec5SDimitry Andricclass POOL16C_MOVEP16_FM_MMR6 { 7360b57cec5SDimitry Andric bits<3> rt; 7370b57cec5SDimitry Andric bits<3> rs; 7380b57cec5SDimitry Andric 7390b57cec5SDimitry Andric bits<16> Inst; 7400b57cec5SDimitry Andric 7410b57cec5SDimitry Andric let Inst{15-10} = 0b010001; 742*bdd1243dSDimitry Andric // bits 7-9 are populated by MipsMCCodeEmitter::encodeInstruction, with a 743*bdd1243dSDimitry Andric // special encoding of both rd1 and rd2. 744*bdd1243dSDimitry Andric let Inst{9-7} = ?; 7450b57cec5SDimitry Andric let Inst{6-4} = rt; 7460b57cec5SDimitry Andric let Inst{3} = rs{2}; 7470b57cec5SDimitry Andric let Inst{2} = 0b1; 7480b57cec5SDimitry Andric let Inst{1-0} = rs{1-0}; 7490b57cec5SDimitry Andric} 7500b57cec5SDimitry Andric 7510b57cec5SDimitry Andricclass POOL16C_OR16_XOR16_FM_MMR6<bits<4> op> { 7520b57cec5SDimitry Andric bits<3> rt; 7530b57cec5SDimitry Andric bits<3> rs; 7540b57cec5SDimitry Andric 7550b57cec5SDimitry Andric bits<16> Inst; 7560b57cec5SDimitry Andric 7570b57cec5SDimitry Andric let Inst{15-10} = 0b010001; 7580b57cec5SDimitry Andric let Inst{9-7} = rt; 7590b57cec5SDimitry Andric let Inst{6-4} = rs; 7600b57cec5SDimitry Andric let Inst{3-0} = op; 7610b57cec5SDimitry Andric} 7620b57cec5SDimitry Andric 7630b57cec5SDimitry Andricclass POOL16C_BREAKPOINT_FM_MMR6<bits<6> op> { 7640b57cec5SDimitry Andric bits<4> code_; 7650b57cec5SDimitry Andric bits<16> Inst; 7660b57cec5SDimitry Andric 7670b57cec5SDimitry Andric let Inst{15-10} = 0b010001; 7680b57cec5SDimitry Andric let Inst{9-6} = code_; 7690b57cec5SDimitry Andric let Inst{5-0} = op; 7700b57cec5SDimitry Andric} 7710b57cec5SDimitry Andric 7720b57cec5SDimitry Andricclass POOL16A_SUBU16_FM_MMR6 { 7730b57cec5SDimitry Andric bits<3> rs; 7740b57cec5SDimitry Andric bits<3> rt; 7750b57cec5SDimitry Andric bits<3> rd; 7760b57cec5SDimitry Andric 7770b57cec5SDimitry Andric bits<16> Inst; 7780b57cec5SDimitry Andric 7790b57cec5SDimitry Andric let Inst{15-10} = 0b000001; 7800b57cec5SDimitry Andric let Inst{9-7} = rs; 7810b57cec5SDimitry Andric let Inst{6-4} = rt; 7820b57cec5SDimitry Andric let Inst{3-1} = rd; 7830b57cec5SDimitry Andric let Inst{0} = 0b1; 7840b57cec5SDimitry Andric} 7850b57cec5SDimitry Andric 7860b57cec5SDimitry Andricclass POOL32A_WRPGPR_WSBH_FM_MMR6<string instr_asm, bits<10> funct> 7870b57cec5SDimitry Andric : MMR6Arch<instr_asm>, MipsR6Inst { 7880b57cec5SDimitry Andric bits<5> rt; 7890b57cec5SDimitry Andric bits<5> rs; 7900b57cec5SDimitry Andric 7910b57cec5SDimitry Andric bits<32> Inst; 7920b57cec5SDimitry Andric 7930b57cec5SDimitry Andric let Inst{31-26} = 0x00; 7940b57cec5SDimitry Andric let Inst{25-21} = rt; 7950b57cec5SDimitry Andric let Inst{20-16} = rs; 7960b57cec5SDimitry Andric let Inst{15-6} = funct; 7970b57cec5SDimitry Andric let Inst{5-0} = 0x3c; 7980b57cec5SDimitry Andric} 7990b57cec5SDimitry Andric 8000b57cec5SDimitry Andricclass POOL32F_RECIP_ROUND_FM_MMR6<string instr_asm, bits<1> fmt, bits<8> funct> 8010b57cec5SDimitry Andric : MMR6Arch<instr_asm>, MipsR6Inst { 8020b57cec5SDimitry Andric bits<5> ft; 8030b57cec5SDimitry Andric bits<5> fs; 8040b57cec5SDimitry Andric 8050b57cec5SDimitry Andric bits<32> Inst; 8060b57cec5SDimitry Andric 8070b57cec5SDimitry Andric let Inst{31-26} = 0b010101; 8080b57cec5SDimitry Andric let Inst{25-21} = ft; 8090b57cec5SDimitry Andric let Inst{20-16} = fs; 8100b57cec5SDimitry Andric let Inst{15} = 0; 8110b57cec5SDimitry Andric let Inst{14} = fmt; 8120b57cec5SDimitry Andric let Inst{13-6} = funct; 8130b57cec5SDimitry Andric let Inst{5-0} = 0b111011; 8140b57cec5SDimitry Andric} 8150b57cec5SDimitry Andric 816480093f4SDimitry Andricclass POOL32F_RINT_FM_MMR6<string instr_asm, bits<2> fmt> : MMR6Arch<instr_asm>, 817480093f4SDimitry Andric MipsR6Inst { 8180b57cec5SDimitry Andric bits<5> fs; 8190b57cec5SDimitry Andric bits<5> fd; 8200b57cec5SDimitry Andric 8210b57cec5SDimitry Andric bits<32> Inst; 8220b57cec5SDimitry Andric 8230b57cec5SDimitry Andric let Inst{31-26} = 0b010101; 8240b57cec5SDimitry Andric let Inst{25-21} = fs; 8250b57cec5SDimitry Andric let Inst{20-16} = fd; 8260b57cec5SDimitry Andric let Inst{15-11} = 0; 8270b57cec5SDimitry Andric let Inst{10-9} = fmt; 8280b57cec5SDimitry Andric let Inst{8-0} = 0b000100000; 8290b57cec5SDimitry Andric} 8300b57cec5SDimitry Andric 8310b57cec5SDimitry Andricclass POOL32F_SEL_FM_MMR6<string instr_asm, bits<2> fmt, bits<9> funct> 8320b57cec5SDimitry Andric : MMR6Arch<instr_asm>, MipsR6Inst { 8330b57cec5SDimitry Andric bits<5> ft; 8340b57cec5SDimitry Andric bits<5> fs; 8350b57cec5SDimitry Andric bits<5> fd; 8360b57cec5SDimitry Andric 8370b57cec5SDimitry Andric bits<32> Inst; 8380b57cec5SDimitry Andric 8390b57cec5SDimitry Andric let Inst{31-26} = 0b010101; 8400b57cec5SDimitry Andric let Inst{25-21} = ft; 8410b57cec5SDimitry Andric let Inst{20-16} = fs; 8420b57cec5SDimitry Andric let Inst{15-11} = fd; 8430b57cec5SDimitry Andric let Inst{10-9} = fmt; 8440b57cec5SDimitry Andric let Inst{8-0} = funct; 8450b57cec5SDimitry Andric} 8460b57cec5SDimitry Andric 8470b57cec5SDimitry Andricclass POOL32F_CLASS_FM_MMR6<string instr_asm, bits<2> fmt, bits<9> funct> 8480b57cec5SDimitry Andric : MMR6Arch<instr_asm>, MipsR6Inst { 8490b57cec5SDimitry Andric bits<5> fs; 8500b57cec5SDimitry Andric bits<5> fd; 8510b57cec5SDimitry Andric 8520b57cec5SDimitry Andric bits<32> Inst; 8530b57cec5SDimitry Andric 8540b57cec5SDimitry Andric let Inst{31-26} = 0b010101; 8550b57cec5SDimitry Andric let Inst{25-21} = fs; 8560b57cec5SDimitry Andric let Inst{20-16} = fd; 8570b57cec5SDimitry Andric let Inst{15-11} = 0b00000; 8580b57cec5SDimitry Andric let Inst{10-9} = fmt; 8590b57cec5SDimitry Andric let Inst{8-0} = funct; 8600b57cec5SDimitry Andric} 8610b57cec5SDimitry Andric 8620b57cec5SDimitry Andricclass POOL32A_TLBINV_FM_MMR6<string instr_asm, bits<10> funct> 8630b57cec5SDimitry Andric : MMR6Arch<instr_asm>, MipsR6Inst { 8640b57cec5SDimitry Andric bits<32> Inst; 8650b57cec5SDimitry Andric 8660b57cec5SDimitry Andric let Inst{31-26} = 0x0; 8670b57cec5SDimitry Andric let Inst{25-16} = 0x0; 8680b57cec5SDimitry Andric let Inst{15-6} = funct; 8690b57cec5SDimitry Andric let Inst{5-0} = 0b111100; 8700b57cec5SDimitry Andric} 8710b57cec5SDimitry Andric 8720b57cec5SDimitry Andricclass POOL32A_MFTC0_FM_MMR6<string instr_asm, bits<5> funct, bits<6> opcode> 8730b57cec5SDimitry Andric : MMR6Arch<instr_asm>, MipsR6Inst { 8740b57cec5SDimitry Andric bits<5> rt; 8750b57cec5SDimitry Andric bits<5> rs; 8760b57cec5SDimitry Andric bits<3> sel; 8770b57cec5SDimitry Andric 8780b57cec5SDimitry Andric bits<32> Inst; 8790b57cec5SDimitry Andric 8800b57cec5SDimitry Andric let Inst{31-26} = 0b000000; 8810b57cec5SDimitry Andric let Inst{25-21} = rt; 8820b57cec5SDimitry Andric let Inst{20-16} = rs; 8830b57cec5SDimitry Andric let Inst{15-14} = 0; 8840b57cec5SDimitry Andric let Inst{13-11} = sel; 8850b57cec5SDimitry Andric let Inst{10-6} = funct; 8860b57cec5SDimitry Andric let Inst{5-0} = opcode; 8870b57cec5SDimitry Andric} 8880b57cec5SDimitry Andric 8890b57cec5SDimitry Andricclass POOL32A_GINV_FM_MMR6<string instr_asm, bits<2> ginv> 8900b57cec5SDimitry Andric : MMR6Arch<instr_asm>, MipsR6Inst { 8910b57cec5SDimitry Andric bits<5> rs; 8920b57cec5SDimitry Andric bits<2> type; 8930b57cec5SDimitry Andric 8940b57cec5SDimitry Andric bits<32> Inst; 8950b57cec5SDimitry Andric 8960b57cec5SDimitry Andric let Inst{31-26} = 0x0; 8970b57cec5SDimitry Andric let Inst{25-21} = 0x0; 8980b57cec5SDimitry Andric let Inst{20-16} = rs; 8990b57cec5SDimitry Andric let Inst{15-13} = 0b011; 9000b57cec5SDimitry Andric let Inst{12-11} = ginv; 9010b57cec5SDimitry Andric let Inst{10-9} = type; 9020b57cec5SDimitry Andric let Inst{8-6} = 0b101; 9030b57cec5SDimitry Andric let Inst{5-0} = 0b111100; 9040b57cec5SDimitry Andric} 9050b57cec5SDimitry Andric 9060b57cec5SDimitry Andricclass POOL32F_MFTC1_FM_MMR6<string instr_asm, bits<8> funct> 9070b57cec5SDimitry Andric : MMR6Arch<instr_asm> { 9080b57cec5SDimitry Andric bits<5> rt; 9090b57cec5SDimitry Andric bits<5> fs; 9100b57cec5SDimitry Andric 9110b57cec5SDimitry Andric bits<32> Inst; 9120b57cec5SDimitry Andric 9130b57cec5SDimitry Andric let Inst{31-26} = 0b010101; 9140b57cec5SDimitry Andric let Inst{25-21} = rt; 9150b57cec5SDimitry Andric let Inst{20-16} = fs; 9160b57cec5SDimitry Andric let Inst{15-14} = 0; 9170b57cec5SDimitry Andric let Inst{13-6} = funct; 9180b57cec5SDimitry Andric let Inst{5-0} = 0b111011; 9190b57cec5SDimitry Andric} 9200b57cec5SDimitry Andric 9210b57cec5SDimitry Andricclass POOL32A_MFTC2_FM_MMR6<string instr_asm, bits<10> funct> 9220b57cec5SDimitry Andric : MMR6Arch<instr_asm>, MipsR6Inst { 9230b57cec5SDimitry Andric bits<5> rt; 9240b57cec5SDimitry Andric bits<5> impl; 9250b57cec5SDimitry Andric 9260b57cec5SDimitry Andric bits<32> Inst; 9270b57cec5SDimitry Andric 9280b57cec5SDimitry Andric let Inst{31-26} = 0b000000; 9290b57cec5SDimitry Andric let Inst{25-21} = rt; 9300b57cec5SDimitry Andric let Inst{20-16} = impl; 9310b57cec5SDimitry Andric let Inst{15-6} = funct; 9320b57cec5SDimitry Andric let Inst{5-0} = 0b111100; 9330b57cec5SDimitry Andric} 9340b57cec5SDimitry Andric 9350b57cec5SDimitry Andricclass CMP_BRANCH_2R_OFF16_FM_MMR6<string opstr, bits<6> funct> 9360b57cec5SDimitry Andric : MipsR6Inst, MMR6Arch<opstr> { 9370b57cec5SDimitry Andric bits<5> rt; 9380b57cec5SDimitry Andric bits<5> rs; 9390b57cec5SDimitry Andric bits<16> offset; 9400b57cec5SDimitry Andric 9410b57cec5SDimitry Andric bits<32> Inst; 9420b57cec5SDimitry Andric 9430b57cec5SDimitry Andric let Inst{31-26} = funct; 9440b57cec5SDimitry Andric let Inst{25-21} = rt; 9450b57cec5SDimitry Andric let Inst{20-16} = rs; 9460b57cec5SDimitry Andric let Inst{15-0} = offset; 9470b57cec5SDimitry Andric} 9480b57cec5SDimitry Andric 9490b57cec5SDimitry Andricclass POOL32A_DVPEVP_FM_MMR6<string instr_asm, bits<10> funct> 9500b57cec5SDimitry Andric : MMR6Arch<instr_asm>, MipsR6Inst { 9510b57cec5SDimitry Andric bits<5> rs; 9520b57cec5SDimitry Andric 9530b57cec5SDimitry Andric bits<32> Inst; 9540b57cec5SDimitry Andric 9550b57cec5SDimitry Andric let Inst{31-26} = 0b000000; 9560b57cec5SDimitry Andric let Inst{25-21} = 0b00000; 9570b57cec5SDimitry Andric let Inst{20-16} = rs; 9580b57cec5SDimitry Andric let Inst{15-6} = funct; 9590b57cec5SDimitry Andric let Inst{5-0} = 0b111100; 9600b57cec5SDimitry Andric} 9610b57cec5SDimitry Andric 962349cc55cSDimitry Andricclass CMP_BRANCH_OFF21_FM_MMR6<bits<6> funct> : MipsR6Inst { 9630b57cec5SDimitry Andric bits<5> rs; 9640b57cec5SDimitry Andric bits<21> offset; 9650b57cec5SDimitry Andric 9660b57cec5SDimitry Andric bits<32> Inst; 9670b57cec5SDimitry Andric 9680b57cec5SDimitry Andric let Inst{31-26} = funct; 9690b57cec5SDimitry Andric let Inst{25-21} = rs; 9700b57cec5SDimitry Andric let Inst{20-0} = offset; 9710b57cec5SDimitry Andric} 9720b57cec5SDimitry Andric 9730b57cec5SDimitry Andricclass POOL32I_BRANCH_COP_1_2_FM_MMR6<string instr_asm, bits<5> funct> 9740b57cec5SDimitry Andric : MMR6Arch<instr_asm> { 9750b57cec5SDimitry Andric bits<5> rt; 9760b57cec5SDimitry Andric bits<16> offset; 9770b57cec5SDimitry Andric 9780b57cec5SDimitry Andric bits<32> Inst; 9790b57cec5SDimitry Andric 9800b57cec5SDimitry Andric let Inst{31-26} = 0b010000; 9810b57cec5SDimitry Andric let Inst{25-21} = funct; 9820b57cec5SDimitry Andric let Inst{20-16} = rt; 9830b57cec5SDimitry Andric let Inst{15-0} = offset; 9840b57cec5SDimitry Andric} 9850b57cec5SDimitry Andric 9860b57cec5SDimitry Andricclass LDWC1_SDWC1_FM_MMR6<string instr_asm, bits<6> funct> 9870b57cec5SDimitry Andric : MMR6Arch<instr_asm> { 9880b57cec5SDimitry Andric bits<5> ft; 9890b57cec5SDimitry Andric bits<21> addr; 9900b57cec5SDimitry Andric bits<5> base = addr{20-16}; 9910b57cec5SDimitry Andric bits<16> offset = addr{15-0}; 9920b57cec5SDimitry Andric 9930b57cec5SDimitry Andric bits<32> Inst; 9940b57cec5SDimitry Andric 9950b57cec5SDimitry Andric let Inst{31-26} = funct; 9960b57cec5SDimitry Andric let Inst{25-21} = ft; 9970b57cec5SDimitry Andric let Inst{20-16} = base; 9980b57cec5SDimitry Andric let Inst{15-0} = offset; 9990b57cec5SDimitry Andric} 10000b57cec5SDimitry Andric 10010b57cec5SDimitry Andricclass POOL32B_LDWC2_SDWC2_FM_MMR6<string instr_asm, bits<4> funct> 10020b57cec5SDimitry Andric : MMR6Arch<instr_asm>, MipsR6Inst { 10030b57cec5SDimitry Andric bits<5> rt; 10040b57cec5SDimitry Andric bits<21> addr; 10050b57cec5SDimitry Andric bits<5> base = addr{20-16}; 10060b57cec5SDimitry Andric bits<11> offset = addr{10-0}; 10070b57cec5SDimitry Andric 10080b57cec5SDimitry Andric bits<32> Inst; 10090b57cec5SDimitry Andric 10100b57cec5SDimitry Andric let Inst{31-26} = 0b001000; 10110b57cec5SDimitry Andric let Inst{25-21} = rt; 10120b57cec5SDimitry Andric let Inst{20-16} = base; 10130b57cec5SDimitry Andric let Inst{15-12} = funct; 10140b57cec5SDimitry Andric let Inst{11} = 0; 10150b57cec5SDimitry Andric let Inst{10-0} = offset; 10160b57cec5SDimitry Andric} 10170b57cec5SDimitry Andric 10180b57cec5SDimitry Andricclass POOL32C_LL_E_SC_E_FM_MMR6<string instr_asm, bits<4> majorFunc, 1019480093f4SDimitry Andric bits<3> minorFunc> : MMR6Arch<instr_asm>, 1020480093f4SDimitry Andric MipsR6Inst { 10210b57cec5SDimitry Andric bits<5> rt; 10220b57cec5SDimitry Andric bits<21> addr; 10230b57cec5SDimitry Andric bits<5> base = addr{20-16}; 10240b57cec5SDimitry Andric bits<9> offset = addr{8-0}; 10250b57cec5SDimitry Andric 10260b57cec5SDimitry Andric bits<32> Inst; 10270b57cec5SDimitry Andric 10280b57cec5SDimitry Andric let Inst{31-26} = 0b011000; 10290b57cec5SDimitry Andric let Inst{25-21} = rt; 10300b57cec5SDimitry Andric let Inst{20-16} = base; 10310b57cec5SDimitry Andric let Inst{15-12} = majorFunc; 10320b57cec5SDimitry Andric let Inst{11-9} = minorFunc; 10330b57cec5SDimitry Andric let Inst{8-0} = offset; 10340b57cec5SDimitry Andric} 1035