]> git.openpandora.org Git - pandora-kernel.git/commitdiff
MIPS: Add microMIPS MSA support.
authorSteven J. Hill <Steven.Hill@imgtec.com>
Tue, 15 Apr 2014 21:06:49 +0000 (16:06 -0500)
committerRalf Baechle <ralf@linux-mips.org>
Wed, 4 Jun 2014 20:50:41 +0000 (22:50 +0200)
This patch adds support for the microMIPS implementation of the MSA
instructions.

Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
Reviewed-by: Paul Burton <Paul.Burton@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/6763/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/include/asm/asmmacro.h
arch/mips/include/asm/msa.h

index f7db79a846bb42b2d945a3cd22f3c6ad7aef8636..935543f1453848660ae6fdc69922bcb9b10cae5b 100644 (file)
        .set    pop
        .endm
 #else
+
+#ifdef CONFIG_CPU_MICROMIPS
+#define CFC_MSA_INSN           0x587e0056
+#define CTC_MSA_INSN           0x583e0816
+#define LDD_MSA_INSN           0x58000837
+#define STD_MSA_INSN           0x5800083f
+#define COPY_UW_MSA_INSN       0x58f00056
+#define COPY_UD_MSA_INSN       0x58f80056
+#define INSERT_W_MSA_INSN      0x59300816
+#define INSERT_D_MSA_INSN      0x59380816
+#else
+#define CFC_MSA_INSN           0x787e0059
+#define CTC_MSA_INSN           0x783e0819
+#define LDD_MSA_INSN           0x78000823
+#define STD_MSA_INSN           0x78000827
+#define COPY_UW_MSA_INSN       0x78f00059
+#define COPY_UD_MSA_INSN       0x78f80059
+#define INSERT_W_MSA_INSN      0x79300819
+#define INSERT_D_MSA_INSN      0x79380819
+#endif
+
        /*
         * Temporary until all toolchains in use include MSA support.
         */
        .macro  cfcmsa  rd, cs
        .set    push
        .set    noat
-       .word   0x787e0059 | (\cs << 11)
+       .insn
+       .word   CFC_MSA_INSN | (\cs << 11)
        move    \rd, $1
        .set    pop
        .endm
        .set    push
        .set    noat
        move    $1, \rs
-       .word   0x783e0819 | (\cd << 6)
+       .word   CTC_MSA_INSN | (\cd << 6)
        .set    pop
        .endm
 
        .set    push
        .set    noat
        add     $1, \base, \off
-       .word   0x78000823 | (\wd << 6)
+       .word   LDD_MSA_INSN | (\wd << 6)
        .set    pop
        .endm
 
        .set    push
        .set    noat
        add     $1, \base, \off
-       .word   0x78000827 | (\wd << 6)
+       .word   STD_MSA_INSN | (\wd << 6)
        .set    pop
        .endm
 
        .macro  copy_u_w        rd, ws, n
        .set    push
        .set    noat
-       .word   0x78f00059 | (\n << 16) | (\ws << 11)
+       .insn
+       .word   COPY_UW_MSA_INSN | (\n << 16) | (\ws << 11)
        /* move triggers an assembler bug... */
        or      \rd, $1, zero
        .set    pop
        .macro  copy_u_d        rd, ws, n
        .set    push
        .set    noat
-       .word   0x78f80059 | (\n << 16) | (\ws << 11)
+       .insn
+       .word   COPY_UD_MSA_INSN | (\n << 16) | (\ws << 11)
        /* move triggers an assembler bug... */
        or      \rd, $1, zero
        .set    pop
        .set    noat
        /* move triggers an assembler bug... */
        or      $1, \rs, zero
-       .word   0x79300819 | (\n << 16) | (\wd << 6)
+       .word   INSERT_W_MSA_INSN | (\n << 16) | (\wd << 6)
        .set    pop
        .endm
 
        .set    noat
        /* move triggers an assembler bug... */
        or      $1, \rs, zero
-       .word   0x79380819 | (\n << 16) | (\wd << 6)
+       .word   INSERT_D_MSA_INSN | (\n << 16) | (\wd << 6)
        .set    pop
        .endm
 #endif
Simple merge