linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] MIPS: Loongson64: Use three arguments for slti
@ 2021-12-08 16:56 Nathan Chancellor
  2021-12-09  9:31 ` Thomas Bogendoerfer
  0 siblings, 1 reply; 2+ messages in thread
From: Nathan Chancellor @ 2021-12-08 16:56 UTC (permalink / raw)
  To: Huacai Chen, Jiaxun Yang, Thomas Bogendoerfer
  Cc: Nick Desaulniers, Sergey Shtylyov, linux-mips, linux-kernel,
	llvm, Nathan Chancellor, Ryutaroh Matsumoto

LLVM's integrated assembler does not support 'slti <reg>, <imm>':

<instantiation>:16:12: error: invalid operand for instruction
 slti $12, (0x6300 | 0x0008)
           ^
arch/mips/kernel/head.S:86:2: note: while in macro instantiation
 kernel_entry_setup # cpu specific setup
 ^
<instantiation>:16:12: error: invalid operand for instruction
 slti $12, (0x6300 | 0x0008)
           ^
arch/mips/kernel/head.S:150:2: note: while in macro instantiation
 smp_slave_setup
 ^

To increase compatibility with LLVM's integrated assembler, use the full
form of 'slti <reg>, <reg>, <imm>', which matches the rest of
arch/mips/. This does not result in any change for GNU as.

Link: https://github.com/ClangBuiltLinux/linux/issues/1526
Reported-by: Ryutaroh Matsumoto <ryutaroh@ict.e.titech.ac.jp>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---

v1 -> v2: https://lore.kernel.org/r/20211207170129.578089-1-nathan@kernel.org/

* Fix typos in commit message ("stli" -> "slti") [Sergey]

 arch/mips/include/asm/mach-loongson64/kernel-entry-init.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/mips/include/asm/mach-loongson64/kernel-entry-init.h b/arch/mips/include/asm/mach-loongson64/kernel-entry-init.h
index 13373c5144f8..efb41b351974 100644
--- a/arch/mips/include/asm/mach-loongson64/kernel-entry-init.h
+++ b/arch/mips/include/asm/mach-loongson64/kernel-entry-init.h
@@ -32,7 +32,7 @@
 	nop
 	/* Loongson-3A R2/R3 */
 	andi	t0, (PRID_IMP_MASK | PRID_REV_MASK)
-	slti	t0, (PRID_IMP_LOONGSON_64C | PRID_REV_LOONGSON3A_R2_0)
+	slti	t0, t0, (PRID_IMP_LOONGSON_64C | PRID_REV_LOONGSON3A_R2_0)
 	bnez	t0, 2f
 	nop
 1:
@@ -63,7 +63,7 @@
 	nop
 	/* Loongson-3A R2/R3 */
 	andi	t0, (PRID_IMP_MASK | PRID_REV_MASK)
-	slti	t0, (PRID_IMP_LOONGSON_64C | PRID_REV_LOONGSON3A_R2_0)
+	slti	t0, t0, (PRID_IMP_LOONGSON_64C | PRID_REV_LOONGSON3A_R2_0)
 	bnez	t0, 2f
 	nop
 1:

base-commit: 0fcfb00b28c0b7884635dacf38e46d60bf3d4eb1
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] MIPS: Loongson64: Use three arguments for slti
  2021-12-08 16:56 [PATCH v2] MIPS: Loongson64: Use three arguments for slti Nathan Chancellor
@ 2021-12-09  9:31 ` Thomas Bogendoerfer
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Bogendoerfer @ 2021-12-09  9:31 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Huacai Chen, Jiaxun Yang, Nick Desaulniers, Sergey Shtylyov,
	linux-mips, linux-kernel, llvm, Ryutaroh Matsumoto

On Wed, Dec 08, 2021 at 09:56:17AM -0700, Nathan Chancellor wrote:
> LLVM's integrated assembler does not support 'slti <reg>, <imm>':
> 
> <instantiation>:16:12: error: invalid operand for instruction
>  slti $12, (0x6300 | 0x0008)
>            ^
> arch/mips/kernel/head.S:86:2: note: while in macro instantiation
>  kernel_entry_setup # cpu specific setup
>  ^
> <instantiation>:16:12: error: invalid operand for instruction
>  slti $12, (0x6300 | 0x0008)
>            ^
> arch/mips/kernel/head.S:150:2: note: while in macro instantiation
>  smp_slave_setup
>  ^
> 
> To increase compatibility with LLVM's integrated assembler, use the full
> form of 'slti <reg>, <reg>, <imm>', which matches the rest of
> arch/mips/. This does not result in any change for GNU as.
> 
> Link: https://github.com/ClangBuiltLinux/linux/issues/1526
> Reported-by: Ryutaroh Matsumoto <ryutaroh@ict.e.titech.ac.jp>
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> ---
> 
> v1 -> v2: https://lore.kernel.org/r/20211207170129.578089-1-nathan@kernel.org/
> 
> * Fix typos in commit message ("stli" -> "slti") [Sergey]
> 
>  arch/mips/include/asm/mach-loongson64/kernel-entry-init.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

applied to mips-next.

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-12-09  9:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-08 16:56 [PATCH v2] MIPS: Loongson64: Use three arguments for slti Nathan Chancellor
2021-12-09  9:31 ` Thomas Bogendoerfer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).