summaryrefslogtreecommitdiff
path: root/05/util.b
diff options
context:
space:
mode:
Diffstat (limited to '05/util.b')
-rw-r--r--05/util.b5
1 files changed, 5 insertions, 0 deletions
diff --git a/05/util.b b/05/util.b
index 5f7c5e6..25ce686 100644
--- a/05/util.b
+++ b/05/util.b
@@ -5,6 +5,11 @@ function sign_extend_32_to_64
n |= c * 0xffffffff00000000
return n
+; round up to nearest multiple of 8
+function round_up_to_8
+ argument n
+ n += 7
+ return n & 0xfffffffffffffff8
; multiply two 64-bit signed numbers to a 128-bit number
function full_multiply_signed