mirror of
https://github.com/irmen/prog8.git
synced 2025-01-11 13:29:45 +00:00
fix IR codegen error for b=float>value
This commit is contained in:
parent
b941d6f1e4
commit
004048e5a7
@ -595,7 +595,7 @@ internal class ExpressionGen(private val codeGen: IRCodeGen) {
|
||||
} else {
|
||||
if (greaterEquals) Opcode.SGE else Opcode.SGT
|
||||
}
|
||||
addInstr(result, IRInstruction(ins, vmDt, reg1=cmpResultReg, reg2 = resultRegister, reg3 = zeroRegister), null)
|
||||
addInstr(result, IRInstruction(ins, IRDataType.BYTE, reg1=cmpResultReg, reg2 = resultRegister, reg3 = zeroRegister), null)
|
||||
return ExpressionCodeResult(result, IRDataType.BYTE, cmpResultReg, -1)
|
||||
} else {
|
||||
if(binExpr.left.type==DataType.STR || binExpr.right.type==DataType.STR) {
|
||||
|
@ -1,8 +1,6 @@
|
||||
TODO
|
||||
====
|
||||
|
||||
fix IR codegen error: type FLOAT invalid for SGTS
|
||||
|
||||
add tests for comparison that do an assignment rather than an if.
|
||||
|
||||
fix ifelse codegens:
|
||||
|
@ -6,41 +6,27 @@
|
||||
|
||||
main {
|
||||
sub start() {
|
||||
cx16.r0 = $2200
|
||||
float @shared fl = 1123.56
|
||||
bool @shared bb
|
||||
|
||||
if fl as bool
|
||||
bb=fl<12345.6
|
||||
cx16.r0L++
|
||||
bb=fl<=12345.6
|
||||
cx16.r0L++
|
||||
bb=fl>12345.6
|
||||
cx16.r0L++
|
||||
bb=fl>=12345.6
|
||||
cx16.r0L++
|
||||
if bb
|
||||
txt.print("yep ")
|
||||
else
|
||||
txt.print("nope ")
|
||||
bb=fl>12345.6
|
||||
if bb
|
||||
txt.print("yep ")
|
||||
else
|
||||
txt.print("nope ")
|
||||
|
||||
bool @shared qq = fl as bool
|
||||
if qq
|
||||
txt.print("yep ")
|
||||
else
|
||||
txt.print("nope ")
|
||||
|
||||
if cx16.r0 as bool
|
||||
txt.print("yep ")
|
||||
else
|
||||
txt.print("nope ")
|
||||
|
||||
qq = cx16.r0 as bool
|
||||
if qq
|
||||
txt.print("yep ")
|
||||
else
|
||||
txt.print("nope ")
|
||||
|
||||
if cx16.r0s as bool
|
||||
txt.print("yep ")
|
||||
else
|
||||
txt.print("nope ")
|
||||
|
||||
qq = cx16.r0s as bool
|
||||
if qq
|
||||
txt.print("yep ")
|
||||
else
|
||||
txt.print("nope ")
|
||||
|
||||
; test_stack.test()
|
||||
; broken_word_gt()
|
||||
|
Loading…
x
Reference in New Issue
Block a user