[wasm] add __multi3

update-fork
MITSUNARI Shigeo 5 years ago
parent 21f666d80c
commit b23b7e1088
  1. 2
      include/mcl/bn.h
  2. 17
      src/gen.cpp

@ -127,7 +127,7 @@ enum {
}; };
// return 0xABC which means A.BC // return 0xABC which means A.BC
MCLBN_DLL_API int mclBn_getVersion(); MCLBN_DLL_API int mclBn_getVersion(void);
/* /*
init library init library
@param curve [in] type of bn curve @param curve [in] type of bn curve

@ -120,10 +120,27 @@ struct Code : public mcl::Generator {
ac = shl(zext(ac, 128), 32); ac = shl(zext(ac, 128), 32);
z = add(ac, ad); 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() void gen_mulUU()
{ {
if (wasm) { if (wasm) {
gen_mul32x32(); gen_mul32x32();
gen_multi3();
} }
resetGlobalIdx(); resetGlobalIdx();
Operand z(Int, unit2); Operand z(Int, unit2);

Loading…
Cancel
Save