File tree 8 files changed +38
-0
lines changed
8 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -25,12 +25,16 @@ Variable get: valnum -> option rhs.
25
25
Function combine_compimm_ne_0 (x: valnum) : option(condition * list valnum) :=
26
26
match get x with
27
27
| Some(Op (Ocmp c) ys) => Some (c, ys)
28
+ | Some(Op (Oxorimm n) ys) =>
29
+ if Int.eq n (Int.zero_ext 12 n) then Some (Ccompimm Cne n, ys) else None
28
30
| _ => None
29
31
end .
30
32
31
33
Function combine_compimm_eq_0 (x: valnum) : option(condition * list valnum) :=
32
34
match get x with
33
35
| Some(Op (Ocmp c) ys) => Some (negate_condition c, ys)
36
+ | Some(Op (Oxorimm n) ys) =>
37
+ if Int.eq n (Int.zero_ext 12 n) then Some (Ccompimm Ceq n, ys) else None
34
38
| _ => None
35
39
end .
36
40
Original file line number Diff line number Diff line change 48
48
(* of cmp *)
49
49
UseGetSound. rewrite <- H.
50
50
destruct (eval_condition cond (map valu args) m); simpl; auto. destruct b; auto.
51
+ (* of xorimm *)
52
+ UseGetSound. rewrite <- H.
53
+ destruct v; simpl; auto. rewrite Int.xor_is_zero; auto.
51
54
Qed .
52
55
53
56
Lemma combine_compimm_eq_0_sound:
61
64
UseGetSound. rewrite <- H.
62
65
rewrite eval_negate_condition.
63
66
destruct (eval_condition c (map valu args) m); simpl; auto. destruct b; auto.
67
+ (* of xorimm *)
68
+ UseGetSound. rewrite <- H.
69
+ destruct v; simpl; auto. rewrite Int.xor_is_zero; auto.
64
70
Qed .
65
71
66
72
Lemma combine_compimm_eq_1_sound:
Original file line number Diff line number Diff line change @@ -26,12 +26,16 @@ Variable get: valnum -> option rhs.
26
26
Function combine_compimm_ne_0 (x: valnum) : option(condition * list valnum) :=
27
27
match get x with
28
28
| Some(Op (Ocmp c) ys) => Some (c, ys)
29
+ | Some(Op (Oxorimm n) ys) =>
30
+ if Int.eq n (Int.zero_ext 8 n) then Some (Ccompimm Cne n, ys) else None
29
31
| _ => None
30
32
end .
31
33
32
34
Function combine_compimm_eq_0 (x: valnum) : option(condition * list valnum) :=
33
35
match get x with
34
36
| Some(Op (Ocmp c) ys) => Some (negate_condition c, ys)
37
+ | Some(Op (Oxorimm n) ys) =>
38
+ if Int.eq n (Int.zero_ext 8 n) then Some (Ccompimm Ceq n, ys) else None
35
39
| _ => None
36
40
end .
37
41
Original file line number Diff line number Diff line change 56
56
(* of cmp *)
57
57
UseGetSound. rewrite <- H.
58
58
destruct (eval_condition cond (map valu args) m); simpl; auto. destruct b; auto.
59
+ (* of xorimm *)
60
+ UseGetSound. rewrite <- H.
61
+ destruct v; simpl; auto. rewrite Int.xor_is_zero; auto.
59
62
Qed .
60
63
61
64
Lemma combine_compimm_eq_0_sound:
69
72
UseGetSound. rewrite <- H.
70
73
rewrite eval_negate_condition.
71
74
destruct (eval_condition c (map valu args) m); simpl; auto. destruct b; auto.
75
+ (* of xorimm *)
76
+ UseGetSound. rewrite <- H.
77
+ destruct v; simpl; auto. rewrite Int.xor_is_zero; auto.
72
78
Qed .
73
79
74
80
Lemma combine_compimm_eq_1_sound:
Original file line number Diff line number Diff line change @@ -27,13 +27,17 @@ Function combine_compimm_ne_0 (x: valnum) : option(condition * list valnum) :=
27
27
match get x with
28
28
| Some(Op (Ocmp c) ys) => Some (c, ys)
29
29
| Some(Op (Oandimm n) ys) => Some (Cmasknotzero n, ys)
30
+ | Some(Op (Oxorimm n) ys) =>
31
+ if Int.eq n (Int.sign_ext 16 n) then Some (Ccompimm Cne n, ys) else None
30
32
| _ => None
31
33
end .
32
34
33
35
Function combine_compimm_eq_0 (x: valnum) : option(condition * list valnum) :=
34
36
match get x with
35
37
| Some(Op (Ocmp c) ys) => Some (negate_condition c, ys)
36
38
| Some(Op (Oandimm n) ys) => Some (Cmaskzero n, ys)
39
+ | Some(Op (Oxorimm n) ys) =>
40
+ if Int.eq n (Int.sign_ext 16 n) then Some (Ccompimm Ceq n, ys) else None
37
41
| _ => None
38
42
end .
39
43
Original file line number Diff line number Diff line change 59
59
(* of and *)
60
60
UseGetSound. rewrite <- H.
61
61
destruct v; simpl; auto.
62
+ (* of xorimm *)
63
+ UseGetSound. rewrite <- H.
64
+ destruct v; simpl; auto. rewrite Int.xor_is_zero; auto.
62
65
Qed .
63
66
64
67
Lemma combine_compimm_eq_0_sound:
74
77
destruct (eval_condition c (map valu args) m); simpl; auto. destruct b; auto.
75
78
(* of and *)
76
79
UseGetSound. rewrite <- H. destruct v; auto.
80
+ (* of xorimm *)
81
+ UseGetSound. rewrite <- H.
82
+ destruct v; simpl; auto. rewrite Int.xor_is_zero; auto.
77
83
Qed .
78
84
79
85
Lemma combine_compimm_eq_1_sound:
Original file line number Diff line number Diff line change @@ -27,13 +27,15 @@ Function combine_compimm_ne_0 (x: valnum) : option(condition * list valnum) :=
27
27
match get x with
28
28
| Some(Op (Ocmp c) ys) => Some (c, ys)
29
29
| Some(Op (Oandimm n) ys) => Some (Cmasknotzero n, ys)
30
+ | Some(Op (Oxorimm n) ys) => Some (Ccompimm Cne n, ys)
30
31
| _ => None
31
32
end .
32
33
33
34
Function combine_compimm_eq_0 (x: valnum) : option(condition * list valnum) :=
34
35
match get x with
35
36
| Some(Op (Ocmp c) ys) => Some (negate_condition c, ys)
36
37
| Some(Op (Oandimm n) ys) => Some (Cmaskzero n, ys)
38
+ | Some(Op (Oxorimm n) ys) => Some (Ccompimm Ceq n, ys)
37
39
| _ => None
38
40
end .
39
41
Original file line number Diff line number Diff line change 53
53
(* of and *)
54
54
UseGetSound. rewrite <- H.
55
55
destruct v; simpl; auto.
56
+ (* of xorimm *)
57
+ UseGetSound. rewrite <- H.
58
+ destruct v; simpl; auto. rewrite Int.xor_is_zero; auto.
56
59
Qed .
57
60
58
61
Lemma combine_compimm_eq_0_sound:
68
71
destruct (eval_condition c (map valu args) m); simpl; auto. destruct b; auto.
69
72
(* of and *)
70
73
UseGetSound. rewrite <- H. destruct v; auto.
74
+ (* of xorimm *)
75
+ UseGetSound. rewrite <- H.
76
+ destruct v; simpl; auto. rewrite Int.xor_is_zero; auto.
71
77
Qed .
72
78
73
79
Lemma combine_compimm_eq_1_sound:
You can’t perform that action at this time.
0 commit comments