diff mbox

[1/2] lib/mpi: avoid assembler warning

Message ID 1456490794-1034544-1-git-send-email-arnd@arndb.de (mailing list archive)
State Accepted
Delegated to: Herbert Xu
Headers show

Commit Message

Arnd Bergmann Feb. 26, 2016, 12:46 p.m. UTC
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@arndb.de>
---
 lib/mpi/longlong.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Herbert Xu Feb. 27, 2016, 7:35 p.m. UTC | #1
On Fri, Feb 26, 2016 at 01:46:26PM +0100, Arnd Bergmann wrote:
> 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@arndb.de>

Both applied.
diff mbox

Patch

diff --git a/lib/mpi/longlong.h b/lib/mpi/longlong.h
index b90e255c2a68..93336502af08 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")