From 73ab7968d862c4d4d883fb3d3215353eba905b0f Mon Sep 17 00:00:00 2001 From: Michael Schmidt Date: Fri, 15 Dec 2017 00:01:30 +0100 Subject: Introduce 'cmn' instruction and optimize compare-with-immediate when negated immediates can be encoded. --- arm/Asmgenproof1.v | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'arm/Asmgenproof1.v') 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. -- cgit