Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 70dff4d9 authored by Paul Burton's avatar Paul Burton Committed by Ralf Baechle
Browse files

MIPS: fix read_msa_* & write_msa_* functions on non-MSA toolchains



Commit d96cc3d1 "MIPS: Add microMIPS MSA support." attempted to use
the value of a macro within an inline asm statement but instead emitted
a comment leading to the cfcmsa & ctcmsa instructions being omitted. Fix
that by passing CFC_MSA_INSN & CTC_MSA_INSN as arguments to the asm
statements.

Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/7305/


Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 732c0c3c
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -115,10 +115,10 @@ static inline unsigned int read_msa_##name(void) \
	"	.set	push\n"					\
	"	.set	push\n"					\
	"	.set	noat\n"					\
	"	.set	noat\n"					\
	"	.insn\n"					\
	"	.insn\n"					\
	"	.word	#CFC_MSA_INSN | (" #cs " << 11)\n"	\
	"	.word	%1 | (" #cs " << 11)\n"			\
	"	move	%0, $1\n"				\
	"	move	%0, $1\n"				\
	"	.set	pop\n"					\
	"	.set	pop\n"					\
	: "=r"(reg));						\
	: "=r"(reg) : "i"(CFC_MSA_INSN));			\
	return reg;						\
	return reg;						\
}								\
}								\
								\
								\
@@ -129,9 +129,9 @@ static inline void write_msa_##name(unsigned int val) \
	"	.set	noat\n"					\
	"	.set	noat\n"					\
	"	move	$1, %0\n"				\
	"	move	$1, %0\n"				\
	"	.insn\n"					\
	"	.insn\n"					\
	"	.word	#CTC_MSA_INSN | (" #cs " << 6)\n"	\
	"	.word	%1 | (" #cs " << 6)\n"			\
	"	.set	pop\n"					\
	"	.set	pop\n"					\
	: : "r"(val));						\
	: : "r"(val), "i"(CTC_MSA_INSN));			\
}
}


#endif /* !TOOLCHAIN_SUPPORTS_MSA */
#endif /* !TOOLCHAIN_SUPPORTS_MSA */