[git] GCRYPT - branch, master, updated. libgcrypt-1.5.0-416-g85bb0a9
    by Jussi Kivilinna 
    cvs at cvs.gnupg.org
       
    Wed Dec  4 17:23:07 CET 2013
    
    
  
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU crypto library".
The branch, master has been updated
       via  85bb0a98ea5add0296cbcc415d557eaa1f6bd294 (commit)
      from  c56080c26186d25dec05f01831494c77d8d07e13 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 85bb0a98ea5add0296cbcc415d557eaa1f6bd294
Author: Jussi Kivilinna <jussi.kivilinna at iki.fi>
Date:   Wed Dec 4 18:17:22 2013 +0200
    mpi: add inline assembly for x86-64
    
    * mpi/longlong.h [__x86_64] (add_ssaaaa, sub_ddmmss, umul_ppmm)
    (udiv_qrnnd, count_leading_zeros, count_trailing_zeros): New.
    --
    
    Signed-off-by: Jussi Kivilinna <jussi.kivilinna at iki.fi>
diff --git a/mpi/longlong.h b/mpi/longlong.h
index 8dd8fe8..4f33937 100644
--- a/mpi/longlong.h
+++ b/mpi/longlong.h
@@ -555,6 +555,69 @@ extern USItype __udiv_qrnnd ();
 #endif
 #endif /* 80x86 */
 
+/***************************************
+ *********** AMD64 / x86-64 ************
+ ***************************************/
+#if defined(__x86_64) && W_TYPE_SIZE == 64
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+  __asm__ ("addq %5,%1\n"                                               \
+	   "adcq %3,%0"                                                 \
+	   : "=r" ((sh)),                                               \
+	     "=&r" ((sl))                                               \
+	   : "0" ((UDItype)(ah)),                                       \
+	     "g"  ((UDItype)(bh)),                                      \
+	     "1" ((UDItype)(al)),                                       \
+	     "g"  ((UDItype)(bl))                                       \
+	   __CLOBBER_CC)
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+  __asm__ ("subq %5,%1\n"                                               \
+	   "sbbq %3,%0"                                                 \
+	   : "=r" ((sh)),                                               \
+	     "=&r" ((sl))                                               \
+	   : "0" ((UDItype)(ah)),                                       \
+	     "g" ((UDItype)(bh)),                                       \
+	     "1" ((UDItype)(al)),                                       \
+	     "g" ((UDItype)(bl))                                        \
+	   __CLOBBER_CC)
+#define umul_ppmm(w1, w0, u, v) \
+  __asm__ ("mulq %3"                                                    \
+	   : "=a" ((w0)),                                               \
+	     "=d" ((w1))                                                \
+	   : "0" ((UDItype)(u)),                                        \
+	     "rm" ((UDItype)(v))                                        \
+	   __CLOBBER_CC)
+#define udiv_qrnnd(q, r, n1, n0, d) \
+  __asm__ ("divq %4"                                                    \
+	   : "=a" ((q)),                                                \
+	     "=d" ((r))                                                 \
+	   : "0" ((UDItype)(n0)),                                       \
+	     "1" ((UDItype)(n1)),                                       \
+	     "rm" ((UDItype)(d))                                        \
+	   __CLOBBER_CC)
+#define count_leading_zeros(count, x) \
+  do {                                                                  \
+    UDItype __cbtmp;                                                    \
+    __asm__ ("bsrq %1,%0"                                               \
+             : "=r" (__cbtmp) : "rm" ((UDItype)(x))                     \
+             __CLOBBER_CC);                                             \
+    (count) = __cbtmp ^ 63;                                             \
+  } while (0)
+#define count_trailing_zeros(count, x) \
+  do {                                                                  \
+    UDItype __cbtmp;                                                    \
+    __asm__ ("bsfq %1,%0"                                               \
+             : "=r" (__cbtmp) : "rm" ((UDItype)(x))                     \
+             __CLOBBER_CC);                                             \
+    (count) = __cbtmp;                                                  \
+  } while (0)
+#ifndef UMUL_TIME
+#define UMUL_TIME 40
+#endif
+#ifndef UDIV_TIME
+#define UDIV_TIME 40
+#endif
+#endif /* __x86_64 */
+
 
 /***************************************
  **************  I860  *****************
-----------------------------------------------------------------------
Summary of changes:
 mpi/longlong.h |   63 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 63 insertions(+)
hooks/post-receive
-- 
The GNU crypto library
http://git.gnupg.org
_______________________________________________
Gnupg-commits mailing list
Gnupg-commits at gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-commits
    
    
More information about the Gcrypt-devel
mailing list