remove inv instructions

This commit is contained in:
Freya Murphy 2024-09-30 15:10:52 -04:00
parent 6991a233ad
commit 60d9eb30d0
Signed by: freya
GPG key ID: 744AB800E383AE52
2 changed files with 3 additions and 32 deletions

View file

@ -84,8 +84,6 @@ enum mips_instruction_type {
MIPS_INS_LHU, MIPS_INS_LHU,
MIPS_INS_LUI, MIPS_INS_LUI,
MIPS_INS_LW, MIPS_INS_LW,
MIPS_INS_LWL,
MIPS_INS_LWR,
MIPS_INS_MFHI, MIPS_INS_MFHI,
MIPS_INS_MFLO, MIPS_INS_MFLO,
MIPS_INS_MTHI, MIPS_INS_MTHI,
@ -94,12 +92,9 @@ enum mips_instruction_type {
MIPS_INS_MUH, MIPS_INS_MUH,
MIPS_INS_MULU, MIPS_INS_MULU,
MIPS_INS_MUHU, MIPS_INS_MUHU,
MIPS_INS_MULT,
MIPS_INS_SB, MIPS_INS_SB,
MIPS_INS_SH, MIPS_INS_SH,
MIPS_INS_SW, MIPS_INS_SW,
MIPS_INS_SWL,
MIPS_INS_SWR,
MIPS_INS_SLL, MIPS_INS_SLL,
MIPS_INS_SLLV, MIPS_INS_SLLV,
MIPS_INS_SLT, MIPS_INS_SLT,
@ -203,7 +198,7 @@ MIPS_INS(ANDI, .op = MIPS_OP_ANDI)
/* BAL - branch and link */ /* BAL - branch and link */
#define MIPS_OP_REGIMM 0b000001 #define MIPS_OP_REGIMM 0b000001
#define MIPS_FUNCT_BAL 0b10001 #define MIPS_FUNCT_BAL 0b10001
MIPS_INS(BAL, .op = MIPS_OP_REGIMM, .funct = MIPS_FUNCT_BAL) MIPS_INS(BAL, .op = MIPS_OP_REGIMM, .bfunct = MIPS_FUNCT_BAL)
/* BALC - branch and link, compact */ /* BALC - branch and link, compact */
#define MIPS_OP_BALC 0b111010 #define MIPS_OP_BALC 0b111010
@ -343,14 +338,6 @@ MIPS_INS(LUI, .op = MIPS_OP_LUI)
#define MIPS_OP_LW 0b100011 #define MIPS_OP_LW 0b100011
MIPS_INS(LW, .op = MIPS_OP_LW) MIPS_INS(LW, .op = MIPS_OP_LW)
/* LWL - load word left */
#define MIPS_OP_LWL 0b100010
MIPS_INS(LWL, .op = MIPS_OP_LWL)
/* LWR - load word right */
#define MIPS_OP_LWR 0b100110
MIPS_INS(LWR, .op = MIPS_OP_LWR)
/* MFHI - move from hi */ /* MFHI - move from hi */
#define MIPS_FUNCT_MFHI 0b010000 #define MIPS_FUNCT_MFHI 0b010000
MIPS_INS(MFHI, .op = MIPS_OP_SPECIAL, .funct = MIPS_FUNCT_MFHI) MIPS_INS(MFHI, .op = MIPS_OP_SPECIAL, .funct = MIPS_FUNCT_MFHI)
@ -389,10 +376,6 @@ MIPS_INS(MULU, .op = MIPS_OP_SPECIAL, .shamt = MIPS_SOP31_MULU,
MIPS_INS(MUHU, .op = MIPS_OP_SPECIAL, .shamt = MIPS_SOP31_MUHU, MIPS_INS(MUHU, .op = MIPS_OP_SPECIAL, .shamt = MIPS_SOP31_MUHU,
.funct = MIPS_FUNCT_SOP31) .funct = MIPS_FUNCT_SOP31)
/* MULT - multiply (OLD) */
#define MIPS_FUNCT_MULT 0b011000
MIPS_INS(MULT, .op = MIPS_OP_SPECIAL, .funct = MIPS_FUNCT_MULT)
/* SB - store byte */ /* SB - store byte */
#define MIPS_OP_SB 0b101000 #define MIPS_OP_SB 0b101000
MIPS_INS(SB, .op = MIPS_OP_SB) MIPS_INS(SB, .op = MIPS_OP_SB)
@ -405,14 +388,6 @@ MIPS_INS(SH, .op = MIPS_OP_SH)
#define MIPS_OP_SW 0b101011 #define MIPS_OP_SW 0b101011
MIPS_INS(SW, .op = MIPS_OP_SW) MIPS_INS(SW, .op = MIPS_OP_SW)
/* SWL - store word left */
#define MIPS_OP_SWL 0b101010
MIPS_INS(SWL, .op = MIPS_OP_SWL)
/* SWR - store word right */
#define MIPS_OP_SWR 0b101110
MIPS_INS(SWR, .op = MIPS_OP_SWR)
/* SLL - shift left logical */ /* SLL - shift left logical */
#define MIPS_FUNCT_SLL 0b000000 #define MIPS_FUNCT_SLL 0b000000
MIPS_INS(SLL, .op = MIPS_OP_SPECIAL, .funct = MIPS_FUNCT_SLL) MIPS_INS(SLL, .op = MIPS_OP_SPECIAL, .funct = MIPS_FUNCT_SLL)

View file

@ -148,8 +148,6 @@ const enum mips_parse_format mips_parse_formats[] = {
FORMAT(LHU, SL) FORMAT(LHU, SL)
FORMAT(LUI, SLI) FORMAT(LUI, SLI)
FORMAT(LW, SL) FORMAT(LW, SL)
FORMAT(LWL, SL)
FORMAT(LWR, SL)
FORMAT(MFHI, RD) FORMAT(MFHI, RD)
FORMAT(MFLO, RD) FORMAT(MFLO, RD)
FORMAT(MTHI, RS) FORMAT(MTHI, RS)
@ -158,11 +156,9 @@ const enum mips_parse_format mips_parse_formats[] = {
FORMAT(MUH, R) FORMAT(MUH, R)
FORMAT(MULU, R) FORMAT(MULU, R)
FORMAT(MUHU, R) FORMAT(MUHU, R)
FORMAT(MULT, R2)
FORMAT(SB, SL) FORMAT(SB, SL)
FORMAT(SH, SL) FORMAT(SH, SL)
FORMAT(SW, SL) FORMAT(SW, SL)
FORMAT(SWL, SL)
FORMAT(SLL, S) FORMAT(SLL, S)
FORMAT(SLLV, SV) FORMAT(SLLV, SV)
FORMAT(SLT, R) FORMAT(SLT, R)
@ -862,9 +858,9 @@ static int parse_pseudo_la(struct parser *parser, struct ins_expr *expr)
expr->ins[0] = mips_instructions[MIPS_INS_LUI]; expr->ins[0] = mips_instructions[MIPS_INS_LUI];
expr->ins[0].data.rt = reg; expr->ins[0].data.rt = reg;
expr->ins[0].data.immd = B16(hi); expr->ins[0].data.immd = B16(hi);
expr->ins[1] = mips_instructions[MIPS_INS_ORI]; expr->ins[1] = mips_instructions[MIPS_INS_ADDI];
expr->ins[1].data.rt = reg; expr->ins[1].data.rt = reg;
expr->ins[1].data.rs = MIPS_REG_ZERO; expr->ins[1].data.rs = reg;
expr->ins[1].data.immd = B16(lo); expr->ins[1].data.immd = B16(lo);
return M_SUCCESS; return M_SUCCESS;