aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMITSUNARI Shigeo <herumi@nifty.com>2016-12-25 09:18:57 +0800
committerMITSUNARI Shigeo <herumi@nifty.com>2016-12-25 09:18:57 +0800
commit8c82725cf4291c78846e54e102aa6217dd56338a (patch)
tree2fe32ec6a0cb294bf4e8183fecf73b760c21161f /src
parent1838f97b1e7beb748145c11098295ed155680ffb (diff)
downloadtangerine-mcl-8c82725cf4291c78846e54e102aa6217dd56338a.tar.gz
tangerine-mcl-8c82725cf4291c78846e54e102aa6217dd56338a.tar.zst
tangerine-mcl-8c82725cf4291c78846e54e102aa6217dd56338a.zip
inline AddUnitPre
Diffstat (limited to 'src')
-rw-r--r--src/low_func.hpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/low_func.hpp b/src/low_func.hpp
index 905961f..92d4c46 100644
--- a/src/low_func.hpp
+++ b/src/low_func.hpp
@@ -61,15 +61,19 @@ template<class Tag = Gtag>
struct AddUnitPre {
static inline Unit func(Unit *x, Unit n, Unit y)
{
-#if 0
+#if 1
+ int ret = 0;
Unit t = x[0] + y;
- if (t >= y) return 0;
+ x[0] = t;
+ if (t >= y) goto EXIT_0;
for (size_t i = 1; i < n; i++) {
t = x[i] + 1;
x[i] = t;
- if (t != 0) return 0;
+ if (t != 0) goto EXIT_0;
}
- return 1;
+ ret = 1;
+ EXIT_0:
+ return ret;
#else
return mpn_add_1((mp_limb_t*)x, (const mp_limb_t*)x, (int)n, y);
#endif