Changeset 727 for trunk/lib


Ignore:
Timestamp:
Nov 28, 2010, 5:25:40 PM (9 years ago)
Author:
cameron
Message:

Fix ADC64 version of double_int64_sbb

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/block_carry.h

    r726 r727  
    7070
    7171#define double_int64_adc(x1, x2, y1, y2, rslt1, rslt2, carry) \
    72    __asm__ __volatile__ ("add %[carryin], %[z1]\n\t" \
     72   __asm__ __volatile__ ("neg %[carryin]\n\t" \
    7373         "adc %[e1], %[z1]\n\t" \
    7474         "adc %[e2], %[z2]\n\t" \
     
    122122} while(0)
    123123
    124 
    125 #define double_int64_sbb(x1, x2, y1, y2, rslt1, rslt2, borrow) \
    126    __asm__ __volatile__ ("sub %[borrowin], %[z1]\n\t" \
    127          "sbb %[e1], %[z1]\n\t" \
    128          "sbb %[e2], %[z2]\n\t" \
    129          "mov $0, %[borrowout]\n\t" \
    130          "adc $0, %[borrowout]\n\t" \
    131          : [z1] "=a" (rslt1), [z2] "=r" (rslt2), [borrowout] "=r" (borrow) \
    132          : "0" (y1), "1" (y2), [borrowin] "2" (borrow), \
    133                    [e1] "b" (x1), [e2] "r" (x2)\
    134          : "cc")
    135 
     124#define double_int64_sbb(x1, x2, y1, y2, rslt1, rslt2, brw) \
     125  __asm__  ("neg %[borrowflag]\n\t" \
     126        "sbb %[e1], %[z1]\n\t" \
     127        "sbb %[e2], %[z2]\n\t" \
     128         "mov $0, %[borrowflag]\n\t" \
     129         "sbb $0, %[borrowflag]\n\t" \
     130     : [z1] "=r" (rslt1), [z2] "=r" (rslt2), [borrowflag] "=a" (brw) \
     131         : "[z1]" (x1), "[z2]" (x2), \
     132           [e1] "r" (y1), [e2] "r" (y2), \
     133           "[borrowflag]" (brw) \
     134         : "cc")
    136135
    137136#define sbb128(first, second, borrow, diff) \
     
    144143  diff = rslt.bitblock;\
    145144} while(0)
     145
    146146
    147147#endif
Note: See TracChangeset for help on using the changeset viewer.