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

MIPS: Add LDX and LWX instructions to uasm.

Needed by Octeon II optimized TLB handlers.

Signed-off-by: David Daney <ddaney@caviumnetworks.com>
To: linux-mips@linux-mips.org
Pachwork: https://patchwork.linux-mips.org/patch/1903/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

David Daney and committed by
Ralf Baechle
bb3d68c3 cc33ae43

+24 -1
+14
arch/mips/include/asm/inst.h
··· 72 72 enum spec3_op { 73 73 ext_op, dextm_op, dextu_op, dext_op, 74 74 ins_op, dinsm_op, dinsu_op, dins_op, 75 + lx_op = 0x0a, 75 76 bshfl_op = 0x20, 76 77 dbshfl_op = 0x24, 77 78 rdhwr_op = 0x3b ··· 177 176 enum mad_func { 178 177 madd_fp_op = 0x08, msub_fp_op = 0x0a, 179 178 nmadd_fp_op = 0x0c, nmsub_fp_op = 0x0e 179 + }; 180 + 181 + /* 182 + * func field for special3 lx opcodes (Cavium Octeon). 183 + */ 184 + enum lx_func { 185 + lwx_op = 0x00, 186 + lhx_op = 0x04, 187 + lbux_op = 0x06, 188 + ldx_op = 0x08, 189 + lwux_op = 0x10, 190 + lhux_op = 0x14, 191 + lbx_op = 0x16, 180 192 }; 181 193 182 194 /*
+4
arch/mips/include/asm/uasm.h
··· 119 119 Ip_u1(_syscall); 120 120 Ip_u1u2s3(_bbit0); 121 121 Ip_u1u2s3(_bbit1); 122 + Ip_u3u1u2(_lwx); 123 + Ip_u3u1u2(_ldx); 122 124 123 125 /* Handle labels. */ 124 126 struct uasm_label { ··· 158 156 # define UASM_i_SUBU(buf, rs, rt, rd) uasm_i_dsubu(buf, rs, rt, rd) 159 157 # define UASM_i_LL(buf, rs, rt, off) uasm_i_lld(buf, rs, rt, off) 160 158 # define UASM_i_SC(buf, rs, rt, off) uasm_i_scd(buf, rs, rt, off) 159 + # define UASM_i_LWX(buf, rs, rt, rd) uasm_i_ldx(buf, rs, rt, rd) 161 160 #else 162 161 # define UASM_i_LW(buf, rs, rt, off) uasm_i_lw(buf, rs, rt, off) 163 162 # define UASM_i_SW(buf, rs, rt, off) uasm_i_sw(buf, rs, rt, off) ··· 173 170 # define UASM_i_SUBU(buf, rs, rt, rd) uasm_i_subu(buf, rs, rt, rd) 174 171 # define UASM_i_LL(buf, rs, rt, off) uasm_i_ll(buf, rs, rt, off) 175 172 # define UASM_i_SC(buf, rs, rt, off) uasm_i_sc(buf, rs, rt, off) 173 + # define UASM_i_LWX(buf, rs, rt, rd) uasm_i_lwx(buf, rs, rt, rd) 176 174 #endif 177 175 178 176 #define uasm_i_b(buf, off) uasm_i_beq(buf, 0, 0, off)
+6 -1
arch/mips/mm/uasm.c
··· 68 68 insn_pref, insn_rfe, insn_sc, insn_scd, insn_sd, insn_sll, 69 69 insn_sra, insn_srl, insn_rotr, insn_subu, insn_sw, insn_tlbp, 70 70 insn_tlbr, insn_tlbwi, insn_tlbwr, insn_xor, insn_xori, 71 - insn_dins, insn_dinsm, insn_syscall, insn_bbit0, insn_bbit1 71 + insn_dins, insn_dinsm, insn_syscall, insn_bbit0, insn_bbit1, 72 + insn_lwx, insn_ldx 72 73 }; 73 74 74 75 struct insn { ··· 147 146 { insn_syscall, M(spec_op, 0, 0, 0, 0, syscall_op), SCIMM}, 148 147 { insn_bbit0, M(lwc2_op, 0, 0, 0, 0, 0), RS | RT | BIMM }, 149 148 { insn_bbit1, M(swc2_op, 0, 0, 0, 0, 0), RS | RT | BIMM }, 149 + { insn_lwx, M(spec3_op, 0, 0, 0, lwx_op, lx_op), RS | RT | RD }, 150 + { insn_ldx, M(spec3_op, 0, 0, 0, ldx_op, lx_op), RS | RT | RD }, 150 151 { insn_invalid, 0, 0 } 151 152 }; 152 153 ··· 437 434 I_u1(_syscall); 438 435 I_u1u2s3(_bbit0); 439 436 I_u1u2s3(_bbit1); 437 + I_u3u1u2(_lwx) 438 + I_u3u1u2(_ldx) 440 439 441 440 #ifdef CONFIG_CPU_CAVIUM_OCTEON 442 441 #include <asm/octeon/octeon.h>