#17749: GMP-ECM using deprecated asm syntax on mips architecture
----------------------------------+----------------------------
   Reporter:  etn40ff             |            Owner:
       Type:  defect              |           Status:  new
   Priority:  major               |        Milestone:  sage-6.5
  Component:  packages: standard  |         Keywords:  GMP-ECM
  Merged in:                      |          Authors:
  Reviewers:                      |  Report Upstream:  N/A
Work issues:                      |           Branch:
     Commit:                      |     Dependencies:
   Stopgaps:                      |
----------------------------------+----------------------------
 According to GCC 4.4 release notes:

 """
 The MIPS port no longer recognizes the h asm constraint. It was necessary
 to remove this constraint in order to avoid generating unpredictable code
 sequences.
 One of the main uses of the h constraint was to extract the high part of a
 multiplication on 64-bit targets. For example:
 {{{
     asm ("dmultu\t%1,%2" : "=h" (result) : "r" (x), "r" (y));
 }}}
 You can now achieve the same effect using 128-bit types:
 {{{
     typedef unsigned int uint128_t __attribute__((mode(TI)));
     result = ((uint128_t) x * y) >> 64;
 }}}
 The second sequence is better in many ways. For example, if x and y are
 constants, the compiler can perform the multiplication at compile time. If
 x and y are not constants, the compiler can schedule the runtime
 multiplication better than it can schedule an asm statement.
 """

 Unfortunately the latest version of GMP-ECM still uses this construction
 making it impossible to build on mips:

 {{{
 ...
 In file included from sp.h:90:0,
                  from sp.c:23:
 sp.c: In function 'sp_spp':
 longlong.h:936:3: error: impossible constraint in 'asm'
    __asm__ ("multu %2,%3" : "=l" (w0), "=h" (w1) : "d" (u), "d" (v))
    ^
 sp.h:425:3: note: in expansion of macro 'umul_ppmm'
    umul_ppmm (u, v, x, y);
    ^
 longlong.h:936:3: error: impossible constraint in 'asm'
    __asm__ ("multu %2,%3" : "=l" (w0), "=h" (w1) : "d" (u), "d" (v))
    ^
 sp.h:406:3: note: in expansion of macro 'umul_ppmm'
    umul_ppmm (q2, tmp, q1, di);
    ^
 longlong.h:936:3: error: impossible constraint in 'asm'
    __asm__ ("multu %2,%3" : "=l" (w0), "=h" (w1) : "d" (u), "d" (v))
    ^
 sp.h:407:3: note: in expansion of macro 'umul_ppmm'
    umul_ppmm (dqh, dql, q2, d);
    ^
 longlong.h:936:3: error: impossible constraint in 'asm'
    __asm__ ("multu %2,%3" : "=l" (w0), "=h" (w1) : "d" (u), "d" (v))
    ^
 sp.h:434:3: note: in expansion of macro 'umul_ppmm'
    umul_ppmm (u, v, x, x);
    ^
 longlong.h:936:3: error: impossible constraint in 'asm'
    __asm__ ("multu %2,%3" : "=l" (w0), "=h" (w1) : "d" (u), "d" (v))
    ^
 sp.h:406:3: note: in expansion of macro 'umul_ppmm'
    umul_ppmm (q2, tmp, q1, di);
    ^
 longlong.h:936:3: error: impossible constraint in 'asm'
    __asm__ ("multu %2,%3" : "=l" (w0), "=h" (w1) : "d" (u), "d" (v))
    ^
 sp.h:407:3: note: in expansion of macro 'umul_ppmm'
    umul_ppmm (dqh, dql, q2, d);
    ^
 longlong.h:936:3: error: impossible constraint in 'asm'
    __asm__ ("multu %2,%3" : "=l" (w0), "=h" (w1) : "d" (u), "d" (v))
    ^
 sp.h:434:3: note: in expansion of macro 'umul_ppmm'
    umul_ppmm (u, v, x, x);
    ^
 longlong.h:936:3: error: impossible constraint in 'asm'
    __asm__ ("multu %2,%3" : "=l" (w0), "=h" (w1) : "d" (u), "d" (v))
    ^
 sp.h:406:3: note: in expansion of macro 'umul_ppmm'
    umul_ppmm (q2, tmp, q1, di);
    ^
 longlong.h:936:3: error: impossible constraint in 'asm'
    __asm__ ("multu %2,%3" : "=l" (w0), "=h" (w1) : "d" (u), "d" (v))
    ^
 sp.h:407:3: note: in expansion of macro 'umul_ppmm'
    umul_ppmm (dqh, dql, q2, d);
    ^
 ...
 }}}

--
Ticket URL: <http://trac.sagemath.org/ticket/17749>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to