Skip to content
Snippets Groups Projects
Commit 27df38c2 authored by Sylvain Henry's avatar Sylvain Henry Committed by Ben Gamari
Browse files

JS: better implementation for plusWord64 (#23597)

(cherry picked from commit b55a8ea7)
parent e0fbb1d4
No related tags found
No related merge requests found
...@@ -60,11 +60,11 @@ function h$hs_minusWord64(h1,l1,h2,l2) { ...@@ -60,11 +60,11 @@ function h$hs_minusWord64(h1,l1,h2,l2) {
} }
function h$hs_plusWord64(h1,l1,h2,l2) { function h$hs_plusWord64(h1,l1,h2,l2) {
var a = W64(h1,l1); var l = l1+l2;
var b = W64(h2,l2); var rl = l>>>0;
var r = BigInt.asUintN(64, a + b); var rh = (h1+h2+(l!=rl?1:0))>>>0;
TRACE_ARITH("Word64: " + a + " + " + b + " ==> " + r) TRACE_ARITH("Word64: " + (h1,l1) + " + " + (h2,l2) + " ==> " + (rh,rl))
RETURN_W64(r); RETURN_UBX_TUP2(rh,rl);
} }
function h$hs_timesInt64(h1,l1,h2,l2) { function h$hs_timesInt64(h1,l1,h2,l2) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment