diff options
author | Paul Burton <paul.burton@imgtec.com> | 2015-01-30 07:09:33 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2015-03-27 14:42:44 -0400 |
commit | e1bebbab1eaecac77d77033010b5e0f51b737e64 (patch) | |
tree | fceb2b86c2e64a2f850f6f27433dcf1e99a44262 | |
parent | a3a49810c55e3489dfb5d72a9b2e41ab1db9ffb9 (diff) |
MIPS: wrap cfcmsa & ctcmsa accesses for toolchains with MSA support
Uses of the cfcmsa & ctcmsa instructions were not being wrapped by a
macro in the case where the toolchain supports MSA, since the arguments
exactly match a typical use of the instructions. However using current
toolchains this leads to errors such as:
arch/mips/kernel/genex.S:437: Error: opcode not supported on this processor: mips32r2 (mips32r2) `cfcmsa $5,1'
Thus uses of the instructions must be in the context of a ".set msa"
directive, however doing that from the users of the instructions would
be messy due to the possibility that the toolchain does not support
MSA. Fix this by renaming the macros (prepending an underscore) in order
to avoid recursion when attempting to emit the instructions, and provide
implementations for the TOOLCHAIN_SUPPORTS_MSA case which ".set msa" as
appropriate.
Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/9163/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r-- | arch/mips/include/asm/asmmacro.h | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/arch/mips/include/asm/asmmacro.h b/arch/mips/include/asm/asmmacro.h index 73dec5c2084a..a64e424ace16 100644 --- a/arch/mips/include/asm/asmmacro.h +++ b/arch/mips/include/asm/asmmacro.h | |||
@@ -211,6 +211,22 @@ | |||
211 | .endm | 211 | .endm |
212 | 212 | ||
213 | #ifdef TOOLCHAIN_SUPPORTS_MSA | 213 | #ifdef TOOLCHAIN_SUPPORTS_MSA |
214 | .macro _cfcmsa rd, cs | ||
215 | .set push | ||
216 | .set mips32r2 | ||
217 | .set msa | ||
218 | cfcmsa \rd, $\cs | ||
219 | .set pop | ||
220 | .endm | ||
221 | |||
222 | .macro _ctcmsa cd, rs | ||
223 | .set push | ||
224 | .set mips32r2 | ||
225 | .set msa | ||
226 | ctcmsa $\cd, \rs | ||
227 | .set pop | ||
228 | .endm | ||
229 | |||
214 | .macro ld_d wd, off, base | 230 | .macro ld_d wd, off, base |
215 | .set push | 231 | .set push |
216 | .set mips32r2 | 232 | .set mips32r2 |
@@ -283,7 +299,7 @@ | |||
283 | /* | 299 | /* |
284 | * Temporary until all toolchains in use include MSA support. | 300 | * Temporary until all toolchains in use include MSA support. |
285 | */ | 301 | */ |
286 | .macro cfcmsa rd, cs | 302 | .macro _cfcmsa rd, cs |
287 | .set push | 303 | .set push |
288 | .set noat | 304 | .set noat |
289 | SET_HARDFLOAT | 305 | SET_HARDFLOAT |
@@ -293,7 +309,7 @@ | |||
293 | .set pop | 309 | .set pop |
294 | .endm | 310 | .endm |
295 | 311 | ||
296 | .macro ctcmsa cd, rs | 312 | .macro _ctcmsa cd, rs |
297 | .set push | 313 | .set push |
298 | .set noat | 314 | .set noat |
299 | SET_HARDFLOAT | 315 | SET_HARDFLOAT |
@@ -391,7 +407,7 @@ | |||
391 | .set push | 407 | .set push |
392 | .set noat | 408 | .set noat |
393 | SET_HARDFLOAT | 409 | SET_HARDFLOAT |
394 | cfcmsa $1, MSA_CSR | 410 | _cfcmsa $1, MSA_CSR |
395 | sw $1, THREAD_MSA_CSR(\thread) | 411 | sw $1, THREAD_MSA_CSR(\thread) |
396 | .set pop | 412 | .set pop |
397 | .endm | 413 | .endm |
@@ -401,7 +417,7 @@ | |||
401 | .set noat | 417 | .set noat |
402 | SET_HARDFLOAT | 418 | SET_HARDFLOAT |
403 | lw $1, THREAD_MSA_CSR(\thread) | 419 | lw $1, THREAD_MSA_CSR(\thread) |
404 | ctcmsa MSA_CSR, $1 | 420 | _ctcmsa MSA_CSR, $1 |
405 | .set pop | 421 | .set pop |
406 | ld_d 0, THREAD_FPR0, \thread | 422 | ld_d 0, THREAD_FPR0, \thread |
407 | ld_d 1, THREAD_FPR1, \thread | 423 | ld_d 1, THREAD_FPR1, \thread |