Changeset 447
 Timestamp:
 Jul 7, 2010, 6:15:39 PM (9 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

proto/parabix2/compiled/template.c
r442 r447 78 78 } \ 79 79 80 #define double_int64_adc(x1, x2, y1, y2, rslt1, rslt2, carry) \81 __asm__ ("sahf\n\t" \82 "adc %[e1], %[z1]\n\t" \83 "adc %[e2], %[z2]\n\t" \84 "lahf\n\t" \85 : [z1] "=r" (rslt1), [z2] "=r" (rslt2), [carryflag] "=a" (carry) \86 : "[z1]" (x1), "[z2]" (x2), \87 [e1] "r" (y1), [e2] "r" (y2), \88 "[carryflag]" (carry) \89 : "cc")90 91 #define adc128(first, second, carry, sum) \92 do\93 {\94 union {__m128i bitblock;\95 uint64_t int64[2];} rslt;\96 \97 union {__m128i bitblock;\98 uint64_t int64[2];} x;\99 \100 union {__m128i bitblock;\101 uint64_t int64[2];} y;\102 \103 x.bitblock = first;\104 y.bitblock = second;\105 \106 double_int64_adc(x.int64[0], x.int64[1], y.int64[0], y.int64[1], rslt.int64[0], rslt.int64[1], carry);\107 sum = rslt.bitblock;\108 }while(0)109 110 111 112 #define double_int64_sbb(x1, x2, y1, y2, rslt1, rslt2, carry) \113 __asm__ ("sahf\n\t" \114 "sbb %[e1], %[z1]\n\t" \115 "sbb %[e2], %[z2]\n\t" \116 "lahf\n\t" \117 : [z1] "=r" (rslt1), [z2] "=r" (rslt2), [carryflag] "=a" (carry) \118 : "[z1]" (x1), "[z2]" (x2), \119 [e1] "r" (y1), [e2] "r" (y2), \120 "[carryflag]" (carry) \121 : "cc")122 123 #define sbb128(first, second, carry, sum) \124 do\125 { union {__m128i bitblock;\126 uint64_t int64[2];} rslt;\127 \128 union {__m128i bitblock;\129 uint64_t int64[2];} x;\130 \131 union {__m128i bitblock;\132 uint64_t int64[2];} y;\133 \134 x.bitblock = first;\135 y.bitblock = second;\136 \137 double_int64_sbb(x.int64[0], x.int64[1], y.int64[0], y.int64[1], \138 rslt.int64[0], rslt.int64[1], carry);\139 sum = rslt.bitblock;\140 }while(0)141 142 80 143 81 #define BUFFER_SIZE 12800
Note: See TracChangeset
for help on using the changeset viewer.