Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: uasm: Add MTHI/MTLO instructions

Add MTHI/MTLO instructions for writing to the hi & lo registers to uasm
so that KVM can use uasm for generating its entry point code at runtime.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

authored by

James Hogan and committed by
Paolo Bonzini
9f730a60 61c64cf9

+16 -5
+2
arch/mips/include/asm/uasm.h
··· 146 146 Ip_u1(_mflo); 147 147 Ip_u1u2u3(_mtc0); 148 148 Ip_u1u2u3(_mthc0); 149 + Ip_u1(_mthi); 150 + Ip_u1(_mtlo); 149 151 Ip_u3u1u2(_mul); 150 152 Ip_u3u1u2(_or); 151 153 Ip_u2u1u3(_ori);
+2
arch/mips/include/uapi/asm/inst.h
··· 375 375 mm_mflo32_op = 0x075, 376 376 mm_jalrhb_op = 0x07c, 377 377 mm_tlbwi_op = 0x08d, 378 + mm_mthi32_op = 0x0b5, 378 379 mm_tlbwr_op = 0x0cd, 380 + mm_mtlo32_op = 0x0f5, 379 381 mm_di_op = 0x11d, 380 382 mm_jalrs_op = 0x13c, 381 383 mm_jalrshb_op = 0x17c,
+2
arch/mips/mm/uasm-micromips.c
··· 89 89 { insn_mfhi, M(mm_pool32a_op, 0, 0, 0, mm_mfhi32_op, mm_pool32axf_op), RS }, 90 90 { insn_mflo, M(mm_pool32a_op, 0, 0, 0, mm_mflo32_op, mm_pool32axf_op), RS }, 91 91 { insn_mtc0, M(mm_pool32a_op, 0, 0, 0, mm_mtc0_op, mm_pool32axf_op), RT | RS | RD }, 92 + { insn_mthi, M(mm_pool32a_op, 0, 0, 0, mm_mthi32_op, mm_pool32axf_op), RS }, 93 + { insn_mtlo, M(mm_pool32a_op, 0, 0, 0, mm_mtlo32_op, mm_pool32axf_op), RS }, 92 94 { insn_mul, M(mm_pool32a_op, 0, 0, 0, 0, mm_mul_op), RT | RS | RD }, 93 95 { insn_or, M(mm_pool32a_op, 0, 0, 0, 0, mm_or32_op), RT | RS | RD }, 94 96 { insn_ori, M(mm_ori32_op, 0, 0, 0, 0, 0), RT | RS | UIMM },
+2
arch/mips/mm/uasm-mips.c
··· 119 119 { insn_mflo, M(spec_op, 0, 0, 0, 0, mflo_op), RD }, 120 120 { insn_mtc0, M(cop0_op, mtc_op, 0, 0, 0, 0), RT | RD | SET}, 121 121 { insn_mthc0, M(cop0_op, mthc0_op, 0, 0, 0, 0), RT | RD | SET}, 122 + { insn_mthi, M(spec_op, 0, 0, 0, 0, mthi_op), RS }, 123 + { insn_mtlo, M(spec_op, 0, 0, 0, 0, mtlo_op), RS }, 122 124 { insn_mul, M(spec2_op, 0, 0, 0, 0, mul_op), RS | RT | RD}, 123 125 { insn_ori, M(ori_op, 0, 0, 0, 0, 0), RS | RT | UIMM }, 124 126 { insn_or, M(spec_op, 0, 0, 0, 0, or_op), RS | RT | RD },
+8 -5
arch/mips/mm/uasm.c
··· 56 56 insn_ext, insn_ins, insn_j, insn_jal, insn_jalr, insn_jr, insn_lb, 57 57 insn_ld, insn_ldx, insn_lh, insn_ll, insn_lld, insn_lui, insn_lw, 58 58 insn_lwx, insn_mfc0, insn_mfhc0, insn_mfhi, insn_mflo, insn_mtc0, 59 - insn_mthc0, insn_mul, insn_or, insn_ori, insn_pref, insn_rfe, insn_rotr, 60 - insn_sc, insn_scd, insn_sd, insn_sll, insn_sllv, insn_slt, insn_sltiu, 61 - insn_sltu, insn_sra, insn_srl, insn_srlv, insn_subu, insn_sw, insn_sync, 62 - insn_syscall, insn_tlbp, insn_tlbr, insn_tlbwi, insn_tlbwr, insn_wait, 63 - insn_wsbh, insn_xor, insn_xori, insn_yield, insn_lddir, insn_ldpte, 59 + insn_mthc0, insn_mthi, insn_mtlo, insn_mul, insn_or, insn_ori, 60 + insn_pref, insn_rfe, insn_rotr, insn_sc, insn_scd, insn_sd, insn_sll, 61 + insn_sllv, insn_slt, insn_sltiu, insn_sltu, insn_sra, insn_srl, 62 + insn_srlv, insn_subu, insn_sw, insn_sync, insn_syscall, insn_tlbp, 63 + insn_tlbr, insn_tlbwi, insn_tlbwr, insn_wait, insn_wsbh, insn_xor, 64 + insn_xori, insn_yield, insn_lddir, insn_ldpte, 64 65 }; 65 66 66 67 struct insn { ··· 307 306 I_u1(_mflo) 308 307 I_u1u2u3(_mtc0) 309 308 I_u1u2u3(_mthc0) 309 + I_u1(_mthi) 310 + I_u1(_mtlo) 310 311 I_u3u1u2(_mul) 311 312 I_u2u1u3(_ori) 312 313 I_u3u1u2(_or)