From 9d275a8694885b359e230424fa957c6b194e9030 Mon Sep 17 00:00:00 2001 From: MITSUNARI Shigeo Date: Tue, 6 Nov 2018 10:41:23 +0900 Subject: [PATCH] add Fp2::sub for bls12 --- src/fp_generator.hpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/fp_generator.hpp b/src/fp_generator.hpp index 4d45725..22692f3 100644 --- a/src/fp_generator.hpp +++ b/src/fp_generator.hpp @@ -3523,6 +3523,17 @@ private: vmovq(px, xm0); gen_raw_fp_add6(pz, px, py, FpByte_, t1, t2, false); } + void gen_fp2_sub6() + { + StackFrame sf(this, 3, 5); + const Reg64& pz = sf.p[0]; + const Reg64& px = sf.p[1]; + const Reg64& py = sf.p[2]; + Pack t = sf.t; + t.append(rax); + gen_raw_fp_sub6(pz, px, py, 0, t, false); + gen_raw_fp_sub6(pz, px, py, FpByte_, t, false); + } void3u gen_fp2_add() { align(16); @@ -3545,6 +3556,10 @@ private: gen_fp2_sub4(); return func; } + if (pn_ == 6 && !isFullBit_) { + gen_fp2_sub6(); + return func; + } return 0; } void gen_fp2_sub4()