]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
MIPS: microMIPS: mfhc1 & mthc1 support for the FPU emulator
authorSteven J. Hill <Steven.Hill@imgtec.com>
Thu, 7 Nov 2013 12:48:29 +0000 (12:48 +0000)
committerJohn Crispin <blogic@openwrt.org>
Tue, 14 Jan 2014 20:39:36 +0000 (21:39 +0100)
This patch adds support for microMIPS encodings of the mfhc1 & mthc1
instructions introduced in release 2 of the mips32 & mips64
architectures, converting them to their mips32 equivalents for the FPU
emulator.

Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Acked-by: John Crispin <blogic@openwrt.org>
Patchwork: http://patchwork.linux-mips.org/patch/6110/

arch/mips/include/uapi/asm/inst.h
arch/mips/math-emu/cp1emu.c

index e5a676e3d3c04ce267dc6254652ff48520565823..4752fdd52d401698f2e649e4636d8bc4c1a08a95 100644 (file)
@@ -397,8 +397,10 @@ enum mm_32f_73_minor_op {
        mm_movt1_op = 0xa5,
        mm_ftruncw_op = 0xac,
        mm_fneg1_op = 0xad,
+       mm_mfhc1_op = 0xc0,
        mm_froundl_op = 0xcc,
        mm_fcvtd1_op = 0xcd,
+       mm_mthc1_op = 0xe0,
        mm_froundw_op = 0xec,
        mm_fcvts1_op = 0xed,
 };
index efe008846ed056759dd2e66c83a54cfe2d4d789c..98f87ef9ddd5a6b9d1e55324d06e3e080f5115e3 100644 (file)
@@ -417,14 +417,20 @@ static int microMIPS32_to_MIPS32(union mips_instruction *insn_ptr)
                        case mm_mtc1_op:
                        case mm_cfc1_op:
                        case mm_ctc1_op:
+                       case mm_mfhc1_op:
+                       case mm_mthc1_op:
                                if (insn.mm_fp1_format.op == mm_mfc1_op)
                                        op = mfc_op;
                                else if (insn.mm_fp1_format.op == mm_mtc1_op)
                                        op = mtc_op;
                                else if (insn.mm_fp1_format.op == mm_cfc1_op)
                                        op = cfc_op;
-                               else
+                               else if (insn.mm_fp1_format.op == mm_ctc1_op)
                                        op = ctc_op;
+                               else if (insn.mm_fp1_format.op == mm_mfhc1_op)
+                                       op = mfhc_op;
+                               else
+                                       op = mthc_op;
                                mips32_insn.fp1_format.opcode = cop1_op;
                                mips32_insn.fp1_format.op = op;
                                mips32_insn.fp1_format.rt =