#include "libiberty.h" #include "symcat.h" #include "opcode/crx.h" const inst crx_instruction[] = { /* Create an arithmetic instruction - INST[bw]. */ #define ARITH_BYTE_INST(NAME, OPC) \ /* opc8 cst4 r */ \ {NAME, 1, OPC, 24, ARITH_BYTE_INS, {{cst4,20}, {regr,16}}}, \ /* opc8 i16 r */ \ {NAME, 2, (OPC<<4)+0xE, 20, ARITH_BYTE_INS, {{i16,0}, {regr,16}}}, \ /* opc8 r r */ \ {NAME, 1, OPC+0x40, 24, ARITH_BYTE_INS, {{regr,20}, {regr,16}}} ARITH_BYTE_INST ("addub", 0x0), ARITH_BYTE_INST ("addb", 0x1), ARITH_BYTE_INST ("addcb", 0x2), ARITH_BYTE_INST ("andb", 0x3), ARITH_BYTE_INST ("cmpb", 0x4), ARITH_BYTE_INST ("movb", 0x5), ARITH_BYTE_INST ("orb", 0x6), ARITH_BYTE_INST ("subb", 0x7), ARITH_BYTE_INST ("subcb", 0x8), ARITH_BYTE_INST ("xorb", 0x9), ARITH_BYTE_INST ("mulb", 0xA), ARITH_BYTE_INST ("adduw", 0x10), ARITH_BYTE_INST ("addw", 0x11), ARITH_BYTE_INST ("addcw", 0x12), ARITH_BYTE_INST ("andw", 0x13),
/* Create an arithmetic instruction - INST[bw]. */ #define ARITH_BYTE_INST(NAME, OPC, OP1) \ /* opc8 imm4 r */ \ {NAME, 1, OPC, 24, ARITH_BYTE_INS, {{uimm4_1,20}, {regr,16}}}, \ /* opc8 imm16 r */ \ {NAME, 2, (OPC<<4)+0xB, 20, ARITH_BYTE_INS, {{OP1,0}, {regr,16}}}, \ /* opc8 r r */ \ {NAME, 1, OPC+0x1, 24, ARITH_BYTE_INS, {{regr,20}, {regr,16}}} /* For Logical operations, allow unsigned imm16 also. */ #define ARITH1_BYTE_INST(NAME, OPC, OP1) \ /* opc8 imm16 r */ \ {NAME, 2, (OPC<<4)+0xB, 20, ARITH_BYTE_INS, {{OP1,0}, {regr,16}}} ARITH_BYTE_INST ("andb", 0x20, uimm16), ARITH1_BYTE_INST ("andb", 0x20, imm16), ARITH_BYTE_INST ("andw", 0x22, uimm16), ARITH1_BYTE_INST ("andw", 0x22, imm16), ARITH_BYTE_INST ("orb", 0x24, uimm16), ARITH1_BYTE_INST ("orb", 0x24, imm16), ARITH_BYTE_INST ("orw", 0x26, uimm16), ARITH1_BYTE_INST ("orw", 0x26, imm16), ARITH_BYTE_INST ("xorb", 0x28, uimm16), ARITH1_BYTE_INST ("xorb", 0x28, imm16), ARITH_BYTE_INST ("xorw", 0x2A, uimm16), ARITH1_BYTE_INST ("xorw", 0x2A, imm16), ARITH_BYTE_INST ("addub", 0x2C, imm16),