mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-05 23:33:07 +00:00
replace mul_const
This commit is contained in:
parent
eb4f8fec45
commit
6451190d76
@ -17,15 +17,15 @@ return_on_stack:
|
||||
|
||||
/// 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
|
||||
/// 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
|
||||
|
||||
|
||||
@ -84,6 +84,24 @@
|
||||
// stack:
|
||||
%endmacro
|
||||
|
||||
// cost: 9; note this returns y, x for x + yi
|
||||
%macro i9
|
||||
// stack: a , b
|
||||
DUP2
|
||||
DUP2
|
||||
// stack: a , b, a , b
|
||||
PUSH 9
|
||||
MULFP254
|
||||
SUBFP254
|
||||
// stack: 9a - b, a , b
|
||||
SWAP2
|
||||
// stack: b , a, 9a - b
|
||||
PUSH 9
|
||||
MULFP254
|
||||
ADDFP254
|
||||
// stack: 9b + a, 9a - b
|
||||
%endmacro
|
||||
|
||||
// cost: 6
|
||||
%macro dup1_fp6
|
||||
// stack: f: 6
|
||||
@ -190,22 +208,6 @@
|
||||
// stack: h0, h1, h2, h3, h4, h5
|
||||
%endmacro
|
||||
|
||||
// cost: 9; note this returns y, x for x + yi
|
||||
%macro i9
|
||||
// stack: a , b
|
||||
DUP2
|
||||
DUP2
|
||||
// stack: a , b, a , b
|
||||
%mul_const(9)
|
||||
SUBFP254
|
||||
// stack: 9a - b, a , b
|
||||
SWAP2
|
||||
// stack: b , a, 9a - b
|
||||
%mul_const(9)
|
||||
ADDFP254
|
||||
// stack: 9b + a, 9a - b
|
||||
%endmacro
|
||||
|
||||
// cost: 156
|
||||
%macro mul_fp6
|
||||
/// E = E0 + E1t + E2t^2 = CD
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user