summary refs log tree commit diff
path: root/lisc
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2016-02-21 11:35:53 -0500
committerQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2016-02-21 11:35:53 -0500
commit420bf4cc8b74c8d7226b504baa022561f3a18574 (patch)
tree51ea7c0ee297fcae557fca79e639d2895b9ebfd1 /lisc
parent3983c206f9103fcb11db3f91b4a4da1b71f44526 (diff)
downloadroux-420bf4cc8b74c8d7226b504baa022561f3a18574.tar.gz
genius or idiot?
Diffstat (limited to 'lisc')
-rw-r--r--lisc/isel.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/lisc/isel.c b/lisc/isel.c
index c2d92d1..eb7906c 100644
--- a/lisc/isel.c
+++ b/lisc/isel.c
@@ -50,23 +50,23 @@ static int
 iscmp(int op, int *k, int *c)
 {
 	if (OCmpw <= op && op <= OCmpw1) {
-		*c = op - OCmpw;
-		*k = Kw;
+		c && (*c = op - OCmpw);
+		k && (*k = Kw);
 		return 1;
 	}
 	if (OCmpl <= op && op <= OCmpl1) {
-		*c = op - OCmpl;
-		*k = Kl;
+		c && (*c = op - OCmpl);
+		k && (*k = Kl);
 		return 1;
 	}
 	if (OCmps <= op && op <= OCmps1) {
-		*c = fcmptoi(op - OCmps);
-		*k = Ks;
+		c && (*c = fcmptoi(op - OCmps));
+		k && (*k = Ks);
 		return 1;
 	}
 	if (OCmpd <= op && op <= OCmpd1) {
-		*c = fcmptoi(op - OCmpd);
-		*k = Kd;
+		c && (*c = fcmptoi(op - OCmpd));
+		k && (*k = Kd);
 		return 1;
 	}
 	return 0;
@@ -336,10 +336,7 @@ flagi(Ins *i0, Ins *i)
 	while (i>i0)
 		switch ((--i)->op) {
 		default:
-			if ((OCmpw <= i->op && i->op <= OCmpw1)
-			||  (OCmpl <= i->op && i->op <= OCmpl1)
-			||  (OCmps <= i->op && i->op <= OCmps1)
-			||  (OCmpd <= i->op && i->op <= OCmpd1))
+			if (iscmp(i->op, 0, 0))
 				return i;
 			if (isext(i->op) || isload(i->op))
 				continue;