don't call AddUnitPre if not necessary

dev
MITSUNARI Shigeo 8 years ago
parent 58f2467b4d
commit 93024e94b8
  1. 5
      src/fp_proto.hpp

@ -146,7 +146,10 @@ struct MulPre {
c -= SubPre<N, Tag>::f(tmp, tmp, z + N); c -= SubPre<N, Tag>::f(tmp, tmp, z + N);
// c:tmp[N] = ad + bc // c:tmp[N] = ad + bc
c += AddPre<N, Tag>::f(z + H, z + H, tmp); 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) static inline void func(Unit *z, const Unit *x, const Unit *y)
{ {

Loading…
Cancel
Save