aboutsummaryrefslogtreecommitdiffstats
path: root/runtime/c/i64.h
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>2016-10-04 15:52:16 +0200
committerXavier Leroy <xavier.leroy@inria.fr>2016-10-04 15:52:16 +0200
commitd2af79a77ed2936ff0ed90cadf8e48637d774d4c (patch)
tree09300943e12a98ae80598c79d455b31725271ead /runtime/c/i64.h
parenta44893028eb1dd434c68001234ad56d030205a8e (diff)
downloadcompcert-d2af79a77ed2936ff0ed90cadf8e48637d774d4c.tar.gz
compcert-d2af79a77ed2936ff0ed90cadf8e48637d774d4c.zip
Turn 64-bit integer division and modulus by constants into multiply-high
This trick was already implemented for 32-bit integer division and modulus. Here we extend it to the 64-bit case. For 32-bit target processors, the runtime library must implement 64-bit multiply-high (signed and unsigned). Tentative implementations are provided for IA32 and PowerPC, but need testing.
Diffstat (limited to 'runtime/c/i64.h')
-rw-r--r--runtime/c/i64.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/runtime/c/i64.h b/runtime/c/i64.h
index dd584533..a75214fe 100644
--- a/runtime/c/i64.h
+++ b/runtime/c/i64.h
@@ -41,3 +41,5 @@ extern signed long long __i64_sar(signed long long x, int amount);
extern unsigned long long __i64_udivmod(unsigned long long n,
unsigned long long d,
unsigned long long * rp);
+extern unsigned long long __i64_umulh(unsigned long long u,
+ unsigned long long v);