ref: 8b6f2a9391cf8ca1d8cc4069c887bd8d15c186fe
parent: 86ee994f7a815da62e1109b197aaa2bd7d01404f
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Tue Nov 19 04:39:35 EST 2024
mp: use 64-bit mpdigit on 64-bit platforms as it's slightly faster
--- a/3rd/mp/mptouv.c
+++ b/3rd/mp/mptouv.c
@@ -18,7 +18,9 @@
b->sign = 1;
for(s = 0; s < VLDIGITS; s++){
b->p[s] = v;
+#ifndef BITS64
v >>= Dbits;
+#endif
}
b->top = s;
return mpnorm(b);
--- a/3rd/mp/mptov.c
+++ b/3rd/mp/mptov.c
@@ -20,7 +20,9 @@
uv = v * b->sign;
for(s = 0; s < VLDIGITS; s++){
b->p[s] = uv;
+#ifndef BITS64
uv >>= Dbits;
+#endif
}
b->top = s;
return mpnorm(b);
--- a/posix/mp.h
+++ b/posix/mp.h
@@ -1,6 +1,10 @@
#pragma once
+#ifdef BITS64
+typedef uint64_t mpdigit;
+#else
typedef uint32_t mpdigit;
+#endif
typedef union FPdbleword FPdbleword;
union FPdbleword