diff options
author | Xavier Leroy <xavier.leroy@college-de-france.fr> | 2021-06-10 09:52:47 +0200 |
---|---|---|
committer | Xavier Leroy <xavier.leroy@college-de-france.fr> | 2021-08-22 13:22:37 +0200 |
commit | e9f40aaca38ba81f3e9e5c0a5e03de9fa074d838 (patch) | |
tree | 3c0fb02295c22135786f8633613bd8320472c37a /lib | |
parent | 4fe221a26400fcf1aaca74889afffa5d01897b13 (diff) | |
download | compcert-kvx-e9f40aaca38ba81f3e9e5c0a5e03de9fa074d838.tar.gz compcert-kvx-e9f40aaca38ba81f3e9e5c0a5e03de9fa074d838.zip |
Int.sign_ext_shr_shl: weaker hypothesis
Works also for sign_ext 32.
ARM, RISC-V: adapt Asmgenproof1 accordingly
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Integers.v | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Integers.v b/lib/Integers.v index b38f8564..63dc2251 100644 --- a/lib/Integers.v +++ b/lib/Integers.v @@ -2766,7 +2766,7 @@ Qed. Corollary sign_ext_shr_shl: forall n x, - 0 < n < zwordsize -> + 0 < n <= zwordsize -> let y := repr (zwordsize - n) in sign_ext n x = shr (shl x y) y. Proof. @@ -2801,7 +2801,7 @@ Qed. Lemma sign_ext_range: forall n x, 0 < n < zwordsize -> -two_p (n-1) <= signed (sign_ext n x) < two_p (n-1). Proof. - intros. rewrite sign_ext_shr_shl; auto. + intros. rewrite sign_ext_shr_shl by lia. set (X := shl x (repr (zwordsize - n))). assert (two_p (n - 1) > 0) by (apply two_p_gt_ZERO; lia). assert (unsigned (repr (zwordsize - n)) = zwordsize - n). |