summary refs log tree commit diff
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin@c9x.me>2022-02-25 11:09:04 +0100
committerQuentin Carbonneaux <quentin@c9x.me>2022-02-27 11:27:40 +0100
commitc0cdef2e447aa9acf7494d4968151aaebc601955 (patch)
tree45eaa6df53d891421ce13aeaaeae461e5e1d73aa
parent65821c9b14f8a950ed8b82be085da4a698ebf20d (diff)
downloadroux-c0cdef2e447aa9acf7494d4968151aaebc601955.tar.gz
rv64: cosmetics in isel
-rw-r--r--rv64/isel.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/rv64/isel.c b/rv64/isel.c
index bb6fb02..e441597 100644
--- a/rv64/isel.c
+++ b/rv64/isel.c
@@ -3,8 +3,11 @@
 static int
 memarg(Ref *r, int op, Ins *i)
 {
-	return ((isload(op) || op == Ocall) && r == &i->arg[0])
-	|| (isstore(op) && r == &i->arg[1]);
+	if (isload(op) || op == Ocall)
+		return r == &i->arg[0];
+	if (isstore(op))
+		return r == &i->arg[1];
+	return 0;
 }
 
 static int
@@ -28,8 +31,8 @@ fixarg(Ref *r, int k, Ins *i, Fn *fn)
 		c = &fn->con[r0.val];
 		if (c->type == CAddr && memarg(r, op, i))
 			break;
-		if (c->type == CBits && immarg(r, op, i)
-		&& -2048 <= c->bits.i && c->bits.i < 2048)
+		if (c->type == CBits && immarg(r, op, i))
+		if (-2048 <= c->bits.i && c->bits.i < 2048)
 			break;
 		r1 = newtmp("isel", k, fn);
 		if (KBASE(k) == 1) {
@@ -131,7 +134,7 @@ selcmp(Ins i, int k, int op, Fn *fn)
 		break;
 	case NCmpI+Cfuo:
 		negate(&i.to, fn);
-		/* fallthrough */
+		/* fall through */
 	case NCmpI+Cfo:
 		r0 = newtmp("isel", i.cls, fn);
 		r1 = newtmp("isel", i.cls, fn);