result <- RC + ~(RA * RB) + CARRY
gives wrong results
// Multiply and subtract.
k = 0;
+#ifdef ORIGINAL
for (i = 0; i < n; i++) {
p = qhat*vn[i];
t = un[i+j] - k - (p & 0xFFFFFFFFLL);
un[i+j] = t;
k = (p >> 32) - (t >> 32);
}
+#else
+ for (i = 0; i < n; i++) {
+ unsigned rhi;
+ unsigned long long sum;
+ p = ((unsigned long long)un[i+j])+ ~(qhat*vn[i]) + k;
+ rhi = (p >> 32);
+ if (((unsigned long long)k) <= 1) rhi += 1;
+ k = rhi;
+ un[i+j] = sum & 0xffffffff;
+ }
+#endif
t = un[j+n] - k;
un[j+n] = t;