summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2015-08-07 16:43:43 -0400
committerQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2015-09-15 23:01:30 -0400
commit23846dd534123b50fe1c989017c39b225bf152bd (patch)
tree9eb8d5d723bb71bd87406d6506603a92f1b8eec0
parent0c5b683658f9f4ba8a1f7a24b125ef64a6aa6f47 (diff)
downloadroux-23846dd534123b50fe1c989017c39b225bf152bd.tar.gz
factor some comparison emitting code
-rw-r--r--lisc/isel.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/lisc/isel.c b/lisc/isel.c
index 51de6c7..36466ee 100644
--- a/lisc/isel.c
+++ b/lisc/isel.c
@@ -185,10 +185,7 @@ seljmp(Blk *b, Fn *fn)
} else
b->jmp.type = JXJc + Cne;
} else {
- if (islong(r, fn))
- emit(OXCmpl, R, CON_Z, r);
- else
- emit(OXCmpw, R, CON_Z, r);
+ selcmp((Ref[2]){r, CON_Z}, fn);
b->jmp.type = JXJc + Cne;
}
}