move fp_mul_NIST_P192 to gen.cpp

dev
MITSUNARI Shigeo 9 years ago
parent 736dafb754
commit 35c1e7f7fb
  1. 19
      src/gen.cpp
  2. 8
      src/once.txt

@ -161,12 +161,30 @@ struct Code : public mcl::Generator {
beginFunc(mcl_fp_sqr_NIST_P192); beginFunc(mcl_fp_sqr_NIST_P192);
Operand buf = _alloca(192, 2); Operand buf = _alloca(192, 2);
Operand p = bitcast(buf, Operand(IntPtr, unit)); // QQQ : use makeType() Operand p = bitcast(buf, Operand(IntPtr, unit)); // QQQ : use makeType()
// QQQ define later
Function mcl_fpDbl_sqrPre192("mcl_fpDbl_sqrPre192", Void, p, px); Function mcl_fpDbl_sqrPre192("mcl_fpDbl_sqrPre192", Void, p, px);
call(mcl_fpDbl_sqrPre192, p, px); call(mcl_fpDbl_sqrPre192, p, px);
call(mcl_fpDbl_mod_NIST_P192, py, buf); call(mcl_fpDbl_mod_NIST_P192, py, buf);
ret(Void); ret(Void);
endFunc(); 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() void gen_once()
{ {
gen_mulUU(); gen_mulUU();
@ -175,6 +193,7 @@ struct Code : public mcl::Generator {
gen_makeNIST_P192(); gen_makeNIST_P192();
gen_mcl_fpDbl_mod_NIST_P192(); gen_mcl_fpDbl_mod_NIST_P192();
gen_mcl_fp_sqr_NIST_P192(); gen_mcl_fp_sqr_NIST_P192();
gen_mcl_fp_mul_NIST_P192();
} }
Operand extract(const Operand& x, uint32_t shift) Operand extract(const Operand& x, uint32_t shift)
{ {

@ -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 ; NIST_P521
; p = (1 << 521) - 1 ; p = (1 << 521) - 1
; x = [H:L] ; x = [H:L]

Loading…
Cancel
Save