diff options
author | lloyd <[email protected]> | 2006-06-06 15:13:50 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2006-06-06 15:13:50 +0000 |
commit | 69df9ac7fdaf575474e3904e08ad6974d06e9379 (patch) | |
tree | fb82a241935f21abdd354d3c9e7455ecb55b43cb /src | |
parent | d3522b3622ac4aad18215bc173f9e26953c6cc3d (diff) |
Revert the last change; it turned out to require a bunch of changes to the
assembly code in order to handle the argument aliasing correctly, and it
seems I don't understand GCC's extended asm syntax well enough to figure
out how to get it work in a way that isn't hideous.
Diffstat (limited to 'src')
-rw-r--r-- | src/mp_asm.cpp | 8 | ||||
-rw-r--r-- | src/mp_misc.cpp | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/mp_asm.cpp b/src/mp_asm.cpp index ef8292083..ec2e31011 100644 --- a/src/mp_asm.cpp +++ b/src/mp_asm.cpp @@ -148,7 +148,7 @@ void bigint_linmul2(word x[], u32bit x_size, word y) carry = word8_linmul2(x + j, y, carry); for(u32bit j = blocks; j != x_size; ++j) - x[j] = word_madd2(x[j], y, &carry); + x[j] = word_madd2(x[j], y, carry, &carry); x[x_size] = carry; } @@ -166,7 +166,7 @@ void bigint_linmul3(word z[], const word x[], u32bit x_size, word y) carry = word8_linmul3(z + j, x + j, y, carry); for(u32bit j = blocks; j != x_size; ++j) - z[j] = word_madd2(x[j], y, &carry); + z[j] = word_madd2(x[j], y, carry, &carry); z[x_size] = carry; } @@ -190,7 +190,7 @@ void bigint_simple_mul(word z[], const word x[], u32bit x_size, carry = word8_madd3(z + j + k, y + k, x_j, carry); for(u32bit k = blocks; k != y_size; ++k) - z[j+k] = word_madd3(x_j, y[k], z[j+k], &carry); + z[j+k] = word_madd3(x_j, y[k], z[j+k], carry, &carry); z[j+y_size] = carry; } @@ -215,7 +215,7 @@ void montgomery_reduce(word z[], u32bit z_size, carry = word8_madd3(z_j + k, x + k, y, carry); for(u32bit k = blocks; k != x_size; ++k) - z_j[k] = word_madd3(x[k], y, z_j[k], &carry); + z_j[k] = word_madd3(x[k], y, z_j[k], carry, &carry); word carry2 = 0; z_j[x_size] = word_add(z_j[x_size], carry, &carry2); diff --git a/src/mp_misc.cpp b/src/mp_misc.cpp index 782ad9d15..f551948b7 100644 --- a/src/mp_misc.cpp +++ b/src/mp_misc.cpp @@ -17,8 +17,8 @@ u32bit bigint_divcore(word q, word y1, word y2, word x1, word x2, word x3) { word y0 = 0; - y2 = word_madd2(q, y2, &y0); - y1 = word_madd2(q, y1, &y0); + y2 = word_madd2(q, y2, y0, &y0); + y1 = word_madd2(q, y1, y0, &y0); if(y0 > x1) return 1; if(y0 < x1) return 0; @@ -80,8 +80,8 @@ word bigint_divop(word n1, word n0, word d) word bigint_modop(word n1, word n0, word d) { word z = bigint_divop(n1, n0, d); - word carry = 0; - z = word_madd2(z, d, &carry); + word dummy = 0; + z = word_madd2(z, d, dummy, &dummy); return (n0-z); } |