mirror of
https://github.com/irmen/prog8.git
synced 2025-01-11 13:29:45 +00:00
fix bug in float < and > comparisons
This commit is contained in:
parent
3df182b8c3
commit
b30b8b7368
@ -428,7 +428,9 @@ var_fac1_greater_f .proc
|
|||||||
cmp #1
|
cmp #1
|
||||||
beq +
|
beq +
|
||||||
lda #0
|
lda #0
|
||||||
+ rts
|
rts
|
||||||
|
+ lda #1
|
||||||
|
rts
|
||||||
.pend
|
.pend
|
||||||
|
|
||||||
var_fac1_greatereq_f .proc
|
var_fac1_greatereq_f .proc
|
||||||
|
@ -6,8 +6,8 @@ clean:
|
|||||||
rm -f *.prg *.asm *.vice-*
|
rm -f *.prg *.asm *.vice-*
|
||||||
|
|
||||||
test: clean
|
test: clean
|
||||||
p8compile *.p8 >/dev/null
|
p8compile -target cx16 *.p8 >/dev/null
|
||||||
for program in *.prg; do \
|
for program in *.prg; do \
|
||||||
echo "RUNNING:" $$program ; \
|
echo "RUNNING:" $$program ; \
|
||||||
x64sc $$program >/dev/null ; \
|
x16emu -run -prg $$program >/dev/null ; \
|
||||||
done
|
done
|
||||||
|
@ -5,11 +5,14 @@ all: test
|
|||||||
clean:
|
clean:
|
||||||
rm -f *.prg *.asm *.vice-* test_*.p8
|
rm -f *.prg *.asm *.vice-* test_*.p8
|
||||||
|
|
||||||
test: clean
|
test: clean generate test_prgs
|
||||||
|
|
||||||
|
generate:
|
||||||
python make_tests.py
|
python make_tests.py
|
||||||
p8compile -noopt -target cx16 *.p8 >/dev/null
|
p8compile -noopt -target cx16 *.p8 >/dev/null
|
||||||
|
|
||||||
|
test_prgs:
|
||||||
for program in *.prg; do \
|
for program in *.prg; do \
|
||||||
echo "RUNNING:" $$program ; \
|
echo "RUNNING:" $$program ; \
|
||||||
x16emu -run -prg $$program >/dev/null ; \
|
x16emu -run -prg $$program >/dev/null ; \
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -33,9 +33,14 @@ def gen_test(dt, comparison, left, right, expected):
|
|||||||
stmt_ok = lambda ix: f"error({ix})"
|
stmt_ok = lambda ix: f"error({ix})"
|
||||||
stmt_else = lambda ix: "num_successes++"
|
stmt_else = lambda ix: "num_successes++"
|
||||||
|
|
||||||
|
def c(number):
|
||||||
|
if dt not in ("byte", "ubyte"):
|
||||||
|
return f"({number} as {dt})"
|
||||||
|
return str(number)
|
||||||
|
|
||||||
print(
|
print(
|
||||||
f""" left = {left}
|
f""" left = {c(left)}
|
||||||
right = {right}
|
right = {c(right)}
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -43,7 +48,7 @@ f""" left = {left}
|
|||||||
index += 1
|
index += 1
|
||||||
print(
|
print(
|
||||||
f""" ; test #{index}
|
f""" ; test #{index}
|
||||||
if {left} {comparison} {right} {{
|
if {c(left)} {comparison} {c(right)} {{
|
||||||
{stmt_ok(index)}
|
{stmt_ok(index)}
|
||||||
}} else {{
|
}} else {{
|
||||||
{stmt_else(index)}
|
{stmt_else(index)}
|
||||||
@ -53,7 +58,7 @@ f""" ; test #{index}
|
|||||||
index += 1
|
index += 1
|
||||||
print(
|
print(
|
||||||
f""" ; test #{index}
|
f""" ; test #{index}
|
||||||
if {left} {comparison} right {{
|
if {c(left)} {comparison} right {{
|
||||||
{stmt_ok(index)}
|
{stmt_ok(index)}
|
||||||
}} else {{
|
}} else {{
|
||||||
{stmt_else(index)}
|
{stmt_else(index)}
|
||||||
@ -63,7 +68,7 @@ f""" ; test #{index}
|
|||||||
index += 1
|
index += 1
|
||||||
print(
|
print(
|
||||||
f""" ; test #{index}
|
f""" ; test #{index}
|
||||||
if {left} {comparison} right+zero {{
|
if {c(left)} {comparison} right+zero {{
|
||||||
{stmt_ok(index)}
|
{stmt_ok(index)}
|
||||||
}} else {{
|
}} else {{
|
||||||
{stmt_else(index)}
|
{stmt_else(index)}
|
||||||
@ -73,7 +78,7 @@ f""" ; test #{index}
|
|||||||
index += 1
|
index += 1
|
||||||
print(
|
print(
|
||||||
f""" ; test #{index}
|
f""" ; test #{index}
|
||||||
if left {comparison} {right} {{
|
if left {comparison} {c(right)} {{
|
||||||
{stmt_ok(index)}
|
{stmt_ok(index)}
|
||||||
}} else {{
|
}} else {{
|
||||||
{stmt_else(index)}
|
{stmt_else(index)}
|
||||||
@ -103,7 +108,7 @@ f""" ; test #{index}
|
|||||||
index += 1
|
index += 1
|
||||||
print(
|
print(
|
||||||
f""" ; test #{index}
|
f""" ; test #{index}
|
||||||
if left+zero {comparison} {right} {{
|
if left+zero {comparison} {c(right)} {{
|
||||||
{stmt_ok(index)}
|
{stmt_ok(index)}
|
||||||
}} else {{
|
}} else {{
|
||||||
{stmt_else(index)}
|
{stmt_else(index)}
|
||||||
|
@ -4,7 +4,6 @@ TODO
|
|||||||
|
|
||||||
- fix errors in comparison changes (first complete the new comparison test generation tool)
|
- fix errors in comparison changes (first complete the new comparison test generation tool)
|
||||||
- fix imageviewer only showing first image (likely fixed by the one above)
|
- fix imageviewer only showing first image (likely fixed by the one above)
|
||||||
- fix X register (evalstack) issue in arithmetic/builtins.prg
|
|
||||||
- add cx16 vload()
|
- add cx16 vload()
|
||||||
|
|
||||||
- optimize several inner loops in gfx2
|
- optimize several inner loops in gfx2
|
||||||
|
Loading…
x
Reference in New Issue
Block a user