[SCM] Debian packaging for libntl - Number Theory Library branch, master, updated. 725690a74333b49e1096467192cc414183237986

Bernhard R. Link brlink at debian.org
Fri Feb 3 21:15:29 UTC 2012


The following commit has been merged in the master branch:
commit 167bf8e15c7475babc0782c2fe8b3af5bcf1ddbd
Author: Aurelien Jarno <aurel32 at debian.org>
Date:   Sun Apr 17 23:41:31 2011 +0200

    gcc-4.5-mips
    
    Bug-Debian: 623162
    
    Since GCC 4.4 it's not possible anymore to use the 'h' constraints for
    MIPS inline assembly code when doing a multiplication. That's why sprng
    fails to build from source on mips and mipsel.
    
    That said GCC supports 32x32 => 64 multiplication on 32-bit architecture
    for a lot of time, so there is no need to use assembly code for that.
    The patch below fixes the problem by using standard multiplication
    instead of assembly code. I have also included the code for MIPS64 using
    128-bit hints for reference (the second hunk), though it is not used in
    Debian.

diff --git a/include/NTL/SPMM_ASM.h b/include/NTL/SPMM_ASM.h
index dc0bfb9..9ff7942 100644
--- a/include/NTL/SPMM_ASM.h
+++ b/include/NTL/SPMM_ASM.h
@@ -147,8 +147,8 @@ static inline unsigned long MulHiUL(unsigned long a, unsigned long b)
 
 static inline unsigned long MulHiUL(unsigned long a, unsigned long b)
 {
-   unsigned long hi, lo;
-   __asm__ ("multu %2,%3" : "=l" (lo), "=h" (hi) : "d" (a), "d" (b));
+   unsigned long hi;
+   hi = ((unsigned long long) a * b) >> 32;
    return hi;
 } 
 
@@ -159,8 +159,9 @@ static inline unsigned long MulHiUL(unsigned long a, unsigned long b)
 
 static inline unsigned long MulHiUL(unsigned long a, unsigned long b)
 {
-   unsigned long hi, lo;
-   __asm__ ("dmultu %2,%3" : "=l" (lo), "=h" (hi) : "d" (a), "d" (b));
+   typedef unsigned int uint128_t __attribute__((mode(TI)));
+   unsigned long hi;
+   hi = ((uint128_t) a * b) >> 64;
    return hi;
 }
 

-- 
Debian packaging for libntl - Number Theory Library



More information about the debian-science-commits mailing list