Skip to content

Commit f6fce60

Browse files
authored
Merge pull request #526 from boriel/bugfix/cast_f16_to_int_param_fails
Fix crash when converting f16 to int param
2 parents 08c0ac7 + 183550c commit f6fce60

3 files changed

Lines changed: 684 additions & 4 deletions

File tree

src/arch/zx48k/backend/__f16.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def _f16_oper(op1, op2=None, useBC=False, reversed=False):
6060
will be rearranged, so it contains a 32 bit pushed parameter value for the
6161
subroutine to be called.
6262
63-
If preserveHL is True, then BC will be used instead of HL for lower part
63+
If useBC is True, then BC will be used instead of HL for lower part
6464
for the 1st operand.
6565
"""
6666
output = []
@@ -83,7 +83,7 @@ def _f16_oper(op1, op2=None, useBC=False, reversed=False):
8383
if immediate:
8484
op = op[1:]
8585

86-
hl = 'hl' if not useBC and not indirect else 'bc'
86+
hl = 'hl' if not useBC else 'bc'
8787

8888
if is_float(op):
8989
float1 = True
@@ -97,7 +97,7 @@ def _f16_oper(op1, op2=None, useBC=False, reversed=False):
9797
output.append('ld hl, (%i)' % op)
9898

9999
output.append(runtime_call(RuntimeLabel.ILOAD32))
100-
if preserveHL: # noqa TODO: it will fail
100+
if useBC:
101101
output.append('ld b, h')
102102
output.append('ld c, l')
103103
else:
@@ -115,7 +115,7 @@ def _f16_oper(op1, op2=None, useBC=False, reversed=False):
115115

116116
if indirect:
117117
output.append(runtime_call(RuntimeLabel.ILOAD32))
118-
if preserveHL: # noqa TODO: it will fail
118+
if useBC:
119119
output.append('ld b, h')
120120
output.append('ld c, l')
121121
else:

0 commit comments

Comments
 (0)