aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--_CoqProject1
-rw-r--r--src/Compilers/Z/ArithmeticSimplifierInterp.v3
-rw-r--r--src/Util/Tactics.v1
-rw-r--r--src/Util/Tactics/SpecializeAllWays.v8
4 files changed, 13 insertions, 0 deletions
diff --git a/_CoqProject b/_CoqProject
index 51eca87d1..189469e20 100644
--- a/_CoqProject
+++ b/_CoqProject
@@ -6572,6 +6572,7 @@ src/Util/Tactics/SetoidSubst.v
src/Util/Tactics/SideConditionsBeforeToAfter.v
src/Util/Tactics/SimplifyProjections.v
src/Util/Tactics/SimplifyRepeatedIfs.v
+src/Util/Tactics/SpecializeAllWays.v
src/Util/Tactics/SpecializeBy.v
src/Util/Tactics/SplitInContext.v
src/Util/Tactics/SubstEvars.v
diff --git a/src/Compilers/Z/ArithmeticSimplifierInterp.v b/src/Compilers/Z/ArithmeticSimplifierInterp.v
index cd76a3479..c34089a60 100644
--- a/src/Compilers/Z/ArithmeticSimplifierInterp.v
+++ b/src/Compilers/Z/ArithmeticSimplifierInterp.v
@@ -174,6 +174,9 @@ Proof.
| progress change (2^1)%Z with 2%Z in *
| progress rewrite ?Z.land_0_l, ?Z.land_0_r, ?Z.lor_0_l, ?Z.lor_0_r, ?Z.opp_involutive, ?Z.shiftr_0_r
| progress rewrite ?Z.land_ones by lia
+ | match goal with
+ | [ H : (?bitwidth < 0)%Z, H' : context[(2^?bitwidth)%Z] |- _ ] => is_var bitwidth; destruct bitwidth; cbn in H
+ end
| progress autorewrite with Zshift_to_pow in *
| rewrite !Z.sub_with_borrow_to_add_get_carry
| progress cbv [Z.add_with_carry]
diff --git a/src/Util/Tactics.v b/src/Util/Tactics.v
index 5a2bca803..95b4a29fc 100644
--- a/src/Util/Tactics.v
+++ b/src/Util/Tactics.v
@@ -31,6 +31,7 @@ Require Export Crypto.Util.Tactics.SetoidSubst.
Require Export Crypto.Util.Tactics.SideConditionsBeforeToAfter.
Require Export Crypto.Util.Tactics.SimplifyProjections.
Require Export Crypto.Util.Tactics.SimplifyRepeatedIfs.
+Require Export Crypto.Util.Tactics.SpecializeAllWays.
Require Export Crypto.Util.Tactics.SpecializeBy.
Require Export Crypto.Util.Tactics.SplitInContext.
Require Export Crypto.Util.Tactics.SubstEvars.
diff --git a/src/Util/Tactics/SpecializeAllWays.v b/src/Util/Tactics/SpecializeAllWays.v
new file mode 100644
index 000000000..154f1d2ae
--- /dev/null
+++ b/src/Util/Tactics/SpecializeAllWays.v
@@ -0,0 +1,8 @@
+Require Export Crypto.Util.FixCoqMistakes.
+Require Export Crypto.Util.Tactics.UniquePose.
+
+Ltac specialize_all_ways :=
+ repeat match goal with
+ | [ H : ?A, H' : forall a : ?A, _ |- _ ]
+ => unique pose proof (H' H)
+ end.