diff --git a/src/gen.cpp b/src/gen.cpp index 5a72f9e..97db041 100644 --- a/src/gen.cpp +++ b/src/gen.cpp @@ -161,12 +161,30 @@ struct Code : public mcl::Generator { beginFunc(mcl_fp_sqr_NIST_P192); Operand buf = _alloca(192, 2); Operand p = bitcast(buf, Operand(IntPtr, unit)); // QQQ : use makeType() + // QQQ define later Function mcl_fpDbl_sqrPre192("mcl_fpDbl_sqrPre192", Void, p, px); call(mcl_fpDbl_sqrPre192, p, px); call(mcl_fpDbl_mod_NIST_P192, py, buf); ret(Void); endFunc(); } + void gen_mcl_fp_mul_NIST_P192() + { + resetGlobalIdx(); + Operand pz(IntPtr, 192); + Operand px(IntPtr, unit); + Operand py(IntPtr, unit); + Function f("mcl_fp_mul_NIST_P192", Void, pz, px, py); + beginFunc(f); + Operand buf = _alloca(192, 2); + Operand p = bitcast(buf, Operand(IntPtr, unit)); // QQQ : use makeType() + // QQQ define later + Function mcl_fpDbl_mulPre192("mcl_fpDbl_mulPre192", Void, p, px, py); + call(mcl_fpDbl_mulPre192, p, px, py); + call(mcl_fpDbl_mod_NIST_P192, pz, buf); + ret(Void); + endFunc(); + } void gen_once() { gen_mulUU(); @@ -175,6 +193,7 @@ struct Code : public mcl::Generator { gen_makeNIST_P192(); gen_mcl_fpDbl_mod_NIST_P192(); gen_mcl_fp_sqr_NIST_P192(); + gen_mcl_fp_mul_NIST_P192(); } Operand extract(const Operand& x, uint32_t shift) { diff --git a/src/once.txt b/src/once.txt index 3972479..3394fe7 100644 --- a/src/once.txt +++ b/src/once.txt @@ -1,11 +1,3 @@ -define void @mcl_fp_mul_NIST_P192(i192* %pz, i$(unit)* %px, i$(unit)* %py) { - %buf = alloca i192, i32 2 - %p = bitcast i192* %buf to i$(unit)* - call void @mcl_fpDbl_mulPre192(i$(unit)* %p, i$(unit)* %px, i$(unit)* %py) - call void @mcl_fpDbl_mod_NIST_P192(i192* %pz, i192* %buf) - ret void -} - ; NIST_P521 ; p = (1 << 521) - 1 ; x = [H:L]