From b23b7e1088ac16d9154892f0b729a07410cc76d6 Mon Sep 17 00:00:00 2001 From: MITSUNARI Shigeo Date: Mon, 13 Apr 2020 12:09:51 +0900 Subject: [PATCH] [wasm] add __multi3 --- include/mcl/bn.h | 2 +- src/gen.cpp | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/include/mcl/bn.h b/include/mcl/bn.h index 96e6b81..b2211b7 100644 --- a/include/mcl/bn.h +++ b/include/mcl/bn.h @@ -127,7 +127,7 @@ enum { }; // return 0xABC which means A.BC -MCLBN_DLL_API int mclBn_getVersion(); +MCLBN_DLL_API int mclBn_getVersion(void); /* init library @param curve [in] type of bn curve diff --git a/src/gen.cpp b/src/gen.cpp index 2f9ae19..3edcfc5 100644 --- a/src/gen.cpp +++ b/src/gen.cpp @@ -120,10 +120,27 @@ struct Code : public mcl::Generator { ac = shl(zext(ac, 128), 32); z = add(ac, ad); } + void gen_multi3() + { + resetGlobalIdx(); + Operand z(Int, unit2); + Operand x(Int, unit); + Operand y(Int, unit); + std::string name = "__multi3"; + Function f(name, z, x, y); +// f.setPrivate(); + verifyAndSetPrivate(f); + beginFunc(f); + + gen_mul64x64(z, x, y); + ret(z); + endFunc(); + } void gen_mulUU() { if (wasm) { gen_mul32x32(); + gen_multi3(); } resetGlobalIdx(); Operand z(Int, unit2);