From 40fe2b02db38119e05d3fef3943125aa45113602 Mon Sep 17 00:00:00 2001
From: Paul Bakker
Date: Wed, 8 Jul 2009 19:49:01 +0000
Subject: [PATCH] - Fixed clobberlist of asm command. (Required for correct
handling of coverage testing)
---
include/polarssl/bn_mul.h | 23 ++++++++++++-----------
1 file changed, 12 insertions(+), 11 deletions(-)
diff --git a/include/polarssl/bn_mul.h b/include/polarssl/bn_mul.h
index d4ea7bdb4..676c448f8 100644
--- a/include/polarssl/bn_mul.h
+++ b/include/polarssl/bn_mul.h
@@ -50,15 +50,17 @@
asm( "movl %0, %%ecx " :: "m" (c)); \
asm( "movl %0, %%ebx " :: "m" (b));
-#define MULADDC_CORE \
- asm( "lodsl " ); \
- asm( "mull %ebx " ); \
- asm( "addl %ecx, %eax " ); \
- asm( "adcl $0, %edx " ); \
- asm( "addl (%edi), %eax " ); \
- asm( "adcl $0, %edx " ); \
- asm( "movl %edx, %ecx " ); \
- asm( "stosl " );
+#define MULADDC_CORE \
+ asm( " \
+ lodsl; \
+ mull %%ebx; \
+ addl %%ecx, %%eax; \
+ adcl $0, %%edx; \
+ addl (%%edi), %%eax; \
+ adcl $0, %%edx; \
+ movl %%edx, %%ecx; \
+ stosl; " ::: \
+ "%eax", "%ebx", "%ecx", "%edx", "%edi", "esi");
#if defined(POLARSSL_HAVE_SSE2)
@@ -139,8 +141,7 @@
asm( "movl %0, %%ebx " :: "m" (t)); \
asm( "movl %%ecx, %0 " : "=m" (c)); \
asm( "movl %%edi, %0 " : "=m" (d)); \
- asm( "movl %%esi, %0 " : "=m" (s) :: \
- "eax", "ecx", "edx", "esi", "edi" );
+ asm( "movl %%esi, %0 " : "=m" (s));
#endif /* SSE2 */
#endif /* i386 */