Changeset f0af17 in git for libpolys/coeffs


Ignore:
Timestamp:
Apr 12, 2013, 12:29:11 PM (11 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
80f146cd522414ce52432c92dfa9773f1a0952d4
Parents:
b1d1ab3d52a1e071ff9951a82b411435d01f77b4
Message:
fix: work around aggressive optimizations (syModStd)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpolys/coeffs/modulop.h

    rb1d1ab3 rf0af17  
    117117static inline number npAddM(number a, number b, const coeffs r)
    118118{
    119   long R = (long)a + (long)b;
     119  unsigned long R = (unsigned long)a + (unsigned long)b;
    120120  return (number)(R >= r->ch ? R - r->ch : R);
    121121}
     
    128128static inline number npAddM(number a, number b, const coeffs r)
    129129{
    130    long res = ((long)a + (long)b);
     130   unsigned long res = (long)((unsigned long)a + (unsigned long)b);
    131131   res -= r->ch;
    132132#if SIZEOF_LONG == 8
    133    res += (res >> 63) & r->ch;
     133   res += ((long)res >> 63) & r->ch;
    134134#else
    135    res += (res >> 31) & r->ch;
     135   res += ((long)res >> 31) & r->ch;
    136136#endif
    137137   return (number)res;
Note: See TracChangeset for help on using the changeset viewer.