formatting

This commit is contained in:
JanLJL
2022-08-29 11:30:46 +02:00
parent 671f7f5591
commit 76542782c8
2 changed files with 23 additions and 27 deletions

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env python3
from collections import OrderedDict, defaultdict
from collections import defaultdict
from fractions import Fraction
@@ -42,7 +42,9 @@ class EntryBuilder:
description += ' scale: "*"\n'
else:
if "{k}" in ot:
description += " - class: register\n name: {}\n mask: True\n".format(ot.replace("{k}", ""))
description += " - class: register\n name: {}\n mask: True\n".format(
ot.replace("{k}", "")
)
else:
description += " - class: register\n name: {}\n".format(ot)
@@ -107,8 +109,7 @@ class EntryBuilderIntelPort9(EntryBuilder):
port_pressure = port_pressure + [[1, "79"], [1, "48"]]
operands = ["mem" if o == "mem" else o for o in operand_types]
latency += 0
return (
EntryBuilder.build_description(
return EntryBuilder.build_description(
self,
instruction_name,
operands,
@@ -116,7 +117,6 @@ class EntryBuilderIntelPort9(EntryBuilder):
latency,
"with store",
)
)
# Register only:
return EntryBuilder.build_description(
@@ -132,9 +132,7 @@ def get_description(instruction_form, port_pressure, latency, rhs_comment=None):
commented_entry = ""
for line in entry.split("\n"):
commented_entry += ("{:<" + str(max_length) + "} # {}\n").format(
line, rhs_comment
)
commented_entry += ("{:<" + str(max_length) + "} # {}\n").format(line, rhs_comment)
entry = commented_entry
return entry

View File

@@ -126,8 +126,7 @@ class MOVEntryBuilderIntelPort9(MOVEntryBuilder):
port_pressure = port_pressure + [[1, "79"], [1, "48"]]
operands = ["mem" if o == "mem" else o for o in operand_types]
latency += 0
return (
MOVEntryBuilder.build_description(
return MOVEntryBuilder.build_description(
self,
instruction_name,
operands,
@@ -135,7 +134,6 @@ class MOVEntryBuilderIntelPort9(MOVEntryBuilder):
latency,
"with store",
)
)
# Register only:
return MOVEntryBuilder.build_description(