summary refs log tree commit diff
path: root/lisc/spill.c
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2015-07-31 10:21:10 -0400
committerQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2015-09-15 23:01:29 -0400
commitd8d17705c4f525314471f5526ef3328dd41625cd (patch)
tree9b0f9b2a90918f16647898e296f303407a95725e /lisc/spill.c
parent1a78659dfab54d808fbc568d6b7ff5e4012695c0 (diff)
downloadroux-d8d17705c4f525314471f5526ef3328dd41625cd.tar.gz
clean the commutativity + fix bug in emit
The commutativity information only makes sense for
arithmetic expressions.  To account for that, I introduced
a new tri-valued boolean type B3.  Memory operations, for
example, will receive an undefined commutativity trit.

The code emitter was buggy when rega emitted instructions
like 'rax = add 1, rax', this is now fixed using the
commutativity information (we rewrite it in 'rax = add
rax, 1').
Diffstat (limited to 'lisc/spill.c')
-rw-r--r--lisc/spill.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lisc/spill.c b/lisc/spill.c
index 1181bc1..921a81c 100644
--- a/lisc/spill.c
+++ b/lisc/spill.c
@@ -355,7 +355,7 @@ spill(Fn *fn)
 			w = (Bits){{0}};
 			if (rtype(i->arg[1]) == RSym
 			&& !req(i->to, R)
-			&& !opdesc[i->op].commut) {
+			&& opdesc[i->op].comm == F) {
 				/* <arch>
 				 *   here we make sure that we
 				 *   will never have to compile