diff options
author | David Daney <ddaney@caviumnetworks.com> | 2010-07-23 21:41:41 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2010-08-05 08:26:20 -0400 |
commit | de6d5b555c1887b5b9b59854a45ebd4805fb4b39 (patch) | |
tree | 6f99e2f60a21a7ed4de851942ca4925b16ebb250 /arch/mips | |
parent | ca148125e6134de334b61822539d220794d8da18 (diff) |
MIPS: uasm: Add drotr32 and uasm_i_drotr_safe.
Signed-off-by: David Daney <ddaney@caviumnetworks.com>
To: linux-mips@linux-mips.org
To: wim@iguana.be
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/1495/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips')
-rw-r--r-- | arch/mips/include/asm/uasm.h | 10 | ||||
-rw-r--r-- | arch/mips/mm/uasm.c | 13 |
2 files changed, 18 insertions, 5 deletions
diff --git a/arch/mips/include/asm/uasm.h b/arch/mips/include/asm/uasm.h index 697e40c06497..3964b2e6c7d6 100644 --- a/arch/mips/include/asm/uasm.h +++ b/arch/mips/include/asm/uasm.h | |||
@@ -71,6 +71,7 @@ Ip_u2u1u3(_dsra); | |||
71 | Ip_u2u1u3(_dsrl); | 71 | Ip_u2u1u3(_dsrl); |
72 | Ip_u2u1u3(_dsrl32); | 72 | Ip_u2u1u3(_dsrl32); |
73 | Ip_u2u1u3(_drotr); | 73 | Ip_u2u1u3(_drotr); |
74 | Ip_u2u1u3(_drotr32); | ||
74 | Ip_u3u1u2(_dsubu); | 75 | Ip_u3u1u2(_dsubu); |
75 | Ip_0(_eret); | 76 | Ip_0(_eret); |
76 | Ip_u1(_j); | 77 | Ip_u1(_j); |
@@ -176,6 +177,15 @@ static inline void uasm_i_dsrl_safe(u32 **p, unsigned int a1, | |||
176 | uasm_i_dsrl32(p, a1, a2, a3 - 32); | 177 | uasm_i_dsrl32(p, a1, a2, a3 - 32); |
177 | } | 178 | } |
178 | 179 | ||
180 | static inline void uasm_i_drotr_safe(u32 **p, unsigned int a1, | ||
181 | unsigned int a2, unsigned int a3) | ||
182 | { | ||
183 | if (a3 < 32) | ||
184 | uasm_i_drotr(p, a1, a2, a3); | ||
185 | else | ||
186 | uasm_i_drotr32(p, a1, a2, a3 - 32); | ||
187 | } | ||
188 | |||
179 | static inline void uasm_i_dsll_safe(u32 **p, unsigned int a1, | 189 | static inline void uasm_i_dsll_safe(u32 **p, unsigned int a1, |
180 | unsigned int a2, unsigned int a3) | 190 | unsigned int a2, unsigned int a3) |
181 | { | 191 | { |
diff --git a/arch/mips/mm/uasm.c b/arch/mips/mm/uasm.c index 611d564fdcf1..fe041d5bb41a 100644 --- a/arch/mips/mm/uasm.c +++ b/arch/mips/mm/uasm.c | |||
@@ -62,11 +62,12 @@ enum opcode { | |||
62 | insn_beql, insn_bgez, insn_bgezl, insn_bltz, insn_bltzl, | 62 | insn_beql, insn_bgez, insn_bgezl, insn_bltz, insn_bltzl, |
63 | insn_bne, insn_cache, insn_daddu, insn_daddiu, insn_dmfc0, | 63 | insn_bne, insn_cache, insn_daddu, insn_daddiu, insn_dmfc0, |
64 | insn_dmtc0, insn_dsll, insn_dsll32, insn_dsra, insn_dsrl, | 64 | insn_dmtc0, insn_dsll, insn_dsll32, insn_dsra, insn_dsrl, |
65 | insn_dsrl32, insn_drotr, insn_dsubu, insn_eret, insn_j, insn_jal, | 65 | insn_dsrl32, insn_drotr, insn_drotr32, insn_dsubu, insn_eret, |
66 | insn_jr, insn_ld, insn_ll, insn_lld, insn_lui, insn_lw, insn_mfc0, | 66 | insn_j, insn_jal, insn_jr, insn_ld, insn_ll, insn_lld, |
67 | insn_mtc0, insn_or, insn_ori, insn_pref, insn_rfe, insn_sc, insn_scd, | 67 | insn_lui, insn_lw, insn_mfc0, insn_mtc0, insn_or, insn_ori, |
68 | insn_sd, insn_sll, insn_sra, insn_srl, insn_rotr, insn_subu, insn_sw, | 68 | insn_pref, insn_rfe, insn_sc, insn_scd, insn_sd, insn_sll, |
69 | insn_tlbp, insn_tlbr, insn_tlbwi, insn_tlbwr, insn_xor, insn_xori, | 69 | insn_sra, insn_srl, insn_rotr, insn_subu, insn_sw, insn_tlbp, |
70 | insn_tlbr, insn_tlbwi, insn_tlbwr, insn_xor, insn_xori, | ||
70 | insn_dins, insn_syscall | 71 | insn_dins, insn_syscall |
71 | }; | 72 | }; |
72 | 73 | ||
@@ -108,6 +109,7 @@ static struct insn insn_table[] __cpuinitdata = { | |||
108 | { insn_dsrl, M(spec_op, 0, 0, 0, 0, dsrl_op), RT | RD | RE }, | 109 | { insn_dsrl, M(spec_op, 0, 0, 0, 0, dsrl_op), RT | RD | RE }, |
109 | { insn_dsrl32, M(spec_op, 0, 0, 0, 0, dsrl32_op), RT | RD | RE }, | 110 | { insn_dsrl32, M(spec_op, 0, 0, 0, 0, dsrl32_op), RT | RD | RE }, |
110 | { insn_drotr, M(spec_op, 1, 0, 0, 0, dsrl_op), RT | RD | RE }, | 111 | { insn_drotr, M(spec_op, 1, 0, 0, 0, dsrl_op), RT | RD | RE }, |
112 | { insn_drotr32, M(spec_op, 1, 0, 0, 0, dsrl32_op), RT | RD | RE }, | ||
111 | { insn_dsubu, M(spec_op, 0, 0, 0, 0, dsubu_op), RS | RT | RD }, | 113 | { insn_dsubu, M(spec_op, 0, 0, 0, 0, dsubu_op), RS | RT | RD }, |
112 | { insn_eret, M(cop0_op, cop_op, 0, 0, 0, eret_op), 0 }, | 114 | { insn_eret, M(cop0_op, cop_op, 0, 0, 0, eret_op), 0 }, |
113 | { insn_j, M(j_op, 0, 0, 0, 0, 0), JIMM }, | 115 | { insn_j, M(j_op, 0, 0, 0, 0, 0), JIMM }, |
@@ -375,6 +377,7 @@ I_u2u1u3(_dsra) | |||
375 | I_u2u1u3(_dsrl) | 377 | I_u2u1u3(_dsrl) |
376 | I_u2u1u3(_dsrl32) | 378 | I_u2u1u3(_dsrl32) |
377 | I_u2u1u3(_drotr) | 379 | I_u2u1u3(_drotr) |
380 | I_u2u1u3(_drotr32) | ||
378 | I_u3u1u2(_dsubu) | 381 | I_u3u1u2(_dsubu) |
379 | I_0(_eret) | 382 | I_0(_eret) |
380 | I_u1(_j) | 383 | I_u1(_j) |