diff options
| author | Markos Chandras <markos.chandras@imgtec.com> | 2014-04-08 07:47:11 -0400 |
|---|---|---|
| committer | Ralf Baechle <ralf@linux-mips.org> | 2014-05-30 09:54:38 -0400 |
| commit | ab9e4fa092db6c4beea8fde67261959520675456 (patch) | |
| tree | 9ab1a6cb3ea8e005dd131ce89fd1701c4e923fab | |
| parent | e8ef868b470984064c23ce4bf2cd4c0167e1fbe5 (diff) | |
MIPS: uasm: Add wsbh uasm instruction
It will be used later on by bpf-jit
[ralf@linux-mips.org: Resolved conflict.]
Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: http://patchwork.linux-mips.org/patch/6732/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
| -rw-r--r-- | arch/mips/include/asm/uasm.h | 1 | ||||
| -rw-r--r-- | arch/mips/include/uapi/asm/inst.h | 11 | ||||
| -rw-r--r-- | arch/mips/mm/uasm-micromips.c | 1 | ||||
| -rw-r--r-- | arch/mips/mm/uasm-mips.c | 1 | ||||
| -rw-r--r-- | arch/mips/mm/uasm.c | 3 |
5 files changed, 16 insertions, 1 deletions
diff --git a/arch/mips/include/asm/uasm.h b/arch/mips/include/asm/uasm.h index 090f7503e421..d754ddc496d0 100644 --- a/arch/mips/include/asm/uasm.h +++ b/arch/mips/include/asm/uasm.h | |||
| @@ -157,6 +157,7 @@ Ip_0(_tlbr); | |||
| 157 | Ip_0(_tlbwi); | 157 | Ip_0(_tlbwi); |
| 158 | Ip_0(_tlbwr); | 158 | Ip_0(_tlbwr); |
| 159 | Ip_u1(_wait); | 159 | Ip_u1(_wait); |
| 160 | Ip_u2u1(_wsbh); | ||
| 160 | Ip_u3u1u2(_xor); | 161 | Ip_u3u1u2(_xor); |
| 161 | Ip_u2u1u3(_xori); | 162 | Ip_u2u1u3(_xori); |
| 162 | Ip_u2u1(_yield); | 163 | Ip_u2u1(_yield); |
diff --git a/arch/mips/include/uapi/asm/inst.h b/arch/mips/include/uapi/asm/inst.h index c78d235f86ee..aa37373bfd64 100644 --- a/arch/mips/include/uapi/asm/inst.h +++ b/arch/mips/include/uapi/asm/inst.h | |||
| @@ -206,6 +206,16 @@ enum lx_func { | |||
| 206 | }; | 206 | }; |
| 207 | 207 | ||
| 208 | /* | 208 | /* |
| 209 | * BSHFL opcodes | ||
| 210 | */ | ||
| 211 | enum bshfl_func { | ||
| 212 | wsbh_op = 0x2, | ||
| 213 | dshd_op = 0x5, | ||
| 214 | seb_op = 0x10, | ||
| 215 | seh_op = 0x18, | ||
| 216 | }; | ||
| 217 | |||
| 218 | /* | ||
| 209 | * (microMIPS) Major opcodes. | 219 | * (microMIPS) Major opcodes. |
| 210 | */ | 220 | */ |
| 211 | enum mm_major_op { | 221 | enum mm_major_op { |
| @@ -258,6 +268,7 @@ enum mm_32a_minor_op { | |||
| 258 | mm_lwxs_op = 0x118, | 268 | mm_lwxs_op = 0x118, |
| 259 | mm_addu32_op = 0x150, | 269 | mm_addu32_op = 0x150, |
| 260 | mm_subu32_op = 0x1d0, | 270 | mm_subu32_op = 0x1d0, |
| 271 | mm_wsbh_op = 0x1ec, | ||
| 261 | mm_and_op = 0x250, | 272 | mm_and_op = 0x250, |
| 262 | mm_or32_op = 0x290, | 273 | mm_or32_op = 0x290, |
| 263 | mm_xor32_op = 0x310, | 274 | mm_xor32_op = 0x310, |
diff --git a/arch/mips/mm/uasm-micromips.c b/arch/mips/mm/uasm-micromips.c index 260ca1b26504..071a4c1c2024 100644 --- a/arch/mips/mm/uasm-micromips.c +++ b/arch/mips/mm/uasm-micromips.c | |||
| @@ -112,6 +112,7 @@ static struct insn insn_table_MM[] = { | |||
| 112 | { insn_tlbwi, M(mm_pool32a_op, 0, 0, 0, mm_tlbwi_op, mm_pool32axf_op), 0 }, | 112 | { insn_tlbwi, M(mm_pool32a_op, 0, 0, 0, mm_tlbwi_op, mm_pool32axf_op), 0 }, |
| 113 | { insn_tlbwr, M(mm_pool32a_op, 0, 0, 0, mm_tlbwr_op, mm_pool32axf_op), 0 }, | 113 | { insn_tlbwr, M(mm_pool32a_op, 0, 0, 0, mm_tlbwr_op, mm_pool32axf_op), 0 }, |
| 114 | { insn_wait, M(mm_pool32a_op, 0, 0, 0, mm_wait_op, mm_pool32axf_op), SCIMM }, | 114 | { insn_wait, M(mm_pool32a_op, 0, 0, 0, mm_wait_op, mm_pool32axf_op), SCIMM }, |
| 115 | { insn_wsbh, M(mm_pool32a_op, 0, 0, 0, mm_wsbh_op, mm_pool32axf_op), RT | RS }, | ||
| 115 | { insn_xor, M(mm_pool32a_op, 0, 0, 0, 0, mm_xor32_op), RT | RS | RD }, | 116 | { insn_xor, M(mm_pool32a_op, 0, 0, 0, 0, mm_xor32_op), RT | RS | RD }, |
| 116 | { insn_xori, M(mm_xori32_op, 0, 0, 0, 0, 0), RT | RS | UIMM }, | 117 | { insn_xori, M(mm_xori32_op, 0, 0, 0, 0, 0), RT | RS | UIMM }, |
| 117 | { insn_dins, 0, 0 }, | 118 | { insn_dins, 0, 0 }, |
diff --git a/arch/mips/mm/uasm-mips.c b/arch/mips/mm/uasm-mips.c index ad1701c4727d..c50d3b4b55a7 100644 --- a/arch/mips/mm/uasm-mips.c +++ b/arch/mips/mm/uasm-mips.c | |||
| @@ -120,6 +120,7 @@ static struct insn insn_table[] = { | |||
| 120 | { insn_tlbwi, M(cop0_op, cop_op, 0, 0, 0, tlbwi_op), 0 }, | 120 | { insn_tlbwi, M(cop0_op, cop_op, 0, 0, 0, tlbwi_op), 0 }, |
| 121 | { insn_tlbwr, M(cop0_op, cop_op, 0, 0, 0, tlbwr_op), 0 }, | 121 | { insn_tlbwr, M(cop0_op, cop_op, 0, 0, 0, tlbwr_op), 0 }, |
| 122 | { insn_wait, M(cop0_op, cop_op, 0, 0, 0, wait_op), SCIMM }, | 122 | { insn_wait, M(cop0_op, cop_op, 0, 0, 0, wait_op), SCIMM }, |
| 123 | { insn_wsbh, M(spec3_op, 0, 0, 0, wsbh_op, bshfl_op), RT | RD }, | ||
| 123 | { insn_xori, M(xori_op, 0, 0, 0, 0, 0), RS | RT | UIMM }, | 124 | { insn_xori, M(xori_op, 0, 0, 0, 0, 0), RS | RT | UIMM }, |
| 124 | { insn_xor, M(spec_op, 0, 0, 0, 0, xor_op), RS | RT | RD }, | 125 | { insn_xor, M(spec_op, 0, 0, 0, 0, xor_op), RS | RT | RD }, |
| 125 | { insn_yield, M(spec3_op, 0, 0, 0, 0, yield_op), RS | RD }, | 126 | { insn_yield, M(spec3_op, 0, 0, 0, 0, yield_op), RS | RD }, |
diff --git a/arch/mips/mm/uasm.c b/arch/mips/mm/uasm.c index e0738fa514bc..678e41a57892 100644 --- a/arch/mips/mm/uasm.c +++ b/arch/mips/mm/uasm.c | |||
| @@ -55,7 +55,7 @@ enum opcode { | |||
| 55 | insn_rotr, insn_sc, insn_scd, insn_sd, insn_sll, insn_sllv, insn_sltiu, | 55 | insn_rotr, insn_sc, insn_scd, insn_sd, insn_sll, insn_sllv, insn_sltiu, |
| 56 | insn_sltu, insn_sra, insn_srl, insn_srlv, insn_subu, insn_sw, insn_sync, | 56 | insn_sltu, insn_sra, insn_srl, insn_srlv, insn_subu, insn_sw, insn_sync, |
| 57 | insn_syscall, insn_tlbp, insn_tlbr, insn_tlbwi, insn_tlbwr, insn_wait, | 57 | insn_syscall, insn_tlbp, insn_tlbr, insn_tlbwi, insn_tlbwr, insn_wait, |
| 58 | insn_xor, insn_xori, insn_yield, | 58 | insn_wsbh, insn_xor, insn_xori, insn_yield, |
| 59 | }; | 59 | }; |
| 60 | 60 | ||
| 61 | struct insn { | 61 | struct insn { |
| @@ -298,6 +298,7 @@ I_0(_tlbr) | |||
| 298 | I_0(_tlbwi) | 298 | I_0(_tlbwi) |
| 299 | I_0(_tlbwr) | 299 | I_0(_tlbwr) |
| 300 | I_u1(_wait); | 300 | I_u1(_wait); |
| 301 | I_u2u1(_wsbh) | ||
| 301 | I_u3u1u2(_xor) | 302 | I_u3u1u2(_xor) |
| 302 | I_u2u1u3(_xori) | 303 | I_u2u1u3(_xori) |
| 303 | I_u2u1(_yield) | 304 | I_u2u1(_yield) |
