diff options
author | Marc Glisse <marc.glisse@inria.fr> | 2012-02-16 21:41:39 +0100 |
---|---|---|
committer | Marc Glisse <marc.glisse@inria.fr> | 2012-02-16 21:41:39 +0100 |
commit | 6ccdf3596dbccb115d141114d96a9d28cdb10e18 (patch) | |
tree | c046f566a7a52dbf10d26bef16ba100f0d336fc6 /gmpxx.h | |
parent | 71e62c3340b9ffa636bb61e1a1e3c81334bcba3f (diff) | |
download | gmp-6ccdf3596dbccb115d141114d96a9d28cdb10e18.tar.gz |
Replace e=a*b-c*d with tmp=c*d, e=a*b, e-=tmp, which uses one less temporary.
Diffstat (limited to 'gmpxx.h')
-rw-r--r-- | gmpxx.h | 15 |
1 files changed, 9 insertions, 6 deletions
@@ -2441,8 +2441,9 @@ public: : expr(val1, val2) { } void eval(typename __gmp_resolve_expr<T>::ptr_type p) const { - __gmp_expr<T, T> temp1(expr.val1), temp2(expr.val2); - Op::eval(p, temp1.__get_mp(), temp2.__get_mp()); + __gmp_expr<T, T> temp2(expr.val2); + expr.val1.eval(p); + Op::eval(p, p, temp2.__get_mp()); } void eval(typename __gmp_resolve_expr<T>::ptr_type p, mp_bitcnt_t prec) const @@ -2474,8 +2475,9 @@ public: : expr(val1, val2) { } void eval(typename __gmp_resolve_expr<T>::ptr_type p) const { - __gmp_expr<T, T> temp1(expr.val1), temp2(expr.val2); - Op::eval(p, temp1.__get_mp(), temp2.__get_mp()); + __gmp_expr<T, T> temp1(expr.val1); + expr.val2.eval(p); + Op::eval(p, temp1.__get_mp(), p); } void eval(typename __gmp_resolve_expr<T>::ptr_type p, mp_bitcnt_t prec) const @@ -2507,8 +2509,9 @@ public: : expr(val1, val2) { } void eval(typename __gmp_resolve_expr<T>::ptr_type p) const { - __gmp_expr<T, T> temp1(expr.val1), temp2(expr.val2); - Op::eval(p, temp1.__get_mp(), temp2.__get_mp()); + __gmp_expr<T, T> temp2(expr.val2); + expr.val1.eval(p); + Op::eval(p, p, temp2.__get_mp()); } void eval(typename __gmp_resolve_expr<T>::ptr_type p, mp_bitcnt_t prec) const |