[Gmp-commit] /var/hg/gmp: 2 new changesets

mercurial at gmplib.org mercurial at gmplib.org
Sat Jan 5 20:12:18 CET 2013


details:   /var/hg/gmp/rev/187b7b1646ee
changeset: 15235:187b7b1646ee
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Sat Jan 05 20:12:01 2013 +0100
description:
(aarch64): Make add_ssaaaa and sub_ddmmss actually work.

details:   /var/hg/gmp/rev/2ef43d173ab0
changeset: 15236:2ef43d173ab0
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Sat Jan 05 20:12:13 2013 +0100
description:
ChangeLog

diffstat:

 ChangeLog  |   4 ++++
 longlong.h |  21 +++++++--------------
 2 files changed, 11 insertions(+), 14 deletions(-)

diffs (45 lines):

diff -r 87a24013e9ee -r 2ef43d173ab0 ChangeLog
--- a/ChangeLog	Fri Jan 04 16:32:01 2013 +0100
+++ b/ChangeLog	Sat Jan 05 20:12:13 2013 +0100
@@ -1,3 +1,7 @@
+2013-01-05  Torbjorn Granlund  <tege at gmplib.org>
+
+	* longlong.h (aarch64): Make add_ssaaaa and sub_ddmmss actually work.
+
 2013-01-04 Marco Bodrato <bodrato at mail.dm.unipi.it>
 
 	From shuax:
diff -r 87a24013e9ee -r 2ef43d173ab0 longlong.h
--- a/longlong.h	Fri Jan 04 16:32:01 2013 +0100
+++ b/longlong.h	Sat Jan 05 20:12:13 2013 +0100
@@ -530,23 +530,16 @@
 #endif /* __arm__ */
 
 #if defined (__aarch64__) && W_TYPE_SIZE == 64
+/* FIXME: Extend the immediate range for the low word by using both
+   ADDS and SUBS, since they set carry in the same way.  */
 #define add_ssaaaa(sh, sl, ah, al, bh, bl) \
-  __asm__ ("adds\t%1, %4, %5\n\tadc\t%0, %2, %3"			\
+  __asm__ ("adds\t%1, %x4, %5\n\tadc\t%0, %x2, %x3"			\
 	   : "=r" (sh), "=&r" (sl)					\
-	   : "r" (ah), "rZ" (bh), "%r" (al), "rI" (bl) __CLOBBER_CC)
+	   : "rZ" (ah), "rZ" (bh), "%r" (al), "rI" (bl) __CLOBBER_CC)
 #define sub_ddmmss(sh, sl, ah, al, bh, bl) \
-  do {									\
-    if (__builtin_constant_p (bl))					\
-      {									\
-	__asm__ ("subs\t%1, %4, %5\n\tsbc\t%0, %2, %3"			\
-		 : "=r" (sh), "=&r" (sl)				\
-		 : "r" (ah), "r" (bh), "r" (al), "rI" (bl) __CLOBBER_CC); \
-      }									\
-    else /* only bh might be a constant */				\
-      __asm__ ("subs\t%1, %4, %5\n\tsbc\t%0, %2, %3"			\
-	       : "=r" (sh), "=&r" (sl)					\
-	       : "r" (ah), "rZ" (bh), "r" (al), "rI" (bl) __CLOBBER_CC);\
-    } while (0)
+  __asm__ ("subs\t%1, %x4, %5\n\tsbc\t%0, %x2, %x3"			\
+	   : "=r,r" (sh), "=&r,&r" (sl)					\
+	   : "rZ,rZ" (ah), "rZ,rZ" (bh), "r,Z" (al), "rI,r" (bl) __CLOBBER_CC)
 #define umul_ppmm(ph, pl, m0, m1) \
   do {									\
     UDItype __m0 = (m0), __m1 = (m1);					\


More information about the gmp-commit mailing list