Commit 92078e06 authored by David Daney's avatar David Daney Committed by Ralf Baechle

MIPS: Add drotr and dins instructions to uasm.

Signed-off-by: default avatarDavid Daney <ddaney@caviumnetworks.com>
Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent f6ed1b3b
...@@ -60,11 +60,11 @@ enum opcode { ...@@ -60,11 +60,11 @@ enum opcode {
insn_beql, insn_bgez, insn_bgezl, insn_bltz, insn_bltzl, insn_beql, insn_bgez, insn_bgezl, insn_bltz, insn_bltzl,
insn_bne, insn_cache, insn_daddu, insn_daddiu, insn_dmfc0, insn_bne, insn_cache, insn_daddu, insn_daddiu, insn_dmfc0,
insn_dmtc0, insn_dsll, insn_dsll32, insn_dsra, insn_dsrl, insn_dmtc0, insn_dsll, insn_dsll32, insn_dsra, insn_dsrl,
insn_dsrl32, insn_dsubu, insn_eret, insn_j, insn_jal, insn_jr, insn_dsrl32, insn_drotr, insn_dsubu, insn_eret, insn_j, insn_jal,
insn_ld, insn_ll, insn_lld, insn_lui, insn_lw, insn_mfc0, insn_jr, insn_ld, insn_ll, insn_lld, insn_lui, insn_lw, insn_mfc0,
insn_mtc0, insn_ori, insn_pref, insn_rfe, insn_sc, insn_scd, insn_mtc0, insn_ori, insn_pref, insn_rfe, insn_sc, insn_scd,
insn_sd, insn_sll, insn_sra, insn_srl, insn_subu, insn_sw, insn_sd, insn_sll, insn_sra, insn_srl, insn_subu, insn_sw,
insn_tlbp, insn_tlbwi, insn_tlbwr, insn_xor, insn_xori insn_tlbp, insn_tlbwi, insn_tlbwr, insn_xor, insn_xori, insn_dins
}; };
struct insn { struct insn {
...@@ -104,6 +104,7 @@ static struct insn insn_table[] __cpuinitdata = { ...@@ -104,6 +104,7 @@ static struct insn insn_table[] __cpuinitdata = {
{ insn_dsra, M(spec_op, 0, 0, 0, 0, dsra_op), RT | RD | RE }, { insn_dsra, M(spec_op, 0, 0, 0, 0, dsra_op), RT | RD | RE },
{ insn_dsrl, M(spec_op, 0, 0, 0, 0, dsrl_op), RT | RD | RE }, { insn_dsrl, M(spec_op, 0, 0, 0, 0, dsrl_op), RT | RD | RE },
{ insn_dsrl32, M(spec_op, 0, 0, 0, 0, dsrl32_op), RT | RD | RE }, { insn_dsrl32, M(spec_op, 0, 0, 0, 0, dsrl32_op), RT | RD | RE },
{ insn_drotr, M(spec_op, 1, 0, 0, 0, dsrl_op), RT | RD | RE },
{ insn_dsubu, M(spec_op, 0, 0, 0, 0, dsubu_op), RS | RT | RD }, { insn_dsubu, M(spec_op, 0, 0, 0, 0, dsubu_op), RS | RT | RD },
{ insn_eret, M(cop0_op, cop_op, 0, 0, 0, eret_op), 0 }, { insn_eret, M(cop0_op, cop_op, 0, 0, 0, eret_op), 0 },
{ insn_j, M(j_op, 0, 0, 0, 0, 0), JIMM }, { insn_j, M(j_op, 0, 0, 0, 0, 0), JIMM },
...@@ -132,6 +133,7 @@ static struct insn insn_table[] __cpuinitdata = { ...@@ -132,6 +133,7 @@ static struct insn insn_table[] __cpuinitdata = {
{ insn_tlbwr, M(cop0_op, cop_op, 0, 0, 0, tlbwr_op), 0 }, { insn_tlbwr, M(cop0_op, cop_op, 0, 0, 0, tlbwr_op), 0 },
{ insn_xor, M(spec_op, 0, 0, 0, 0, xor_op), RS | RT | RD }, { insn_xor, M(spec_op, 0, 0, 0, 0, xor_op), RS | RT | RD },
{ insn_xori, M(xori_op, 0, 0, 0, 0, 0), RS | RT | UIMM }, { insn_xori, M(xori_op, 0, 0, 0, 0, 0), RS | RT | UIMM },
{ insn_dins, M(spec3_op, 0, 0, 0, 0, dins_op), RS | RT | RD | RE },
{ insn_invalid, 0, 0 } { insn_invalid, 0, 0 }
}; };
...@@ -304,6 +306,12 @@ Ip_u2u1s3(op) \ ...@@ -304,6 +306,12 @@ Ip_u2u1s3(op) \
build_insn(buf, insn##op, b, a, c); \ build_insn(buf, insn##op, b, a, c); \
} }
#define I_u2u1msbu3(op) \
Ip_u2u1msbu3(op) \
{ \
build_insn(buf, insn##op, b, a, c+d-1, c); \
}
#define I_u1u2(op) \ #define I_u1u2(op) \
Ip_u1u2(op) \ Ip_u1u2(op) \
{ \ { \
...@@ -349,6 +357,7 @@ I_u2u1u3(_dsll32) ...@@ -349,6 +357,7 @@ I_u2u1u3(_dsll32)
I_u2u1u3(_dsra) I_u2u1u3(_dsra)
I_u2u1u3(_dsrl) I_u2u1u3(_dsrl)
I_u2u1u3(_dsrl32) I_u2u1u3(_dsrl32)
I_u2u1u3(_drotr)
I_u3u1u2(_dsubu) I_u3u1u2(_dsubu)
I_0(_eret) I_0(_eret)
I_u1(_j) I_u1(_j)
...@@ -377,6 +386,7 @@ I_0(_tlbwi) ...@@ -377,6 +386,7 @@ I_0(_tlbwi)
I_0(_tlbwr) I_0(_tlbwr)
I_u3u1u2(_xor) I_u3u1u2(_xor)
I_u2u1u3(_xori) I_u2u1u3(_xori)
I_u2u1msbu3(_dins);
/* Handle labels. */ /* Handle labels. */
void __cpuinit uasm_build_label(struct uasm_label **lab, u32 *addr, int lid) void __cpuinit uasm_build_label(struct uasm_label **lab, u32 *addr, int lid)
......
...@@ -34,6 +34,11 @@ uasm_i##op(u32 **buf, unsigned int a, signed int b, unsigned int c) ...@@ -34,6 +34,11 @@ uasm_i##op(u32 **buf, unsigned int a, signed int b, unsigned int c)
void __cpuinit \ void __cpuinit \
uasm_i##op(u32 **buf, unsigned int a, unsigned int b, signed int c) uasm_i##op(u32 **buf, unsigned int a, unsigned int b, signed int c)
#define Ip_u2u1msbu3(op) \
void __cpuinit \
uasm_i##op(u32 **buf, unsigned int a, unsigned int b, unsigned int c, \
unsigned int d)
#define Ip_u1u2(op) \ #define Ip_u1u2(op) \
void __cpuinit uasm_i##op(u32 **buf, unsigned int a, unsigned int b) void __cpuinit uasm_i##op(u32 **buf, unsigned int a, unsigned int b)
...@@ -65,6 +70,7 @@ Ip_u2u1u3(_dsll32); ...@@ -65,6 +70,7 @@ Ip_u2u1u3(_dsll32);
Ip_u2u1u3(_dsra); Ip_u2u1u3(_dsra);
Ip_u2u1u3(_dsrl); Ip_u2u1u3(_dsrl);
Ip_u2u1u3(_dsrl32); Ip_u2u1u3(_dsrl32);
Ip_u2u1u3(_drotr);
Ip_u3u1u2(_dsubu); Ip_u3u1u2(_dsubu);
Ip_0(_eret); Ip_0(_eret);
Ip_u1(_j); Ip_u1(_j);
...@@ -93,6 +99,7 @@ Ip_0(_tlbwi); ...@@ -93,6 +99,7 @@ Ip_0(_tlbwi);
Ip_0(_tlbwr); Ip_0(_tlbwr);
Ip_u3u1u2(_xor); Ip_u3u1u2(_xor);
Ip_u2u1u3(_xori); Ip_u2u1u3(_xori);
Ip_u2u1msbu3(_dins);
/* Handle labels. */ /* Handle labels. */
struct uasm_label { struct uasm_label {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment