aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Burton <paul.burton@imgtec.com>2015-03-27 13:00:03 -0400
committerRalf Baechle <ralf@linux-mips.org>2015-03-27 14:42:42 -0400
commit631afc65e8f4f845945ef9e90236d10cee601498 (patch)
treec65e9c9c34001065e17b44e5b60baa5f17ef4602
parentacaf6a97d623af123314c2f8ce4cf7254f6b2fc1 (diff)
MIPS: Push .set mips64r* into the functions needing it
The {save,restore}_fp_context{,32} functions require that the assembler allows the use of sdc instructions on any FP register, and this is acomplished by setting the arch to mips64r2 or mips64r6 (using MIPS_ISA_ARCH_LEVEL_RAW). However this has the effect of enabling the assembler to use mips64 instructions in the expansion of pseudo-instructions. This was done in the (now-reverted) commit eec43a224cf1 "MIPS: Save/restore MSA context around signals" which led to my mistakenly believing that there was an assembler bug, when in reality the assembler was just emitting mips64 instructions. Avoid the issue for future commits which will add code to r4k_fpu.S by pushing the .set MIPS_ISA_ARCH_LEVEL_RAW directives into the functions that require it, and remove the spurious assertion declaring the assembler bug. Signed-off-by: Paul Burton <paul.burton@imgtec.com> [james.hogan@imgtec.com: Rebase on v4.0-rc1 and reword commit message to reflect use of MIPS_ISA_ARCH_LEVEL_RAW] Signed-off-by: James Hogan <james.hogan@imgtec.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/9612/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r--arch/mips/include/asm/asmmacro.h12
-rw-r--r--arch/mips/kernel/r4k_fpu.S2
2 files changed, 5 insertions, 9 deletions
diff --git a/arch/mips/include/asm/asmmacro.h b/arch/mips/include/asm/asmmacro.h
index 0cae4595e985..782dde7fed57 100644
--- a/arch/mips/include/asm/asmmacro.h
+++ b/arch/mips/include/asm/asmmacro.h
@@ -326,8 +326,7 @@
326 SET_HARDFLOAT 326 SET_HARDFLOAT
327 .insn 327 .insn
328 .word COPY_UW_MSA_INSN | (\n << 16) | (\ws << 11) 328 .word COPY_UW_MSA_INSN | (\n << 16) | (\ws << 11)
329 /* move triggers an assembler bug... */ 329 move \rd, $1
330 or \rd, $1, zero
331 .set pop 330 .set pop
332 .endm 331 .endm
333 332
@@ -337,8 +336,7 @@
337 SET_HARDFLOAT 336 SET_HARDFLOAT
338 .insn 337 .insn
339 .word COPY_UD_MSA_INSN | (\n << 16) | (\ws << 11) 338 .word COPY_UD_MSA_INSN | (\n << 16) | (\ws << 11)
340 /* move triggers an assembler bug... */ 339 move \rd, $1
341 or \rd, $1, zero
342 .set pop 340 .set pop
343 .endm 341 .endm
344 342
@@ -346,8 +344,7 @@
346 .set push 344 .set push
347 .set noat 345 .set noat
348 SET_HARDFLOAT 346 SET_HARDFLOAT
349 /* move triggers an assembler bug... */ 347 move $1, \rs
350 or $1, \rs, zero
351 .word INSERT_W_MSA_INSN | (\n << 16) | (\wd << 6) 348 .word INSERT_W_MSA_INSN | (\n << 16) | (\wd << 6)
352 .set pop 349 .set pop
353 .endm 350 .endm
@@ -356,8 +353,7 @@
356 .set push 353 .set push
357 .set noat 354 .set noat
358 SET_HARDFLOAT 355 SET_HARDFLOAT
359 /* move triggers an assembler bug... */ 356 move $1, \rs
360 or $1, \rs, zero
361 .word INSERT_D_MSA_INSN | (\n << 16) | (\wd << 6) 357 .word INSERT_D_MSA_INSN | (\n << 16) | (\wd << 6)
362 .set pop 358 .set pop
363 .endm 359 .endm
diff --git a/arch/mips/kernel/r4k_fpu.S b/arch/mips/kernel/r4k_fpu.S
index 676c5030a953..1d88af26ba82 100644
--- a/arch/mips/kernel/r4k_fpu.S
+++ b/arch/mips/kernel/r4k_fpu.S
@@ -34,7 +34,6 @@
34 .endm 34 .endm
35 35
36 .set noreorder 36 .set noreorder
37 .set MIPS_ISA_ARCH_LEVEL_RAW
38 37
39LEAF(_save_fp_context) 38LEAF(_save_fp_context)
40 .set push 39 .set push
@@ -103,6 +102,7 @@ LEAF(_save_fp_context)
103 /* Save 32-bit process floating point context */ 102 /* Save 32-bit process floating point context */
104LEAF(_save_fp_context32) 103LEAF(_save_fp_context32)
105 .set push 104 .set push
105 .set MIPS_ISA_ARCH_LEVEL_RAW
106 SET_HARDFLOAT 106 SET_HARDFLOAT
107 cfc1 t1, fcr31 107 cfc1 t1, fcr31
108 108