Skip to content

Commit

Permalink
remove new_fixup from software pipelining for M7
Browse files Browse the repository at this point in the history
  • Loading branch information
mkannwischer authored and dop-amin committed Dec 2, 2024
1 parent a8a4fbb commit 00b2a6f
Showing 1 changed file with 28 additions and 26 deletions.
54 changes: 28 additions & 26 deletions slothy/targets/arm_v7m/arch_v7m.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,25 +154,27 @@ def start(self, loop_cnt, indentation=0, fixup=0, unroll=1, jump_if_empty=None,
logging.debug(f"Loop counter {loop_cnt} is incremented by {inc_per_iter} per iteration")
# Check whether instructions modifying the loop count moved to
# pre/postamble and adjust the fixup based on that.
new_fixup = 0
if postamble_code is not None:
new_fixup = 0
for l in postamble_code:
if l.text == "":
continue
inst = Instruction.parser(l)
if loop_cnt in inst[0].args_in_out and inst[0].increment is not None:
new_fixup = new_fixup + simplify(inst[0].increment)

if new_fixup != 0 or fixup != 0:
# new_fixup = 0
# if postamble_code is not None:
# new_fixup = 0
# for l in postamble_code:
# if l.text == "":
# continue
# inst = Instruction.parser(l)
# if loop_cnt in inst[0].args_in_out and inst[0].increment is not None:
# new_fixup = new_fixup + simplify(inst[0].increment)

# if new_fixup != 0 or fixup != 0:
if fixup != 0:
yield f"{indent}push {{{self.additional_data['end']}}}"
yield f"{indent}vmov {self.additional_data['end']}, {self.additional_data['endf']}"

if new_fixup != 0:
yield f"{indent}sub {self.additional_data['end']}, {self.additional_data['end']}, #{new_fixup}"
# if new_fixup != 0:
# yield f"{indent}sub {self.additional_data['end']}, {self.additional_data['end']}, #{new_fixup}"
if fixup != 0:
yield f"{indent}sub {self.additional_data['end']}, {self.additional_data['end']}, #{fixup*inc_per_iter}"
if new_fixup != 0 or fixup != 0:
#if new_fixup != 0 or fixup != 0:
if fixup != 0:
yield f"{indent}vmov {self.additional_data['endf']}, {self.additional_data['end']}"
yield f"{indent}pop {{{self.additional_data['end']}}}"
if jump_if_empty is not None:
Expand Down Expand Up @@ -221,18 +223,18 @@ def start(self, loop_cnt, indentation=0, fixup=0, unroll=1, jump_if_empty=None,

# Check whether instructions modifying the loop count moved to
# pre/postamble and adjust the fixup based on that.
new_fixup = 0
if postamble_code is not None:
new_fixup = 0
for l in postamble_code:
if l.text == "":
continue
inst = Instruction.parser(l)
if loop_cnt in inst[0].args_in_out and inst[0].increment is not None:
new_fixup = new_fixup + simplify(inst[0].increment)

if new_fixup != 0:
yield f"{indent}sub {self.additional_data['end']}, {self.additional_data['end']}, #{new_fixup}"
# new_fixup = 0
# if postamble_code is not None:
# new_fixup = 0
# for l in postamble_code:
# if l.text == "":
# continue
# inst = Instruction.parser(l)
# if loop_cnt in inst[0].args_in_out and inst[0].increment is not None:
# new_fixup = new_fixup + simplify(inst[0].increment)

# if new_fixup != 0:
# yield f"{indent}sub {self.additional_data['end']}, {self.additional_data['end']}, #{new_fixup}"

if fixup != 0:
yield f"{indent}sub {self.additional_data['end']}, {self.additional_data['end']}, #{fixup*inc_per_iter}"
Expand Down

0 comments on commit 00b2a6f

Please sign in to comment.