mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-03 22:33:06 +00:00
detailed accounting
This commit is contained in:
parent
dde24e6b30
commit
1f39053d9a
@ -1,14 +1,3 @@
|
||||
/// F = f + f'z
|
||||
/// G = g + g'z
|
||||
///
|
||||
/// h + h'z = FG
|
||||
///
|
||||
/// h = fg + sh(f'g')
|
||||
/// h' = (f+f')(g+g') - fg - f'g'
|
||||
///
|
||||
/// Note: each symbol in the stack comments consists of six words
|
||||
|
||||
|
||||
global test_mul_Fp12:
|
||||
// stack: f, f', g, g'
|
||||
%store_fp6(0)
|
||||
@ -26,6 +15,31 @@ return_on_stack:
|
||||
%jump(0xdeadbeef)
|
||||
|
||||
|
||||
/// macro | num | ops | cost
|
||||
/// -------------------------
|
||||
/// load | 8 | 40 | 320
|
||||
/// store | 5 | 40 | 200
|
||||
/// dup | 5 | 6 | 30
|
||||
/// swap | 4 | 16 | 64
|
||||
/// add | 3 | 16 | 48
|
||||
/// sub | 2 | 17 | 34
|
||||
/// mul | 3 | 156 | 468
|
||||
/// i9 | 1 | 9 | 9
|
||||
/// jump | 1 | 1 | 1
|
||||
///
|
||||
/// TOTAL: 1174
|
||||
|
||||
|
||||
/// F = f + f'z
|
||||
/// G = g + g'z
|
||||
///
|
||||
/// H = h + h'z = FG
|
||||
///
|
||||
/// h = fg + sh(f'g')
|
||||
/// h' = (f+f')(g+g') - fg - f'g'
|
||||
///
|
||||
/// Note: each symbol in the stack comments consists of six words
|
||||
|
||||
global mul_Fp12:
|
||||
%load_fp6(6)
|
||||
%load_fp6(18)
|
||||
|
||||
@ -54,7 +54,7 @@
|
||||
// stack:
|
||||
%endmacro
|
||||
|
||||
// cost: 49
|
||||
// cost: store (40) + i9 (9) = 49
|
||||
%macro store_fp6_sh(offset)
|
||||
// stack: x0, x1, x2, x3, x4, x5
|
||||
PUSH $offset
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user