diff options
author | MITSUNARI Shigeo <herumi@nifty.com> | 2016-11-01 09:31:00 +0800 |
---|---|---|
committer | MITSUNARI Shigeo <herumi@nifty.com> | 2016-11-01 09:31:00 +0800 |
commit | 93024e94b87c8a1d60ae7da438d4e76bc9ed9c49 (patch) | |
tree | f5c29e3fee5f01ca2bea9a2b7c6e2f9857063ba1 | |
parent | 58f2467b4dc946a90756f87aa64b7dfaf00cf6e7 (diff) | |
download | dexon-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.hpp | 5 |
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) { |