aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMITSUNARI Shigeo <herumi@nifty.com>2016-11-01 09:31:00 +0800
committerMITSUNARI Shigeo <herumi@nifty.com>2016-11-01 09:31:00 +0800
commit93024e94b87c8a1d60ae7da438d4e76bc9ed9c49 (patch)
treef5c29e3fee5f01ca2bea9a2b7c6e2f9857063ba1
parent58f2467b4dc946a90756f87aa64b7dfaf00cf6e7 (diff)
downloaddexon-mcl-93024e94b87c8a1d60ae7da438d4e76bc9ed9c49.tar.gz
dexon-mcl-93024e94b87c8a1d60ae7da438d4e76bc9ed9c49.tar.zst
dexon-mcl-93024e94b87c8a1d60ae7da438d4e76bc9ed9c49.zip
don't call AddUnitPre if not necessary
-rw-r--r--src/fp_proto.hpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/fp_proto.hpp b/src/fp_proto.hpp
index 73fc272..6c54a74 100644
--- a/src/fp_proto.hpp
+++ b/src/fp_proto.hpp
@@ -146,7 +146,10 @@ struct MulPre {
c -= SubPre<N, Tag>::f(tmp, tmp, z + N);
// c:tmp[N] = ad + bc
c += AddPre<N, Tag>::f(z + H, z + H, tmp);
- AddUnitPre<Tag>::f(z + N + H, H, c);
+ assert(c <= 1);
+ if (c) {
+ AddUnitPre<Tag>::f(z + N + H, H, 1);
+ }
}
static inline void func(Unit *z, const Unit *x, const Unit *y)
{