aboutsummaryrefslogtreecommitdiff
path: root/src/BoundedArithmetic/ArchitectureToZLike.v
diff options
context:
space:
mode:
authorGravatar Jason Gross <jagro@google.com>2016-09-15 16:15:42 -0700
committerGravatar Jason Gross <jgross@mit.edu>2016-09-22 14:58:53 -0400
commit36cffa1f6b04497d8935b466c8362afd5f2ae5c8 (patch)
treef2649356c5ee61635e3e17bcca9c66316e38f52f /src/BoundedArithmetic/ArchitectureToZLike.v
parent95cd2c60969c8d14e92689336c1d0a93cc105b19 (diff)
Don't inline everything in Montgomery and Barrett
We still use CSE in fancy machine, because we want to lift the ldi's above the rest of the code. However, on a quick inspection, the algorithm no longer needs CSE to be duplicate-free.
Diffstat (limited to 'src/BoundedArithmetic/ArchitectureToZLike.v')
-rw-r--r--src/BoundedArithmetic/ArchitectureToZLike.v3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/BoundedArithmetic/ArchitectureToZLike.v b/src/BoundedArithmetic/ArchitectureToZLike.v
index 3388ece78..80f0d9803 100644
--- a/src/BoundedArithmetic/ArchitectureToZLike.v
+++ b/src/BoundedArithmetic/ArchitectureToZLike.v
@@ -4,6 +4,7 @@ Require Import Crypto.BoundedArithmetic.Interface.
Require Import Crypto.BoundedArithmetic.DoubleBounded.
Require Import Crypto.ModularArithmetic.ZBounded.
Require Import Crypto.Util.Tuple.
+Require Import Crypto.Util.LockedLet.
Local Open Scope Z_scope.
@@ -23,7 +24,7 @@ Section fancy_machine_p256_montgomery_foundation.
DivBy_SmallBound v := snd v;
DivBy_SmallerBound v := if smaller_bound_exp =? n
then snd v
- else shrd (snd v) (fst v) smaller_bound_exp;
+ else llet v := v in shrd (snd v) (fst v) smaller_bound_exp;
Mul x y := muldw x y;
CarryAdd x y := adc x y false;
CarrySubSmall x y := subc x y false;