diff options
Diffstat (limited to 'arch/mips/mm/uasm-mips.c')
-rw-r--r-- | arch/mips/mm/uasm-mips.c | 38 |
1 files changed, 31 insertions, 7 deletions
diff --git a/arch/mips/mm/uasm-mips.c b/arch/mips/mm/uasm-mips.c index 8e02291cfc0c..b4a837893562 100644 --- a/arch/mips/mm/uasm-mips.c +++ b/arch/mips/mm/uasm-mips.c | |||
@@ -38,13 +38,13 @@ | |||
38 | | (e) << RE_SH \ | 38 | | (e) << RE_SH \ |
39 | | (f) << FUNC_SH) | 39 | | (f) << FUNC_SH) |
40 | 40 | ||
41 | /* Define these when we are not the ISA the kernel is being compiled with. */ | 41 | /* This macro sets the non-variable bits of an R6 instruction. */ |
42 | #ifdef CONFIG_CPU_MICROMIPS | 42 | #define M6(a, b, c, d, e) \ |
43 | #define CL_uasm_i_b(buf, off) ISAOPC(_beq)(buf, 0, 0, off) | 43 | ((a) << OP_SH \ |
44 | #define CL_uasm_i_beqz(buf, rs, off) ISAOPC(_beq)(buf, rs, 0, off) | 44 | | (b) << RS_SH \ |
45 | #define CL_uasm_i_beqzl(buf, rs, off) ISAOPC(_beql)(buf, rs, 0, off) | 45 | | (c) << RT_SH \ |
46 | #define CL_uasm_i_bnez(buf, rs, off) ISAOPC(_bne)(buf, rs, 0, off) | 46 | | (d) << SIMM9_SH \ |
47 | #endif | 47 | | (e) << FUNC_SH) |
48 | 48 | ||
49 | #include "uasm.c" | 49 | #include "uasm.c" |
50 | 50 | ||
@@ -62,7 +62,11 @@ static struct insn insn_table[] = { | |||
62 | { insn_bltzl, M(bcond_op, 0, bltzl_op, 0, 0, 0), RS | BIMM }, | 62 | { insn_bltzl, M(bcond_op, 0, bltzl_op, 0, 0, 0), RS | BIMM }, |
63 | { insn_bltz, M(bcond_op, 0, bltz_op, 0, 0, 0), RS | BIMM }, | 63 | { insn_bltz, M(bcond_op, 0, bltz_op, 0, 0, 0), RS | BIMM }, |
64 | { insn_bne, M(bne_op, 0, 0, 0, 0, 0), RS | RT | BIMM }, | 64 | { insn_bne, M(bne_op, 0, 0, 0, 0, 0), RS | RT | BIMM }, |
65 | #ifndef CONFIG_CPU_MIPSR6 | ||
65 | { insn_cache, M(cache_op, 0, 0, 0, 0, 0), RS | RT | SIMM }, | 66 | { insn_cache, M(cache_op, 0, 0, 0, 0, 0), RS | RT | SIMM }, |
67 | #else | ||
68 | { insn_cache, M6(cache_op, 0, 0, 0, cache6_op), RS | RT | SIMM9 }, | ||
69 | #endif | ||
66 | { insn_daddiu, M(daddiu_op, 0, 0, 0, 0, 0), RS | RT | SIMM }, | 70 | { insn_daddiu, M(daddiu_op, 0, 0, 0, 0, 0), RS | RT | SIMM }, |
67 | { insn_daddu, M(spec_op, 0, 0, 0, 0, daddu_op), RS | RT | RD }, | 71 | { insn_daddu, M(spec_op, 0, 0, 0, 0, daddu_op), RS | RT | RD }, |
68 | { insn_dinsm, M(spec3_op, 0, 0, 0, 0, dinsm_op), RS | RT | RD | RE }, | 72 | { insn_dinsm, M(spec3_op, 0, 0, 0, 0, dinsm_op), RS | RT | RD | RE }, |
@@ -85,13 +89,22 @@ static struct insn insn_table[] = { | |||
85 | { insn_jal, M(jal_op, 0, 0, 0, 0, 0), JIMM }, | 89 | { insn_jal, M(jal_op, 0, 0, 0, 0, 0), JIMM }, |
86 | { insn_jalr, M(spec_op, 0, 0, 0, 0, jalr_op), RS | RD }, | 90 | { insn_jalr, M(spec_op, 0, 0, 0, 0, jalr_op), RS | RD }, |
87 | { insn_j, M(j_op, 0, 0, 0, 0, 0), JIMM }, | 91 | { insn_j, M(j_op, 0, 0, 0, 0, 0), JIMM }, |
92 | #ifndef CONFIG_CPU_MIPSR6 | ||
88 | { insn_jr, M(spec_op, 0, 0, 0, 0, jr_op), RS }, | 93 | { insn_jr, M(spec_op, 0, 0, 0, 0, jr_op), RS }, |
94 | #else | ||
95 | { insn_jr, M(spec_op, 0, 0, 0, 0, jalr_op), RS }, | ||
96 | #endif | ||
89 | { insn_lb, M(lb_op, 0, 0, 0, 0, 0), RS | RT | SIMM }, | 97 | { insn_lb, M(lb_op, 0, 0, 0, 0, 0), RS | RT | SIMM }, |
90 | { insn_ld, M(ld_op, 0, 0, 0, 0, 0), RS | RT | SIMM }, | 98 | { insn_ld, M(ld_op, 0, 0, 0, 0, 0), RS | RT | SIMM }, |
91 | { insn_ldx, M(spec3_op, 0, 0, 0, ldx_op, lx_op), RS | RT | RD }, | 99 | { insn_ldx, M(spec3_op, 0, 0, 0, ldx_op, lx_op), RS | RT | RD }, |
92 | { insn_lh, M(lh_op, 0, 0, 0, 0, 0), RS | RT | SIMM }, | 100 | { insn_lh, M(lh_op, 0, 0, 0, 0, 0), RS | RT | SIMM }, |
101 | #ifndef CONFIG_CPU_MIPSR6 | ||
93 | { insn_lld, M(lld_op, 0, 0, 0, 0, 0), RS | RT | SIMM }, | 102 | { insn_lld, M(lld_op, 0, 0, 0, 0, 0), RS | RT | SIMM }, |
94 | { insn_ll, M(ll_op, 0, 0, 0, 0, 0), RS | RT | SIMM }, | 103 | { insn_ll, M(ll_op, 0, 0, 0, 0, 0), RS | RT | SIMM }, |
104 | #else | ||
105 | { insn_lld, M6(spec3_op, 0, 0, 0, lld6_op), RS | RT | SIMM9 }, | ||
106 | { insn_ll, M6(spec3_op, 0, 0, 0, ll6_op), RS | RT | SIMM9 }, | ||
107 | #endif | ||
95 | { insn_lui, M(lui_op, 0, 0, 0, 0, 0), RT | SIMM }, | 108 | { insn_lui, M(lui_op, 0, 0, 0, 0, 0), RT | SIMM }, |
96 | { insn_lw, M(lw_op, 0, 0, 0, 0, 0), RS | RT | SIMM }, | 109 | { insn_lw, M(lw_op, 0, 0, 0, 0, 0), RS | RT | SIMM }, |
97 | { insn_lwx, M(spec3_op, 0, 0, 0, lwx_op, lx_op), RS | RT | RD }, | 110 | { insn_lwx, M(spec3_op, 0, 0, 0, lwx_op, lx_op), RS | RT | RD }, |
@@ -104,11 +117,20 @@ static struct insn insn_table[] = { | |||
104 | { insn_mul, M(spec2_op, 0, 0, 0, 0, mul_op), RS | RT | RD}, | 117 | { insn_mul, M(spec2_op, 0, 0, 0, 0, mul_op), RS | RT | RD}, |
105 | { insn_ori, M(ori_op, 0, 0, 0, 0, 0), RS | RT | UIMM }, | 118 | { insn_ori, M(ori_op, 0, 0, 0, 0, 0), RS | RT | UIMM }, |
106 | { insn_or, M(spec_op, 0, 0, 0, 0, or_op), RS | RT | RD }, | 119 | { insn_or, M(spec_op, 0, 0, 0, 0, or_op), RS | RT | RD }, |
120 | #ifndef CONFIG_CPU_MIPSR6 | ||
107 | { insn_pref, M(pref_op, 0, 0, 0, 0, 0), RS | RT | SIMM }, | 121 | { insn_pref, M(pref_op, 0, 0, 0, 0, 0), RS | RT | SIMM }, |
122 | #else | ||
123 | { insn_pref, M6(spec3_op, 0, 0, 0, pref6_op), RS | RT | SIMM9 }, | ||
124 | #endif | ||
108 | { insn_rfe, M(cop0_op, cop_op, 0, 0, 0, rfe_op), 0 }, | 125 | { insn_rfe, M(cop0_op, cop_op, 0, 0, 0, rfe_op), 0 }, |
109 | { insn_rotr, M(spec_op, 1, 0, 0, 0, srl_op), RT | RD | RE }, | 126 | { insn_rotr, M(spec_op, 1, 0, 0, 0, srl_op), RT | RD | RE }, |
127 | #ifndef CONFIG_CPU_MIPSR6 | ||
110 | { insn_scd, M(scd_op, 0, 0, 0, 0, 0), RS | RT | SIMM }, | 128 | { insn_scd, M(scd_op, 0, 0, 0, 0, 0), RS | RT | SIMM }, |
111 | { insn_sc, M(sc_op, 0, 0, 0, 0, 0), RS | RT | SIMM }, | 129 | { insn_sc, M(sc_op, 0, 0, 0, 0, 0), RS | RT | SIMM }, |
130 | #else | ||
131 | { insn_scd, M6(spec3_op, 0, 0, 0, scd6_op), RS | RT | SIMM9 }, | ||
132 | { insn_sc, M6(spec3_op, 0, 0, 0, sc6_op), RS | RT | SIMM9 }, | ||
133 | #endif | ||
112 | { insn_sd, M(sd_op, 0, 0, 0, 0, 0), RS | RT | SIMM }, | 134 | { insn_sd, M(sd_op, 0, 0, 0, 0, 0), RS | RT | SIMM }, |
113 | { insn_sll, M(spec_op, 0, 0, 0, 0, sll_op), RT | RD | RE }, | 135 | { insn_sll, M(spec_op, 0, 0, 0, 0, sll_op), RT | RD | RE }, |
114 | { insn_sllv, M(spec_op, 0, 0, 0, 0, sllv_op), RS | RT | RD }, | 136 | { insn_sllv, M(spec_op, 0, 0, 0, 0, sllv_op), RS | RT | RD }, |
@@ -198,6 +220,8 @@ static void build_insn(u32 **buf, enum opcode opc, ...) | |||
198 | op |= build_set(va_arg(ap, u32)); | 220 | op |= build_set(va_arg(ap, u32)); |
199 | if (ip->fields & SCIMM) | 221 | if (ip->fields & SCIMM) |
200 | op |= build_scimm(va_arg(ap, u32)); | 222 | op |= build_scimm(va_arg(ap, u32)); |
223 | if (ip->fields & SIMM9) | ||
224 | op |= build_scimm9(va_arg(ap, u32)); | ||
201 | va_end(ap); | 225 | va_end(ap); |
202 | 226 | ||
203 | **buf = op; | 227 | **buf = op; |