diff options
author | David Daney <ddaney@caviumnetworks.com> | 2009-10-14 15:16:55 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2009-12-16 20:57:01 -0500 |
commit | 92078e0618f525e22945040b5daea21d4b6d4a16 (patch) | |
tree | f5c222ab3dcc3fcfe08200dca2fd470d449cb2b7 /arch/mips/mm | |
parent | f6ed1b3b3579db5c8c3aaf6fd3010c706973a35d (diff) |
MIPS: Add drotr and dins instructions to uasm.
Signed-off-by: David Daney <ddaney@caviumnetworks.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/mm')
-rw-r--r-- | arch/mips/mm/uasm.c | 16 | ||||
-rw-r--r-- | arch/mips/mm/uasm.h | 7 |
2 files changed, 20 insertions, 3 deletions
diff --git a/arch/mips/mm/uasm.c b/arch/mips/mm/uasm.c index f467199676a8..0a165c5179a1 100644 --- a/arch/mips/mm/uasm.c +++ b/arch/mips/mm/uasm.c | |||
@@ -60,11 +60,11 @@ enum opcode { | |||
60 | insn_beql, insn_bgez, insn_bgezl, insn_bltz, insn_bltzl, | 60 | insn_beql, insn_bgez, insn_bgezl, insn_bltz, insn_bltzl, |
61 | insn_bne, insn_cache, insn_daddu, insn_daddiu, insn_dmfc0, | 61 | insn_bne, insn_cache, insn_daddu, insn_daddiu, insn_dmfc0, |
62 | insn_dmtc0, insn_dsll, insn_dsll32, insn_dsra, insn_dsrl, | 62 | insn_dmtc0, insn_dsll, insn_dsll32, insn_dsra, insn_dsrl, |
63 | insn_dsrl32, insn_dsubu, insn_eret, insn_j, insn_jal, insn_jr, | 63 | insn_dsrl32, insn_drotr, insn_dsubu, insn_eret, insn_j, insn_jal, |
64 | insn_ld, insn_ll, insn_lld, insn_lui, insn_lw, insn_mfc0, | 64 | insn_jr, insn_ld, insn_ll, insn_lld, insn_lui, insn_lw, insn_mfc0, |
65 | insn_mtc0, insn_ori, insn_pref, insn_rfe, insn_sc, insn_scd, | 65 | insn_mtc0, insn_ori, insn_pref, insn_rfe, insn_sc, insn_scd, |
66 | insn_sd, insn_sll, insn_sra, insn_srl, insn_subu, insn_sw, | 66 | insn_sd, insn_sll, insn_sra, insn_srl, insn_subu, insn_sw, |
67 | insn_tlbp, insn_tlbwi, insn_tlbwr, insn_xor, insn_xori | 67 | insn_tlbp, insn_tlbwi, insn_tlbwr, insn_xor, insn_xori, insn_dins |
68 | }; | 68 | }; |
69 | 69 | ||
70 | struct insn { | 70 | struct insn { |
@@ -104,6 +104,7 @@ static struct insn insn_table[] __cpuinitdata = { | |||
104 | { insn_dsra, M(spec_op, 0, 0, 0, 0, dsra_op), RT | RD | RE }, | 104 | { insn_dsra, M(spec_op, 0, 0, 0, 0, dsra_op), RT | RD | RE }, |
105 | { insn_dsrl, M(spec_op, 0, 0, 0, 0, dsrl_op), RT | RD | RE }, | 105 | { insn_dsrl, M(spec_op, 0, 0, 0, 0, dsrl_op), RT | RD | RE }, |
106 | { insn_dsrl32, M(spec_op, 0, 0, 0, 0, dsrl32_op), RT | RD | RE }, | 106 | { insn_dsrl32, M(spec_op, 0, 0, 0, 0, dsrl32_op), RT | RD | RE }, |
107 | { insn_drotr, M(spec_op, 1, 0, 0, 0, dsrl_op), RT | RD | RE }, | ||
107 | { insn_dsubu, M(spec_op, 0, 0, 0, 0, dsubu_op), RS | RT | RD }, | 108 | { insn_dsubu, M(spec_op, 0, 0, 0, 0, dsubu_op), RS | RT | RD }, |
108 | { insn_eret, M(cop0_op, cop_op, 0, 0, 0, eret_op), 0 }, | 109 | { insn_eret, M(cop0_op, cop_op, 0, 0, 0, eret_op), 0 }, |
109 | { insn_j, M(j_op, 0, 0, 0, 0, 0), JIMM }, | 110 | { insn_j, M(j_op, 0, 0, 0, 0, 0), JIMM }, |
@@ -132,6 +133,7 @@ static struct insn insn_table[] __cpuinitdata = { | |||
132 | { insn_tlbwr, M(cop0_op, cop_op, 0, 0, 0, tlbwr_op), 0 }, | 133 | { insn_tlbwr, M(cop0_op, cop_op, 0, 0, 0, tlbwr_op), 0 }, |
133 | { insn_xor, M(spec_op, 0, 0, 0, 0, xor_op), RS | RT | RD }, | 134 | { insn_xor, M(spec_op, 0, 0, 0, 0, xor_op), RS | RT | RD }, |
134 | { insn_xori, M(xori_op, 0, 0, 0, 0, 0), RS | RT | UIMM }, | 135 | { insn_xori, M(xori_op, 0, 0, 0, 0, 0), RS | RT | UIMM }, |
136 | { insn_dins, M(spec3_op, 0, 0, 0, 0, dins_op), RS | RT | RD | RE }, | ||
135 | { insn_invalid, 0, 0 } | 137 | { insn_invalid, 0, 0 } |
136 | }; | 138 | }; |
137 | 139 | ||
@@ -304,6 +306,12 @@ Ip_u2u1s3(op) \ | |||
304 | build_insn(buf, insn##op, b, a, c); \ | 306 | build_insn(buf, insn##op, b, a, c); \ |
305 | } | 307 | } |
306 | 308 | ||
309 | #define I_u2u1msbu3(op) \ | ||
310 | Ip_u2u1msbu3(op) \ | ||
311 | { \ | ||
312 | build_insn(buf, insn##op, b, a, c+d-1, c); \ | ||
313 | } | ||
314 | |||
307 | #define I_u1u2(op) \ | 315 | #define I_u1u2(op) \ |
308 | Ip_u1u2(op) \ | 316 | Ip_u1u2(op) \ |
309 | { \ | 317 | { \ |
@@ -349,6 +357,7 @@ I_u2u1u3(_dsll32) | |||
349 | I_u2u1u3(_dsra) | 357 | I_u2u1u3(_dsra) |
350 | I_u2u1u3(_dsrl) | 358 | I_u2u1u3(_dsrl) |
351 | I_u2u1u3(_dsrl32) | 359 | I_u2u1u3(_dsrl32) |
360 | I_u2u1u3(_drotr) | ||
352 | I_u3u1u2(_dsubu) | 361 | I_u3u1u2(_dsubu) |
353 | I_0(_eret) | 362 | I_0(_eret) |
354 | I_u1(_j) | 363 | I_u1(_j) |
@@ -377,6 +386,7 @@ I_0(_tlbwi) | |||
377 | I_0(_tlbwr) | 386 | I_0(_tlbwr) |
378 | I_u3u1u2(_xor) | 387 | I_u3u1u2(_xor) |
379 | I_u2u1u3(_xori) | 388 | I_u2u1u3(_xori) |
389 | I_u2u1msbu3(_dins); | ||
380 | 390 | ||
381 | /* Handle labels. */ | 391 | /* Handle labels. */ |
382 | void __cpuinit uasm_build_label(struct uasm_label **lab, u32 *addr, int lid) | 392 | void __cpuinit uasm_build_label(struct uasm_label **lab, u32 *addr, int lid) |
diff --git a/arch/mips/mm/uasm.h b/arch/mips/mm/uasm.h index c6d1e3dd82d4..3d153edaa51e 100644 --- a/arch/mips/mm/uasm.h +++ b/arch/mips/mm/uasm.h | |||
@@ -34,6 +34,11 @@ uasm_i##op(u32 **buf, unsigned int a, signed int b, unsigned int c) | |||
34 | void __cpuinit \ | 34 | void __cpuinit \ |
35 | uasm_i##op(u32 **buf, unsigned int a, unsigned int b, signed int c) | 35 | uasm_i##op(u32 **buf, unsigned int a, unsigned int b, signed int c) |
36 | 36 | ||
37 | #define Ip_u2u1msbu3(op) \ | ||
38 | void __cpuinit \ | ||
39 | uasm_i##op(u32 **buf, unsigned int a, unsigned int b, unsigned int c, \ | ||
40 | unsigned int d) | ||
41 | |||
37 | #define Ip_u1u2(op) \ | 42 | #define Ip_u1u2(op) \ |
38 | void __cpuinit uasm_i##op(u32 **buf, unsigned int a, unsigned int b) | 43 | void __cpuinit uasm_i##op(u32 **buf, unsigned int a, unsigned int b) |
39 | 44 | ||
@@ -65,6 +70,7 @@ Ip_u2u1u3(_dsll32); | |||
65 | Ip_u2u1u3(_dsra); | 70 | Ip_u2u1u3(_dsra); |
66 | Ip_u2u1u3(_dsrl); | 71 | Ip_u2u1u3(_dsrl); |
67 | Ip_u2u1u3(_dsrl32); | 72 | Ip_u2u1u3(_dsrl32); |
73 | Ip_u2u1u3(_drotr); | ||
68 | Ip_u3u1u2(_dsubu); | 74 | Ip_u3u1u2(_dsubu); |
69 | Ip_0(_eret); | 75 | Ip_0(_eret); |
70 | Ip_u1(_j); | 76 | Ip_u1(_j); |
@@ -93,6 +99,7 @@ Ip_0(_tlbwi); | |||
93 | Ip_0(_tlbwr); | 99 | Ip_0(_tlbwr); |
94 | Ip_u3u1u2(_xor); | 100 | Ip_u3u1u2(_xor); |
95 | Ip_u2u1u3(_xori); | 101 | Ip_u2u1u3(_xori); |
102 | Ip_u2u1msbu3(_dins); | ||
96 | 103 | ||
97 | /* Handle labels. */ | 104 | /* Handle labels. */ |
98 | struct uasm_label { | 105 | struct uasm_label { |