MIPS: Loongson-3: Add some unaligned instructions emulation
Subsystems (2)
PATCH 1/1 MIPS: Loongson-3: Add some unaligned instructions emulation
1, Add unaligned gslq, gssq, gslqc1, gssqc1 emulation; 2, Add unaligned gsl{h, w, d}x, gss{h, w, d}x emulation; 3, Add unaligned gslwxc1, gsswxc1, gsldxc1, gssdxc1 emulation.
--- arch/mips/include/asm/fpu_emulator.h | 2 - arch/mips/include/asm/inst.h | 773 ++++++++++++++++++++++++++++++++++ arch/mips/include/uapi/asm/inst.h | 26 ++ arch/mips/kernel/unaligned.c | 775 ----------------------------------- arch/mips/loongson64/cop2-ex.c | 274 ++++++++++++- 5 files changed, 1072 insertions(+), 778 deletions(-)
arch/mips/include/asm/fpu_emulator.h +0 -2
@@ -174,8 +174,6 @@ int process_fpemu_return(int sig, void __user *fault_addr, unsigned long fcr31);int isBranchInstr (struct pt_regs *regs,struct mm_decoded_insn dec_insn,unsigned long *contpc); -int mm_isBranchInstr (struct pt_regs *regs,struct mm_decoded_insn dec_insn, -unsigned long *contpc);/* * Mask the FCSR Cause bits according to the Enable bits, observing
arch/mips/include/asm/inst.h +773 -0
783 lines not on this page · raw message
arch/mips/include/uapi/asm/inst.h +26 -0
@@ -989,6 +989,30 @@ struct mm16_r5_format { /* Load/store from stack pointer format */ };/* +* Loongson-3 overridden COP2 instruction formats (32-bit length) +*/ +struct loongson3_lswc2_format { /* Loongson-3 overridden lwc2/swc2 Load/Store format */ + __BITFIELD_FIELD(unsigned int opcode : 6, + __BITFIELD_FIELD(unsigned int base : 5, + __BITFIELD_FIELD(unsigned int rt : 5, + __BITFIELD_FIELD(unsigned int fr : 1, + __BITFIELD_FIELD(unsigned int offset : 9, + __BITFIELD_FIELD(unsigned int ls : 1, + __BITFIELD_FIELD(unsigned int rq : 5, + ;))))))) +}; + +struct loongson3_lsdc2_format { /* Loongson-3 overridden ldc2/sdc2 Load/Store format */ + __BITFIELD_FIELD(unsigned int opcode : 6, + __BITFIELD_FIELD(unsigned int base : 5, + __BITFIELD_FIELD(unsigned int rt : 5, + __BITFIELD_FIELD(unsigned int index : 5, + __BITFIELD_FIELD(unsigned int offset : 8, + __BITFIELD_FIELD(unsigned int opcode1 : 3, + ;)))))) +}; + +/* * MIPS16e instruction formats (16-bit length) */ struct m16e_rr {
@@ -1088,6 +1112,8 @@ union mips_instruction {struct mm16_rb_format mm16_rb_format;struct mm16_r3_format mm16_r3_format;struct mm16_r5_format mm16_r5_format; +struct loongson3_lswc2_format loongson3_lswc2_format; +struct loongson3_lsdc2_format loongson3_lsdc2_format; };union mips16e_instruction {
arch/mips/kernel/unaligned.c +0 -775
787 lines not on this page · raw message
arch/mips/loongson64/cop2-ex.c +273 -1
299 lines not on this page · raw message
Signature · 1 line
2.7.0
Jiaxun Yang
maintainerQuoted 3 lines · On Thu, 9 Apr 2020 17:47:55 +0800 Huacai Chen <[email protected]> wrote:
1, Add unaligned gslq, gssq, gslqc1, gssqc1 emulation; 2, Add unaligned gsl{h, w, d}x, gss{h, w, d}x emulation; 3, Add unaligned gslwxc1, gsswxc1, gsldxc1, gssdxc1 emulation.
Probably you should split your changes into two patches?
The first patch moves load & store helpers to the header and the second one adds emulation in exception handler.
Thanks.
Quoted 4 lines
Signed-off-by Pei Huang <[email protected]>Signed-off-by Shuangshuang Zhang <[email protected]>Signed-off-by Huacai Chen <[email protected]>
Quoted 9 lines
--- arch/mips/include/asm/fpu_emulator.h | 2 - arch/mips/include/asm/inst.h | 773 ++++++++++++++++++++++++++++++++++ arch/mips/include/uapi/asm/inst.h | 26 ++ arch/mips/kernel/unaligned.c | 775-----------------------------------
arch/mips/loongson64/cop2-ex.c
| 274 ++++++++++++- 5 files changed, 1072 insertions(+), 778
deletions(-)
--
Jiaxun Yang