fp6 as fn

This commit is contained in:
Dmitry Vagner 2022-10-20 17:35:43 -04:00
parent 3ccafd88d9
commit 06e0dd643b
2 changed files with 7 additions and 2 deletions

View File

@ -1,3 +1,5 @@
/// Note: uncomment this to test
global test_mul_Fp12:
// stack: in0, f, in0', f', in1, g, in1', g', in1, out, in0, out
%store_fp6
@ -19,6 +21,7 @@ return_on_stack:
// stack: h, h'
%jump(0xdeadbeef)
/// fp6 macros:
/// macro | num | ops | cost
/// -------------------------
@ -27,7 +30,7 @@ return_on_stack:
/// dup | 5 | 6 | 30
/// swap | 4 | 16 | 64
/// add | 4 | 16 | 64
/// sub | 1 | 17 | 17
/// subr | 1 | 17 | 17
/// mul | 3 | 156 | 468
/// i9 | 1 | 9 | 9
///

View File

@ -84,7 +84,7 @@ global mul_fp6:
SUBFP254
ADDFP254
// stack: E0 = 9CDX - CDX_ + C0D0 , CDX , C0D0_, CDX_
SWAP15
SWAP10
SWAP3
// stack: CDX_ , CDX , C0D0_
PUSH 9
@ -234,3 +234,5 @@ global mul_fp6:
ADDFP254
// stack: E2_ = c0d2_ + c0_d2 + c1d1_ + c1_d1 + c2d0_ + c2_d0
SWAP5
// stack: jumpdest, E0, E0_, E1, E1_, E2, E2_
JUMP