uasm.c (9d066a252786e1a18484a6283f82614d42a9f4ac) | uasm.c (c29732a179c2ed0cb9f001a8dc07dcf432389313) |
---|---|
1/* 2 * This file is subject to the terms and conditions of the GNU General Public 3 * License. See the file "COPYING" in the main directory of this archive 4 * for more details. 5 * 6 * A small micro-assembler. It is intentionally kept simple, does only 7 * support a subset of instructions, and does not try to hide pipeline 8 * effects like branch delay slots. --- 35 unchanged lines hidden (view full) --- 44#define SET_SH 0 45#define SIMM9_SH 7 46#define SIMM9_MASK 0x1ff 47 48enum opcode { 49 insn_invalid, 50 insn_addiu, insn_addu, insn_and, insn_andi, insn_bbit0, insn_bbit1, 51 insn_beq, insn_beql, insn_bgez, insn_bgezl, insn_bltz, insn_bltzl, | 1/* 2 * This file is subject to the terms and conditions of the GNU General Public 3 * License. See the file "COPYING" in the main directory of this archive 4 * for more details. 5 * 6 * A small micro-assembler. It is intentionally kept simple, does only 7 * support a subset of instructions, and does not try to hide pipeline 8 * effects like branch delay slots. --- 35 unchanged lines hidden (view full) --- 44#define SET_SH 0 45#define SIMM9_SH 7 46#define SIMM9_MASK 0x1ff 47 48enum opcode { 49 insn_invalid, 50 insn_addiu, insn_addu, insn_and, insn_andi, insn_bbit0, insn_bbit1, 51 insn_beq, insn_beql, insn_bgez, insn_bgezl, insn_bltz, insn_bltzl, |
52 insn_bne, insn_cache, insn_daddiu, insn_daddu, insn_dins, insn_dinsm, 53 insn_divu, insn_dmfc0, insn_dmtc0, insn_drotr, insn_drotr32, insn_dsll, 54 insn_dsll32, insn_dsra, insn_dsrl, insn_dsrl32, insn_dsubu, insn_eret, 55 insn_ext, insn_ins, insn_j, insn_jal, insn_jalr, insn_jr, insn_lb, 56 insn_ld, insn_ldx, insn_lh, insn_ll, insn_lld, insn_lui, insn_lw, 57 insn_lwx, insn_mfc0, insn_mfhc0, insn_mfhi, insn_mflo, insn_mtc0, 58 insn_mthc0, insn_mul, insn_or, insn_ori, insn_pref, insn_rfe, 59 insn_rotr, insn_sc, insn_scd, insn_sd, insn_sll, insn_sllv, insn_slt, 60 insn_sltiu, insn_sltu, insn_sra, insn_srl, insn_srlv, insn_subu, 61 insn_sw, insn_sync, insn_syscall, insn_tlbp, insn_tlbr, insn_tlbwi, 62 insn_tlbwr, insn_wait, insn_wsbh, insn_xor, insn_xori, insn_yield, 63 insn_lddir, insn_ldpte, | 52 insn_bne, insn_cache, insn_cfc1, insn_ctc1, insn_daddiu, insn_daddu, 53 insn_dins, insn_dinsm, insn_divu, insn_dmfc0, insn_dmtc0, insn_drotr, 54 insn_drotr32, insn_dsll, insn_dsll32, insn_dsra, insn_dsrl, insn_dsrl32, 55 insn_dsubu, insn_eret, insn_ext, insn_ins, insn_j, insn_jal, insn_jalr, 56 insn_jr, insn_lb, insn_ld, insn_ldx, insn_lh, insn_ll, insn_lld, 57 insn_lui, insn_lw, insn_lwx, insn_mfc0, insn_mfhc0, insn_mfhi, 58 insn_mflo, insn_mtc0, insn_mthc0, insn_mul, insn_or, insn_ori, 59 insn_pref, insn_rfe, insn_rotr, insn_sc, insn_scd, insn_sd, insn_sll, 60 insn_sllv, insn_slt, insn_sltiu, insn_sltu, insn_sra, insn_srl, 61 insn_srlv, insn_subu, insn_sw, insn_sync, insn_syscall, insn_tlbp, 62 insn_tlbr, insn_tlbwi, insn_tlbwr, insn_wait, insn_wsbh, insn_xor, 63 insn_xori, insn_yield, insn_lddir, insn_ldpte, |
64}; 65 66struct insn { 67 enum opcode opcode; 68 u32 match; 69 enum fields fields; 70}; 71 --- 191 unchanged lines hidden (view full) --- 263I_u1u2s3(_beq) 264I_u1u2s3(_beql) 265I_u1s2(_bgez) 266I_u1s2(_bgezl) 267I_u1s2(_bltz) 268I_u1s2(_bltzl) 269I_u1u2s3(_bne) 270I_u2s3u1(_cache) | 64}; 65 66struct insn { 67 enum opcode opcode; 68 u32 match; 69 enum fields fields; 70}; 71 --- 191 unchanged lines hidden (view full) --- 263I_u1u2s3(_beq) 264I_u1u2s3(_beql) 265I_u1s2(_bgez) 266I_u1s2(_bgezl) 267I_u1s2(_bltz) 268I_u1s2(_bltzl) 269I_u1u2s3(_bne) 270I_u2s3u1(_cache) |
271I_u1u2(_cfc1) 272I_u1u2(_ctc1) |
|
271I_u1u2u3(_dmfc0) 272I_u1u2u3(_dmtc0) 273I_u2u1s3(_daddiu) 274I_u3u1u2(_daddu) 275I_u1u2(_divu) 276I_u2u1u3(_dsll) 277I_u2u1u3(_dsll32) 278I_u2u1u3(_dsra) --- 319 unchanged lines hidden --- | 273I_u1u2u3(_dmfc0) 274I_u1u2u3(_dmtc0) 275I_u2u1s3(_daddiu) 276I_u3u1u2(_daddu) 277I_u1u2(_divu) 278I_u2u1u3(_dsll) 279I_u2u1u3(_dsll32) 280I_u2u1u3(_dsra) --- 319 unchanged lines hidden --- |