comparison modules/llcompile.tp @ 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
comparison
equal deleted inserted replaced
352:f74ce841fd1e 353:95bc24c729e6
132 size <- _size 132 size <- _size
133 signed? <- _signed 133 signed? <- _signed
134 } 134 }
135 } else: { 135 } else: {
136 _compOps ifget: (expr op) :condFun { 136 _compOps ifget: (expr op) :condFun {
137 if: (rv isInteger?) {
138 tmp <- rv
139 rv <- ilf getReg
140 ilf add: (il mov: tmp rv rs)
141 }
137 ilf add: (il cmp: lv rv _size) 142 ilf add: (il cmp: lv rv _size)
138 cond <- condFun: _signed 143 cond <- condFun: _signed
139 ilf add: (il bool: cond (dest val)) 144 ilf add: (il bool: cond (dest val))
140 #{ 145 #{
141 val <- dest val 146 val <- dest val