Skip to content

Commit a587a86

Browse files
committed
CHB:ARM: add condition code relationships
1 parent d0c3d1d commit a587a86

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

CodeHawk/CHB/bchlibarm32/bCHARMConditionalExpr.ml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ let cc_expr
288288
(XOp (XGt, [v x; v y]), [x; y])
289289

290290
| (LogicalShiftLeft (true, ACCAlways, _, x, y, _), ACCNonNegative) ->
291-
(XOp (XGe, [XOp (XLsl, [vu x; vu y]); zero_constant_expr]), [x; y])
291+
(XOp (XGe, [XOp (XLsl, [vu x; vu y]); zero_constant_expr]), [x; y])
292292

293293
(* ------------------------------------------------- Compare-negative --- *)
294294

@@ -310,8 +310,11 @@ let cc_expr
310310

311311
(* ------------------------------------------------------------- Move --- *)
312312

313-
| (Move (true, ACCAlways, _, y, _, _), ACCNotEqual) ->
314-
(XOp (XNe, [v y; zero_constant_expr]), [y])
313+
| (Move (true, ACCAlways, _, x, _, _), ACCEqual) ->
314+
(XOp (XEq, [v x; zero_constant_expr]), [x])
315+
316+
| (Move (true, ACCAlways, _, x, _, _), ACCNotEqual) ->
317+
(XOp (XNe, [v x; zero_constant_expr]), [x])
315318

316319
(* ------------------------------------------------- Reverse Subtract --- *)
317320

@@ -344,6 +347,9 @@ let cc_expr
344347
| (Subtract (true, ACCAlways, _, x, y, _, _), ACCNegative) ->
345348
(XOp (XLt, [XOp (XMinus, [v x; v y]); zero_constant_expr]), [x; y])
346349

350+
| (Subtract (true, ACCAlways, _, x, y, _, _), ACCNonNegative) ->
351+
(XOp (XGe, [XOp (XMinus, [v x; v y]); zero_constant_expr]), [x; y])
352+
347353
| (Subtract (true, ACCAlways, _, x, y, _, _), ACCNotEqual) ->
348354
(XOp (XNe, [XOp (XMinus, [v x; v y]); zero_constant_expr]), [x; y])
349355

0 commit comments

Comments
 (0)