diff --git a/sample/large.cpp b/sample/large.cpp index cd79412..eb8d4e5 100644 --- a/sample/large.cpp +++ b/sample/large.cpp @@ -11,7 +11,7 @@ typedef mcl::FpT<> Fp; typedef mcl::fp::Unit Unit; using namespace mcl::fp; -#include "../src/low_gmp.hpp" +//#include "../src/low_gmp.hpp" const size_t N = 12; #if 0 @@ -110,8 +110,10 @@ void test(const std::string& pStr, mcl::fp::Mode mode) CYBOZU_BENCH("sqrPre", op.fpDbl_sqrPre, ux, ux); CYBOZU_BENCH("add", op.fpDbl_add, ux, ux, ux, op.p); CYBOZU_BENCH("sub", op.fpDbl_sub, ux, ux, ux, op.p); - CYBOZU_BENCH("addNC", op.fpDbl_addNC, ux, ux, ux); - CYBOZU_BENCH("subNC", op.fpDbl_subNC, ux, ux, ux); + if (op.fpDbl_addNC) { + CYBOZU_BENCH("addNC", op.fpDbl_addNC, ux, ux, ux); + CYBOZU_BENCH("subNC", op.fpDbl_subNC, ux, ux, ux); + } CYBOZU_BENCH("mont", op.fpDbl_mod, ux, ux, op.p); CYBOZU_BENCH("mul", Fp::mul, x, x, x); compareGmp(pStr); diff --git a/sample/rawbench.cpp b/sample/rawbench.cpp index ddfe733..e911019 100644 --- a/sample/rawbench.cpp +++ b/sample/rawbench.cpp @@ -38,8 +38,13 @@ void benchRaw(const char *p, mcl::fp::Mode mode) double fp2_sqrT, fp2_mulT; CYBOZU_BENCH_T(fp_addT, op.fp_add, uz, ux, uy, op.p); CYBOZU_BENCH_T(fp_subT, op.fp_sub, uz, uy, ux, op.p); - CYBOZU_BENCH_T(fp_addNCT, op.fp_addNC, uz, ux, uy); - CYBOZU_BENCH_T(fp_subNCT, op.fp_subNC, uz, uy, ux); + if (op.fp_addNC) { + CYBOZU_BENCH_T(fp_addNCT, op.fp_addNC, uz, ux, uy); + CYBOZU_BENCH_T(fp_subNCT, op.fp_subNC, uz, uy, ux); + } else { + fp_addNCT = 0; + fp_subNCT = 0; + } CYBOZU_BENCH_T(fp_sqrT, op.fp_sqr, uz, ux, op.p); CYBOZU_BENCH_T(fp_mulT, op.fp_mul, uz, ux, uy, op.p); CYBOZU_BENCH_T(fp_mul_UnitT, op.fp_mul_Unit, uz, ux, 12345678, op.p);