diff --git a/misc/Makefile b/misc/Makefile index 25a7c27..c9dec20 100644 --- a/misc/Makefile +++ b/misc/Makefile @@ -2,5 +2,5 @@ all: low_test CFLAGS=-I ../include/ -m32 -Ofast -Wall -Wextra -DNDEBUG -low_test: low_test.cpp ../src/low_funct.hpp +low_test: low_test.cpp ../src/low_func_wasm.hpp $(CXX) -o low_test low_test.cpp $(CFLAGS) diff --git a/misc/low_test.cpp b/misc/low_test.cpp index 91af412..6d3e9b4 100644 --- a/misc/low_test.cpp +++ b/misc/low_test.cpp @@ -9,7 +9,7 @@ void dump(const char *msg, const uint32_t *x, size_t n) } printf("\n"); } -#include "../src/low_funct.hpp" +#include "../src/low_func_wasm.hpp" #define MCL_USE_VINT #define MCL_VINT_FIXED_BUFFER diff --git a/src/fp.cpp b/src/fp.cpp index 484ad43..cd3266e 100644 --- a/src/fp.cpp +++ b/src/fp.cpp @@ -4,8 +4,8 @@ #include #include #if defined(__EMSCRIPTEN__) && MCL_SIZEOF_UNIT == 4 -#define FOR_WASM -#include "low_funct.hpp" +#define USE_WASM +#include "low_func_wasm.hpp" #endif #if defined(MCL_STATIC_CODE) || defined(MCL_USE_XBYAK) || (defined(MCL_USE_LLVM) && (CYBOZU_HOST == CYBOZU_HOST_INTEL)) @@ -411,12 +411,12 @@ static bool initForMont(Op& op, const Unit *p, Mode mode) return true; } -#ifdef FOR_WASM +#ifdef USE_WASM template void setWasmOp(Op& op) { if (!(op.isMont && !op.isFullBit)) return; -EM_ASM({console.log($0)}, N); +//EM_ASM({console.log($0)}, N); // op.fp_addPre = mcl::addT; // op.fp_subPre = mcl::subT; // op.fpDbl_addPre = mcl::addT; @@ -570,7 +570,7 @@ bool Op::init(const mpz_class& _p, size_t maxBitSize, int _xi_a, Mode mode, size default: return false; } -#ifdef FOR_WASM +#ifdef USE_WASM if (N == 8) { setWasmOp<8>(*this); } else if (N == 12) { diff --git a/src/low_funct.hpp b/src/low_func_wasm.hpp similarity index 100% rename from src/low_funct.hpp rename to src/low_func_wasm.hpp