From ebbb5cf6cc96b89ff76eb996d2a43d3e2d5a3668 Mon Sep 17 00:00:00 2001 From: MITSUNARI Shigeo Date: Mon, 8 Feb 2021 14:47:48 +0900 Subject: [PATCH] remove fpDbl_sqrPreA_ --- include/mcl/fp_tower.hpp | 7 +------ include/mcl/op.hpp | 2 -- src/fp_generator.hpp | 4 ++-- src/fp_static_code.hpp | 2 +- 4 files changed, 4 insertions(+), 11 deletions(-) diff --git a/include/mcl/fp_tower.hpp b/include/mcl/fp_tower.hpp index b39f7b3..65aedd7 100644 --- a/include/mcl/fp_tower.hpp +++ b/include/mcl/fp_tower.hpp @@ -128,7 +128,6 @@ public: static void subPre(FpDblT& z, const FpDblT& x, const FpDblT& y) { Fp::op_.fpDbl_subPre(z.v_, x.v_, y.v_); } static void mulPre(FpDblT& xy, const Fp& x, const Fp& y) { Fp::op_.fpDbl_mulPre(xy.v_, x.v_, y.v_); } #endif - static void sqrPreC(FpDblT& xx, const Fp& x) { Fp::op_.fpDbl_sqrPre(xx.v_, x.v_); } /* mul(z, x, y) = mulPre(xy, x, y) + mod(z, xy) */ @@ -155,11 +154,7 @@ public: mulPre = fp::func_ptr_cast(op.fpDbl_mulPreA_); if (mulPre == 0) mulPre = mulPreC; #endif - if (op.fpDbl_sqrPreA_) { - sqrPre = fp::func_ptr_cast(op.fpDbl_sqrPreA_); - } else { - sqrPre = sqrPreC; - } + sqrPre = fp::func_ptr_cast(op.fpDbl_sqrPre); } void operator+=(const FpDblT& x) { add(*this, *this, x); } void operator-=(const FpDblT& x) { sub(*this, *this, x); } diff --git a/include/mcl/op.hpp b/include/mcl/op.hpp index 29ca9f8..b8c1dbe 100644 --- a/include/mcl/op.hpp +++ b/include/mcl/op.hpp @@ -222,7 +222,6 @@ struct Op { void3u fpDbl_addA_; void3u fpDbl_subA_; void3u fpDbl_mulPreA_; - void2u fpDbl_sqrPreA_; void2u fpDbl_modA_; void3u fp2Dbl_mulPreA_; void2u fp2Dbl_sqrPreA_; @@ -309,7 +308,6 @@ struct Op { fpDbl_addA_ = 0; fpDbl_subA_ = 0; fpDbl_mulPreA_ = 0; - fpDbl_sqrPreA_ = 0; fpDbl_modA_ = 0; fp2Dbl_mulPreA_ = 0; fp2Dbl_sqrPreA_ = 0; diff --git a/src/fp_generator.hpp b/src/fp_generator.hpp index 3227d93..5ab7f9c 100644 --- a/src/fp_generator.hpp +++ b/src/fp_generator.hpp @@ -425,8 +425,8 @@ private: setFuncInfo(prof_, suf, "Dbl_mulPre", op.fpDbl_mulPreA_, getCurr()); align(16); - op.fpDbl_sqrPreA_ = gen_fpDbl_sqrPre(); - setFuncInfo(prof_, suf, "Dbl_sqrPre", op.fpDbl_sqrPreA_, getCurr()); + op.fpDbl_sqrPre = gen_fpDbl_sqrPre(); + setFuncInfo(prof_, suf, "Dbl_sqrPre", op.fpDbl_sqrPre, getCurr()); align(16); op.fp2_addA_ = gen_fp2_add(); diff --git a/src/fp_static_code.hpp b/src/fp_static_code.hpp index 09d4d01..6584410 100644 --- a/src/fp_static_code.hpp +++ b/src/fp_static_code.hpp @@ -66,7 +66,7 @@ void setStaticCode(mcl::fp::Op& op) op.fpDbl_addPre = mclx_FpDbl_addPre; op.fpDbl_subPre = mclx_FpDbl_subPre; op.fpDbl_mulPreA_ = mclx_FpDbl_mulPre; - op.fpDbl_sqrPreA_ = mclx_FpDbl_sqrPre; + op.fpDbl_sqrPre = mclx_FpDbl_sqrPre; op.fp2_addA_ = mclx_Fp2_add; op.fp2_subA_ = mclx_Fp2_sub; op.fp2_negA_ = mclx_Fp2_neg;