changeset 353:95bc24c729e6

Move right hand parameter to cmp in _compileBinary to a temp reg if it is a constant since those are only supported in the left hand param currently
author Michael Pavone <pavone@retrodev.com>
date Tue, 14 Apr 2015 19:54:03 -0700
parents f74ce841fd1e
children a6cdcc1b1c02
files modules/llcompile.tp
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/modules/llcompile.tp	Mon Apr 13 22:42:27 2015 -0700
+++ b/modules/llcompile.tp	Tue Apr 14 19:54:03 2015 -0700
@@ -134,6 +134,11 @@
 				}
 			} else: {
 				_compOps ifget: (expr op) :condFun {
+					if: (rv isInteger?) {
+						tmp <- rv
+						rv <- ilf getReg
+						ilf add: (il mov: tmp rv rs)
+					}
 					ilf add: (il cmp: lv rv _size)
 					cond <- condFun: _signed
 					ilf add: (il bool: cond (dest val))