aboutsummaryrefslogtreecommitdiffstats
path: root/arm/Asmgenproof1.v
diff options
context:
space:
mode:
authorMichael Schmidt <github@mschmidt.me>2017-12-15 00:01:30 +0100
committerMichael Schmidt <github@mschmidt.me>2017-12-15 00:01:30 +0100
commit73ab7968d862c4d4d883fb3d3215353eba905b0f (patch)
treeed09a92dc480a54eb26987e66d3dfb83fbe03de7 /arm/Asmgenproof1.v
parentcdf6681b3450baa1489c6a62e1903a450c0e2c3f (diff)
downloadcompcert-kvx-73ab7968d862c4d4d883fb3d3215353eba905b0f.tar.gz
compcert-kvx-73ab7968d862c4d4d883fb3d3215353eba905b0f.zip
Introduce 'cmn' instruction and optimize compare-with-immediate when negated immediates can be encoded.
Diffstat (limited to 'arm/Asmgenproof1.v')
-rw-r--r--arm/Asmgenproof1.v14
1 files changed, 14 insertions, 0 deletions
diff --git a/arm/Asmgenproof1.v b/arm/Asmgenproof1.v
index c1015a8c..98cd5eea 100644
--- a/arm/Asmgenproof1.v
+++ b/arm/Asmgenproof1.v
@@ -1069,6 +1069,13 @@ Proof.
split. destruct (Val.cmp_bool c0 (rs x) (Vint i)) eqn:CMP; auto.
split; apply cond_for_signed_cmp_correct; auto. rewrite Val.negate_cmp_bool, CMP; auto.
apply compare_int_inv.
+ destruct (is_immed_arith (Int.neg i)).
+ econstructor.
+ split. apply exec_straight_one. simpl. eauto. auto.
+ split. destruct (Val.cmp_bool c0 (rs x) (Vint i)) eqn:CMP; auto.
+ split; apply cond_for_signed_cmp_correct; rewrite Int.neg_involutive; auto.
+ rewrite Val.negate_cmp_bool, CMP; auto.
+ apply compare_int_inv.
exploit (loadimm_correct IR14). intros [rs' [P [Q R]]].
econstructor.
split. eapply exec_straight_trans. eexact P. apply exec_straight_one. simpl.
@@ -1084,6 +1091,13 @@ Proof.
split. destruct (Val.cmpu_bool (Mem.valid_pointer m) c0 (rs x) (Vint i)) eqn:CMP; auto.
split; apply cond_for_unsigned_cmp_correct; auto. rewrite Val.negate_cmpu_bool, CMP; auto.
apply compare_int_inv.
+ destruct (is_immed_arith (Int.neg i)).
+ econstructor.
+ split. apply exec_straight_one. simpl. eauto. auto.
+ split. destruct (Val.cmpu_bool (Mem.valid_pointer m) c0 (rs x) (Vint i)) eqn:CMP; auto.
+ split; apply cond_for_unsigned_cmp_correct; rewrite Int.neg_involutive; auto.
+ rewrite Val.negate_cmpu_bool, CMP; auto.
+ apply compare_int_inv.
exploit (loadimm_correct IR14). intros [rs' [P [Q R]]].
econstructor.
split. eapply exec_straight_trans. eexact P. apply exec_straight_one. simpl.