Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/arch/z80/backend/_float.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def _float_oper(op1, op2=None) -> list[str]:
"""Returns pop sequence for floating point operands
1st operand in A DE BC, 2nd operand remains in the stack

Unlike 8bit and 16bit version, this does not supports
Unlike 8bit and 16bit version, this does not support
operands inversion. Since many of the instructions are implemented
as functions, they must support this.

Expand Down Expand Up @@ -83,7 +83,7 @@ def _float_oper(op1, op2=None) -> list[str]:
else:
output.append("pop hl")

output.append(runtime_call(RuntimeLabel.ILOADF))
output.append(runtime_call(RuntimeLabel.LOADF))
else:
if op[0] == "_":
output.append("ld a, (%s)" % op)
Expand All @@ -94,7 +94,7 @@ def _float_oper(op1, op2=None) -> list[str]:

if op2 is not None:
op = op1
if is_float(op): # An float must be in the stack. Let's push it
if is_float(op): # A float must be in the stack. Let's push it
A, DE, BC = _float(op)
output.append("ld hl, %s" % BC)
output.append("push hl")
Expand Down
8 changes: 3 additions & 5 deletions src/arch/z80/backend/_parray.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,10 @@ def _paload32(ins: Quad) -> list[str]:


def _paloadf(ins: Quad) -> list[str]:
"""Loads a floating point value from a memory address.
If 2nd arg. start with '*', it is always treated as
an indirect value.
"""
"""Loads a floating point value from a memory address."""
output = _paddr(ins[2])
output.append(runtime_call(RuntimeLabel.ILOADF))

output.append(runtime_call(RuntimeLabel.LOADF))
output.extend(_fpush())

return output
Expand Down
6 changes: 3 additions & 3 deletions src/arch/z80/visitor/translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,9 @@ def visit_ARRAYLOAD(self, node):
t1 = optemps.new_t()
t2 = optemps.new_t()
t3 = optemps.new_t()
self.ic_pload(gl.PTR_TYPE, t1, -(node.entry.offset - self.TYPE(gl.PTR_TYPE).size))
self.ic_add(gl.PTR_TYPE, t2, t1, node.offset)
self.ic_load(node.type_, t3, "*$%s" % t2)
self.ic_pload(gl.PTR_TYPE, t1, -node.entry.offset + self.TYPE(gl.PTR_TYPE).size)
self.ic_add(gl.PTR_TYPE, t2, t1, offset)
self.ic_load(node.type_, t3, f"*${t2}")

def _emit_arraycopy_child(self, child: symbols.ID):
assert child.token == "VARARRAY"
Expand Down
Loading