diff options
author | MITSUNARI Shigeo <herumi@nifty.com> | 2016-11-01 13:44:49 +0800 |
---|---|---|
committer | MITSUNARI Shigeo <herumi@nifty.com> | 2016-11-01 13:44:49 +0800 |
commit | a92e6acf7ee6475c16d154ec4c81e72c4351c464 (patch) | |
tree | 57d0b6d02dbeb2399db5e481c112d5e4e10523b0 | |
parent | 762d3d591d015dcf47ab4c5cc0e1bba39f91d0b9 (diff) | |
download | dexon-mcl-a92e6acf7ee6475c16d154ec4c81e72c4351c464.tar.gz dexon-mcl-a92e6acf7ee6475c16d154ec4c81e72c4351c464.tar.zst dexon-mcl-a92e6acf7ee6475c16d154ec4c81e72c4351c464.zip |
fix SqrPre to avoid zero array
-rw-r--r-- | src/fp_proto.hpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/fp_proto.hpp b/src/fp_proto.hpp index 7e19710..cd59e39 100644 --- a/src/fp_proto.hpp +++ b/src/fp_proto.hpp @@ -165,8 +165,6 @@ struct MulPre { template<size_t N, class Tag> const void3u MulPre<N, Tag>::f = MulPre<N, Tag>::func; -static inline void MulPre0(Unit*, const Unit*, const Unit*) {} - template<class Tag> struct MulPre<0, Tag> { static inline void f(Unit*, const Unit*, const Unit*) {} @@ -228,6 +226,19 @@ struct SqrPre { template<size_t N, class Tag> const void2u SqrPre<N, Tag>::f = SqrPre<N, Tag>::func; +template<class Tag> +struct SqrPre<0, Tag> { + static inline void f(Unit*, const Unit*) {} +}; + +template<class Tag> +struct SqrPre<1, Tag> { + static inline void f(Unit* y, const Unit* x) + { + SqrPreCore<1, Tag>::f(y, x); + } +}; + // z[N + 1] <- x[N] * y template<size_t N, class Tag = Gtag> struct MulUnitPre { |