diff options
author | James Hogan <james.hogan@imgtec.com> | 2016-06-23 12:34:38 -0400 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2016-07-05 10:08:40 -0400 |
commit | 6f63405cb67bc4424cd7cada11783dcef0f8b3c2 (patch) | |
tree | fb873b19d51384360b22bdb7d8f9dca62d5788c8 | |
parent | 9f730a60e5a046230cff8c9f4c8eb73f6dca7d81 (diff) |
MIPS: uasm: Add r6 MUL encoding
Add the R6 MUL instruction encoding for 3 operand signed multiply to
uasm so that KVM can use uasm for generating its entry point code at
runtime on R6.
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r-- | arch/mips/include/uapi/asm/inst.h | 44 | ||||
-rw-r--r-- | arch/mips/mm/uasm-mips.c | 4 |
2 files changed, 48 insertions, 0 deletions
diff --git a/arch/mips/include/uapi/asm/inst.h b/arch/mips/include/uapi/asm/inst.h index 6319c5037e66..fc96012c75d1 100644 --- a/arch/mips/include/uapi/asm/inst.h +++ b/arch/mips/include/uapi/asm/inst.h | |||
@@ -93,6 +93,50 @@ enum spec3_op { | |||
93 | }; | 93 | }; |
94 | 94 | ||
95 | /* | 95 | /* |
96 | * Bits 10-6 minor opcode for r6 spec mult/div encodings | ||
97 | */ | ||
98 | enum mult_op { | ||
99 | mult_mult_op = 0x0, | ||
100 | mult_mul_op = 0x2, | ||
101 | mult_muh_op = 0x3, | ||
102 | }; | ||
103 | enum multu_op { | ||
104 | multu_multu_op = 0x0, | ||
105 | multu_mulu_op = 0x2, | ||
106 | multu_muhu_op = 0x3, | ||
107 | }; | ||
108 | enum div_op { | ||
109 | div_div_op = 0x0, | ||
110 | div_div6_op = 0x2, | ||
111 | div_mod_op = 0x3, | ||
112 | }; | ||
113 | enum divu_op { | ||
114 | divu_divu_op = 0x0, | ||
115 | divu_divu6_op = 0x2, | ||
116 | divu_modu_op = 0x3, | ||
117 | }; | ||
118 | enum dmult_op { | ||
119 | dmult_dmult_op = 0x0, | ||
120 | dmult_dmul_op = 0x2, | ||
121 | dmult_dmuh_op = 0x3, | ||
122 | }; | ||
123 | enum dmultu_op { | ||
124 | dmultu_dmultu_op = 0x0, | ||
125 | dmultu_dmulu_op = 0x2, | ||
126 | dmultu_dmuhu_op = 0x3, | ||
127 | }; | ||
128 | enum ddiv_op { | ||
129 | ddiv_ddiv_op = 0x0, | ||
130 | ddiv_ddiv6_op = 0x2, | ||
131 | ddiv_dmod_op = 0x3, | ||
132 | }; | ||
133 | enum ddivu_op { | ||
134 | ddivu_ddivu_op = 0x0, | ||
135 | ddivu_ddivu6_op = 0x2, | ||
136 | ddivu_dmodu_op = 0x3, | ||
137 | }; | ||
138 | |||
139 | /* | ||
96 | * rt field of bcond opcodes. | 140 | * rt field of bcond opcodes. |
97 | */ | 141 | */ |
98 | enum rt_op { | 142 | enum rt_op { |
diff --git a/arch/mips/mm/uasm-mips.c b/arch/mips/mm/uasm-mips.c index 86a3c76a1ad8..cec524167822 100644 --- a/arch/mips/mm/uasm-mips.c +++ b/arch/mips/mm/uasm-mips.c | |||
@@ -121,7 +121,11 @@ static struct insn insn_table[] = { | |||
121 | { insn_mthc0, M(cop0_op, mthc0_op, 0, 0, 0, 0), RT | RD | SET}, | 121 | { insn_mthc0, M(cop0_op, mthc0_op, 0, 0, 0, 0), RT | RD | SET}, |
122 | { insn_mthi, M(spec_op, 0, 0, 0, 0, mthi_op), RS }, | 122 | { insn_mthi, M(spec_op, 0, 0, 0, 0, mthi_op), RS }, |
123 | { insn_mtlo, M(spec_op, 0, 0, 0, 0, mtlo_op), RS }, | 123 | { insn_mtlo, M(spec_op, 0, 0, 0, 0, mtlo_op), RS }, |
124 | #ifndef CONFIG_CPU_MIPSR6 | ||
124 | { insn_mul, M(spec2_op, 0, 0, 0, 0, mul_op), RS | RT | RD}, | 125 | { insn_mul, M(spec2_op, 0, 0, 0, 0, mul_op), RS | RT | RD}, |
126 | #else | ||
127 | { insn_mul, M(spec_op, 0, 0, 0, mult_mul_op, mult_op), RS | RT | RD}, | ||
128 | #endif | ||
125 | { insn_ori, M(ori_op, 0, 0, 0, 0, 0), RS | RT | UIMM }, | 129 | { insn_ori, M(ori_op, 0, 0, 0, 0, 0), RS | RT | UIMM }, |
126 | { insn_or, M(spec_op, 0, 0, 0, 0, or_op), RS | RT | RD }, | 130 | { insn_or, M(spec_op, 0, 0, 0, 0, or_op), RS | RT | RD }, |
127 | #ifndef CONFIG_CPU_MIPSR6 | 131 | #ifndef CONFIG_CPU_MIPSR6 |