LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] MPILIB: avoid assembler warning
@ 2015-01-28 16:24 Arnd Bergmann
  2015-01-28 16:42 ` David Howells
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2015-01-28 16:24 UTC (permalink / raw)
  To: Dmitry Kasatkin, David Howells, Andrew Morton
  Cc: linux-kernel, linux-arm-kernel, linux-crypto, Herbert Xu,
	David S. Miller

A wrapper around the umull assembly instruction might reuse
the input register as an output, which is undefined on
some ARM machines, as pointed out by this assembler warning:

  CC      lib/mpi/generic_mpih-mul1.o
/tmp/ccxJuxIy.s: Assembler messages:
/tmp/ccxJuxIy.s:53: rdhi, rdlo and rm must all be different
  CC      lib/mpi/generic_mpih-mul2.o
/tmp/ccI0scAD.s: Assembler messages:
/tmp/ccI0scAD.s:53: rdhi, rdlo and rm must all be different
  CC      lib/mpi/generic_mpih-mul3.o
/tmp/ccMvVQcp.s: Assembler messages:
/tmp/ccMvVQcp.s:53: rdhi, rdlo and rm must all be different

This changes the constraints to force different registers to
be used as output.

Signed-off-by: Arnd Bergmann <arnd@arnd.de>
---
Not sure who would be the best person to pick this patch up.

diff --git a/lib/mpi/longlong.h b/lib/mpi/longlong.h
index aac511417ad1..c4dbdb506174 100644
--- a/lib/mpi/longlong.h
+++ b/lib/mpi/longlong.h
@@ -216,7 +216,7 @@ extern UDItype __udiv_qrnnd(UDItype *, UDItype, UDItype, UDItype);
 	__asm__ ("%@ Inlined umul_ppmm\n" \
 		"umull %r1, %r0, %r2, %r3" \
 	: "=&r" ((USItype)(xh)), \
-			"=r" ((USItype)(xl)) \
+			"=&r" ((USItype)(xl)) \
 	: "r" ((USItype)(a)), \
 			"r" ((USItype)(b)) \
 	: "r0", "r1")


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

* Re: [PATCH] MPILIB: avoid assembler warning
  2015-01-28 16:24 [PATCH] MPILIB: avoid assembler warning Arnd Bergmann
@ 2015-01-28 16:42 ` David Howells
  0 siblings, 0 replies; 2+ messages in thread
From: David Howells @ 2015-01-28 16:42 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: dhowells, Dmitry Kasatkin, Andrew Morton, linux-kernel,
	linux-arm-kernel, linux-crypto, Herbert Xu, David S. Miller

Arnd Bergmann <arnd@arndb.de> wrote:

> Not sure who would be the best person to pick this patch up.

I can pick it up, but I wonder if the MPI asm bits should be distributed to
asm/mpilib.h headers rather than being in the lib/ directory.

David

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

end of thread, other threads:[~2015-01-28 21:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-28 16:24 [PATCH] MPILIB: avoid assembler warning Arnd Bergmann
2015-01-28 16:42 ` David Howells

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).