diff options
author | Michael Schmidt <github@mschmidt.me> | 2017-12-15 00:01:30 +0100 |
---|---|---|
committer | Michael Schmidt <github@mschmidt.me> | 2017-12-15 00:01:30 +0100 |
commit | 73ab7968d862c4d4d883fb3d3215353eba905b0f (patch) | |
tree | ed09a92dc480a54eb26987e66d3dfb83fbe03de7 /arm/Asmgenproof1.v | |
parent | cdf6681b3450baa1489c6a62e1903a450c0e2c3f (diff) | |
download | compcert-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.v | 14 |
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. |